Skip to content

Commit d366243

Browse files
authored
added correct filtering for mlflow in app launcher (#5795)
* added correct filtering for mlflow in app launcher * added test case
1 parent fce6bde commit d366243

2 files changed

Lines changed: 24 additions & 3 deletions

File tree

frontend/src/app/AppLauncher.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const AppLauncher: React.FC = () => {
7777
(link) =>
7878
link.spec.location === 'ApplicationMenu' &&
7979
!appConsoleLinkNames.includes(link.metadata?.name ?? '') &&
80-
(isMLflowEnabled || link.metadata?.name !== 'mlflowlink'),
80+
(isMLflowEnabled || !(link.metadata?.name && link.metadata.name.startsWith('mlflow'))),
8181
)
8282
.toSorted((a, b) => a.spec.text.localeCompare(b.spec.text));
8383

packages/cypress/cypress/tests/mocked/applications/application.cy.ts

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ import {
33
mockDscStatus,
44
dataScienceStackComponentMap,
55
} from '@odh-dashboard/internal/__mocks__';
6-
import { mockConsoleLinks } from '@odh-dashboard/internal/__mocks__/mockConsoleLinks';
6+
import {
7+
mockConsoleLinks,
8+
mockMLflowLink,
9+
mockOpenDataHubConsoleLink,
10+
} from '@odh-dashboard/internal/__mocks__/mockConsoleLinks';
711
import { DataScienceStackComponent } from '@odh-dashboard/internal/concepts/areas/types';
812
import { OdhPlatformType } from '@odh-dashboard/internal/types';
913
import { appChrome } from '../../../pages/appChrome';
@@ -48,7 +52,23 @@ describe('Application', () => {
4852
});
4953

5054
it('Validate clicking on App Launcher opens menu', () => {
51-
cy.interceptOdh('GET /api/console-links', mockConsoleLinks());
55+
cy.interceptOdh(
56+
'GET /api/console-links',
57+
mockConsoleLinks([
58+
mockOpenDataHubConsoleLink,
59+
mockMLflowLink,
60+
{
61+
...mockMLflowLink,
62+
metadata: {
63+
name: 'mlflow-1234',
64+
},
65+
spec: {
66+
...mockMLflowLink.spec,
67+
text: 'MLflow test 1234',
68+
},
69+
},
70+
]),
71+
);
5272
cy.interceptOdh('GET /api/config', mockDashboardConfig({ mlflow: true }));
5373
appChrome.visit();
5474
const applicationLauncher = appChrome.getApplicationLauncher();
@@ -60,6 +80,7 @@ describe('Application', () => {
6080

6181
// Have the MLflow link
6282
applicationLauncherMenuGroupStatic.shouldHaveApplicationLauncherItem('MLflow');
83+
applicationLauncherMenuGroupStatic.shouldHaveApplicationLauncherItem('MLflow test 1234');
6384

6485
applicationLauncherMenuGroupStatic
6586
.findApplicationLauncherItem('MLflow')

0 commit comments

Comments
 (0)