diff --git a/frontend/cypress/e2e/word-count.spec.ts b/frontend/cypress/e2e/word-count.spec.ts index e07202a4c..f7c648615 100644 --- a/frontend/cypress/e2e/word-count.spec.ts +++ b/frontend/cypress/e2e/word-count.spec.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file) + * SPDX-FileCopyrightText: 2023 The HedgeDoc developers (see AUTHORS file) * * SPDX-License-Identifier: AGPL-3.0-only */ @@ -11,32 +11,32 @@ describe('Test word count with', () => { it('empty note', () => { cy.setCodemirrorContent('') - cy.getByCypressId('sidebar-btn-document-info').click() - cy.getByCypressId('document-info-modal').should('be.visible') + cy.getByCypressId('sidebar-menu-info').click() + cy.getByCypressId('document-info-word-count').should('be.visible') cy.getByCypressId('document-info-word-count').contains('0') }) it('simple words', () => { cy.setCodemirrorContent('five words should be enough') cy.getMarkdownBody().contains('five words should be enough') - cy.getByCypressId('sidebar-btn-document-info').click() - cy.getByCypressId('document-info-modal').should('be.visible') + cy.getByCypressId('sidebar-menu-info').click() + cy.getByCypressId('document-info-word-count').should('be.visible') cy.getByCypressId('document-info-word-count').contains('5') }) it('excluded codeblocks', () => { cy.setCodemirrorContent('```\nthis is should be ignored\n```\n\ntwo `words`') cy.getMarkdownBody().contains('two words') - cy.getByCypressId('sidebar-btn-document-info').click() - cy.getByCypressId('document-info-modal').should('be.visible') + cy.getByCypressId('sidebar-menu-info').click() + cy.getByCypressId('document-info-word-count').should('be.visible') cy.getByCypressId('document-info-word-count').contains('2') }) it('excluded images', () => { cy.setCodemirrorContent('![ignored alt text](https://dummyimage.com/48) not ignored text') cy.getMarkdownBody().contains('not ignored text') - cy.getByCypressId('sidebar-btn-document-info').click() - cy.getByCypressId('document-info-modal').should('be.visible') + cy.getByCypressId('sidebar-menu-info').click() + cy.getByCypressId('document-info-word-count').should('be.visible') cy.getByCypressId('document-info-word-count').contains('3') }) }) diff --git a/frontend/locales/en.json b/frontend/locales/en.json index eef80afe9..2217d8934 100644 --- a/frontend/locales/en.json +++ b/frontend/locales/en.json @@ -383,20 +383,20 @@ "tagTime": "Time tag", "spoiler": "Spoiler" }, + "noteInfo": { + "title": "Note info", + "created": "Note created", + "lastUpdated": "Last updated", + "lastUpdatedBy": "Last updated by", + "contributors": "Count of contributors", + "wordCount": "Count of words" + }, "modal": { "snippetImport": { "title": "Import from Snippet", "selectProject": "Select From Available Projects", "selectSnippet": "Select From Available Snippets" }, - "documentInfo": { - "title": "Document info", - "created": "This note was created <0>", - "edited": "<0> was the last editor <1>", - "usersContributed": "<0> users contributed to this document", - "revisions": "<0> revisions are saved", - "words": "<0> words in document" - }, "gistImport": { "title": "Import from Gist", "insertGistUrl": "Paste your gist url hereā€¦" @@ -645,7 +645,7 @@ }, "cheatsheet": { "button": "Open Cheatsheet", - "modal":{ + "modal": { "popup": "Open in new tab", "title": "Cheatsheet", "headlines": { @@ -778,11 +778,11 @@ "example": "I :heart: :hedgehog:" }, "csv": { - "title" : "CSV", - "table" : { + "title": "CSV", + "table": { "title": "Table", - "description" : "You can render a CSV text as table by using a code block with `csv` as language. You must specify the delimiter.", - "example" : "```csv delimiter=;\nUsername; Identifier;First name;Last name\n\"booker12; rbooker\";9012;Rachel;Booker\ngrey07;2070;Laura;Grey\njohnson81;4081;Craig;Johnson\njenkins46;9346;Mary;Jenkins\nsmith79;5079;Jamie;Smith\n```" + "description": "You can render a CSV text as table by using a code block with `csv` as language. You must specify the delimiter.", + "example": "```csv delimiter=;\nUsername; Identifier;First name;Last name\n\"booker12; rbooker\";9012;Rachel;Booker\ngrey07;2070;Laura;Grey\njohnson81;4081;Craig;Johnson\njenkins46;9346;Mary;Jenkins\nsmith79;5079;Jamie;Smith\n```" }, "header": { "title": "Header", diff --git a/frontend/src/components/editor-page/sidebar/specific-sidebar-entries/note-info-sidebar-entry/note-info-modal/time-from-now.tsx b/frontend/src/components/common/time-from-now.tsx similarity index 84% rename from frontend/src/components/editor-page/sidebar/specific-sidebar-entries/note-info-sidebar-entry/note-info-modal/time-from-now.tsx rename to frontend/src/components/common/time-from-now.tsx index 0de3f0c46..69d157b5c 100644 --- a/frontend/src/components/editor-page/sidebar/specific-sidebar-entries/note-info-sidebar-entry/note-info-modal/time-from-now.tsx +++ b/frontend/src/components/common/time-from-now.tsx @@ -17,7 +17,7 @@ export interface TimeFromNowProps { */ export const TimeFromNow: React.FC = ({ time }) => { return ( -