@rancher/shell 3.0.5-rc.3 → 3.0.5-rc.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/images/icons/document.svg +3 -0
- package/assets/images/vendor/cognito.svg +1 -0
- package/assets/styles/app.scss +1 -0
- package/assets/styles/base/_basic.scss +10 -0
- package/assets/styles/base/_spacing.scss +29 -0
- package/assets/styles/global/_layout.scss +1 -1
- package/assets/styles/themes/_dark.scss +25 -0
- package/assets/styles/themes/_light.scss +65 -0
- package/assets/translations/en-us.yaml +322 -24
- package/assets/translations/zh-hans.yaml +8 -5
- package/components/Certificates.vue +5 -0
- package/components/FilterPanel.vue +156 -0
- package/components/{fleet/ForceDirectedTreeChart/index.vue → ForceDirectedTreeChart.vue} +47 -41
- package/components/IconOrSvg.vue +14 -35
- package/components/PromptRemove.vue +5 -1
- package/components/Resource/Detail/Card/PodsCard/Bubble.vue +13 -0
- package/components/Resource/Detail/Card/PodsCard/composable.ts +30 -0
- package/components/Resource/Detail/Card/PodsCard/index.vue +118 -0
- package/components/Resource/Detail/Card/ResourceUsageCard/composable.ts +51 -0
- package/components/Resource/Detail/Card/ResourceUsageCard/index.vue +79 -0
- package/components/Resource/Detail/Card/Scaler.vue +89 -0
- package/components/Resource/Detail/Card/StateCard/composables.ts +112 -0
- package/components/Resource/Detail/Card/StateCard/index.vue +39 -0
- package/components/Resource/Detail/Card/VerticalGap.vue +11 -0
- package/components/Resource/Detail/Card/__tests__/Card.test.ts +36 -0
- package/components/Resource/Detail/Card/__tests__/PodsCard.test.ts +84 -0
- package/components/Resource/Detail/Card/__tests__/ResourceUsageCard.test.ts +72 -0
- package/components/Resource/Detail/Card/__tests__/Scaler.test.ts +87 -0
- package/components/Resource/Detail/Card/__tests__/StateCard.test.ts +53 -0
- package/components/Resource/Detail/Card/__tests__/VerticalGap.test.ts +14 -0
- package/components/Resource/Detail/Card/__tests__/index.test.ts +36 -0
- package/components/Resource/Detail/Card/index.vue +56 -0
- package/components/Resource/Detail/Metadata/Annotations/__tests__/index.test.ts +19 -0
- package/components/Resource/Detail/Metadata/Annotations/composable.ts +12 -0
- package/components/Resource/Detail/Metadata/Annotations/index.vue +26 -0
- package/components/Resource/Detail/Metadata/IdentifyingInformation/__tests__/index.test.ts +103 -0
- package/components/Resource/Detail/Metadata/IdentifyingInformation/composable.ts +281 -0
- package/components/Resource/Detail/Metadata/IdentifyingInformation/index.vue +111 -0
- package/components/Resource/Detail/Metadata/KeyValue.vue +130 -0
- package/components/Resource/Detail/Metadata/Labels/__tests__/index.test.ts +18 -0
- package/components/Resource/Detail/Metadata/Labels/composable.ts +12 -0
- package/components/Resource/Detail/Metadata/Labels/index.vue +27 -0
- package/components/Resource/Detail/Metadata/Rectangle.vue +32 -0
- package/components/Resource/Detail/Metadata/__tests__/KeyValue.test.ts +107 -0
- package/components/Resource/Detail/Metadata/__tests__/Rectangle.test.ts +24 -0
- package/components/Resource/Detail/Metadata/__tests__/index.test.ts +91 -0
- package/components/Resource/Detail/Metadata/composables.ts +29 -0
- package/components/Resource/Detail/Metadata/index.vue +66 -0
- package/components/Resource/Detail/Page.vue +22 -0
- package/components/Resource/Detail/PercentageBar.vue +40 -0
- package/components/Resource/Detail/ResourceRow.vue +119 -0
- package/components/Resource/Detail/SpacedRow.vue +14 -0
- package/components/Resource/Detail/StatusBar.vue +59 -0
- package/components/Resource/Detail/StatusRow.vue +61 -0
- package/components/Resource/Detail/TitleBar/Title.vue +13 -0
- package/components/Resource/Detail/TitleBar/Top.vue +14 -0
- package/components/Resource/Detail/TitleBar/__tests__/Title.test.ts +17 -0
- package/components/Resource/Detail/TitleBar/__tests__/Top.test.ts +17 -0
- package/components/Resource/Detail/TitleBar/__tests__/index.test.ts +142 -0
- package/components/Resource/Detail/TitleBar/composable.ts +31 -0
- package/components/Resource/Detail/TitleBar/index.vue +124 -0
- package/components/Resource/Detail/Top/index.vue +34 -0
- package/components/Resource/Detail/__tests__/Page.test.ts +32 -0
- package/components/ResourceDetail/__tests__/index.test.ts +114 -0
- package/components/ResourceDetail/index.vue +64 -562
- package/components/ResourceDetail/legacy.vue +545 -0
- package/components/ResourceTable.vue +41 -7
- package/components/SlideInPanelManager.vue +76 -8
- package/components/SortableTable/index.vue +13 -2
- package/components/SortableTable/selection.js +21 -8
- package/components/StatusBadge.vue +6 -4
- package/components/SubtleLink.vue +25 -0
- package/components/Wizard.vue +12 -1
- package/components/YamlEditor.vue +1 -1
- package/components/__tests__/FilterPanel.test.ts +81 -0
- package/components/auth/AuthBanner.vue +2 -3
- package/components/auth/RoleDetailEdit.vue +45 -3
- package/components/auth/login/oidc.vue +6 -1
- package/components/fleet/FleetApplications.vue +181 -0
- package/components/fleet/FleetHelmOps.vue +115 -0
- package/components/fleet/FleetIntro.vue +58 -28
- package/components/fleet/FleetNoWorkspaces.vue +5 -1
- package/components/fleet/FleetOCIStorageSecret.vue +171 -0
- package/components/fleet/FleetRepos.vue +38 -76
- package/components/fleet/FleetResources.vue +50 -22
- package/components/fleet/FleetSummary.vue +26 -51
- package/components/fleet/__tests__/FleetOCIStorageSecret.test.ts +213 -0
- package/components/fleet/__tests__/FleetSummary.test.ts +39 -39
- package/components/fleet/dashboard/Empty.vue +73 -0
- package/components/fleet/dashboard/ResourceCard.vue +183 -0
- package/components/fleet/dashboard/ResourceCardSummary.vue +199 -0
- package/components/fleet/dashboard/ResourceDetails.vue +196 -0
- package/components/fleet/dashboard/ResourcePanel.vue +376 -0
- package/components/form/ArrayList.vue +6 -0
- package/components/form/SimpleSecretSelector.vue +8 -2
- package/components/form/ValueFromResource.vue +31 -19
- package/components/formatter/FleetApplicationClustersReady.vue +77 -0
- package/components/formatter/FleetApplicationSource.vue +71 -0
- package/components/formatter/FleetSummaryGraph.vue +7 -0
- package/components/nav/Header.vue +8 -7
- package/components/nav/TopLevelMenu.helper.ts +55 -34
- package/components/nav/TopLevelMenu.vue +11 -0
- package/components/nav/Type.vue +4 -1
- package/composables/useI18n.ts +12 -11
- package/config/labels-annotations.js +14 -11
- package/config/product/auth.js +1 -0
- package/config/product/fleet.js +70 -17
- package/config/query-params.js +3 -1
- package/config/roles.ts +1 -0
- package/config/router/routes.js +20 -2
- package/config/secret.ts +15 -0
- package/config/settings.ts +3 -2
- package/config/table-headers.js +52 -22
- package/config/types.js +2 -0
- package/core/plugin-helpers.ts +3 -2
- package/detail/fleet.cattle.io.cluster.vue +28 -15
- package/detail/fleet.cattle.io.gitrepo.vue +10 -1
- package/detail/fleet.cattle.io.helmop.vue +157 -0
- package/dialog/HelmOpForceUpdateDialog.vue +132 -0
- package/dialog/RedeployWorkloadDialog.vue +164 -0
- package/edit/__tests__/fleet.cattle.io.gitrepo.test.ts +56 -67
- package/edit/auth/oidc.vue +159 -93
- package/edit/fleet.cattle.io.gitrepo.vue +26 -33
- package/edit/fleet.cattle.io.helmop.vue +997 -0
- package/edit/management.cattle.io.fleetworkspace.vue +43 -10
- package/list/fleet.cattle.io.gitrepo.vue +1 -1
- package/list/fleet.cattle.io.helmop.vue +108 -0
- package/list/namespace.vue +5 -2
- package/mixins/auth-config.js +8 -1
- package/mixins/preset.js +100 -0
- package/mixins/resource-fetch-api-pagination.js +2 -0
- package/mixins/resource-fetch.js +1 -1
- package/mixins/resource-table-watch.js +45 -0
- package/models/__tests__/chart.test.ts +273 -0
- package/models/__tests__/fleet.cattle.io.gitrepo.test.ts +1 -1
- package/models/chart.js +144 -2
- package/models/fleet-application.js +385 -0
- package/models/fleet.cattle.io.bundle.js +9 -8
- package/models/fleet.cattle.io.gitrepo.js +41 -365
- package/models/fleet.cattle.io.helmop.js +228 -0
- package/models/management.cattle.io.authconfig.js +1 -0
- package/models/management.cattle.io.fleetworkspace.js +12 -0
- package/models/workload.js +14 -18
- package/package.json +2 -1
- package/pages/auth/verify.vue +13 -1
- package/pages/c/_cluster/apps/charts/AddRepoLink.vue +37 -0
- package/pages/c/_cluster/apps/charts/AppChartCardFooter.vue +80 -0
- package/pages/c/_cluster/apps/charts/AppChartCardSubHeader.vue +54 -0
- package/pages/c/_cluster/apps/charts/StatusLabel.vue +33 -0
- package/pages/c/_cluster/apps/charts/index.vue +302 -484
- package/pages/c/_cluster/explorer/EventsTable.vue +1 -1
- package/pages/c/_cluster/fleet/__tests__/index.test.ts +426 -0
- package/pages/c/_cluster/fleet/application/_resource/_id.vue +14 -0
- package/pages/c/_cluster/fleet/application/_resource/create.vue +14 -0
- package/pages/c/_cluster/fleet/application/create.vue +340 -0
- package/pages/c/_cluster/fleet/application/index.vue +139 -0
- package/pages/c/_cluster/fleet/graph/config.js +277 -0
- package/pages/c/_cluster/fleet/index.vue +772 -330
- package/pages/explorer/resource/detail/configmap.vue +19 -0
- package/plugins/dashboard-store/actions.js +31 -9
- package/plugins/dashboard-store/getters.js +34 -21
- package/plugins/dashboard-store/mutations.js +51 -7
- package/plugins/dashboard-store/resource-class.js +14 -2
- package/plugins/steve/__tests__/subscribe.spec.ts +66 -1
- package/plugins/steve/actions.js +3 -0
- package/plugins/steve/steve-pagination-utils.ts +14 -13
- package/plugins/steve/subscribe.js +229 -42
- package/rancher-components/BadgeState/BadgeState.vue +3 -1
- package/rancher-components/Form/Checkbox/Checkbox.vue +2 -2
- package/rancher-components/RcItemCard/RcItemCard.test.ts +189 -0
- package/rancher-components/RcItemCard/RcItemCard.vue +425 -0
- package/rancher-components/RcItemCard/RcItemCardAction.vue +24 -0
- package/rancher-components/RcItemCard/index.ts +2 -0
- package/store/auth.js +1 -0
- package/store/catalog.js +62 -24
- package/store/index.js +33 -14
- package/store/slideInPanel.ts +6 -0
- package/store/type-map.js +1 -0
- package/types/fleet.d.ts +35 -0
- package/types/resources/settings.d.ts +19 -1
- package/types/shell/index.d.ts +339 -272
- package/types/store/dashboard-store.types.ts +17 -3
- package/types/store/pagination.types.ts +6 -1
- package/types/store/subscribe.types.ts +50 -0
- package/utils/auth.js +32 -3
- package/utils/fleet-types.ts +0 -0
- package/utils/fleet.ts +200 -1
- package/utils/pagination-utils.ts +26 -1
- package/utils/pagination-wrapper.ts +132 -50
- package/utils/settings.ts +4 -1
- package/utils/style.ts +39 -0
- package/utils/validators/formRules/__tests__/index.test.ts +36 -3
- package/utils/validators/formRules/index.ts +10 -3
- package/utils/window.js +11 -7
- package/components/__tests__/ApplicationCard.test.ts +0 -27
- package/components/cards/ApplicationCard.vue +0 -145
- package/components/fleet/ForceDirectedTreeChart/chartIcons.js +0 -17
- package/config/secret.js +0 -14
- package/pages/c/_cluster/fleet/GitRepoGraphConfig.js +0 -249
- /package/{components/form/SSHKnownHosts → dialog}/__tests__/KnownHostsEditDialog.test.ts +0 -0
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { TIMESTAMP } from '@shell/config/labels-annotations';
|
|
3
|
+
import AsyncButton from '@shell/components/AsyncButton';
|
|
4
|
+
import { Card } from '@components/Card';
|
|
5
|
+
import { Banner } from '@components/Banner';
|
|
6
|
+
import { exceptionToErrorsArray } from '@shell/utils/error';
|
|
7
|
+
import { resourceNames } from '@shell/utils/string';
|
|
8
|
+
import { mapGetters } from 'vuex';
|
|
9
|
+
|
|
10
|
+
interface Workload {
|
|
11
|
+
nameDisplay: string;
|
|
12
|
+
type: string;
|
|
13
|
+
schema?: any;
|
|
14
|
+
spec: {
|
|
15
|
+
template: {
|
|
16
|
+
metadata?: {
|
|
17
|
+
annotations?: Record<string, string>;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
save: () => Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export default {
|
|
25
|
+
name: 'RedeployWorkloadDialog',
|
|
26
|
+
|
|
27
|
+
emits: ['close'],
|
|
28
|
+
|
|
29
|
+
components: {
|
|
30
|
+
Card,
|
|
31
|
+
AsyncButton,
|
|
32
|
+
Banner,
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
props: {
|
|
36
|
+
workloads: {
|
|
37
|
+
type: Array as () => Workload[],
|
|
38
|
+
required: true,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
data() {
|
|
43
|
+
return { errors: [] };
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
computed: {
|
|
47
|
+
...mapGetters({ t: 'i18n/t', labelFor: 'type-map/labelFor' }),
|
|
48
|
+
|
|
49
|
+
names(): string[] {
|
|
50
|
+
return this.workloads.map(({ nameDisplay }) => nameDisplay);
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
type(): string {
|
|
54
|
+
const types = new Set(this.workloads.map(({ type }) => type));
|
|
55
|
+
|
|
56
|
+
if (types.size > 1) {
|
|
57
|
+
return this.t('generic.resource', { count: this.workloads.length });
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const [{ schema } = {}] = this.workloads;
|
|
61
|
+
|
|
62
|
+
if (!schema) {
|
|
63
|
+
return `resource${ this.workloads.length === 1 ? '' : 's' }`;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return this.labelFor(schema, this.workloads.length);
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
methods: {
|
|
71
|
+
resourceNames,
|
|
72
|
+
|
|
73
|
+
close(): void {
|
|
74
|
+
this.$emit('close');
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
async apply(buttonDone?: (success: boolean) => void): Promise<void> {
|
|
78
|
+
try {
|
|
79
|
+
const now = new Date().toISOString().replace(/\.\d+Z$/, 'Z');
|
|
80
|
+
|
|
81
|
+
for (const workload of this.workloads) {
|
|
82
|
+
const metadata = workload.spec.template.metadata ??= {};
|
|
83
|
+
const annotations = metadata.annotations ??= {};
|
|
84
|
+
|
|
85
|
+
annotations[TIMESTAMP] = now;
|
|
86
|
+
|
|
87
|
+
await workload.save();
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
buttonDone?.(true);
|
|
91
|
+
this.close();
|
|
92
|
+
} catch (err) {
|
|
93
|
+
this.errors = exceptionToErrorsArray(err);
|
|
94
|
+
buttonDone?.(false);
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
</script>
|
|
100
|
+
|
|
101
|
+
<template>
|
|
102
|
+
<Card
|
|
103
|
+
role="alertdialog"
|
|
104
|
+
aria-modal="true"
|
|
105
|
+
class="prompt-redeploy"
|
|
106
|
+
:show-highlight-border="false"
|
|
107
|
+
>
|
|
108
|
+
<template #title>
|
|
109
|
+
<h4 class="text-default-text">
|
|
110
|
+
{{ t('promptRedeploy.title', { type }) }}
|
|
111
|
+
</h4>
|
|
112
|
+
</template>
|
|
113
|
+
|
|
114
|
+
<template #body>
|
|
115
|
+
<div class="mb-10">
|
|
116
|
+
<span
|
|
117
|
+
v-clean-html="t('promptRedeploy.attemptingToRedeploy', {
|
|
118
|
+
type,
|
|
119
|
+
names: resourceNames(names, null, t),
|
|
120
|
+
})"
|
|
121
|
+
/>
|
|
122
|
+
<Banner
|
|
123
|
+
v-for="(error, i) in errors"
|
|
124
|
+
:key="i"
|
|
125
|
+
role="alert"
|
|
126
|
+
color="error"
|
|
127
|
+
:label="error"
|
|
128
|
+
/>
|
|
129
|
+
</div>
|
|
130
|
+
</template>
|
|
131
|
+
|
|
132
|
+
<template #actions>
|
|
133
|
+
<button
|
|
134
|
+
role="button"
|
|
135
|
+
class="btn role-secondary"
|
|
136
|
+
:aria-label="t('generic.cancel')"
|
|
137
|
+
@click="close"
|
|
138
|
+
>
|
|
139
|
+
{{ t('generic.cancel') }}
|
|
140
|
+
</button>
|
|
141
|
+
<div class="spacer" />
|
|
142
|
+
<AsyncButton
|
|
143
|
+
role="button"
|
|
144
|
+
class="btn bg-error ml-10"
|
|
145
|
+
:action-label="t('asyncButton.redeploy.action')"
|
|
146
|
+
@click="apply"
|
|
147
|
+
/>
|
|
148
|
+
</template>
|
|
149
|
+
</Card>
|
|
150
|
+
</template>
|
|
151
|
+
|
|
152
|
+
<style lang="scss">
|
|
153
|
+
.prompt-redeploy {
|
|
154
|
+
&.card-container {
|
|
155
|
+
box-shadow: none;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.card-actions {
|
|
159
|
+
.spacer {
|
|
160
|
+
flex: 1;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
</style>
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { mount } from '@vue/test-utils';
|
|
2
2
|
import { _CREATE, _EDIT, _VIEW } from '@shell/config/query-params';
|
|
3
|
-
import GitRepo from '@shell/
|
|
3
|
+
import GitRepo from '@shell/models/fleet.cattle.io.gitrepo';
|
|
4
|
+
import GitRepoComponent from '@shell/edit/fleet.cattle.io.gitrepo.vue';
|
|
4
5
|
|
|
5
6
|
const mockStore = {
|
|
6
7
|
dispatch: jest.fn(),
|
|
8
|
+
commit: jest.fn(),
|
|
7
9
|
getters: {
|
|
8
10
|
'i18n/t': (text: string) => text,
|
|
9
11
|
'i18n/exists': jest.fn(),
|
|
@@ -12,8 +14,10 @@ const mockStore = {
|
|
|
12
14
|
'current_store/schemaFor': jest.fn(),
|
|
13
15
|
'current_store/all': jest.fn(),
|
|
14
16
|
workspace: jest.fn(),
|
|
15
|
-
}
|
|
17
|
+
},
|
|
18
|
+
rootGetters: { 'i18n/t': jest.fn() },
|
|
16
19
|
};
|
|
20
|
+
|
|
17
21
|
const mocks = {
|
|
18
22
|
$store: mockStore,
|
|
19
23
|
$fetchState: { pending: false },
|
|
@@ -26,8 +30,9 @@ const mocks = {
|
|
|
26
30
|
}
|
|
27
31
|
},
|
|
28
32
|
};
|
|
33
|
+
|
|
29
34
|
const mockComputed = {
|
|
30
|
-
...
|
|
35
|
+
...GitRepoComponent.computed,
|
|
31
36
|
steps: () => [{
|
|
32
37
|
name: 'stepAdvanced',
|
|
33
38
|
title: 'title',
|
|
@@ -39,22 +44,46 @@ const mockComputed = {
|
|
|
39
44
|
}],
|
|
40
45
|
};
|
|
41
46
|
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
+
const mockRepo = {
|
|
48
|
+
type: 'fleet.cattle.io.gitrepo',
|
|
49
|
+
apiVersion: 'fleet.cattle.io/v1alpha1',
|
|
50
|
+
kind: 'GitRepo',
|
|
51
|
+
metadata: {
|
|
52
|
+
name: `test`,
|
|
53
|
+
namespace: 'test',
|
|
54
|
+
},
|
|
55
|
+
spec: {
|
|
56
|
+
targetNamespace: 'custom-namespace-name',
|
|
57
|
+
targets: [
|
|
58
|
+
{ clusterName: `fleet-local` }
|
|
59
|
+
],
|
|
47
60
|
},
|
|
48
|
-
|
|
61
|
+
status: {}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const initGitRepo = (props: any, value?: any) => {
|
|
65
|
+
const initValue = new GitRepo({
|
|
66
|
+
...mockRepo,
|
|
67
|
+
...(value || {})
|
|
68
|
+
}, {
|
|
69
|
+
getters: { schemaFor: () => ({ linkFor: jest.fn() }) },
|
|
70
|
+
dispatch: jest.fn(),
|
|
71
|
+
rootGetters: { 'i18n/t': jest.fn() },
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
return {
|
|
75
|
+
props: {
|
|
76
|
+
value: initValue,
|
|
77
|
+
...props
|
|
78
|
+
},
|
|
79
|
+
computed: mockComputed,
|
|
80
|
+
global: { mocks },
|
|
81
|
+
};
|
|
49
82
|
};
|
|
50
83
|
|
|
51
84
|
describe('view: fleet.cattle.io.gitrepo, mode: view - should', () => {
|
|
52
85
|
it('hide advanced options banner', () => {
|
|
53
|
-
const wrapper = mount(
|
|
54
|
-
props: { value: values, mode: _VIEW },
|
|
55
|
-
computed: mockComputed,
|
|
56
|
-
global: { mocks }
|
|
57
|
-
});
|
|
86
|
+
const wrapper = mount(GitRepoComponent, initGitRepo({ mode: _VIEW }));
|
|
58
87
|
|
|
59
88
|
const advancedInfoBanner = wrapper.find('[data-testid="gitrepo-advanced-info"]');
|
|
60
89
|
|
|
@@ -66,11 +95,7 @@ describe.each([
|
|
|
66
95
|
_CREATE,
|
|
67
96
|
_EDIT,
|
|
68
97
|
])('view: fleet.cattle.io.gitrepo, mode: %p - should', (mode) => {
|
|
69
|
-
const wrapper = mount(
|
|
70
|
-
props: { value: values, mode },
|
|
71
|
-
computed: mockComputed,
|
|
72
|
-
global: { mocks }
|
|
73
|
-
});
|
|
98
|
+
const wrapper = mount(GitRepoComponent, initGitRepo({ mode }));
|
|
74
99
|
|
|
75
100
|
it('show advanced options banner', () => {
|
|
76
101
|
const advancedInfoBanner = wrapper.find('[data-testid="gitrepo-advanced-info"]');
|
|
@@ -119,21 +144,13 @@ describe.each([
|
|
|
119
144
|
disablePolling,
|
|
120
145
|
enabled
|
|
121
146
|
) => {
|
|
122
|
-
const wrapper = mount(
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
spec: {
|
|
127
|
-
disablePolling,
|
|
128
|
-
pollingInterval: 10
|
|
129
|
-
},
|
|
130
|
-
status: { webhookCommit: 'sha' },
|
|
131
|
-
},
|
|
132
|
-
realMode: mode
|
|
147
|
+
const wrapper = mount(GitRepoComponent, initGitRepo({ realMode: mode }, {
|
|
148
|
+
spec: {
|
|
149
|
+
disablePolling,
|
|
150
|
+
pollingInterval: 10
|
|
133
151
|
},
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
});
|
|
152
|
+
status: { webhookCommit: 'sha' },
|
|
153
|
+
}));
|
|
137
154
|
|
|
138
155
|
const pollingCheckbox = wrapper.findComponent('[data-testid="gitRepo-enablePolling-checkbox"]') as any;
|
|
139
156
|
const pollingIntervalInput = wrapper.find('[data-testid="gitRepo-pollingInterval-input"]');
|
|
@@ -167,17 +184,7 @@ describe.each([
|
|
|
167
184
|
pollingInterval,
|
|
168
185
|
unitValue,
|
|
169
186
|
) => {
|
|
170
|
-
const wrapper = mount(
|
|
171
|
-
props: {
|
|
172
|
-
value: {
|
|
173
|
-
...values,
|
|
174
|
-
spec: { pollingInterval }
|
|
175
|
-
},
|
|
176
|
-
realMode: mode
|
|
177
|
-
},
|
|
178
|
-
computed: mockComputed,
|
|
179
|
-
global: { mocks },
|
|
180
|
-
});
|
|
187
|
+
const wrapper = mount(GitRepoComponent, initGitRepo({ realMode: mode }, { spec: { pollingInterval } }));
|
|
181
188
|
|
|
182
189
|
const pollingIntervalInput = wrapper.find('[data-testid="gitRepo-pollingInterval-input"]').element as any;
|
|
183
190
|
|
|
@@ -198,17 +205,7 @@ describe.each([
|
|
|
198
205
|
pollingInterval,
|
|
199
206
|
visible,
|
|
200
207
|
) => {
|
|
201
|
-
const wrapper = mount(
|
|
202
|
-
props: {
|
|
203
|
-
value: {
|
|
204
|
-
...values,
|
|
205
|
-
spec: { pollingInterval }
|
|
206
|
-
},
|
|
207
|
-
realMode: mode
|
|
208
|
-
},
|
|
209
|
-
computed: mockComputed,
|
|
210
|
-
global: { mocks },
|
|
211
|
-
});
|
|
208
|
+
const wrapper = mount(GitRepoComponent, initGitRepo({ realMode: mode }, { spec: { pollingInterval } }));
|
|
212
209
|
|
|
213
210
|
const pollingIntervalMinimumValueWarning = wrapper.find('[data-testid="gitRepo-pollingInterval-minimumValueWarning"]');
|
|
214
211
|
|
|
@@ -226,18 +223,10 @@ describe.each([
|
|
|
226
223
|
webhookCommit,
|
|
227
224
|
visible
|
|
228
225
|
) => {
|
|
229
|
-
const wrapper = mount(
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
spec: { pollingInterval: 60 },
|
|
234
|
-
status: { webhookCommit },
|
|
235
|
-
},
|
|
236
|
-
realMode: mode
|
|
237
|
-
},
|
|
238
|
-
computed: mockComputed,
|
|
239
|
-
global: { mocks },
|
|
240
|
-
});
|
|
226
|
+
const wrapper = mount(GitRepoComponent, initGitRepo({ realMode: mode }, {
|
|
227
|
+
spec: { pollingInterval: 60 },
|
|
228
|
+
status: { webhookCommit },
|
|
229
|
+
}));
|
|
241
230
|
|
|
242
231
|
const pollingIntervalWebhookWarning = wrapper.find('[data-testid="gitRepo-pollingInterval-webhookWarning"]');
|
|
243
232
|
|