Skip to content

Commit 80a8389

Browse files
authored
showing correct amount of table results (#6908)
* showing correct amount of table results * updated component testing
1 parent 3b2effd commit 80a8389

File tree

4 files changed

+19
-18
lines changed

4 files changed

+19
-18
lines changed

app/react/Routes.tsx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -113,16 +113,18 @@ const getRoutesLayout = (
113113
<Route path="new" element={adminsOnlyRoute(<NewTemplate />)} />
114114
<Route path="edit/:templateId" element={adminsOnlyRoute(<EditTemplate />)} />
115115
</Route>
116-
<Route
117-
path="metadata_extraction"
118-
element={adminsOnlyRoute(<IXDashboard />)}
119-
loader={IXdashboardLoader(headers)}
120-
/>
121-
<Route
122-
path="metadata_extraction/suggestions/:extractorId"
123-
loader={IXSuggestionsLoader(headers)}
124-
element={adminsOnlyRoute(<IXSuggestions />)}
125-
/>
116+
<Route path="metadata_extraction">
117+
<Route
118+
index
119+
element={adminsOnlyRoute(<IXDashboard />)}
120+
loader={IXdashboardLoader(headers)}
121+
/>
122+
<Route
123+
path="suggestions/:extractorId"
124+
loader={IXSuggestionsLoader(headers)}
125+
element={adminsOnlyRoute(<IXSuggestions />)}
126+
/>
127+
</Route>
126128
<Route path="relationship-types">
127129
<Route
128130
index
@@ -202,7 +204,7 @@ const getRoutes = (
202204
return createRoutesFromElements(
203205
<Route path="/" element={<App customParams={parameters} />}>
204206
{layout}
205-
<Route path=":lang">
207+
<Route path="/:lang">
206208
{layout}
207209
<Route path="*" element={<GeneralError />} />
208210
</Route>

app/react/V2/Components/Layouts/SettingsContent.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
/* eslint-disable react/no-multi-comp */
2-
import { Link } from 'react-router-dom';
32
import React, { PropsWithChildren } from 'react';
43
import { Breadcrumb } from 'flowbite-react';
54
import { ChevronLeftIcon } from '@heroicons/react/20/solid';
6-
import { Translate } from 'app/I18N';
5+
import { I18NLink, Translate } from 'app/I18N';
76

87
interface SettingsContentProps extends PropsWithChildren {
98
className?: string;
@@ -31,12 +30,12 @@ const SettingsContent = ({ children, className }: SettingsContentProps) => (
3130

3231
const SettingsHeader = ({ contextId, title, children, path, className }: SettingsHeaderProps) => (
3332
<div className={`${className || ''} flex pt-5 pb-4 px-4 `} data-testid="settings-content-header">
34-
<Link to="/settings" className="block lg:hidden">
33+
<I18NLink to="/settings" className="block lg:hidden">
3534
<ChevronLeftIcon className="w-8 stroke-1 lg:hidden" />
3635
<span className="sr-only">
3736
<Translate>Navigate back</Translate>
3837
</span>
39-
</Link>
38+
</I18NLink>
4039
<Breadcrumb className="!relative p-1 flex right-0 !bg-transparent m-0 !w-full flex-wrap align-middle">
4140
{Array.from(path?.entries() || []).map(([key, value]) => (
4241
<Breadcrumb.Item key={key} href={value} className="max-w-xs">

app/react/V2/Components/Layouts/specs/SettingsContent.cy.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ describe('ConfirmationModal', () => {
4747
cy.get('[data-testid="settings-content-header"]')
4848
.invoke('text')
4949
.should('contain', 'Root PathMiddle PathLeafCurrent page');
50-
cy.get('a[href="/settings"]').should('not.be.visible');
50+
cy.get('a[href="/en/settings"]').should('not.be.visible');
5151
cy.contains('a', 'Root Path').invoke('attr', 'href').should('include', '#top');
5252
cy.contains('a', 'Middle Path').invoke('attr', 'href').should('include', '#bottom');
5353
cy.contains('a', 'Leaf').invoke('attr', 'href').should('include', '#footer');
@@ -58,6 +58,6 @@ describe('ConfirmationModal', () => {
5858
it('should have an arrow to return to settings menu for mobile', () => {
5959
cy.viewport(450, 650);
6060
render();
61-
cy.get('a[href="/settings"]').should('be.visible');
61+
cy.get('a[href="/en/settings"]').should('be.visible');
6262
});
6363
});

app/react/V2/Routes/Settings/IX/IXSuggestions.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ const IXSuggestions = () => {
268268
<PaginationState
269269
page={Number(searchParams.get('page') || 1)}
270270
size={SUGGESTIONS_PER_PAGE}
271-
total={status.data?.total || totalPages * SUGGESTIONS_PER_PAGE}
271+
total={aggregation.total || totalPages * SUGGESTIONS_PER_PAGE}
272272
currentLength={currentSuggestions.length}
273273
/>
274274
<div>

0 commit comments

Comments
 (0)