Skip to content
Draft
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
c5cb980
Added workload-dashboard
marcelofukumoto May 18, 2026
7c1a8a4
Removed the TO added on STATUS CARD
marcelofukumoto May 19, 2026
4091873
Remove headless option and make the title only
marcelofukumoto May 19, 2026
17992fe
Fix lint
marcelofukumoto May 19, 2026
ecdfeef
Added the workload-dashboard type.
marcelofukumoto May 19, 2026
27fff42
Upgrades to the code and translation file
marcelofukumoto May 19, 2026
37bab37
Added fetch error and empty state
marcelofukumoto May 19, 2026
42bbb23
Added some errors and changed to ts and composition
marcelofukumoto May 20, 2026
2f82e5f
Added STORE cache for the state colors.
marcelofukumoto May 20, 2026
37c8f3d
Fixed the filter, used the same logic as the other pages.
marcelofukumoto May 20, 2026
100cf2d
Update the subtitle, fixed api request,
marcelofukumoto May 20, 2026
35451b7
Fixed some UIs Added the filter
marcelofukumoto May 21, 2026
15e0278
Remove the route, not useful
marcelofukumoto May 21, 2026
9d93cec
Broke into composables and 2 components. Separate type.ts as well.
marcelofukumoto May 21, 2026
f1f339c
Added unit tests
marcelofukumoto May 21, 2026
1d5116e
Added e2e test
marcelofukumoto May 22, 2026
c9b94cc
Fixed e2e test
marcelofukumoto May 22, 2026
16dd1c5
Changed to reduce specificity
marcelofukumoto May 26, 2026
0d9ee46
Applied code review improvements
marcelofukumoto May 26, 2026
36431d6
Removed prefs STATE_COLOR and fixed bug on state color request by clu…
marcelofukumoto May 26, 2026
201d7bd
Move the stateColor to a composable
marcelofukumoto May 26, 2026
e618784
e2e test fixes
marcelofukumoto May 26, 2026
4ba249b
Fix e2e test
marcelofukumoto May 26, 2026
e10e265
Stopped reusing the components
marcelofukumoto May 26, 2026
5d89ac0
Added some aria labels and focus
marcelofukumoto May 26, 2026
c518a45
Added missing testid
marcelofukumoto May 26, 2026
2f193b6
Removed unnecesary changes on SubtleLink Fixed any cases
marcelofukumoto May 27, 2026
6a9058b
Reposition files
marcelofukumoto May 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion shell/components/Resource/Detail/Card/StatusCard/index.vue
Comment thread
marcelofukumoto marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ import { useI18n } from '@shell/composables/useI18n';
import { StateColor } from '@shell/utils/style';
import { computed } from 'vue';
import { useStore } from 'vuex';
import type { RouteLocationRaw } from 'vue-router';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@codyrancher would you be able to review these component updates / new components? your composition api fu is greater than mine


export interface Props {
title: string;
resources?: any[];
showScaling?: boolean;
showPercent?: boolean;
noResourcesMessage?: string;
rowTo?: RouteLocationRaw | string;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

RouteLocationRaw already includes string, so | string appears to be redundant.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not using this anymore! Thanks

}
</script>

Expand All @@ -24,7 +27,9 @@ const i18n = useI18n(store);
const props = withDefaults(defineProps<Props>(), {
resources: undefined,
showScaling: false,
noResourcesMessage: undefined
showPercent: true,
noResourcesMessage: undefined,
rowTo: undefined
});
const emit = defineEmits(['decrease', 'increase']);

Expand Down Expand Up @@ -85,6 +90,14 @@ const rows = computed(() => {
}));
});

function rowRoute(label: string): RouteLocationRaw | undefined {
if (!props.rowTo || typeof props.rowTo === 'string') {
return undefined;
}

return { ...props.rowTo, query: { q: label } };
Comment thread
marcelofukumoto marked this conversation as resolved.
Outdated
}

</script>

<template>
Expand Down Expand Up @@ -120,6 +133,8 @@ const rows = computed(() => {
:label="row.label"
:count="row.count"
:percent="row.percent"
:showPercent="props.showPercent"
:to="rowRoute(row.label)"
/>
</div>
<div
Expand Down
24 changes: 13 additions & 11 deletions shell/components/Resource/Detail/Card/index.vue
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I have a feeling you may want to create a new component rather than extending this card and the status card.

This was largely intended to implement the summary cards in the design system but we haven't moved it into rancher components yet. https://www.figma.com/design/K3e7DHHM5TsS0vQELeoIFZ/Rancher-DS?node-id=676-159&m=dev

I think we may want to create a new card with a new intent. I think you could move and reuse some of the useful bits from status card and create the new one.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I will create a new component! I think that is the best for now. And I will fix the other issues on the new component

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Created new components. A lot cleaner. The components have no complexity and as you shared the previous components were not created to be shared. Reduced the files changed as well.

Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,19 @@ const { title } = defineProps<CardProps>();

<template>
<div class="detail-card">
<div class="heading">
<slot name="heading">
<div class="title">
<slot name="title">
{{ title }}
</slot>
</div>
</slot>
<slot name="heading-action" />
</div>
<VerticalGap />
<template v-if="title">
Comment thread
marcelofukumoto marked this conversation as resolved.
Outdated
<div class="heading">
<slot name="heading">
<div class="title">
<slot name="title">
{{ title }}
</slot>
</div>
</slot>
<slot name="heading-action" />
</div>
<VerticalGap />
</template>
<div class="body">
<slot name="default" />
</div>
Expand Down
21 changes: 18 additions & 3 deletions shell/components/Resource/Detail/StatusRow.vue
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
<script setup lang="ts">
import { RcCounterBadge } from '@components/Pill';
import SubtleLink from '@shell/components/SubtleLink.vue';
import { StateColor, stateColorCssVar } from '@shell/utils/style';
import type { RouteLocationRaw } from 'vue-router';

export interface Props {
color: StateColor;
label: string;
count: number;
percent: number;
showPercent?: boolean;
to?: RouteLocationRaw;
}

const {
color, label, count, percent
color, label, count, percent, showPercent = true, to
} = defineProps<Props>();
</script>

Expand All @@ -21,15 +25,26 @@ const {
:style="{backgroundColor: stateColorCssVar(color)}"
/>
<div class="label">
{{ label }}
<SubtleLink
Comment thread
marcelofukumoto marked this conversation as resolved.
Outdated
v-if="to"
:to="to"
>
{{ label }}
</SubtleLink>
<template v-else>
{{ label }}
</template>
</div>
<div class="count">
<RcCounterBadge
:count="count"
type="inactive"
/>
</div>
<div class="percent text-muted">
<div
v-if="showPercent"
Comment thread
marcelofukumoto marked this conversation as resolved.
Outdated
class="percent text-muted"
>
{{ percent.toFixed(1) }}%
</div>
</div>
Expand Down
20 changes: 16 additions & 4 deletions shell/config/product/explorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
SNAPSHOT,
VIRTUAL_TYPES,
CAPI,
WORKLOAD_DASHBOARD,
} from '@shell/config/types';

import {
Expand Down Expand Up @@ -103,6 +104,7 @@ export function init(store) {
CONFIG_MAP
], 'storage');
basicType([
WORKLOAD_DASHBOARD,
WORKLOAD,
WORKLOAD_TYPES.DEPLOYMENT,
WORKLOAD_TYPES.DAEMON_SET,
Expand All @@ -112,10 +114,6 @@ export function init(store) {
POD,
], 'workload');

setGroupDefaultType('workload', () => {
Comment thread
marcelofukumoto marked this conversation as resolved.
return store.getters['features/get'](STEVE_CACHE) ? WORKLOAD_TYPES.DEPLOYMENT : undefined;
});

weightGroup('cluster', 99, true);
weightGroup('workload', 98, true);
weightGroup('serviceDiscovery', 96, true);
Expand Down Expand Up @@ -586,6 +584,20 @@ export function init(store) {
overview: true,
});

// Workload Dashboard - overview page using the Resource Summary API
virtualType({
Comment thread
marcelofukumoto marked this conversation as resolved.
label: store.getters['i18n/t'](`typeLabel.${ WORKLOAD }`, { count: 2 }),
group: 'Root',
namespaced: true,
name: WORKLOAD_DASHBOARD,
weight: 100,
icon: 'folder',
ifHaveSubTypes: Object.values(WORKLOAD_TYPES),
route: { name: 'c-cluster-explorer-workload-dashboard' },
exact: true,
overview: true,
});

virtualType({
labelKey: 'members.clusterAndProject',
group: 'cluster',
Expand Down
4 changes: 4 additions & 0 deletions shell/config/router/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,10 @@ export default [
path: '/c/:cluster/explorer/explorer-utils',
component: () => interopDefault(import('@shell/pages/c/_cluster/explorer/explorer-utils.js')),
name: 'c-cluster-explorer-explorer-utils'
}, {
path: '/c/:cluster/explorer/workload-dashboard',
Comment thread
marcelofukumoto marked this conversation as resolved.
component: () => interopDefault(import('@shell/pages/c/_cluster/explorer/workload-dashboard.vue')),
name: 'c-cluster-explorer-workload-dashboard'
}, {
path: '/c/:cluster/explorer/tools',
component: () => interopDefault(import('@shell/pages/c/_cluster/explorer/tools/index.vue')),
Expand Down
1 change: 1 addition & 0 deletions shell/config/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export const RBAC = {
};

export const WORKLOAD = 'workload';
export const WORKLOAD_DASHBOARD = 'workload-dashboard';

/**
* Rancher Workload types
Expand Down
Loading
Loading