Skip to content

Commit

Permalink
Update version of Patternfly to v6 (opendatahub-io#3038)
Browse files Browse the repository at this point in the history
* Update to Patternfly v6

* Fix some alignment issues in table rows
  • Loading branch information
jeff-phillips-18 authored Dec 6, 2024
1 parent 793bdb7 commit 4b8c2bf
Show file tree
Hide file tree
Showing 464 changed files with 5,533 additions and 8,311 deletions.
3 changes: 2 additions & 1 deletion frontend/.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ ODH_IS_PROJECT_ROOT_DIR=false
ODH_PORT=${FRONTEND_PORT}

########## Change the following three variables for ODH/OpenShift AI ##########
ODH_LOGO=odh-logo.svg
ODH_LOGO=odh-logo-light-theme.svg
ODH_LOGO_DARK=odh-logo-dark-theme.svg
ODH_PRODUCT_NAME=Open Data Hub
ODH_FAVICON=odh-favicon.svg
ODH_NOTEBOOK_REPO=opendatahub
Expand Down
8,057 changes: 2,705 additions & 5,352 deletions frontend/package-lock.json

Large diffs are not rendered by default.

58 changes: 41 additions & 17 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,21 @@
"@monaco-editor/react": "^4.6.0",
"@openshift/dynamic-plugin-sdk": "^4.0.0",
"@openshift/dynamic-plugin-sdk-utils": "^4.0.1",
"@patternfly/patternfly": "^5.4.0",
"@patternfly/quickstarts": "^5.3.0",
"@patternfly/react-catalog-view-extension": "^5.0.0",
"@patternfly/react-charts": "^7.4.0",
"@patternfly/react-code-editor": "^5.4.0",
"@patternfly/react-core": "^5.4.1",
"@patternfly/react-drag-drop": "^5.4.0",
"@patternfly/react-icons": "^5.4.0",
"@patternfly/react-log-viewer": "^5.3.0",
"@patternfly/react-styles": "^5.4.0",
"@patternfly/react-table": "^5.4.0",
"@patternfly/react-templates": "^1.1.0",
"@patternfly/react-tokens": "^5.4.0",
"@patternfly/react-topology": "^5.4.1",
"@patternfly/react-virtualized-extension": "^5.1.0",
"@patternfly/patternfly": "^6.0.0",
"@patternfly/quickstarts": "6.0.0",
"@patternfly/react-catalog-view-extension": "^6.0.0",
"@patternfly/react-charts": "^8.0.0",
"@patternfly/react-code-editor": "^6.0.0",
"@patternfly/react-core": "^6.0.0",
"@patternfly/react-drag-drop": "^6.0.0",
"@patternfly/react-icons": "^6.0.0",
"@patternfly/react-log-viewer": "^6.0.0",
"@patternfly/react-styles": "^6.0.0",
"@patternfly/react-table": "^6.0.0",
"@patternfly/react-templates": "^6.0.0",
"@patternfly/react-tokens": "^6.0.0",
"@patternfly/react-topology": "6.1.0-prerelease.3",
"@patternfly/react-virtualized-extension": "^6.0.0",
"@segment/analytics-next": "^1.72.0",
"@types/classnames": "^2.3.1",
"axios": "^1.6.4",
Expand Down Expand Up @@ -146,7 +146,23 @@
"tslib": "^2.5.0",
"typescript": "^5.3.3",
"url-loader": "^4.1.1",
"victory-core": "^36.8.3",
"victory-core": "^37.1.1",
"victory-area": "^37.1.1",
"victory-axis": "^37.1.1",
"victory-bar": "^37.1.1",
"victory-box-plot": "^37.1.1",
"victory-chart": "^37.1.1",
"victory-create-container": "^37.1.1",
"victory-cursor-container": "^37.1.1",
"victory-group": "^37.1.1",
"victory-legend": "^37.1.1",
"victory-line": "^37.1.1",
"victory-pie": "^37.1.1",
"victory-scatter": "^37.1.1",
"victory-stack": "^37.1.1",
"victory-tooltip": "^37.1.1",
"victory-voronoi-container": "^37.1.1",
"victory-zoom-container": "^37.1.1",
"webpack": "^5.96.1",
"webpack-bundle-analyzer": "^4.7.0",
"webpack-cli": "^5.1.4",
Expand Down Expand Up @@ -205,11 +221,19 @@
"react-redux": "^8.0.4",
"react-router": "^6.4.1",
"react": "^18.2.0",
"react-dom": "^18.2.0"
"react-dom": "^18.2.0",
"@patternfly/react-core": "^6.0.0",
"@patternfly/react-icons": "^6.0.0",
"@patternfly/react-styles": "^6.0.0",
"@patternfly/react-table": "^6.0.0",
"@patternfly/react-virtualized-extension": "^6.0.0"
},
"@patternfly/react-topology": {
"react": "^18.2.0"
},
"@patternfly/quickstarts": {
"@patternfly/react-core": "^6.0.0"
},
"ws": "^8.17.1"
}
}
2 changes: 1 addition & 1 deletion frontend/src/__mocks__/mockByon.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable camelcase */
import _ from 'lodash-es';
import * as _ from 'lodash-es';

import { RecursivePartial } from '~/typeHelpers';
import { BYONImage } from '~/types';
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/__mocks__/mockImageStreamK8sResource.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import _ from 'lodash-es';
import * as _ from 'lodash-es';
import { ImageStreamKind } from '~/k8sTypes';
import { RecursivePartial } from '~/typeHelpers';

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/__mocks__/mockNotebookK8sResource.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import _ from 'lodash-es';
import * as _ from 'lodash-es';
import { KnownLabels, NotebookKind } from '~/k8sTypes';
import { DEFAULT_NOTEBOOK_SIZES } from '~/pages/projects/screens/spawner/const';
import { ContainerResources, TolerationEffect, TolerationOperator, VolumeMount } from '~/types';
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/__mocks__/mockNotebookState.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import _ from 'lodash-es';
import * as _ from 'lodash-es';
import { NotebookKind } from '~/k8sTypes';
import { NotebookState, NotebookRefresh } from '~/pages/projects/notebook/types';

Expand Down
10 changes: 7 additions & 3 deletions frontend/src/__tests__/cypress/cypress/pages/clusterStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ class ClusterStorageModal extends Modal {
}

private findPVSizeSelectButton() {
return cy.findByTestId('value-unit-select');
return this.find().findByTestId('value-unit-select');
}

selectPVSize(name: string) {
this.findPVSizeSelectButton().click();
cy.findByRole('menuitem', { name, hidden: true }).click();
this.findPVSizeSelectButton().findDropdownItem(name).click();
return this;
}

shouldHavePVSizeSelectValue(name: string) {
Expand Down Expand Up @@ -127,6 +127,10 @@ class ClusterStorageModal extends Modal {
return this.find().findByTestId('storage-classes-selector');
}

findStorageClassOption(name: string) {
return cy.get('#storage-classes-selector').findByText(name);
}

findStorageClassDeprecatedWarning() {
return this.find().findByTestId('deprecated-storage-warning');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ export class DashboardCodeEditor extends Contextual<HTMLElement> {
}

findUpload(): Cypress.Chainable<JQuery<HTMLElement>> {
return this.find().find('.pf-v5-c-code-editor__main input[type="file"]');
return this.find().find('.pf-v6-c-code-editor__main input[type="file"]');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Pagination {
}

selectToggleOption(name: string) {
return this.findMenuToggleButton().parents().findByRole('menuitem', { name }).click();
return this.findMenuToggleButton().parents().parents().findByRole('menuitem', { name }).click();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export class SearchSelector extends SubComponentBase {
}

findItem(name: string): Cypress.Chainable<JQuery<HTMLElement>> {
return this.findToggleButton().findDropdownItem(name);
return this.findToggleButton().findMenuItem(name);
}

selectItem(name: string): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ class ConnectionTypesPage {
}

findEmptyFilterResults() {
return cy.findByTestId('no-result-found-title');
return cy.findByTestId('dashboard-empty-table-state');
}

findSortButton(name: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class ModelServingGlobal {
}

findEmptyResults() {
return cy.findByTestId('no-result-found-title');
return cy.findByTestId('dashboard-empty-table-state');
}

findSortButton(name: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class NotebookImageSettings {
}

findEmptyResults() {
return cy.findByTestId('no-result-found-title');
return cy.findByTestId('dashboard-empty-table-state');
}

private findTable() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class CompareRunsRocCurve extends Contextual<HTMLElement> {
}

findRocCurveTableEmptyState() {
return this.find().findByTestId('no-result-found-title');
return this.find().findByTestId('dashboard-empty-table-state');
}

getRocCurveRowByName(name: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,26 +53,19 @@ class PipelineRunFilterBar extends PipelineFilterBar {

selectStatusByName(name: string) {
this.findStatusSelect().findSelectOption(name).click();
return this;
}

selectPipelineVersionByName(name: string): void {
this.findPipelineVersionSelect()
.click()
.parents()
.findByTestId('pipeline-version-selector-table-list')
.find('td')
.contains(name)
.click();
}

selectExperimentByName(name: string): Cypress.Chainable<JQuery<HTMLTableCellElement>> {
return this.findExperimentSelect()
.click()
.parents()
.findByTestId('experiment-selector-table-list')
.find('td')
.contains(name)
.click();
selectPipelineVersionByName(name: string) {
this.findPipelineVersionSelect().click();
cy.findByTestId('pipeline-version-selector-table-list').find('td').contains(name).click();
return this;
}

selectExperimentByName(name: string) {
this.findExperimentSelect().click();
cy.findByTestId('experiment-selector-table-list').find('td').contains(name).click();
return this;
}

mockExperiments(experiments: ExperimentKF[], namespace: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class PipelineRunsTable {
}

findEmptyResults() {
return cy.findByTestId('no-result-found-title');
return cy.findByTestId('dashboard-empty-table-state');
}

mockRestoreRun(runId: string, namespace: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ class PipelinesTable {
}

findEmptyResults() {
return cy.findByTestId('no-result-found-title');
return cy.findByTestId('dashboard-empty-table-state');
}

mockDeletePipeline(pipeline: PipelineKF, namespace: string) {
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/__tests__/cypress/cypress/pages/projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class NotebookRow extends TableRow {
}

shouldHaveNotebookImageName(name: string) {
return cy.findByTestId('image-display-name').should('have.text', name);
return cy.findByTestId('image-display-name').should('contain.text', name);
}

findOutdatedElyraInfo() {
Expand Down Expand Up @@ -66,7 +66,7 @@ class ProjectRow extends TableRow {
}

findNotebookColumnExpander() {
return this.find().findByTestId('notebook-column-count');
return this.find().findByTestId('notebook-column-expand').find('button');
}

findNotebookTable() {
Expand Down Expand Up @@ -134,7 +134,7 @@ class ProjectListPage {
}

findEmptyResults() {
return cy.findByTestId('no-result-found-title');
return cy.findByTestId('dashboard-empty-table-state');
}

findSortButton(name: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class GroupSettingSection extends Contextual<HTMLElement> {
removeChipItem(name: string) {
this.findChipGroup()
.find('li')
.findByRole('button', { name: `close ${name}` })
.findByRole('button', { name: `Close ${name}` })
.click();
}

Expand Down
9 changes: 4 additions & 5 deletions frontend/src/__tests__/cypress/cypress/pages/workbench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ class AttachExistingStorageModal extends Modal {
cy.findByTestId('persistent-storage-group')
.findByPlaceholderText('Select a persistent storage')
.click();
cy.findByTestId('persistent-storage-group').contains('button.pf-v5-c-menu__item', name).click();
cy.findByTestId('persistent-storage-group').contains('button.pf-v6-c-menu__item', name).click();
}

findStandardPathInput() {
Expand All @@ -217,8 +217,7 @@ class AttachConnectionModal extends Modal {
}

selectConnectionOption(name: string) {
this.find().findByRole('button', { name: 'Connections' }).click();
this.find().findByRole('option', { name }).click();
this.find().findByRole('button', { name: 'Connections' }).findSelectOption(name).click();
this.find().findByRole('button', { name: 'Connections' }).click();
}

Expand Down Expand Up @@ -357,8 +356,8 @@ class CreateSpawnerPage {
selectExistingDataConnection(name: string) {
cy.findByTestId('data-connection-group')
.findByRole('button', { name: 'Typeahead menu toggle' })
.findSelectOption(name)
.click();
cy.get('[id="dashboard-page-main"]').findByRole('option', { name }).click();
}

findAwsNameInput() {
Expand Down Expand Up @@ -449,7 +448,7 @@ class NotFoundSpawnerPage {
}

shouldHaveErrorMessageTitle(name: string) {
cy.findByTestId('error-message-title').should('have.text', name);
cy.findByTestId('error-message-title').should('contain.text', name);
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ declare global {
isDropdownToggle?: boolean,
) => Cypress.Chainable<JQuery>;

/**
* Finds a patternfly dropdown item by first opening the dropdown if not already opened.
*
* @param name the name of the item
*/
findMenuItem: (name: string | RegExp) => Cypress.Chainable<JQuery>;

/**
* Finds a patternfly dropdown item by first opening the dropdown if not already opened.
*
Expand Down Expand Up @@ -204,7 +211,7 @@ Cypress.Commands.add(
if ($el.attr('aria-expanded') === 'false') {
cy.wrap($el).click();
}
return cy.wrap($el.parent()).findByRole('menuitem', { name });
return cy.get('[data-ouia-component-type="PF6/Dropdown"]').findByRole('menuitem', { name });
});
},
);
Expand All @@ -215,7 +222,17 @@ Cypress.Commands.add('findDropdownItem', { prevSubject: 'element' }, (subject, n
if ($el.attr('aria-expanded') === 'false') {
cy.wrap($el).click();
}
return cy.wrap($el).parent().findByRole('menuitem', { name });
return cy.get('[data-ouia-component-type="PF6/Dropdown"]').findByRole('menuitem', { name });
});
});

Cypress.Commands.add('findMenuItem', { prevSubject: 'element' }, (subject, name) => {
Cypress.log({ displayName: 'findMenuItem', message: name });
return cy.wrap(subject).then(($el) => {
if ($el.attr('aria-expanded') === 'false') {
cy.wrap($el).click();
}
return cy.get('[data-ouia-component-type="PF6/Menu"]').findByRole('menuitem', { name });
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ Cypress.Commands.add('testA11y', { prevSubject: 'optional' }, (subject, context)
c,
{
includedImpacts: ['serious', 'critical'],
rules: {
'color-contrast': { enabled: false },
'scrollable-region-focusable': { enabled: false },
label: { enabled: false },
},
},
(violations) => {
cy.task(
Expand Down
Loading

0 comments on commit 4b8c2bf

Please sign in to comment.