Skip to content

Commit

Permalink
Proper model and dataset formatting in breadcrumbs for ml-hub
Browse files Browse the repository at this point in the history
  • Loading branch information
NotChristianGarcia committed Jul 30, 2024
1 parent 7645ba1 commit 22db795
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,33 @@ const breadcrumbsFromPathname = (pathname: string) => {
console.log(image);
items.push({ to: normalize('/pods/'), text: 'pods' });
items.push({ to: normalize('/pods/images/'), text: 'images' });
items.push({ to: normalize(`/pods/images/${image}/`), text: image });
if (image) {
items.push({ to: normalize(`/pods/images/${image}/`), text: image });
}
} else if (pathname.startsWith('/ml-hub/datasets/')) {
// special case for ml-hub/datasets
const dataset = pathname.replace('/ml-hub/datasets/', '');
console.log(dataset);
items.push({ to: normalize('/ml-hub/'), text: 'ml-hub' });
items.push({ to: normalize('/ml-hub/datasets/'), text: 'datasets' });
if (dataset) {
items.push({
to: normalize(`/ml-hub/datasets/${dataset}/`),
text: dataset,
});
}
} else if (pathname.startsWith('/ml-hub/models/')) {
// special case for ml-hub/models
const model = pathname.replace('/ml-hub/models/', '');
console.log(model);
items.push({ to: normalize('/ml-hub/'), text: 'ml-hub' });
items.push({ to: normalize('/ml-hub/models/'), text: 'models' });
if (model) {
items.push({
to: normalize(`/ml-hub/models/${model}/`),
text: model,
});
}
} else {
// Original logic
const pathParts = pathname.split('/');
Expand Down
20 changes: 10 additions & 10 deletions src/app/Pods/_components/PodsLoadingText/PodsLoadingText.tsx

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 22db795

Please sign in to comment.