-
Notifications
You must be signed in to change notification settings - Fork 297
Update status labels #6746
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
openshift-merge-bot
merged 10 commits into
opendatahub-io:main
from
rsun19:update-status-labels
Apr 2, 2026
Merged
Update status labels #6746
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
dd5480e
update status labels, icons, and colors across dashboard components
rsun19 4cd79bd
standardize status labels across eval-hub, pipelines, model-training,…
rsun19 b790747
removed descriptions
rsun19 e15ad18
use outlined variant for non-interactive status labels
rsun19 c3104c5
align status labels with RHOAI design guidelines
rsun19 9d1e7ac
fix remaining status label inconsistencies across dashboard
rsun19 7bae8a5
fix lint errors
rsun19 eb3c86e
fix status label review issues
rsun19 182f899
fix status label bugs and clean up mock naming
rsun19 4e0e2e1
addressed comments
rsun19 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| import * as React from 'react'; | ||
| import { render, screen } from '@testing-library/react'; | ||
| import { QuickStartContext } from '@patternfly/quickstarts'; | ||
| import { OdhDocument, OdhDocumentType } from '#~/types'; | ||
| import { CompletionStatusEnum } from '#~/utilities/quickStartUtils'; | ||
| import DocCardBadges from '#~/components/DocCardBadges'; | ||
|
|
||
| jest.mock('#~/utilities/quickStartUtils', () => ({ | ||
| ...jest.requireActual('#~/utilities/quickStartUtils'), | ||
| getQuickStartCompletionStatus: jest.fn(), | ||
| })); | ||
|
|
||
| const mockGetQuickStartCompletionStatus = jest.mocked( | ||
| jest.requireMock<typeof import('#~/utilities/quickStartUtils')>('#~/utilities/quickStartUtils') | ||
| .getQuickStartCompletionStatus, | ||
| ); | ||
|
|
||
| const createDoc = ( | ||
| type: OdhDocumentType = OdhDocumentType.Documentation, | ||
| name = 'test-doc', | ||
| durationMinutes?: number, | ||
| ): OdhDocument => | ||
| ({ | ||
| metadata: { name }, | ||
| spec: { | ||
| type, | ||
| displayName: 'Test Doc', | ||
| description: 'desc', | ||
| durationMinutes, | ||
| }, | ||
| } as unknown as OdhDocument); | ||
|
|
||
| const renderWithContext = (odhDoc: OdhDocument) => { | ||
| const contextValue = { | ||
| allQuickStarts: [{ metadata: { name: odhDoc.metadata.name }, spec: { tasks: [] }, status: {} }], | ||
| activeQuickStartID: '', | ||
| allQuickStartStates: {}, | ||
| setActiveQuickStart: jest.fn(), | ||
| restartQuickStart: jest.fn(), | ||
| setQuickStartTaskNumber: jest.fn(), | ||
| setQuickStartTaskStatus: jest.fn(), | ||
| setAllQuickStartStates: jest.fn(), | ||
| getQuickStartForId: jest.fn(), | ||
| }; | ||
|
|
||
| return render( | ||
| <QuickStartContext.Provider value={contextValue as never}> | ||
| <DocCardBadges odhDoc={odhDoc} /> | ||
| </QuickStartContext.Provider>, | ||
| ); | ||
| }; | ||
|
|
||
| describe('DocCardBadges', () => { | ||
| beforeEach(() => { | ||
| mockGetQuickStartCompletionStatus.mockReturnValue(undefined); | ||
| }); | ||
|
|
||
| it('should render documentation type label', () => { | ||
| renderWithContext(createDoc(OdhDocumentType.Documentation)); | ||
| expect(screen.getByText('Documentation')).toBeInTheDocument(); | ||
| }); | ||
|
|
||
| it('should render duration label when duration is provided', () => { | ||
| renderWithContext(createDoc(OdhDocumentType.Documentation, 'doc', 15)); | ||
| expect(screen.getByText('15 minutes')).toBeInTheDocument(); | ||
| }); | ||
|
|
||
| it('should render "In Progress" label with info status for in-progress quickstart', () => { | ||
| mockGetQuickStartCompletionStatus.mockReturnValue(CompletionStatusEnum.InProgress); | ||
| renderWithContext(createDoc(OdhDocumentType.QuickStart, 'qs-in-progress')); | ||
| const inProgressLabel = screen.getByText('In Progress').closest('.pf-v6-c-label'); | ||
| expect(inProgressLabel).toHaveClass('pf-m-info'); | ||
| expect(inProgressLabel).toHaveClass('pf-m-outline'); | ||
| }); | ||
|
|
||
| it('should render "Complete" label with success status for completed quickstart', () => { | ||
| mockGetQuickStartCompletionStatus.mockReturnValue(CompletionStatusEnum.Success); | ||
| renderWithContext(createDoc(OdhDocumentType.QuickStart, 'qs-complete')); | ||
| const completeLabel = screen.getByText('Complete').closest('.pf-v6-c-label'); | ||
| expect(completeLabel).toHaveClass('pf-m-success'); | ||
| expect(completeLabel).toHaveClass('pf-m-outline'); | ||
| }); | ||
|
|
||
| it('should render "Failed" label with danger status for failed quickstart', () => { | ||
| mockGetQuickStartCompletionStatus.mockReturnValue(CompletionStatusEnum.Failed); | ||
| renderWithContext(createDoc(OdhDocumentType.QuickStart, 'qs-failed')); | ||
| const failedLabel = screen.getByText('Failed').closest('.pf-v6-c-label'); | ||
| expect(failedLabel).toHaveClass('pf-m-danger'); | ||
| expect(failedLabel).toHaveClass('pf-m-outline'); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.