@rancher/shell 3.0.5-rc.8 → 3.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/styles/base/_color.scss +4 -1
- package/assets/styles/global/_tooltip.scss +7 -4
- package/assets/styles/themes/_dark.scss +11 -0
- package/assets/styles/themes/_light.scss +13 -1
- package/assets/styles/themes/_modern.scss +22 -0
- package/assets/translations/en-us.yaml +147 -19
- package/assets/translations/zh-hans.yaml +0 -1
- package/chart/monitoring/grafana/index.vue +8 -2
- package/components/ActionMenuShell.vue +3 -1
- package/components/Cron/CronExpressionEditor.vue +299 -0
- package/components/Cron/CronExpressionEditorModal.vue +247 -0
- package/components/Cron/CronTooltip.vue +87 -0
- package/components/Cron/types.ts +13 -0
- package/components/ForceDirectedTreeChart/composable.ts +11 -0
- package/components/PodSecurityAdmission.vue +2 -0
- package/components/PromptModal.vue +1 -1
- package/components/Resource/Detail/Card/__tests__/StateCard.test.ts +1 -0
- package/components/Resource/Detail/CopyToClipboard.vue +78 -0
- package/components/Resource/Detail/FetchLoader/__tests__/composables.test.ts +69 -0
- package/components/Resource/Detail/FetchLoader/composables.ts +27 -0
- package/components/Resource/Detail/Metadata/Annotations/__tests__/index.test.ts +1 -1
- package/components/Resource/Detail/Metadata/Annotations/index.vue +1 -1
- package/components/Resource/Detail/Metadata/IdentifyingInformation/__tests__/identifying-fields.test.ts +13 -61
- package/components/Resource/Detail/Metadata/IdentifyingInformation/__tests__/index.test.ts +33 -6
- package/components/Resource/Detail/Metadata/IdentifyingInformation/identifying-fields.ts +24 -38
- package/components/Resource/Detail/Metadata/IdentifyingInformation/index.vue +25 -5
- package/components/Resource/Detail/Metadata/KeyValue.vue +12 -23
- package/components/Resource/Detail/Metadata/KeyValueRow.vue +144 -0
- package/components/Resource/Detail/Metadata/Labels/__tests__/index.test.ts +1 -0
- package/components/Resource/Detail/Metadata/Labels/index.vue +1 -0
- package/components/Resource/Detail/Metadata/__tests__/KeyValue.test.ts +30 -32
- package/components/Resource/Detail/Metadata/__tests__/KeyValueRow.test.ts +108 -0
- package/components/Resource/Detail/Metadata/__tests__/composables.test.ts +0 -3
- package/components/Resource/Detail/Metadata/__tests__/index.test.ts +12 -5
- package/components/Resource/Detail/Metadata/composables.ts +1 -4
- package/components/Resource/Detail/Metadata/index.vue +1 -0
- package/components/Resource/Detail/Preview/Content.vue +63 -0
- package/components/Resource/Detail/Preview/Preview.vue +128 -0
- package/components/Resource/Detail/Preview/__tests__/Content.spec.ts +71 -0
- package/components/Resource/Detail/Preview/__tests__/Preview.spec.ts +121 -0
- package/components/Resource/Detail/ResourcePopover/ResourcePopoverCard.vue +141 -0
- package/components/Resource/Detail/ResourcePopover/__tests__/ResourcePopoverCard.test.ts +136 -0
- package/components/Resource/Detail/ResourcePopover/__tests__/index.test.ts +245 -0
- package/components/Resource/Detail/ResourcePopover/index.vue +226 -0
- package/components/Resource/Detail/SpacedRow.vue +1 -0
- package/components/Resource/Detail/TitleBar/__tests__/composables.test.ts +0 -5
- package/components/Resource/Detail/TitleBar/__tests__/index.test.ts +1 -1
- package/components/Resource/Detail/TitleBar/composables.ts +1 -3
- package/components/Resource/Detail/TitleBar/index.vue +2 -29
- package/components/Resource/Detail/ViewOptions/composable.ts +9 -0
- package/components/Resource/Detail/ViewOptions/index.vue +41 -0
- package/components/Resource/Detail/__tests__/CopyToClipboard.spec.ts +82 -0
- package/components/ResourceDetail/Masthead/legacy.vue +0 -19
- package/components/ResourceDetail/index.vue +1 -26
- package/components/ResourceTable.vue +24 -0
- package/components/SortableTable/index.vue +7 -1
- package/components/SortableTable/paging.js +3 -0
- package/components/Tabbed/Tab.vue +43 -1
- package/components/Tabbed/index.vue +3 -1
- package/components/__tests__/Cron/CronExpressionEditor.test.ts +151 -0
- package/components/__tests__/Cron/CronExpressionEditorModal.test.ts +81 -0
- package/components/auth/login/saml.vue +86 -0
- package/components/form/LabeledSelect.vue +8 -8
- package/components/form/ProjectMemberEditor.vue +2 -0
- package/components/form/ResourceTabs/composable.ts +54 -0
- package/components/form/ResourceTabs/index.vue +10 -7
- package/components/form/Select.vue +13 -10
- package/components/form/__tests__/LabeledSelect.test.ts +133 -0
- package/components/form/__tests__/Select.test.ts +134 -0
- package/components/nav/Header.vue +6 -5
- package/composables/useExtensionManager.ts +17 -0
- package/config/home-links.js +12 -0
- package/config/labels-annotations.js +0 -1
- package/config/page-actions.js +0 -1
- package/config/product/explorer.js +3 -1
- package/config/product/fleet.js +2 -7
- package/config/product/manager.js +0 -5
- package/config/query-params.js +1 -0
- package/config/router/navigation-guards/clusters.js +2 -1
- package/config/router/navigation-guards/products.js +1 -1
- package/config/store.js +2 -0
- package/core/extension-manager-impl.js +518 -0
- package/core/plugins.js +35 -468
- package/core/types.ts +8 -2
- package/detail/__tests__/autoscaling.horizontalpodautoscaler.test.ts +1 -0
- package/detail/catalog.cattle.io.app.vue +7 -4
- package/detail/fleet.cattle.io.bundle.vue +1 -5
- package/detail/fleet.cattle.io.cluster.vue +3 -2
- package/detail/fleet.cattle.io.gitrepo.vue +76 -49
- package/detail/fleet.cattle.io.helmop.vue +78 -49
- package/dialog/AddonConfigConfirmationDialog.vue +1 -1
- package/dialog/GenericPrompt.vue +1 -1
- package/dialog/ImportDialog.vue +9 -2
- package/dialog/InstallExtensionDialog.vue +18 -10
- package/dialog/SloDialog.vue +1 -1
- package/edit/__tests__/fleet.cattle.io.gitrepo.test.ts +2 -1
- package/edit/__tests__/resources.cattle.io.restore.test.ts +106 -0
- package/edit/auth/oidc.vue +106 -6
- package/edit/auth/saml.vue +5 -5
- package/edit/cloudcredential.vue +31 -17
- package/edit/constraints.gatekeeper.sh.constraint/index.vue +10 -2
- package/edit/fleet.cattle.io.cluster.vue +19 -0
- package/edit/fleet.cattle.io.gitrepo.vue +23 -16
- package/edit/monitoring.coreos.com.alertmanagerconfig/index.vue +12 -11
- package/edit/monitoring.coreos.com.alertmanagerconfig/receiverConfig.vue +11 -1
- package/edit/provisioning.cattle.io.cluster/index.vue +14 -19
- package/edit/provisioning.cattle.io.cluster/rke2.vue +11 -3
- package/edit/provisioning.cattle.io.cluster/tabs/AddOnAdditionalManifest.vue +1 -0
- package/edit/provisioning.cattle.io.cluster/tabs/AddOnConfig.vue +1 -0
- package/edit/provisioning.cattle.io.cluster/tabs/Basics.vue +1 -0
- package/edit/provisioning.cattle.io.cluster/tabs/etcd/S3Config.vue +1 -0
- package/edit/provisioning.cattle.io.cluster/tabs/registries/index.vue +2 -0
- package/edit/provisioning.cattle.io.cluster/tabs/upgrade/DrainOptions.vue +6 -0
- package/edit/resources.cattle.io.restore.vue +5 -8
- package/initialize/install-plugins.js +1 -3
- package/list/__tests__/workload.test.ts +1 -0
- package/list/workload.vue +8 -1
- package/machine-config/components/GCEImage.vue +6 -5
- package/machine-config/google.vue +11 -6
- package/mixins/__tests__/auth-config.test.ts +4 -6
- package/mixins/__tests__/chart.test.ts +139 -1
- package/mixins/auth-config.js +33 -10
- package/mixins/chart.js +58 -18
- package/models/__tests__/namespace.test.ts +69 -0
- package/models/apps.statefulset.js +8 -10
- package/models/chart.js +5 -1
- package/models/fleet-application.js +16 -46
- package/models/fleet.cattle.io.bundle.js +1 -38
- package/models/fleet.cattle.io.gitrepo.js +4 -0
- package/models/fleet.cattle.io.helmop.js +4 -0
- package/models/management.cattle.io.cluster.js +1 -1
- package/models/management.cattle.io.project.js +12 -0
- package/models/namespace.js +30 -0
- package/models/workload.js +4 -1
- package/package.json +10 -10
- package/pages/auth/login.vue +8 -3
- package/pages/auth/logout.vue +6 -5
- package/pages/c/_cluster/apps/charts/AppChartCardFooter.vue +26 -11
- package/pages/c/_cluster/apps/charts/chart.vue +29 -20
- package/pages/c/_cluster/apps/charts/index.vue +1 -0
- package/pages/c/_cluster/apps/charts/install.vue +6 -5
- package/pages/c/_cluster/explorer/tools/__tests__/index.test.ts +102 -12
- package/pages/c/_cluster/explorer/tools/index.vue +145 -254
- package/pages/c/_cluster/manager/cloudCredential/index.vue +18 -1
- package/pages/c/_cluster/manager/drivers/kontainerDriver/index.vue +12 -2
- package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +1 -1
- package/pages/c/_cluster/uiplugins/__tests__/index.spec.ts +318 -0
- package/pages/c/_cluster/uiplugins/index.vue +221 -363
- package/pages/home.vue +1 -9
- package/plugins/axios.js +3 -2
- package/plugins/dashboard-store/resource-class.js +49 -0
- package/plugins/ember-cookie.js +7 -3
- package/plugins/steve/subscribe.js +4 -2
- package/public/index.html +2 -1
- package/rancher-components/Card/Card.vue +1 -1
- package/rancher-components/Form/Checkbox/Checkbox.vue +1 -1
- package/rancher-components/Form/Radio/RadioButton.vue +1 -1
- package/rancher-components/Form/Radio/RadioGroup.vue +1 -1
- package/rancher-components/LabeledTooltip/LabeledTooltip.vue +1 -11
- package/rancher-components/Pill/RcCounterBadge/RcCounterBadge.test.ts +53 -0
- package/rancher-components/Pill/RcCounterBadge/RcCounterBadge.vue +65 -0
- package/rancher-components/Pill/RcCounterBadge/index.ts +1 -0
- package/rancher-components/Pill/RcCounterBadge/types.ts +7 -0
- package/rancher-components/Pill/RcStatusBadge/RcStatusBadge.vue +1 -1
- package/rancher-components/Pill/RcStatusBadge/index.ts +1 -1
- package/rancher-components/Pill/RcStatusIndicator/RcStatusIndicator.vue +3 -3
- package/rancher-components/Pill/RcStatusIndicator/types.ts +1 -1
- package/rancher-components/Pill/RcTag/RcTag.test.ts +64 -0
- package/rancher-components/Pill/RcTag/RcTag.vue +94 -0
- package/rancher-components/Pill/RcTag/index.ts +1 -0
- package/rancher-components/Pill/RcTag/types.ts +9 -0
- package/rancher-components/Pill/types.ts +1 -0
- package/rancher-components/RcItemCard/RcItemCard.vue +1 -0
- package/rancher-components/RcItemCard/RcItemCardAction.vue +12 -0
- package/scripts/test-plugins-build.sh +0 -1
- package/store/__tests__/catalog.test.ts +63 -0
- package/store/__tests__/cookies.test.ts +72 -0
- package/store/auth.js +33 -10
- package/store/catalog.js +2 -2
- package/store/cookies.ts +30 -0
- package/store/prefs.js +10 -5
- package/store/type-map.js +3 -15
- package/types/extension-manager.ts +26 -0
- package/types/shell/index.d.ts +123 -27
- package/utils/__tests__/product.test.ts +129 -0
- package/utils/__tests__/resource.test.ts +87 -0
- package/utils/alertmanagerconfig.js +2 -2
- package/utils/auth.js +4 -77
- package/utils/product.ts +39 -0
- package/utils/resource.ts +35 -0
- package/utils/select.js +0 -24
- package/utils/validators/formRules/__tests__/index.test.ts +3 -0
- package/utils/validators/formRules/index.ts +2 -1
- package/vue.config.js +1 -1
- package/components/Resource/Detail/Metadata/Rectangle.vue +0 -34
- package/components/Resource/Detail/Metadata/__tests__/Rectangle.test.ts +0 -24
- package/components/ResourceDetail/Masthead/__tests__/legacy.test.ts +0 -65
- package/utils/cookie-universal.js +0 -10
- /package/components/{ForceDirectedTreeChart.vue → ForceDirectedTreeChart/index.vue} +0 -0
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import {
|
|
3
|
+
reactive, computed, watch, ref, nextTick
|
|
4
|
+
} from 'vue';
|
|
5
|
+
import { useStore } from 'vuex';
|
|
6
|
+
import { isValidCron } from 'cron-validator';
|
|
7
|
+
import cronstrue from 'cronstrue';
|
|
8
|
+
import { createPopper, Instance as PopperInstance } from '@popperjs/core';
|
|
9
|
+
import { useI18n } from '@shell/composables/useI18n';
|
|
10
|
+
import LabeledInput from '@components/Form/LabeledInput/LabeledInput.vue';
|
|
11
|
+
import CronTooltip from './CronTooltip.vue';
|
|
12
|
+
import type { TooltipSection, CronField } from './types';
|
|
13
|
+
import { cronFields } from './types';
|
|
14
|
+
|
|
15
|
+
const props = defineProps<{
|
|
16
|
+
/**
|
|
17
|
+
* Initial cron expression string.
|
|
18
|
+
*/
|
|
19
|
+
cronExpression?: string;
|
|
20
|
+
}>();
|
|
21
|
+
|
|
22
|
+
// eslint-disable-next-line
|
|
23
|
+
const emit = defineEmits<{
|
|
24
|
+
(e: 'update:isValid', value: boolean): void;
|
|
25
|
+
(e: 'update:readableCron', value: string): void;
|
|
26
|
+
(e: 'update:cronExpression', value: string): void;
|
|
27
|
+
}>();
|
|
28
|
+
|
|
29
|
+
const store = useStore();
|
|
30
|
+
const { t } = useI18n(store);
|
|
31
|
+
const fields: CronField[] = cronFields;
|
|
32
|
+
|
|
33
|
+
const fieldLabels: Record<CronField, string> = {
|
|
34
|
+
minute: 'component.cron.expressionEditor.label.minute',
|
|
35
|
+
hour: 'component.cron.expressionEditor.label.hour',
|
|
36
|
+
dayOfMonth: 'component.cron.expressionEditor.label.dayOfMonth',
|
|
37
|
+
month: 'component.cron.expressionEditor.label.month',
|
|
38
|
+
dayOfWeek: 'component.cron.expressionEditor.label.dayOfWeek',
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
function makeFieldRecord<T>(value: T): Record<CronField, T> {
|
|
42
|
+
return cronFields.reduce((acc, f) => {
|
|
43
|
+
acc[f] = value;
|
|
44
|
+
|
|
45
|
+
return acc;
|
|
46
|
+
}, {} as Record<CronField, T>);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function parseCronToFields(expr: string): Record<CronField, string> {
|
|
50
|
+
const parts = expr?.trim().split(' ') || [];
|
|
51
|
+
const record = makeFieldRecord('');
|
|
52
|
+
|
|
53
|
+
fields.forEach((f, idx) => {
|
|
54
|
+
record[f] = parts[idx] || '';
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
return record;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const cronValues = reactive<Record<CronField, string>>(parseCronToFields(props.cronExpression || '* * * * *'));
|
|
61
|
+
const errors = reactive<Record<CronField, boolean>>(makeFieldRecord(false));
|
|
62
|
+
const focusedField = reactive<Record<CronField, boolean>>(makeFieldRecord(false));
|
|
63
|
+
const rootRef = ref<HTMLElement | null>(null);
|
|
64
|
+
const wrapperRefs: Record<CronField, HTMLElement | null> = makeFieldRecord(null);
|
|
65
|
+
const tooltipRefs: Record<CronField, HTMLElement | null> = makeFieldRecord(null);
|
|
66
|
+
const popperInstances: Record<CronField, PopperInstance | null> = makeFieldRecord(null);
|
|
67
|
+
|
|
68
|
+
const tooltipData: Record<CronField, TooltipSection[]> = {
|
|
69
|
+
minute: [
|
|
70
|
+
{
|
|
71
|
+
type: 'rules',
|
|
72
|
+
items: [
|
|
73
|
+
{ value: '*', descKey: 'component.cron.expressionEditor.minute.any' },
|
|
74
|
+
{ value: '1,5', descKey: 'component.cron.expressionEditor.minute.at1and5' },
|
|
75
|
+
{ value: '1-5', descKey: 'component.cron.expressionEditor.minute.range' },
|
|
76
|
+
{ value: '*/5', descKey: 'component.cron.expressionEditor.minute.every5' },
|
|
77
|
+
{ value: '8/5', descKey: 'component.cron.expressionEditor.minute.start8' },
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
type: 'explanation',
|
|
82
|
+
items: [
|
|
83
|
+
{ descKey: 'component.cron.expressionEditor.minute.allowed' },
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
],
|
|
87
|
+
hour: [
|
|
88
|
+
{
|
|
89
|
+
type: 'rules',
|
|
90
|
+
items: [
|
|
91
|
+
{ value: '*', descKey: 'component.cron.expressionEditor.hour.any' },
|
|
92
|
+
{ value: '1,5', descKey: 'component.cron.expressionEditor.hour.at1and5' },
|
|
93
|
+
{ value: '1-5', descKey: 'component.cron.expressionEditor.hour.range' },
|
|
94
|
+
{ value: '*/5', descKey: 'component.cron.expressionEditor.hour.every5' },
|
|
95
|
+
{ value: '8/5', descKey: 'component.cron.expressionEditor.hour.start8' },
|
|
96
|
+
]
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
type: 'explanation',
|
|
100
|
+
items: [
|
|
101
|
+
{ descKey: 'component.cron.expressionEditor.hour.allowed' },
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
dayOfMonth: [
|
|
106
|
+
{
|
|
107
|
+
type: 'rules',
|
|
108
|
+
items: [
|
|
109
|
+
{ value: '*', descKey: 'component.cron.expressionEditor.dayOfMonth.any' },
|
|
110
|
+
{ value: '?', descKey: 'component.cron.expressionEditor.dayOfMonth.omit' },
|
|
111
|
+
{ value: '1,5', descKey: 'component.cron.expressionEditor.dayOfMonth.1and5' },
|
|
112
|
+
{ value: '1-5', descKey: 'component.cron.expressionEditor.dayOfMonth.range' },
|
|
113
|
+
{ value: '*/5', descKey: 'component.cron.expressionEditor.dayOfMonth.every5' },
|
|
114
|
+
{ value: '8/5', descKey: 'component.cron.expressionEditor.dayOfMonth.start8' },
|
|
115
|
+
]
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
type: 'explanation',
|
|
119
|
+
items: [
|
|
120
|
+
{ descKey: 'component.cron.expressionEditor.dayOfMonth.allowed' },
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
],
|
|
124
|
+
month: [
|
|
125
|
+
{
|
|
126
|
+
type: 'rules',
|
|
127
|
+
items: [
|
|
128
|
+
{ value: '*', descKey: 'component.cron.expressionEditor.month.any' },
|
|
129
|
+
{ value: '1,5', descKey: 'component.cron.expressionEditor.month.1and5' },
|
|
130
|
+
{ value: '1-5', descKey: 'component.cron.expressionEditor.month.range' },
|
|
131
|
+
{ value: '*/2', descKey: 'component.cron.expressionEditor.month.every2' },
|
|
132
|
+
{ value: '3/2', descKey: 'component.cron.expressionEditor.month.start3' },
|
|
133
|
+
]
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
type: 'explanation',
|
|
137
|
+
items: [
|
|
138
|
+
{ descKey: 'component.cron.expressionEditor.month.allowed' },
|
|
139
|
+
{ descKey: 'component.cron.expressionEditor.month.alias' },
|
|
140
|
+
]
|
|
141
|
+
}
|
|
142
|
+
],
|
|
143
|
+
dayOfWeek: [
|
|
144
|
+
{
|
|
145
|
+
type: 'rules',
|
|
146
|
+
items: [
|
|
147
|
+
{ value: '*', descKey: 'component.cron.expressionEditor.dayOfWeek.any' },
|
|
148
|
+
{ value: '?', descKey: 'component.cron.expressionEditor.dayOfWeek.omit' },
|
|
149
|
+
{ value: '1,5', descKey: 'component.cron.expressionEditor.dayOfWeek.1and5' },
|
|
150
|
+
{ value: '1-5', descKey: 'component.cron.expressionEditor.dayOfWeek.range' },
|
|
151
|
+
]
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
type: 'explanation',
|
|
155
|
+
items: [
|
|
156
|
+
{ descKey: 'component.cron.expressionEditor.dayOfWeek.allowed' },
|
|
157
|
+
{ descKey: 'component.cron.expressionEditor.dayOfWeek.alias' },
|
|
158
|
+
]
|
|
159
|
+
}
|
|
160
|
+
],
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
const validateField = (field: CronField, value: string) => {
|
|
164
|
+
if (!value) {
|
|
165
|
+
errors[field] = true;
|
|
166
|
+
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
const exprMap: Record<CronField, string> = {
|
|
171
|
+
minute: `${ value } * * * *`,
|
|
172
|
+
hour: `* ${ value } * * *`,
|
|
173
|
+
dayOfMonth: `* * ${ value } * *`,
|
|
174
|
+
month: `* * * ${ value } *`,
|
|
175
|
+
dayOfWeek: `* * * * ${ value }`,
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
errors[field] = !isValidCron(exprMap[field], {
|
|
179
|
+
alias: true,
|
|
180
|
+
allowBlankDay: true,
|
|
181
|
+
allowSevenAsSunday: true,
|
|
182
|
+
});
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
fields.forEach((f) => validateField(f, cronValues[f]));
|
|
186
|
+
|
|
187
|
+
const isValid = computed(() => !Object.values(errors).some(Boolean));
|
|
188
|
+
const expression = computed(() => fields.map((f) => cronValues[f]).join(' '));
|
|
189
|
+
const readableCron = computed(() => {
|
|
190
|
+
if (!isValid.value) return t('component.cron.expressionEditor.invalidCronExpression');
|
|
191
|
+
try {
|
|
192
|
+
return cronstrue.toString(expression.value);
|
|
193
|
+
} catch {
|
|
194
|
+
return t('component.cron.expressionEditor.invalidCronExpression');
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
watch(cronValues, () => {
|
|
199
|
+
emit('update:cronExpression', expression.value);
|
|
200
|
+
emit('update:readableCron', readableCron.value);
|
|
201
|
+
emit('update:isValid', isValid.value);
|
|
202
|
+
}, { deep: true, immediate: true });
|
|
203
|
+
|
|
204
|
+
const handleInput = (field: CronField, val: string) => {
|
|
205
|
+
cronValues[field] = val;
|
|
206
|
+
validateField(field, val);
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
const handleFocus = async(field: CronField) => {
|
|
210
|
+
focusedField[field] = true;
|
|
211
|
+
await nextTick();
|
|
212
|
+
if (wrapperRefs[field] && tooltipRefs[field]) {
|
|
213
|
+
popperInstances[field] = createPopper(wrapperRefs[field], tooltipRefs[field], {
|
|
214
|
+
placement: 'bottom-start',
|
|
215
|
+
modifiers: [
|
|
216
|
+
{ name: 'flip', options: { fallbackPlacements: ['top-start', 'bottom-end'] } },
|
|
217
|
+
{ name: 'preventOverflow', options: { boundary: rootRef.value || document.body, padding: 4 } },
|
|
218
|
+
{ name: 'offset', options: { offset: [0, 4] } },
|
|
219
|
+
],
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
const handleBlur = (field: CronField) => {
|
|
225
|
+
focusedField[field] = false;
|
|
226
|
+
popperInstances[field]?.destroy();
|
|
227
|
+
popperInstances[field] = null;
|
|
228
|
+
};
|
|
229
|
+
</script>
|
|
230
|
+
|
|
231
|
+
<template>
|
|
232
|
+
<div
|
|
233
|
+
ref="rootRef"
|
|
234
|
+
class="cron-edit"
|
|
235
|
+
v-bind="$attrs"
|
|
236
|
+
>
|
|
237
|
+
<div class="cron-row">
|
|
238
|
+
<div
|
|
239
|
+
v-for="field in fields"
|
|
240
|
+
:key="field"
|
|
241
|
+
:ref="el => wrapperRefs[field] = el as HTMLElement"
|
|
242
|
+
class="input-wrapper"
|
|
243
|
+
>
|
|
244
|
+
<LabeledInput
|
|
245
|
+
:label="t(fieldLabels[field])"
|
|
246
|
+
:value="cronValues[field]"
|
|
247
|
+
:status="errors[field] ? 'error' : undefined"
|
|
248
|
+
:tooltip="errors[field] ? t('component.cron.expressionEditor.invalidValue') : ''"
|
|
249
|
+
:aria-invalid="!!errors[field]"
|
|
250
|
+
:aria-label="t('component.cron.expressionEditor.a11y.examples', { label: t(fieldLabels[field]) })"
|
|
251
|
+
:aria-describedby="`tooltip-${field}`"
|
|
252
|
+
@update:value="val => handleInput(field, val)"
|
|
253
|
+
@focus="() => handleFocus(field)"
|
|
254
|
+
@blur="() => handleBlur(field)"
|
|
255
|
+
/>
|
|
256
|
+
<div
|
|
257
|
+
v-show="focusedField[field]"
|
|
258
|
+
:id="`tooltip-${field}`"
|
|
259
|
+
:ref="el => tooltipRefs[field] = el as HTMLElement"
|
|
260
|
+
role="tooltip"
|
|
261
|
+
class="cron-tooltip-wrapper"
|
|
262
|
+
>
|
|
263
|
+
<CronTooltip :sections="tooltipData[field]" />
|
|
264
|
+
</div>
|
|
265
|
+
</div>
|
|
266
|
+
</div>
|
|
267
|
+
</div>
|
|
268
|
+
</template>
|
|
269
|
+
|
|
270
|
+
<style scoped lang="scss">
|
|
271
|
+
$input-max-width: 110px;
|
|
272
|
+
|
|
273
|
+
.cron-row {
|
|
274
|
+
display: flex;
|
|
275
|
+
justify-content: center;
|
|
276
|
+
flex-wrap: wrap;
|
|
277
|
+
gap: 8px;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.input-wrapper {
|
|
281
|
+
max-width: $input-max-width;
|
|
282
|
+
flex: 1 1 auto;
|
|
283
|
+
|
|
284
|
+
.label {
|
|
285
|
+
color: var(--label-secondary);
|
|
286
|
+
font-size: 12px;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.cron-tooltip-wrapper {
|
|
291
|
+
padding: 16px;
|
|
292
|
+
background: var(--body-bg);
|
|
293
|
+
border: 1px solid var(--border);
|
|
294
|
+
border-radius: var(--border-radius-lg);
|
|
295
|
+
box-shadow: 0 2px 8px var(--shadow);
|
|
296
|
+
display: inline-block;
|
|
297
|
+
z-index: 2;
|
|
298
|
+
}
|
|
299
|
+
</style>
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import {
|
|
3
|
+
ref, watch, onMounted, onBeforeUnmount, nextTick
|
|
4
|
+
} from 'vue';
|
|
5
|
+
import { useStore } from 'vuex';
|
|
6
|
+
import { useI18n } from '@shell/composables/useI18n';
|
|
7
|
+
import AppModal from '@shell/components/AppModal.vue';
|
|
8
|
+
import CronExpressionEditor from './CronExpressionEditor.vue';
|
|
9
|
+
|
|
10
|
+
const props = defineProps<{
|
|
11
|
+
/**
|
|
12
|
+
* Initial cron expression string.
|
|
13
|
+
*/
|
|
14
|
+
cronExpression?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Controls whether the cron editor modal is visible.
|
|
17
|
+
*/
|
|
18
|
+
show: boolean;
|
|
19
|
+
}>();
|
|
20
|
+
|
|
21
|
+
// eslint-disable-next-line
|
|
22
|
+
const emit = defineEmits<{
|
|
23
|
+
(e: 'update:cronExpression', value: string): void;
|
|
24
|
+
(e: 'update:show', value: boolean): void;
|
|
25
|
+
(e: 'update:readableCron', value: string): void;
|
|
26
|
+
}>();
|
|
27
|
+
|
|
28
|
+
const store = useStore();
|
|
29
|
+
const { t } = useI18n(store);
|
|
30
|
+
|
|
31
|
+
const localCron = ref(props.cronExpression ?? '* * * * *');
|
|
32
|
+
const localShow = ref(props.show);
|
|
33
|
+
const readableCron = ref('');
|
|
34
|
+
const isCronValid = ref(true);
|
|
35
|
+
|
|
36
|
+
const cronInfoRef = ref<HTMLElement | null>(null);
|
|
37
|
+
const modalBodyRef = ref<HTMLElement | null>(null);
|
|
38
|
+
const modalWidth = ref('600px');
|
|
39
|
+
|
|
40
|
+
const wildcards = [
|
|
41
|
+
{ symbol: '*', desc: 'component.cron.expressionEditorModal.wildcards.anyValue' },
|
|
42
|
+
{ symbol: 'X,Y', desc: 'component.cron.expressionEditorModal.wildcards.xAndY' },
|
|
43
|
+
{ symbol: 'X-Y', desc: 'component.cron.expressionEditorModal.wildcards.fromXtoY' },
|
|
44
|
+
{ symbol: '*/X', desc: 'component.cron.expressionEditorModal.wildcards.everyX' },
|
|
45
|
+
{ symbol: 'Y/X', desc: 'component.cron.expressionEditorModal.wildcards.everyXStartingY' },
|
|
46
|
+
{ symbol: 'Y-Z/X', desc: 'component.cron.expressionEditorModal.wildcards.everyXFromYtoZ' },
|
|
47
|
+
];
|
|
48
|
+
|
|
49
|
+
const examples = [
|
|
50
|
+
{ cron: '0 0 * * *', desc: 'component.cron.expressionEditorModal.examples.dailyMidnight' },
|
|
51
|
+
{ cron: '0 */5 * * *', desc: 'component.cron.expressionEditorModal.examples.every5Hours' },
|
|
52
|
+
{ cron: '45 17 1 * *', desc: 'component.cron.expressionEditorModal.examples.day1At1745' },
|
|
53
|
+
{ cron: '30 8/1 * * 1-5', desc: 'component.cron.expressionEditorModal.examples.weekdaysAt0830' },
|
|
54
|
+
{ cron: '0 */1 * 3,4,5 *', desc: 'component.cron.expressionEditorModal.examples.marchToMayHourly' },
|
|
55
|
+
{ cron: '0 9-17/4 * * *', desc: 'component.cron.expressionEditorModal.examples.every4Hours9to17' },
|
|
56
|
+
];
|
|
57
|
+
|
|
58
|
+
const closeModal = () => emit('update:show', false);
|
|
59
|
+
const confirmCron = () => {
|
|
60
|
+
if (!isCronValid.value) return;
|
|
61
|
+
emit('update:cronExpression', localCron.value);
|
|
62
|
+
emit('update:readableCron', readableCron.value);
|
|
63
|
+
closeModal();
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
// dynamically update modal width based on content
|
|
67
|
+
const updateWidth = () => {
|
|
68
|
+
if (!modalBodyRef.value || !cronInfoRef.value) return;
|
|
69
|
+
|
|
70
|
+
const bodyStyle = getComputedStyle(modalBodyRef.value);
|
|
71
|
+
const padding = parseFloat(bodyStyle.paddingLeft) + parseFloat(bodyStyle.paddingRight);
|
|
72
|
+
const extraBuffer = 10;
|
|
73
|
+
const contentWidth = cronInfoRef.value.scrollWidth + padding + extraBuffer;
|
|
74
|
+
|
|
75
|
+
// limit width to 90% of viewport
|
|
76
|
+
modalWidth.value = `${ Math.min(contentWidth, window.innerWidth * 0.9) }px`;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
watch(() => props.cronExpression, (val) => {
|
|
80
|
+
if (val !== undefined) localCron.value = val;
|
|
81
|
+
});
|
|
82
|
+
watch(() => props.show, (val) => {
|
|
83
|
+
localShow.value = val;
|
|
84
|
+
|
|
85
|
+
if (val) {
|
|
86
|
+
// reset cron to prop when modal opens
|
|
87
|
+
localCron.value = props.cronExpression ?? '* * * * *';
|
|
88
|
+
nextTick(updateWidth);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
onMounted(() => {
|
|
93
|
+
nextTick(updateWidth);
|
|
94
|
+
window.addEventListener('resize', updateWidth);
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
onBeforeUnmount(() => {
|
|
98
|
+
window.removeEventListener('resize', updateWidth);
|
|
99
|
+
});
|
|
100
|
+
</script>
|
|
101
|
+
|
|
102
|
+
<template>
|
|
103
|
+
<AppModal
|
|
104
|
+
v-if="localShow"
|
|
105
|
+
:width="modalWidth"
|
|
106
|
+
name="cron-editor-modal"
|
|
107
|
+
custom-class="cron-editor-modal"
|
|
108
|
+
aria-labelledby="cron-editor-title"
|
|
109
|
+
aria-describedby="cron-editor-desc"
|
|
110
|
+
trigger-focus-trap
|
|
111
|
+
@close="closeModal"
|
|
112
|
+
>
|
|
113
|
+
<div
|
|
114
|
+
ref="modalBodyRef"
|
|
115
|
+
class="modal-body"
|
|
116
|
+
>
|
|
117
|
+
<h4 id="cron-editor-title">
|
|
118
|
+
{{ t('component.cron.expressionEditorModal.title') }}
|
|
119
|
+
</h4>
|
|
120
|
+
<p
|
|
121
|
+
id="cron-editor-desc"
|
|
122
|
+
class="description"
|
|
123
|
+
>
|
|
124
|
+
{{ t('component.cron.expressionEditorModal.description') }}
|
|
125
|
+
</p>
|
|
126
|
+
|
|
127
|
+
<div
|
|
128
|
+
class="readableCron"
|
|
129
|
+
aria-live="polite"
|
|
130
|
+
>
|
|
131
|
+
{{ readableCron }}
|
|
132
|
+
</div>
|
|
133
|
+
|
|
134
|
+
<CronExpressionEditor
|
|
135
|
+
v-model:cron-expression="localCron"
|
|
136
|
+
v-model:readable-cron="readableCron"
|
|
137
|
+
v-model:is-valid="isCronValid"
|
|
138
|
+
class="custom-cron-editor"
|
|
139
|
+
/>
|
|
140
|
+
|
|
141
|
+
<div
|
|
142
|
+
ref="cronInfoRef"
|
|
143
|
+
class="cron-info"
|
|
144
|
+
>
|
|
145
|
+
<div class="cron-wildcards">
|
|
146
|
+
<h5>{{ t('component.cron.expressionEditorModal.wildcards.title') }}</h5>
|
|
147
|
+
<ul>
|
|
148
|
+
<li
|
|
149
|
+
v-for="(item, idx) in wildcards"
|
|
150
|
+
:key="idx"
|
|
151
|
+
>
|
|
152
|
+
<span class="symbol">{{ item.symbol }}</span>
|
|
153
|
+
<span class="desc">{{ t(item.desc) }}</span>
|
|
154
|
+
</li>
|
|
155
|
+
</ul>
|
|
156
|
+
</div>
|
|
157
|
+
|
|
158
|
+
<div class="cron-examples">
|
|
159
|
+
<h5>{{ t('component.cron.expressionEditorModal.examples.title') }}</h5>
|
|
160
|
+
<ul>
|
|
161
|
+
<li
|
|
162
|
+
v-for="(ex, idx) in examples"
|
|
163
|
+
:key="idx"
|
|
164
|
+
>
|
|
165
|
+
<span class="symbol">{{ ex.cron }}</span>
|
|
166
|
+
<span class="desc">{{ t(ex.desc) }}</span>
|
|
167
|
+
</li>
|
|
168
|
+
</ul>
|
|
169
|
+
</div>
|
|
170
|
+
</div>
|
|
171
|
+
</div>
|
|
172
|
+
|
|
173
|
+
<div class="modal-footer">
|
|
174
|
+
<button
|
|
175
|
+
class="btn btn-sm role-secondary"
|
|
176
|
+
@click="closeModal"
|
|
177
|
+
>
|
|
178
|
+
{{ t('generic.cancel') }}
|
|
179
|
+
</button>
|
|
180
|
+
<button
|
|
181
|
+
class="btn btn-sm role-primary ml-10"
|
|
182
|
+
:disabled="!isCronValid"
|
|
183
|
+
@click="confirmCron"
|
|
184
|
+
>
|
|
185
|
+
{{ t('generic.confirm') }}
|
|
186
|
+
</button>
|
|
187
|
+
</div>
|
|
188
|
+
</AppModal>
|
|
189
|
+
</template>
|
|
190
|
+
|
|
191
|
+
<style scoped lang="scss">
|
|
192
|
+
:global(#modals .cron-editor-modal) {
|
|
193
|
+
border-radius: var(--border-radius-lg);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.modal-body {
|
|
197
|
+
padding: 20px 20px 8px;
|
|
198
|
+
|
|
199
|
+
.description {
|
|
200
|
+
margin: 16px 0;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.readableCron {
|
|
204
|
+
padding: 16px;
|
|
205
|
+
background-color: var(--disabled-banner-bg);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.custom-cron-editor {
|
|
209
|
+
margin: 64px auto;
|
|
210
|
+
max-width: 600px;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.cron-info {
|
|
214
|
+
display: flex;
|
|
215
|
+
gap: 52px;
|
|
216
|
+
flex-wrap: nowrap;
|
|
217
|
+
overflow-x: auto;
|
|
218
|
+
|
|
219
|
+
ul {
|
|
220
|
+
list-style: none;
|
|
221
|
+
padding: 0;
|
|
222
|
+
margin: 16px 0;
|
|
223
|
+
display: grid;
|
|
224
|
+
grid-template-columns: max-content 1fr;
|
|
225
|
+
gap: 8px 10px;
|
|
226
|
+
|
|
227
|
+
li {
|
|
228
|
+
display: contents;
|
|
229
|
+
white-space: nowrap;
|
|
230
|
+
color: var(--input-label);
|
|
231
|
+
font-size: 12px;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.symbol {
|
|
235
|
+
color: var(--body-text);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.modal-footer {
|
|
242
|
+
border-top: 1px solid var(--border);
|
|
243
|
+
display: flex;
|
|
244
|
+
padding: 10px 20px;
|
|
245
|
+
justify-content: flex-end;
|
|
246
|
+
}
|
|
247
|
+
</style>
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue';
|
|
3
|
+
import { useStore } from 'vuex';
|
|
4
|
+
import { useI18n } from '@shell/composables/useI18n';
|
|
5
|
+
import type { TooltipSection } from './types';
|
|
6
|
+
|
|
7
|
+
const props = defineProps<{
|
|
8
|
+
/**
|
|
9
|
+
* Tooltip content sections.
|
|
10
|
+
* Each section has a type (e.g., "rules" or "explanation")
|
|
11
|
+
* and a list of items with optional `value` and i18n `descKey`.
|
|
12
|
+
*/
|
|
13
|
+
sections: TooltipSection[]
|
|
14
|
+
}>();
|
|
15
|
+
|
|
16
|
+
const store = useStore();
|
|
17
|
+
const { t } = useI18n(store);
|
|
18
|
+
|
|
19
|
+
const processedSections = computed(() => {
|
|
20
|
+
return props.sections.map((section) => ({
|
|
21
|
+
...section,
|
|
22
|
+
items: section.items.map((item) => ({
|
|
23
|
+
...item,
|
|
24
|
+
text: item.descKey ? t?.(item.descKey) ?? item.descKey : ''
|
|
25
|
+
}))
|
|
26
|
+
}));
|
|
27
|
+
});
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<template>
|
|
31
|
+
<div class="cron-tooltip-content-wrapper">
|
|
32
|
+
<ul
|
|
33
|
+
v-for="section in processedSections"
|
|
34
|
+
:key="section.type"
|
|
35
|
+
:class="['cron-tooltip-section', `cron-tooltip-${section.type}`]"
|
|
36
|
+
>
|
|
37
|
+
<li
|
|
38
|
+
v-for="item in section.items"
|
|
39
|
+
:key="item.value || item.descKey || item.text"
|
|
40
|
+
>
|
|
41
|
+
<span class="symbol">{{ item.value || '' }}</span>
|
|
42
|
+
<span class="desc">{{ item.text }}</span>
|
|
43
|
+
</li>
|
|
44
|
+
</ul>
|
|
45
|
+
</div>
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<style scoped lang="scss">
|
|
49
|
+
.cron-tooltip-content-wrapper {
|
|
50
|
+
display: flex;
|
|
51
|
+
flex-direction: column;
|
|
52
|
+
|
|
53
|
+
.cron-tooltip-section {
|
|
54
|
+
list-style: none;
|
|
55
|
+
padding: 0;
|
|
56
|
+
margin: 0;
|
|
57
|
+
|
|
58
|
+
&.cron-tooltip-rules {
|
|
59
|
+
display: grid;
|
|
60
|
+
grid-template-columns: max-content 1fr;
|
|
61
|
+
gap: 12px;
|
|
62
|
+
|
|
63
|
+
li {
|
|
64
|
+
display: contents;
|
|
65
|
+
align-items: center;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
&.cron-tooltip-explanation {
|
|
69
|
+
margin-top: 20px;
|
|
70
|
+
display: grid;
|
|
71
|
+
gap: 8px;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
li {
|
|
75
|
+
white-space: nowrap;
|
|
76
|
+
|
|
77
|
+
.symbol {
|
|
78
|
+
color: var(--body-text);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.desc {
|
|
82
|
+
color: var(--input-label);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
</style>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface TooltipItem {
|
|
2
|
+
value?: string;
|
|
3
|
+
descKey?: string;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export interface TooltipSection {
|
|
7
|
+
type: 'rules' | 'explanation';
|
|
8
|
+
items: TooltipItem[];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type CronField = 'minute' | 'hour' | 'dayOfMonth' | 'month' | 'dayOfWeek';
|
|
12
|
+
|
|
13
|
+
export const cronFields: CronField[] = ['minute', 'hour', 'dayOfMonth', 'month', 'dayOfWeek'];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { computed } from 'vue';
|
|
2
|
+
import { graphConfig } from '@shell/pages/c/_cluster/fleet/graph/config';
|
|
3
|
+
|
|
4
|
+
export const useDefaultForceDirectTreeChartProps = (resource: any) => {
|
|
5
|
+
return computed(() => {
|
|
6
|
+
return {
|
|
7
|
+
data: resource,
|
|
8
|
+
fdcConfig: graphConfig
|
|
9
|
+
};
|
|
10
|
+
});
|
|
11
|
+
};
|
|
@@ -222,6 +222,7 @@ export default defineComponent({
|
|
|
222
222
|
<Checkbox
|
|
223
223
|
v-if="!labelsAlwaysActive"
|
|
224
224
|
v-model:value="psaControl.active"
|
|
225
|
+
:mode="mode"
|
|
225
226
|
:data-testid="componentTestid + '--psaControl-' + i + '-active'"
|
|
226
227
|
:label="level"
|
|
227
228
|
:label-key="`podSecurityAdmission.labels.${ level }`"
|
|
@@ -281,6 +282,7 @@ export default defineComponent({
|
|
|
281
282
|
<span class="col span-2">
|
|
282
283
|
<Checkbox
|
|
283
284
|
v-model:value="psaExemptionsControl.active"
|
|
285
|
+
:mode="mode"
|
|
284
286
|
:data-testid="componentTestid + '--psaExemptionsControl-' + i + '-active'"
|
|
285
287
|
:label="dimension"
|
|
286
288
|
:label-key="`podSecurityAdmission.labels.${ dimension }`"
|
|
@@ -94,7 +94,7 @@ export default {
|
|
|
94
94
|
this.errors = [];
|
|
95
95
|
|
|
96
96
|
// Guard against events that can be implicitly passed by components
|
|
97
|
-
const modalData = data instanceof Event ? undefined : data;
|
|
97
|
+
const modalData = (data instanceof Event || !data?.performCallback) ? undefined : data;
|
|
98
98
|
|
|
99
99
|
this.$store.commit('action-menu/togglePromptModal', modalData);
|
|
100
100
|
|
|
@@ -2,6 +2,7 @@ import { mount } from '@vue/test-utils';
|
|
|
2
2
|
import StateCard from '@shell/components/Resource/Detail/Card/StateCard/index.vue';
|
|
3
3
|
import Card from '@shell/components/Resource/Detail/Card/index.vue';
|
|
4
4
|
import ResourceRow from '@shell/components/Resource/Detail/ResourceRow.vue';
|
|
5
|
+
jest.mock('vuex', () => ({ useStore: () => { } }));
|
|
5
6
|
|
|
6
7
|
describe('component: StateCard', () => {
|
|
7
8
|
const title = 'TITLE';
|