فهرست منبع

Merge pull request #17707 from overleaf/AR-modal-close-consistency-fixes

Modal "Close" button consistency fixes

GitOrigin-RevId: 55e5178c9e820fffd220f0010906546f0baa2065
Andrew Rumble 2 سال پیش
والد
کامیت
1c1b48edab

+ 1 - 1
services/web/frontend/js/features/dictionary/components/dictionary-modal-content.tsx

@@ -84,7 +84,7 @@ export default function DictionaryModalContent({
 
       <Modal.Footer>
         <Button bsStyle={null} className="btn-secondary" onClick={handleHide}>
-          {t('done')}
+          {t('close')}
         </Button>
       </Modal.Footer>
     </>

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

@@ -23,7 +23,7 @@ export default function HotkeysModal({
       animation={animation}
     >
       <Modal.Header closeButton>
-        <Modal.Title>{t('hotkeys')} (Source editor)</Modal.Title>
+        <Modal.Title>{t('hotkeys')}</Modal.Title>
       </Modal.Header>
 
       <Modal.Body className="hotkeys-modal">
@@ -192,7 +192,7 @@ export default function HotkeysModal({
 
       <Modal.Footer>
         <Button bsStyle={null} className="btn-secondary" onClick={handleHide}>
-          {t('ok')}
+          {t('close')}
         </Button>
       </Modal.Footer>
     </AccessibleModal>

+ 1 - 1
services/web/frontend/js/features/word-count-modal/components/word-count-modal-content.jsx

@@ -77,7 +77,7 @@ export default function WordCountModalContent({ handleHide }) {
 
       <Modal.Footer>
         <Button bsStyle={null} className="btn-secondary" onClick={handleHide}>
-          {t('done')}
+          {t('close')}
         </Button>
       </Modal.Footer>
     </>

+ 1 - 1
services/web/frontend/js/features/word-count-modal/components/word-count-modal.jsx

@@ -13,7 +13,7 @@ const WordCountModal = React.memo(function WordCountModal({
       animation
       show={show}
       onHide={handleHide}
-      id="clone-project-modal"
+      id="word-count-modal"
     >
       <WordCountModalContent handleHide={handleHide} />
     </AccessibleModal>

+ 1 - 1
services/web/test/frontend/components/editor-left-menu/editor-left-menu.spec.tsx

@@ -800,7 +800,7 @@ describe('<EditorLeftMenu />', function () {
         )
 
         cy.findByRole('button', { name: 'Show Hotkeys' }).click()
-        cy.findByText('Hotkeys (Source editor)')
+        cy.findByText('Hotkeys')
       })
 
       it('shows correct url for documentation', function () {

+ 4 - 2
services/web/test/frontend/features/editor-left-menu/components/settings/settings-dictionary.test.tsx

@@ -17,8 +17,10 @@ describe('<SettingsDictionary />', function () {
     within(modal).getByRole('heading', { name: 'Edit Dictionary' })
     within(modal).getByText('Your custom dictionary is empty.')
 
-    const doneButton = within(modal).getByRole('button', { name: 'Done' })
-    fireEvent.click(doneButton)
+    const [, closeButton] = within(modal).getAllByRole('button', {
+      name: 'Close',
+    })
+    fireEvent.click(closeButton)
     expect(screen.queryByRole('dialog')).to.be.null
   })
 })

+ 1 - 1
services/web/test/frontend/features/hotkeys-modal/components/hotkeys-modal.test.jsx

@@ -14,7 +14,7 @@ describe('<HotkeysModal />', function () {
     const { baseElement } = render(<HotkeysModal {...modalProps} />)
 
     expect(baseElement.querySelector('.modal-title').textContent).to.equal(
-      'Hotkeys (Source editor)'
+      'Hotkeys'
     )
   })