Added additional menuitems to context menu#3644
Conversation
jasonLaster
left a comment
There was a problem hiding this comment.
This is really great work
| const enabledBreakpoints = breakpoints.filter(b => b.disabled === false); | ||
| const disabledBreakpoints = breakpoints.filter(b => b.disabled === true); | ||
| const otherEnabledBreakpoints = breakpoints.filter( | ||
| b => b.disabled === false && b !== breakpoint |
There was a problem hiding this comment.
! b.disabled is okay too :)
| }; | ||
|
|
||
| const items = [ | ||
| { item: enableBreakpoint, hidden: () => breakpoint.disabled === false }, |
| }, | ||
| { | ||
| item: disableOtherBreakpoints, | ||
| hidden: () => otherEnabledBreakpoints.size === 0 |
| ); | ||
| const disableOtherBreakpointsKey = L10N.getStr( | ||
| "breakpointMenuItem.disableOthers.accesskey" | ||
| ); |
There was a problem hiding this comment.
this is the pattern we have elsewhere, but i'm wondering if we can improve upon it:
const getKey = (key) => L10N.getStr(`breakpointMenuItem.${key}.accesskey `)
const getLabel = (label) => L10N.getStr(`breakpointMenuItem.${label} `)
const foo = {
label: getLabel("foo")
accesskey: getKey("foo")
}|
don't worry about the flow error - we're fixing it elsewhere |
Codecov Report
@@ Coverage Diff @@
## master #3644 +/- ##
==========================================
- Coverage 54.51% 54.39% -0.12%
==========================================
Files 120 120
Lines 4786 4796 +10
Branches 992 993 +1
==========================================
Hits 2609 2609
- Misses 2177 2187 +10
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #3644 +/- ##
=========================================
- Coverage 54.82% 54.7% -0.12%
=========================================
Files 120 120
Lines 4810 4820 +10
Branches 1001 1002 +1
=========================================
Hits 2637 2637
- Misses 2173 2183 +10
Continue to review full report at Codecov.
|
Associated Issue: #3630
Summary of Changes
Added the following menuitems to breakpoint context menu: