From 13270dee2d3a529bad4faf05559e6cd9e41468b3 Mon Sep 17 00:00:00 2001 From: Antoine Clausse Date: Thu, 24 Apr 2025 16:56:28 +0200 Subject: [PATCH] [web] Tear down `sidebar-navigation-ui-update`, Update project-list look in SP/CE (#24920) * Remove hacks that conditionally hid `ds-nav` survey * Remove `getAssignment` of `sidebar-navigation-ui-update` * Remove `hasDsNav`: make it true everywhere * Remove dead code * Update Footer so thin footer is shown in SP/CE * Run `web$ make cleanup_unused_locales` & `bin/run web npm run extract-translations` * [server-pro] fix learn wiki tests following DS navigation changes * [server-pro] tests: remove logout action before switching session * [server-pro] tests: fix logout test * [server-pro] tests: use new css class for sidebar on project dashboard * Revert "should add a documentation entry to the nav bar" test change --------- Co-authored-by: Jakob Ackermann GitOrigin-RevId: 93eb7a1b03bb4e54ad1770150d83778b8f7f6727 --- server-ce/test/accounts.spec.ts | 2 +- server-ce/test/admin.spec.ts | 4 +- .../test/create-and-compile-project.spec.ts | 4 - server-ce/test/templates.spec.ts | 4 +- .../Project/ProjectListController.mjs | 9 -- .../web/frontend/extracted-translations.json | 1 - .../components/project-list-default.tsx | 119 ------------------ .../components/project-list-ds-nav.tsx | 5 +- .../components/project-list-root.tsx | 33 ++--- .../components/sidebar/sidebar-filters.tsx | 9 +- .../components/sidebar/tags-list.tsx | 19 +-- .../components/survey-widget-ds-nav.tsx | 11 +- .../project-list/components/survey-widget.tsx | 6 - .../project-list/components/use-is-ds-nav.tsx | 12 -- services/web/locales/en.json | 1 - 15 files changed, 23 insertions(+), 216 deletions(-) delete mode 100644 services/web/frontend/js/features/project-list/components/project-list-default.tsx diff --git a/server-ce/test/accounts.spec.ts b/server-ce/test/accounts.spec.ts index eeeb104087..85d545535a 100644 --- a/server-ce/test/accounts.spec.ts +++ b/server-ce/test/accounts.spec.ts @@ -9,7 +9,7 @@ describe('Accounts', function () { it('can log in and out', function () { login('user@example.com') cy.visit('/project') - cy.findByText('Account').click() + cy.findByRole('menuitem', { name: 'Account' }).click() cy.findByText('Log Out').click() cy.url().should('include', '/login') cy.visit('/project') diff --git a/server-ce/test/admin.spec.ts b/server-ce/test/admin.spec.ts index 18b33c6932..8020deeb4b 100644 --- a/server-ce/test/admin.spec.ts +++ b/server-ce/test/admin.spec.ts @@ -293,7 +293,7 @@ describe('admin panel', function () { cy.findByText(deletedProjectName).should('not.exist') cy.log('navigate to thrashed projects and delete the project') - cy.get('.project-list-sidebar-react').within(() => { + cy.get('.project-list-sidebar-scroll').within(() => { cy.findByText('Trashed Projects').click() }) findProjectRow(deletedProjectName).within(() => @@ -318,7 +318,7 @@ describe('admin panel', function () { cy.log('login as the user and verify the project is restored') login(user1) cy.visit('/project') - cy.get('.project-list-sidebar-react').within(() => { + cy.get('.project-list-sidebar-scroll').within(() => { cy.findByText('Trashed Projects').click() }) cy.findByText(`${deletedProjectName} (Restored)`) diff --git a/server-ce/test/create-and-compile-project.spec.ts b/server-ce/test/create-and-compile-project.spec.ts index 20f8f0dd6d..2be4f208e2 100644 --- a/server-ce/test/create-and-compile-project.spec.ts +++ b/server-ce/test/create-and-compile-project.spec.ts @@ -102,10 +102,6 @@ describe('Project creation and compilation', function () { cy.findByText('Invite not yet accepted.') }) - cy.visit('/project') - cy.findByText('Account').click() - cy.findByText('Log Out').click() - login('collaborator@example.com') openProjectViaInviteNotification(targetProjectName) cy.get('@targetProjectId').then(targetProjectId => { diff --git a/server-ce/test/templates.spec.ts b/server-ce/test/templates.spec.ts index bb581650a2..e36e99315d 100644 --- a/server-ce/test/templates.spec.ts +++ b/server-ce/test/templates.spec.ts @@ -96,12 +96,12 @@ describe('Templates', () => { .parent() .parent() .within(() => cy.get('input[type="checkbox"]').first().check()) - cy.get('.project-list-sidebar-react').within(() => { + cy.get('.project-list-sidebar-scroll').within(() => { cy.findAllByText('New Tag').first().click() }) cy.focused().type(tagName) cy.findByText('Create').click() - cy.get('.project-list-sidebar-react').within(() => { + cy.get('.project-list-sidebar-scroll').within(() => { cy.findByText(tagName) .parent() .within(() => cy.get('.name').should('have.text', `${tagName} (1)`)) diff --git a/services/web/app/src/Features/Project/ProjectListController.mjs b/services/web/app/src/Features/Project/ProjectListController.mjs index 88541ee826..61131ec617 100644 --- a/services/web/app/src/Features/Project/ProjectListController.mjs +++ b/services/web/app/src/Features/Project/ProjectListController.mjs @@ -411,15 +411,6 @@ async function projectListPage(req, res, next) { logger.error({ err: error }, 'Failed to get individual subscription') } - // Get the user's assignment for the DS unified nav split test, which - // populates splitTestVariants with a value for the split test name and allows - // Pug to send it to the browser - await SplitTestHandler.promises.getAssignment( - req, - res, - 'sidebar-navigation-ui-update' - ) - // Get the user's assignment for the papers notification banner split test, // which populates splitTestVariants with a value for the split test name and // allows Pug to send it to the browser diff --git a/services/web/frontend/extracted-translations.json b/services/web/frontend/extracted-translations.json index d24c74f9ec..ddb622b097 100644 --- a/services/web/frontend/extracted-translations.json +++ b/services/web/frontend/extracted-translations.json @@ -1127,7 +1127,6 @@ "optional": "", "or": "", "organization_name": "", - "organize_projects": "", "organize_tags": "", "other": "", "other_causes_of_compile_timeouts": "", diff --git a/services/web/frontend/js/features/project-list/components/project-list-default.tsx b/services/web/frontend/js/features/project-list/components/project-list-default.tsx deleted file mode 100644 index 307e11e490..0000000000 --- a/services/web/frontend/js/features/project-list/components/project-list-default.tsx +++ /dev/null @@ -1,119 +0,0 @@ -import { useProjectListContext } from '../context/project-list-context' -import { useTranslation } from 'react-i18next' -import CurrentPlanWidget from './current-plan-widget/current-plan-widget' -import NewProjectButton from './new-project-button' -import ProjectListTable from './table/project-list-table' -import SurveyWidget from './survey-widget' -import UserNotifications from './notifications/user-notifications' -import SearchForm from './search-form' -import ProjectsDropdown from './dropdown/projects-dropdown' -import SortByDropdown from './dropdown/sort-by-dropdown' -import ProjectTools from './table/project-tools/project-tools' -import ProjectListTitle from './title/project-list-title' -import Sidebar from './sidebar/sidebar' -import LoadMore from './load-more' -import OLCol from '@/features/ui/components/ol/ol-col' -import OLRow from '@/features/ui/components/ol/ol-row' -import { TableContainer } from '@/features/ui/components/bootstrap-5/table' -import DashApiError from '@/features/project-list/components/dash-api-error' - -export default function ProjectListDefault() { - const { t } = useTranslation() - const { - error, - searchText, - setSearchText, - selectedProjects, - filter, - tags, - selectedTagId, - } = useProjectListContext() - - const selectedTag = tags.find(tag => tag._id === selectedTagId) - - const tableTopArea = ( -
- - -
- ) - - return ( - <> - -
- {error ? : ''} - - - - - -
- -
-
- {selectedProjects.length === 0 ? ( - - ) : ( - - )} -
-
- -
-
-
- - - - - -
- -
-
-
- - -
-
- - - - {tableTopArea} - - - - - - - - - -
- - ) -} diff --git a/services/web/frontend/js/features/project-list/components/project-list-ds-nav.tsx b/services/web/frontend/js/features/project-list/components/project-list-ds-nav.tsx index a9870f2a30..8f3b3a8e5d 100644 --- a/services/web/frontend/js/features/project-list/components/project-list-ds-nav.tsx +++ b/services/web/frontend/js/features/project-list/components/project-list-ds-nav.tsx @@ -16,13 +16,14 @@ import { TableContainer } from '@/features/ui/components/bootstrap-5/table' import DashApiError from '@/features/project-list/components/dash-api-error' import getMeta from '@/utils/meta' import DefaultNavbar from '@/features/ui/components/bootstrap-5/navbar/default-navbar' -import FatFooter from '@/features/ui/components/bootstrap-5/footer/fat-footer' +import Footer from '@/features/ui/components/bootstrap-5/footer/footer' import SidebarDsNav from '@/features/project-list/components/sidebar/sidebar-ds-nav' import SystemMessages from '@/shared/components/system-messages' import overleafLogo from '@/shared/svgs/overleaf-a-ds-solution-mallard.svg' export function ProjectListDsNav() { const navbarProps = getMeta('ol-navbar') + const footerProps = getMeta('ol-footer') const { t } = useTranslation() const { error, @@ -117,7 +118,7 @@ export function ProjectListDsNav() { - +