Sfoglia il codice sorgente

Restore Ctrl for some key combinations in the Hotkeys modal (#6036)

GitOrigin-RevId: e4bba11c128d6b6405619b1c4346c286bf69a044
Alf Eaton 4 anni fa
parent
commit
6a175c703b

+ 4 - 4
services/web/frontend/js/features/hotkeys-modal/components/hotkeys-modal.js

@@ -96,11 +96,11 @@ export default function HotkeysModal({
 
 
           <Col xs={4}>
           <Col xs={4}>
             <Hotkey
             <Hotkey
-              combination={`${ctrl} + U`}
+              combination="Ctrl + U"
               description={t('hotkey_to_uppercase')}
               description={t('hotkey_to_uppercase')}
             />
             />
             <Hotkey
             <Hotkey
-              combination={`${ctrl} + Shift + U`}
+              combination="Ctrl + Shift + U"
               description={t('hotkey_to_lowercase')}
               description={t('hotkey_to_lowercase')}
             />
             />
             <Hotkey
             <Hotkey
@@ -126,7 +126,7 @@ export default function HotkeysModal({
         <Row>
         <Row>
           <Col xs={4}>
           <Col xs={4}>
             <Hotkey
             <Hotkey
-              combination={`${ctrl} + Space`}
+              combination="Ctrl + Space"
               description={t('hotkey_autocomplete_menu')}
               description={t('hotkey_autocomplete_menu')}
             />
             />
           </Col>
           </Col>
@@ -154,7 +154,7 @@ export default function HotkeysModal({
         <Row>
         <Row>
           <Col xs={4}>
           <Col xs={4}>
             <Hotkey
             <Hotkey
-              combination={`${ctrl} + Space `}
+              combination={`Ctrl + Space `}
               description={t('hotkey_search_references')}
               description={t('hotkey_search_references')}
             />
             />
           </Col>
           </Col>

+ 2 - 2
services/web/test/frontend/features/hotkeys-modal/components/hotkeys-modal.test.js

@@ -55,7 +55,7 @@ describe('<HotkeysModal />', function () {
   it('uses Cmd for macOS', function () {
   it('uses Cmd for macOS', function () {
     render(<HotkeysModal {...modalProps} isMac />)
     render(<HotkeysModal {...modalProps} isMac />)
 
 
-    expect(screen.getAllByText(/Cmd/)).to.have.length(16)
-    expect(screen.queryByText(/Ctrl/)).to.not.exist
+    expect(screen.getAllByText(/Cmd/)).to.have.length(12)
+    expect(screen.getAllByText(/Ctrl/)).to.have.length(4)
   })
   })
 })
 })