-
Notifications
You must be signed in to change notification settings - Fork 334
[11513] Added workload-dashboard #17728
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
base: master
Are you sure you want to change the base?
Changes from 7 commits
c5cb980
7c1a8a4
4091873
17992fe
ecdfeef
27fff42
37bab37
42bbb23
2f82e5f
37c8f3d
100cf2d
35451b7
15e0278
9d93cec
f1f339c
1d5116e
c9b94cc
16dd1c5
0d9ee46
36431d6
201d7bd
e618784
4ba249b
e10e265
5d89ac0
c518a45
2f193b6
6a9058b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
marcelofukumoto marked this conversation as resolved.
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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'; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not using this anymore! Thanks |
||
| } | ||
| </script> | ||
|
|
||
|
|
@@ -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']); | ||
|
|
||
|
|
@@ -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 } }; | ||
|
marcelofukumoto marked this conversation as resolved.
Outdated
|
||
| } | ||
|
|
||
| </script> | ||
|
|
||
| <template> | ||
|
|
@@ -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 | ||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this use case is different, the user may have not set any and the default
only user namespacesis usedThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is provided by @oboc-sts from the Figma.
Let me ask him to check here directly.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I totally missed the "suggested change"...
Yeah, we can go with the suggestion @richard-cox made above, it makes sense, I like it ;)