Skip to content

"Community and custom models" section should be hidden if there are no catalog sources without labels#1836

Merged
google-oss-prow[bot] merged 3 commits intokubeflow:mainfrom
YuliaKrimerman:community-hide
Nov 18, 2025
Merged

"Community and custom models" section should be hidden if there are no catalog sources without labels#1836
google-oss-prow[bot] merged 3 commits intokubeflow:mainfrom
YuliaKrimerman:community-hide

Conversation

@YuliaKrimerman
Copy link
Copy Markdown
Contributor

Summary

Hide the "Community and custom models" section when there are no enabled catalog sources without labels.

Description

Hides the "Community and custom models" section in the Model Catalog UI when no enabled catalog sources have empty labels.

Changes made:

  • Added hasSourcesWithoutLabels() in modelCatalogUtils.ts to detect enabled sources with empty or whitespace-only labels
  • Updated ModelCatalogAllModelsView.tsx to conditionally render the "Community and custom models" section
  • Updated ModelCatalogSourceLabelBlocks.tsx to conditionally show the "no-labels" toggle button
  • Updated Cypress tests to cover both visible and hidden scenarios

How Has This Been Tested?

Manual Testing:
Run from the ui folder make dev-start
Verified section appears when enabled sources without labels exist
then modify clients/ui/bff/internal/mocks/static_data_mock.go :
{
Id: "adminModel1",
Name: "Admin model 1",
Enabled: &disabled, // Change from &enabled to &disabled
Labels: []string{},
},
And for dora:
{
Id: "dora",
Name: "Dora source",
Enabled: &disabled, // Add this line
Labels: []string{},
},
Re run and verified section hides when all sources have labels or sources without labels are disabled
Screenshot 2025-11-03 at 10 15 38 AM

Automated Testing:

  • Updated Cypress tests:
    • modelCatalogAllModelsView.cy.ts: Added test for hiding behavior; updated existing tests to handle conditional rendering
    • modelCatalog.cy.ts: Fixed API call count to match dynamic category sections

Merge Criteria

  • Commits have meaningful messages
  • Automated tests provided (Cypress tests updated and passing)
  • Developer manually tested changes (verified with BFF mocks)
  • Code changes follow Kubeflow contribution guidelines
  • UI tests added (Cypress tests updated for new behavior)

For UI changes:

  • Developer added/updated tests (Cypress tests updated)
  • UI/UX changes verified (section conditionally hidden per requirements)

Signed-off-by: Yulia Krimerman <juliapiterova@hotmail.com>
Copy link
Copy Markdown
Contributor

@mturley mturley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tiny nit with the test, otherwise LGTM

Comment on lines +169 to +172
const defaultSources = [
mockCatalogSource({}),
mockCatalogSource({ id: 'source-2', name: 'source 2' }),
];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you never actually use defaultSources in an intercept, I think the test only passes because it happens to match the default currently implemented in initIntercepts. In case that changes later I think you need to pass this into the initIntercepts call on line 203 here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mturley fixed. I think it needs /retest though :(

Signed-off-by: Yulia Krimerman <juliapiterova@hotmail.com>
Comment on lines +821 to +834
@@ -828,9 +828,10 @@ func GetCatalogSourceMocks() []models.CatalogSource {
Labels: []string{"Sample category 1"},
},
{
Id: "dora",
Name: "Dora source",
Labels: []string{},
Id: "dora",
Name: "Dora source",
Enabled: &disabled,
Labels: []string{},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@YuliaKrimerman would like to revert this changes in this PR to make community and custom visible in mock mode? Because this changes were mentioned in PR description to test this PR. so should we revert it or is this changes intentional?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverted

@google-oss-prow
Copy link
Copy Markdown
Contributor

@ppadti: changing LGTM is restricted to collaborators

Details

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@mturley
Copy link
Copy Markdown
Contributor

mturley commented Nov 18, 2025

/retest

Signed-off-by: Yulia Krimerman <juliapiterova@hotmail.com>
@mturley
Copy link
Copy Markdown
Contributor

mturley commented Nov 18, 2025

/lgtm
/approve

@google-oss-prow google-oss-prow Bot added the lgtm label Nov 18, 2025
@google-oss-prow
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mturley

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow google-oss-prow Bot merged commit e5fa69f into kubeflow:main Nov 18, 2025
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants