Skip to content

Commit

Permalink
Merge branch 'staging' of https://github.com/huridocs/uwazi into deve…
Browse files Browse the repository at this point in the history
…lopment
  • Loading branch information
Zasa-san committed Sep 17, 2024
2 parents e5c74b7 + 3052b5d commit 14170f7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
6 changes: 3 additions & 3 deletions app/react/V2/Routes/Settings/MenuConfig/MenuConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { IncomingHttpHeaders } from 'http';
import { LoaderFunction, useLoaderData, useRevalidator, useBlocker } from 'react-router-dom';
import { Row, RowSelectionState } from '@tanstack/react-table';
import { useSetAtom } from 'jotai';
import { isEqual } from 'lodash';
import { cloneDeep, isEqual } from 'lodash';
import { Translate } from 'app/I18N';
import * as SettingsAPI from 'app/V2/api/settings';
import { ConfirmNavigationModal } from 'app/V2/Components/Forms';
Expand Down Expand Up @@ -36,7 +36,7 @@ const menuConfigloader =
const MenuConfig = () => {
const links = useLoaderData() as Link[];
const [linkState, setLinkState] = useState(links);
const prevLinks = useRef(links);
const prevLinks = useRef(cloneDeep(links));
const [selectedLinks, setSelectedLinks] = useState<RowSelectionState>({});
const [isSidepanelOpen, setIsSidepanelOpen] = useState(false);
const setNotifications = useSetAtom(notificationAtom);
Expand Down Expand Up @@ -103,7 +103,7 @@ const MenuConfig = () => {
}, [blocker, setShowModal]);

useEffect(() => {
prevLinks.current = links;
prevLinks.current = cloneDeep(links);
setLinkState(links);
}, [links]);

Expand Down
12 changes: 11 additions & 1 deletion cypress/e2e/settings/menu.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('Menu configuration', () => {
cy.intercept('GET', 'api/settings/links').as('fetchLinks');
});

it('tests add links', () => {
it('should add links', () => {
cy.getByTestId('menu-add-link').click();
cy.get('#link-title').click();
cy.get('#link-title').type('Link 1', { delay: 0 });
Expand Down Expand Up @@ -164,4 +164,14 @@ describe('Menu configuration', () => {
});
});
});

it('should add a single child', () => {
cy.contains('button', 'Add link').click();
cy.get('#link-title').click();
cy.get('#link-title').type('Child 1', { delay: 0 });
cy.get('#link-url').type('www.subrow.com', { delay: 0 });
cy.get('#link-group').select('Group 1');
cy.getByTestId('menu-form-submit').click();
cy.contains('button', 'Save').click();
});
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "uwazi",
"version": "1.185.0-rc2",
"version": "1.185.0-rc3",
"description": "Uwazi is a free, open-source solution for organising, analysing and publishing your documents.",
"keywords": [
"react"
Expand Down

0 comments on commit 14170f7

Please sign in to comment.