From 376d9c43a3f21503246024d68a62ff0d734ed33e Mon Sep 17 00:00:00 2001 From: Alexandre Bourdin Date: Wed, 12 Apr 2023 10:54:08 +0200 Subject: [PATCH] Merge pull request #12374 from overleaf/ab-rename-folders-tags [web] Rename folders to tags GitOrigin-RevId: 05c34c515aeeb9230ed512c267f97bcb679767a8 --- services/web/frontend/extracted-translations.json | 15 ++++++++------- .../components/dropdown/projects-dropdown.tsx | 2 +- .../components/modals/create-tag-modal.tsx | 6 +++--- .../components/modals/delete-tag-modal.tsx | 4 ++-- .../components/modals/edit-tag-modal.tsx | 4 ++-- .../components/modals/manage-tag-modal.tsx | 6 +++--- .../project-list/components/sidebar/tags-list.tsx | 9 ++++----- .../table/project-tools/buttons/tags-dropdown.tsx | 7 ++++--- .../project-list/components/tags-list.tsx | 7 +++---- services/web/locales/en.json | 10 ++++++++-- .../components/project-list-root.test.tsx | 8 ++++---- .../components/sidebar/tags-list.test.tsx | 12 ++++++------ .../table/project-tools/project-tools.test.tsx | 2 +- 13 files changed, 49 insertions(+), 43 deletions(-) diff --git a/services/web/frontend/extracted-translations.json b/services/web/frontend/extracted-translations.json index 9902c620d9..cccf315c28 100644 --- a/services/web/frontend/extracted-translations.json +++ b/services/web/frontend/extracted-translations.json @@ -1,8 +1,8 @@ { "a_more_comprehensive_list_of_keyboard_shortcuts": "", "about_to_archive_projects": "", - "about_to_delete_folder": "", "about_to_delete_projects": "", + "about_to_delete_tag": "", "about_to_delete_the_following": "", "about_to_leave_projects": "", "about_to_trash_projects": "", @@ -27,7 +27,7 @@ "add_new_email": "", "add_or_remove_project_from_tag": "", "add_role_and_department": "", - "add_to_folder": "", + "add_to_tag": "", "add_your_first_group_member_now": "", "adding": "", "additional_licenses": "", @@ -153,8 +153,8 @@ "coupons_not_included": "", "create": "", "create_first_project": "", - "create_new_folder": "", "create_new_subscription": "", + "create_new_tag": "", "create_project_in_github": "", "created_at": "", "creating": "", @@ -169,8 +169,8 @@ "delete_acct_no_existing_pw": "", "delete_and_leave": "", "delete_and_leave_projects": "", - "delete_folder": "", "delete_projects": "", + "delete_tag": "", "delete_your_account": "", "deleted_at": "", "deleting": "", @@ -220,9 +220,9 @@ "edit_dictionary": "", "edit_dictionary_empty": "", "edit_dictionary_remove": "", - "edit_folder": "", "edit_in_source_to_see_your_entire_latex_code": "", "edit_in_the_left_pane_click_recompile": "", + "edit_tag": "", "editing": "", "editor_and_pdf": "&", "editor_only_hide_pdf": "", @@ -265,7 +265,6 @@ "first_name": "", "first_x_days_free_after_that_y_per_month": "", "fold_line": "", - "folder_color": "", "following_paths_conflict": "", "font_family": "", "font_size": "", @@ -526,6 +525,8 @@ "new_password": "", "new_project": "", "new_subscription_will_be_billed_immediately": "", + "new_tag": "", + "new_tag_name": "", "new_to_latex_look_at": "", "newsletter": "", "next": "", @@ -817,10 +818,10 @@ "syntax_validation": "", "tab_connecting": "", "tab_no_longer_connected": "", + "tag_color": "", "tag_name_cannot_exceed_characters": "", "tag_name_is_already_used": "", "tags": "", - "tags_slash_folders": "", "take_short_survey": "", "template_approved_by_publisher": "", "template_description": "", diff --git a/services/web/frontend/js/features/project-list/components/dropdown/projects-dropdown.tsx b/services/web/frontend/js/features/project-list/components/dropdown/projects-dropdown.tsx index 59a51c10ad..44eabff699 100644 --- a/services/web/frontend/js/features/project-list/components/dropdown/projects-dropdown.tsx +++ b/services/web/frontend/js/features/project-list/components/dropdown/projects-dropdown.tsx @@ -99,7 +99,7 @@ function ProjectsDropdown() { text={t('trashed_projects')} onClick={handleClose} /> - {t('tags_slash_folders')}: + {t('tags')}: diff --git a/services/web/frontend/js/features/project-list/components/modals/create-tag-modal.tsx b/services/web/frontend/js/features/project-list/components/modals/create-tag-modal.tsx index 4c2040fc13..b9e86dcab2 100644 --- a/services/web/frontend/js/features/project-list/components/modals/create-tag-modal.tsx +++ b/services/web/frontend/js/features/project-list/components/modals/create-tag-modal.tsx @@ -70,7 +70,7 @@ export default function CreateTagModal({ return ( - {t('create_new_folder')} + {t('create_new_tag')} @@ -80,14 +80,14 @@ export default function CreateTagModal({ ref={autoFocusedRef} className="form-control" type="text" - placeholder="New Tag Name" + placeholder={t('new_tag_name')} name="new-tag-form-name" required onChange={e => setTagName(e.target.value)} /> @@ -114,7 +114,7 @@ export function ManageTagModal({ {isDeleteLoading ? ( <>{t('deleting')} … ) : ( - t('delete_folder') + t('delete_tag') )} diff --git a/services/web/frontend/js/features/project-list/components/sidebar/tags-list.tsx b/services/web/frontend/js/features/project-list/components/sidebar/tags-list.tsx index 543c53e223..dea1509021 100644 --- a/services/web/frontend/js/features/project-list/components/sidebar/tags-list.tsx +++ b/services/web/frontend/js/features/project-list/components/sidebar/tags-list.tsx @@ -2,6 +2,7 @@ import { sortBy } from 'lodash' import { Button } from 'react-bootstrap' import { useTranslation } from 'react-i18next' import Icon from '../../../../shared/components/icon' +import MaterialIcon from '../../../../shared/components/material-icon' import { UNCATEGORIZED_KEY, useProjectListContext, @@ -31,7 +32,7 @@ export default function TagsList() { return ( <>
  • -

    {t('tags_slash_folders')}

    +

    {t('tags')}

  • {sortBy(tags, tag => tag.name?.toLowerCase()).map(tag => { @@ -61,9 +62,7 @@ export default function TagsList() { color: getTagColor(tag), }} > - + {tag.name}{' '} diff --git a/services/web/frontend/js/features/project-list/components/table/project-tools/buttons/tags-dropdown.tsx b/services/web/frontend/js/features/project-list/components/table/project-tools/buttons/tags-dropdown.tsx index 9a942ae2ef..b597e4746d 100644 --- a/services/web/frontend/js/features/project-list/components/table/project-tools/buttons/tags-dropdown.tsx +++ b/services/web/frontend/js/features/project-list/components/table/project-tools/buttons/tags-dropdown.tsx @@ -4,6 +4,7 @@ import { Button, Dropdown } from 'react-bootstrap' import { useTranslation } from 'react-i18next' import ControlledDropdown from '../../../../../../shared/components/controlled-dropdown' import Icon from '../../../../../../shared/components/icon' +import MaterialIcon from '../../../../../../shared/components/material-icon' import { useProjectListContext } from '../../../../context/project-list-context' import useTag from '../../../../hooks/use-tag' import { addProjectsToTag, removeProjectsFromTag } from '../../../../util/api' @@ -90,11 +91,11 @@ function TagsDropdown() { title={t('tags')} aria-label={t('tags')} > - +
  • - {t('add_to_folder')} + {t('add_to_tag')}
  • {sortBy(tags, tag => tag.name?.toLowerCase()).map(tag => { return ( @@ -137,7 +138,7 @@ function TagsDropdown() { className="tag-dropdown-button" onClick={handleOpenCreateTagModal} > - {t('create_new_folder')} + {t('create_new_tag')}
    diff --git a/services/web/frontend/js/features/project-list/components/tags-list.tsx b/services/web/frontend/js/features/project-list/components/tags-list.tsx index 36982c9423..d86dd877e9 100644 --- a/services/web/frontend/js/features/project-list/components/tags-list.tsx +++ b/services/web/frontend/js/features/project-list/components/tags-list.tsx @@ -1,5 +1,6 @@ import { Button } from 'react-bootstrap' import { useTranslation } from 'react-i18next' +import MaterialIcon from '../../../shared/components/material-icon' import { getTagColor } from '../util/tag' import MenuItemButton from './dropdown/menu-item-button' import Icon from '../../../shared/components/icon' @@ -65,9 +66,7 @@ function TagsList({ onTagClick, onEditClick }: TagsListProps) { color: getTagColor(tag), }} > - +
    {tag.name}{' '} @@ -100,7 +99,7 @@ function TagsList({ onTagClick, onEditClick }: TagsListProps) { > - {t('new_folder')} + {t('new_tag')} diff --git a/services/web/locales/en.json b/services/web/locales/en.json index 74990b17c5..0302fdd320 100644 --- a/services/web/locales/en.json +++ b/services/web/locales/en.json @@ -13,6 +13,7 @@ "about_to_archive_projects": "You are about to archive the following projects:", "about_to_delete_folder": "You are about to delete the following folders (any projects in them will not be deleted):", "about_to_delete_projects": "You are about to delete the following projects:", + "about_to_delete_tag": "You are about to delete the following tag (any projects in them will not be deleted):", "about_to_delete_the_following": "You are about to delete the following ", "about_to_leave_projects": "You are about to leave the following projects:", "about_to_trash_projects": "You are about to trash the following projects:", @@ -55,6 +56,7 @@ "add_role_and_department": "Add role and department", "add_to_folder": "Add to folder", "add_to_folders": "Add to folders", + "add_to_tag": "Add to tag", "add_your_comment_here": "Add your comment here", "add_your_first_group_member_now": "Add your first group members now", "added": "added", @@ -288,6 +290,7 @@ "create_new_account": "Create new account", "create_new_folder": "Create New Folder", "create_new_subscription": "Create New Subscription", + "create_new_tag": "Create new tag", "create_project_in_github": "Create a GitHub repository", "create_your_first_project": "Create your first project!", "created_at": "Created at", @@ -323,6 +326,7 @@ "delete_and_leave_projects": "Delete and Leave Projects", "delete_folder": "Delete Folder", "delete_projects": "Delete Projects", + "delete_tag": "Delete Tag", "delete_your_account": "Delete your account", "deleted_at": "Deleted At", "deleted_files": "Deleted Files", @@ -394,9 +398,9 @@ "edit_dictionary": "Edit Dictionary", "edit_dictionary_empty": "Your custom dictionary is empty.", "edit_dictionary_remove": "Remove from dictionary", - "edit_folder": "Edit Folder", "edit_in_source_to_see_your_entire_latex_code": "Edit in <0>Source to see your entire LaTeX code, or choose <0>Rich Text for something more visual.", "edit_in_the_left_pane_click_recompile": "Edit in the left pane. Click <0>Recompile to see the PDF output on the right.", + "edit_tag": "Edit Tag", "editing": "Editing", "editor_and_pdf": "Editor <0> PDF", "editor_disconected_click_to_reconnect": "Editor disconnected, click anywhere to reconnect.", @@ -508,7 +512,6 @@ "first_name": "First Name", "first_x_days_free_after_that_y_per_month": "First <0>__trialLen__ days free, after that <0>__price__ per month", "fold_line": "Fold line", - "folder_color": "Folder color", "folders": "Folders", "following_paths_conflict": "The following files and folders conflict with the same path", "font_family": "Font Family", @@ -954,6 +957,8 @@ "new_project": "New Project", "new_snippet_project": "Untitled", "new_subscription_will_be_billed_immediately": "Your new subscription will be billed immediately to your current payment method.", + "new_tag": "New Tag", + "new_tag_name": "New tag name", "new_to_latex_look_at": "New to LaTeX? Start by having a look at our", "newsletter": "Newsletter", "newsletter-accept": "I’d like emails about product offers and company news and events.", @@ -1447,6 +1452,7 @@ "syntax_validation": "Code check", "tab_connecting": "Connecting with the editor", "tab_no_longer_connected": "This tab is no longer connected with the editor", + "tag_color": "Tag color", "tag_name_cannot_exceed_characters": "Tag name cannot exceed __maxLength__ characters", "tag_name_is_already_used": "Tag \"__tagName__\" already exists", "tagline_collaborator": "Great for shared projects", diff --git a/services/web/test/frontend/features/project-list/components/project-list-root.test.tsx b/services/web/test/frontend/features/project-list/components/project-list-root.test.tsx index 4d06030cc4..e899a62c23 100644 --- a/services/web/test/frontend/features/project-list/components/project-list-root.test.tsx +++ b/services/web/test/frontend/features/project-list/components/project-list-root.test.tsx @@ -645,9 +645,9 @@ describe('', function () { const tagsDropdown = within(actionsToolbar).getByLabelText('Tags') fireEvent.click(tagsDropdown) }) - screen.getByText('Add to folder') + screen.getByText('Add to tag') - const newTagButton = screen.getByText('Create New Folder') + const newTagButton = screen.getByText('Create new tag') fireEvent.click(newTagButton) const modal = screen.getAllByRole('dialog')[0] @@ -685,7 +685,7 @@ describe('', function () { const tagsDropdown = within(actionsToolbar).getByLabelText('Tags') fireEvent.click(tagsDropdown) - within(actionsToolbar).getByText('Add to folder') + within(actionsToolbar).getByText('Add to tag') const tagButton = within(actionsToolbar).getByLabelText( `Add or remove project from tag ${this.tagName}` @@ -718,7 +718,7 @@ describe('', function () { const tagsDropdown = within(actionsToolbar).getByLabelText('Tags') fireEvent.click(tagsDropdown) - within(actionsToolbar).getByText('Add to folder') + within(actionsToolbar).getByText('Add to tag') const tagButton = within(actionsToolbar).getByLabelText( `Add or remove project from tag ${this.tagName}` diff --git a/services/web/test/frontend/features/project-list/components/sidebar/tags-list.test.tsx b/services/web/test/frontend/features/project-list/components/sidebar/tags-list.test.tsx index bb4bbf1c6e..f9a081f8e6 100644 --- a/services/web/test/frontend/features/project-list/components/sidebar/tags-list.test.tsx +++ b/services/web/test/frontend/features/project-list/components/sidebar/tags-list.test.tsx @@ -43,10 +43,10 @@ describe('', function () { it('displays the tags list', function () { screen.getByRole('heading', { - name: 'Tags/Folders', + name: 'Tags', }) screen.getByRole('button', { - name: 'New Folder', + name: 'New Tag', }) screen.getByRole('button', { name: 'Tag 1 (1)', @@ -82,7 +82,7 @@ describe('', function () { describe('Create modal', function () { beforeEach(async function () { const newTagButton = screen.getByRole('button', { - name: 'New Folder', + name: 'New Tag', }) await fireEvent.click(newTagButton) @@ -90,7 +90,7 @@ describe('', function () { it('modal is open', async function () { const modal = screen.getAllByRole('dialog', { hidden: false })[0] - within(modal).getByRole('heading', { name: 'Create New Folder' }) + within(modal).getByRole('heading', { name: 'Create new tag' }) }) it('click on cancel closes the modal', async function () { @@ -171,7 +171,7 @@ describe('', function () { it('modal is open', async function () { const modal = screen.getAllByRole('dialog', { hidden: false })[0] - within(modal).getByRole('heading', { name: 'Edit Folder' }) + within(modal).getByRole('heading', { name: 'Edit Tag' }) }) it('click on cancel closes the modal', async function () { @@ -264,7 +264,7 @@ describe('', function () { it('modal is open', async function () { const modal = screen.getAllByRole('dialog', { hidden: false })[0] - within(modal).getByRole('heading', { name: 'Delete Folder' }) + within(modal).getByRole('heading', { name: 'Delete Tag' }) }) it('click on Cancel closes the modal', async function () { diff --git a/services/web/test/frontend/features/project-list/components/table/project-tools/project-tools.test.tsx b/services/web/test/frontend/features/project-list/components/table/project-tools/project-tools.test.tsx index 5fed1e962c..ab8caf15a4 100644 --- a/services/web/test/frontend/features/project-list/components/table/project-tools/project-tools.test.tsx +++ b/services/web/test/frontend/features/project-list/components/table/project-tools/project-tools.test.tsx @@ -18,6 +18,6 @@ describe('', function () { screen.getByLabelText('Archive') screen.getByLabelText('Trash') screen.getByTitle('Tags') - screen.getByRole('button', { name: 'Create New Folder' }) + screen.getByRole('button', { name: 'Create new tag' }) }) })