@rancher/shell 0.5.0 → 0.5.1
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/components/AsyncButton.vue +5 -17
- package/components/Certificates.vue +4 -4
- package/components/DraggableZone.vue +2 -2
- package/components/PodSecurityAdmission.vue +2 -2
- package/components/form/Error.vue +3 -3
- package/components/form/Footer.vue +2 -2
- package/components/form/GitPicker.vue +38 -83
- package/composables/useCompactInput.ts +2 -2
- package/edit/catalog.cattle.io.clusterrepo.vue +18 -0
- package/edit/management.cattle.io.podsecurityadmissionconfigurationtemplate.vue +2 -2
- package/mixins/create-edit-view/index.js +2 -2
- package/package.json +1 -1
- package/rancher-components/Accordion/Accordion.vue +2 -3
- package/rancher-components/BadgeState/BadgeState.vue +3 -3
- package/rancher-components/Banner/Banner.vue +2 -2
- package/rancher-components/Card/Card.vue +3 -3
- package/rancher-components/Form/Checkbox/Checkbox.vue +3 -3
- package/rancher-components/Form/LabeledInput/LabeledInput.test.ts +1 -1
- package/rancher-components/Form/LabeledInput/LabeledInput.vue +23 -53
- package/rancher-components/Form/Radio/RadioButton.vue +7 -13
- package/rancher-components/Form/Radio/RadioGroup.vue +3 -4
- package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +4 -6
- package/rancher-components/Form/ToggleSwitch/ToggleSwitch.vue +4 -7
- package/rancher-components/LabeledTooltip/LabeledTooltip.vue +4 -9
- package/rancher-components/StringList/StringList.vue +8 -8
- package/rancher-components/components/Accordion/Accordion.vue +2 -3
- package/rancher-components/components/BadgeState/BadgeState.vue +3 -3
- package/rancher-components/components/Banner/Banner.vue +2 -2
- package/rancher-components/components/Card/Card.vue +3 -3
- package/rancher-components/components/Form/Checkbox/Checkbox.vue +3 -3
- package/rancher-components/components/Form/LabeledInput/LabeledInput.test.ts +1 -1
- package/rancher-components/components/Form/LabeledInput/LabeledInput.vue +23 -53
- package/rancher-components/components/Form/Radio/RadioButton.vue +7 -13
- package/rancher-components/components/Form/Radio/RadioGroup.vue +3 -4
- package/rancher-components/components/Form/TextArea/TextAreaAutoGrow.vue +4 -6
- package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.vue +4 -7
- package/rancher-components/components/LabeledTooltip/LabeledTooltip.vue +4 -9
- package/rancher-components/components/StringList/StringList.vue +8 -8
- package/tsconfig.paths.json +1 -4
- package/types/shell/index.d.ts +20 -82
- package/utils/git.ts +1 -1
- package/composables/useCompactInput.test.ts +0 -36
- package/composables/useLabeledFormElement.test.ts +0 -135
- package/types/vue-shim.d.ts +0 -42
- /package/rancher-components/BadgeState/{BadgeState.test.ts → BadgeState.spec.ts} +0 -0
- /package/rancher-components/components/BadgeState/{BadgeState.test.ts → BadgeState.spec.ts} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import
|
|
2
|
+
import Vue from 'vue';
|
|
3
3
|
import typeHelper from '@shell/utils/type-helpers';
|
|
4
4
|
|
|
5
5
|
export const ASYNC_BUTTON_STATES = {
|
|
@@ -14,13 +14,7 @@ const TOOLTIP = 'tooltip';
|
|
|
14
14
|
|
|
15
15
|
export type AsyncButtonCallback = (success: boolean) => void;
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
timer: NodeJS.Timeout | undefined;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const provideProps: NonReactiveProps = { timer: undefined };
|
|
22
|
-
|
|
23
|
-
export default defineComponent({
|
|
17
|
+
export default Vue.extend<{ phase: string}, any, any, any>({
|
|
24
18
|
props: {
|
|
25
19
|
/**
|
|
26
20
|
* Mode maps to keys in asyncButton.* translations
|
|
@@ -43,7 +37,7 @@ export default defineComponent({
|
|
|
43
37
|
default: false,
|
|
44
38
|
},
|
|
45
39
|
type: {
|
|
46
|
-
type: String
|
|
40
|
+
type: String,
|
|
47
41
|
default: 'button'
|
|
48
42
|
},
|
|
49
43
|
tabIndex: {
|
|
@@ -119,13 +113,7 @@ export default defineComponent({
|
|
|
119
113
|
|
|
120
114
|
},
|
|
121
115
|
|
|
122
|
-
|
|
123
|
-
const timer = inject('timer', provideProps.timer);
|
|
124
|
-
|
|
125
|
-
return { timer };
|
|
126
|
-
},
|
|
127
|
-
|
|
128
|
-
data() {
|
|
116
|
+
data(): { phase: string, timer?: NodeJS.Timeout} {
|
|
129
117
|
return { phase: this.currentPhase };
|
|
130
118
|
},
|
|
131
119
|
|
|
@@ -257,7 +245,7 @@ export default defineComponent({
|
|
|
257
245
|
this.phase = (success ? ASYNC_BUTTON_STATES.SUCCESS : ASYNC_BUTTON_STATES.ERROR );
|
|
258
246
|
this.timer = setTimeout(() => {
|
|
259
247
|
this.timerDone();
|
|
260
|
-
}, this.delay);
|
|
248
|
+
}, this.delay );
|
|
261
249
|
}
|
|
262
250
|
},
|
|
263
251
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import
|
|
2
|
+
import Vue from 'vue';
|
|
3
3
|
import { mapGetters } from 'vuex';
|
|
4
|
-
import ResourceTable from '@shell/components/ResourceTable
|
|
4
|
+
import ResourceTable from '@shell/components/ResourceTable';
|
|
5
5
|
import { SECRET } from '@shell/config/types';
|
|
6
6
|
import { NAME as NAME_COL, NAMESPACE as NAMESPACE_COL, AGE, STATE } from '@shell/config/table-headers';
|
|
7
7
|
import Secret, { TYPES } from '@shell/models/secret';
|
|
@@ -19,7 +19,7 @@ interface Data {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
export default
|
|
22
|
+
export default Vue.extend<Data, any, any, any>({
|
|
23
23
|
components: {
|
|
24
24
|
ResourceTable, Banner, BadgeState
|
|
25
25
|
},
|
|
@@ -99,7 +99,7 @@ export default defineComponent({
|
|
|
99
99
|
computed: {
|
|
100
100
|
...mapGetters(['isAllNamespaces']),
|
|
101
101
|
|
|
102
|
-
expiredData()
|
|
102
|
+
expiredData() {
|
|
103
103
|
let expiring = 0;
|
|
104
104
|
let expired = 0;
|
|
105
105
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import
|
|
2
|
+
import Vue from 'vue';
|
|
3
3
|
import { mapState } from 'vuex';
|
|
4
4
|
import { BOTTOM, CENTER, LEFT, RIGHT } from '@shell/utils/position';
|
|
5
5
|
|
|
@@ -14,7 +14,7 @@ interface Data {
|
|
|
14
14
|
drag: Drag;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
export default
|
|
17
|
+
export default Vue.extend({
|
|
18
18
|
data(): Data {
|
|
19
19
|
return {
|
|
20
20
|
drag: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import
|
|
2
|
+
import Vue from 'vue';
|
|
3
3
|
import { _VIEW, _CREATE } from '@shell/config/query-params';
|
|
4
4
|
import LabeledSelect from '@shell/components/form/LabeledSelect.vue';
|
|
5
5
|
import Checkbox from '@components/Form/Checkbox/Checkbox.vue';
|
|
@@ -25,7 +25,7 @@ const getExemptionControl = (): PSAExemptionControl => ({
|
|
|
25
25
|
value: ''
|
|
26
26
|
});
|
|
27
27
|
|
|
28
|
-
export default
|
|
28
|
+
export default Vue.extend({
|
|
29
29
|
components: {
|
|
30
30
|
Checkbox, LabeledSelect, LabeledInput
|
|
31
31
|
},
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { PropType
|
|
2
|
+
import Vue, { PropType } from 'vue';
|
|
3
3
|
import Banner from '@components/Banner/Banner.vue';
|
|
4
4
|
|
|
5
|
-
type Rule = (v?: string
|
|
5
|
+
type Rule = (v?: string) => undefined | string;
|
|
6
6
|
|
|
7
|
-
export default
|
|
7
|
+
export default Vue.extend<any, any, any, any>({
|
|
8
8
|
components: { Banner },
|
|
9
9
|
props: {
|
|
10
10
|
value: {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import
|
|
2
|
+
import Vue from 'vue';
|
|
3
3
|
import { _VIEW } from '@shell/config/query-params';
|
|
4
4
|
import AsyncButton, { AsyncButtonCallback } from '@shell/components/AsyncButton.vue';
|
|
5
5
|
import Banner from '@components/Banner/Banner.vue';
|
|
6
6
|
|
|
7
|
-
export default
|
|
7
|
+
export default Vue.extend({
|
|
8
8
|
components: { AsyncButton, Banner },
|
|
9
9
|
|
|
10
10
|
props: {
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import
|
|
2
|
+
import Vue from 'vue';
|
|
3
3
|
import SortableTable from '@shell/components/SortableTable/index.vue';
|
|
4
4
|
import RadioButton from '@components/Form/Radio/RadioButton.vue';
|
|
5
5
|
import debounce from 'lodash/debounce';
|
|
6
6
|
import { isArray } from '@shell/utils/array';
|
|
7
7
|
import LabeledSelect from '@shell/components/form/LabeledSelect.vue';
|
|
8
8
|
import LabeledInput from '@components/Form/LabeledInput/LabeledInput.vue';
|
|
9
|
-
import { GitUtils
|
|
10
|
-
import type { DebouncedFunc } from 'lodash';
|
|
9
|
+
import { GitUtils } from '../../utils/git';
|
|
11
10
|
|
|
12
11
|
interface commit {
|
|
13
12
|
[key: string]: any,
|
|
@@ -18,45 +17,21 @@ interface Data {
|
|
|
18
17
|
repo: boolean,
|
|
19
18
|
branch: boolean,
|
|
20
19
|
commits: boolean,
|
|
21
|
-
branches?: unknown,
|
|
22
20
|
},
|
|
23
21
|
|
|
24
22
|
repos: object[],
|
|
25
23
|
branches: object[],
|
|
26
24
|
commits: commit[],
|
|
27
25
|
|
|
28
|
-
selectedAccOrOrg: string
|
|
29
|
-
selectedRepo: object
|
|
30
|
-
selectedBranch: object
|
|
31
|
-
selectedCommit:
|
|
26
|
+
selectedAccOrOrg: string| null,
|
|
27
|
+
selectedRepo: object| null,
|
|
28
|
+
selectedBranch: object| null,
|
|
29
|
+
selectedCommit: object | null,
|
|
32
30
|
}
|
|
33
31
|
|
|
34
|
-
|
|
35
|
-
name: string;
|
|
36
|
-
label: string;
|
|
37
|
-
width?: number;
|
|
38
|
-
formatter?: string;
|
|
39
|
-
formatterOpts?: { [key: string]: any };
|
|
40
|
-
value?: string | string[];
|
|
41
|
-
sort?: string | string[];
|
|
42
|
-
defaultSort?: boolean;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
interface NonReactiveProps {
|
|
46
|
-
onSearchRepo: DebouncedFunc<(param: any) => Promise<any>> | undefined;
|
|
47
|
-
onSearchBranch: DebouncedFunc<(param: any) => Promise<any>> | undefined;
|
|
48
|
-
debounceTime: number;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const debounceTime = 1_000;
|
|
32
|
+
const debounceTime = 1000;
|
|
52
33
|
|
|
53
|
-
|
|
54
|
-
onSearchRepo: undefined,
|
|
55
|
-
onSearchBranch: undefined,
|
|
56
|
-
debounceTime,
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
export default defineComponent({
|
|
34
|
+
export default Vue.extend<Data, any, any, any>({
|
|
60
35
|
|
|
61
36
|
components: {
|
|
62
37
|
LabeledSelect,
|
|
@@ -77,20 +52,10 @@ export default defineComponent({
|
|
|
77
52
|
}
|
|
78
53
|
},
|
|
79
54
|
|
|
80
|
-
|
|
81
|
-
const onSearchRepo = inject('onSearchRepo', provideProps.onSearchRepo);
|
|
82
|
-
const onSearchBranch = inject('onSearchBranch', provideProps.onSearchBranch);
|
|
83
|
-
const debounceTime = inject('debounceTime', provideProps.debounceTime);
|
|
84
|
-
|
|
55
|
+
data() {
|
|
85
56
|
return {
|
|
86
|
-
onSearchRepo,
|
|
87
|
-
onSearchBranch,
|
|
88
57
|
debounceTime,
|
|
89
|
-
};
|
|
90
|
-
},
|
|
91
58
|
|
|
92
|
-
data(): Data {
|
|
93
|
-
return {
|
|
94
59
|
hasError: {
|
|
95
60
|
repo: false,
|
|
96
61
|
branch: false,
|
|
@@ -101,10 +66,10 @@ export default defineComponent({
|
|
|
101
66
|
branches: [],
|
|
102
67
|
commits: [] as commit[],
|
|
103
68
|
|
|
104
|
-
selectedAccOrOrg:
|
|
105
|
-
selectedRepo:
|
|
106
|
-
selectedBranch:
|
|
107
|
-
selectedCommit:
|
|
69
|
+
selectedAccOrOrg: null,
|
|
70
|
+
selectedRepo: null,
|
|
71
|
+
selectedBranch: null,
|
|
72
|
+
selectedCommit: {},
|
|
108
73
|
};
|
|
109
74
|
},
|
|
110
75
|
|
|
@@ -130,14 +95,13 @@ export default defineComponent({
|
|
|
130
95
|
},
|
|
131
96
|
|
|
132
97
|
computed: {
|
|
133
|
-
commitHeaders()
|
|
98
|
+
commitHeaders() {
|
|
134
99
|
return [
|
|
135
100
|
{
|
|
136
101
|
name: 'index',
|
|
137
102
|
label: this.t(`gitPicker.${ this.type }.tableHeaders.choose.label`),
|
|
138
103
|
width: 60,
|
|
139
|
-
},
|
|
140
|
-
{
|
|
104
|
+
}, {
|
|
141
105
|
name: 'sha',
|
|
142
106
|
label: this.t(`gitPicker.${ this.type }.tableHeaders.sha.label`),
|
|
143
107
|
width: 90,
|
|
@@ -170,20 +134,17 @@ export default defineComponent({
|
|
|
170
134
|
];
|
|
171
135
|
},
|
|
172
136
|
|
|
173
|
-
preparedRepos()
|
|
137
|
+
preparedRepos() {
|
|
174
138
|
return this.normalizeArray(this.repos, (item: any) => ({ id: item.id, name: item.name }));
|
|
175
139
|
},
|
|
176
140
|
|
|
177
|
-
preparedBranches()
|
|
141
|
+
preparedBranches() {
|
|
178
142
|
return this.normalizeArray(this.branches, (item: any) => ({ id: item.id, name: item.name }));
|
|
179
143
|
},
|
|
180
144
|
|
|
181
|
-
preparedCommits()
|
|
182
|
-
return this.normalizeArray(this.commits, (c) => GitUtils[this.type].normalize.commit(c));
|
|
145
|
+
preparedCommits() {
|
|
146
|
+
return this.normalizeArray(this.commits, (c: any) => GitUtils[this.type].normalize.commit(c));
|
|
183
147
|
},
|
|
184
|
-
selectedCommitId(): string | undefined {
|
|
185
|
-
return this.selectedCommit?.commitId;
|
|
186
|
-
}
|
|
187
148
|
},
|
|
188
149
|
|
|
189
150
|
methods: {
|
|
@@ -203,10 +164,10 @@ export default defineComponent({
|
|
|
203
164
|
|
|
204
165
|
reset() {
|
|
205
166
|
this.repos = [];
|
|
206
|
-
this.selectedAccOrOrg =
|
|
207
|
-
this.selectedRepo =
|
|
208
|
-
this.selectedBranch =
|
|
209
|
-
this.selectedCommit =
|
|
167
|
+
this.selectedAccOrOrg = null;
|
|
168
|
+
this.selectedRepo = null;
|
|
169
|
+
this.selectedBranch = null;
|
|
170
|
+
this.selectedCommit = {};
|
|
210
171
|
|
|
211
172
|
this.communicateReset();
|
|
212
173
|
},
|
|
@@ -256,13 +217,13 @@ export default defineComponent({
|
|
|
256
217
|
|
|
257
218
|
async fetchRepos() {
|
|
258
219
|
this.repos = [];
|
|
259
|
-
this.selectedRepo =
|
|
260
|
-
this.selectedBranch =
|
|
261
|
-
this.selectedCommit =
|
|
220
|
+
this.selectedRepo = null;
|
|
221
|
+
this.selectedBranch = null;
|
|
222
|
+
this.selectedCommit = {};
|
|
262
223
|
|
|
263
224
|
this.communicateReset();
|
|
264
225
|
|
|
265
|
-
if (this.selectedAccOrOrg
|
|
226
|
+
if (this.selectedAccOrOrg.length) {
|
|
266
227
|
try {
|
|
267
228
|
const res = await this.$store.dispatch(`${ this.type }/fetchRecentRepos`, { username: this.selectedAccOrOrg });
|
|
268
229
|
|
|
@@ -276,8 +237,8 @@ export default defineComponent({
|
|
|
276
237
|
},
|
|
277
238
|
|
|
278
239
|
async fetchBranches() {
|
|
279
|
-
this.selectedBranch =
|
|
280
|
-
this.selectedCommit =
|
|
240
|
+
this.selectedBranch = null;
|
|
241
|
+
this.selectedCommit = {};
|
|
281
242
|
|
|
282
243
|
this.communicateReset();
|
|
283
244
|
|
|
@@ -292,7 +253,7 @@ export default defineComponent({
|
|
|
292
253
|
},
|
|
293
254
|
|
|
294
255
|
async fetchCommits() {
|
|
295
|
-
this.selectedCommit =
|
|
256
|
+
this.selectedCommit = {};
|
|
296
257
|
|
|
297
258
|
this.communicateReset();
|
|
298
259
|
|
|
@@ -318,7 +279,7 @@ export default defineComponent({
|
|
|
318
279
|
},
|
|
319
280
|
|
|
320
281
|
final(commitId: string) {
|
|
321
|
-
this.selectedCommit = this.preparedCommits.find((c: { commitId?: string }) => c.commitId === commitId)
|
|
282
|
+
this.selectedCommit = this.preparedCommits.find((c: { commitId?: string }) => c.commitId === commitId);
|
|
322
283
|
|
|
323
284
|
if (this.selectedAccOrOrg && this.selectedRepo && this.selectedCommit?.commitId) {
|
|
324
285
|
this.$emit('change', {
|
|
@@ -376,7 +337,7 @@ export default defineComponent({
|
|
|
376
337
|
},
|
|
377
338
|
|
|
378
339
|
status(value: boolean) {
|
|
379
|
-
return value ? 'error' :
|
|
340
|
+
return value ? 'error' : null;
|
|
380
341
|
},
|
|
381
342
|
|
|
382
343
|
reposRules() {
|
|
@@ -394,17 +355,11 @@ export default defineComponent({
|
|
|
394
355
|
const commitId = this.$route.query?.commit;
|
|
395
356
|
|
|
396
357
|
if (commitId) {
|
|
397
|
-
const table = this.$refs.commitsTable
|
|
398
|
-
|
|
399
|
-
setPage: (page: any) => void;
|
|
400
|
-
};
|
|
401
|
-
const page = table?.getPageByRow(commitId, ({ commitId }: commit) => commitId);
|
|
358
|
+
const table = this.$refs.commitsTable;
|
|
359
|
+
const page = table.getPageByRow(commitId, ({ commitId }: commit) => commitId);
|
|
402
360
|
|
|
403
|
-
table
|
|
361
|
+
table.setPage(page);
|
|
404
362
|
}
|
|
405
|
-
},
|
|
406
|
-
selectReduction(e: unknown) {
|
|
407
|
-
return e;
|
|
408
363
|
}
|
|
409
364
|
},
|
|
410
365
|
});
|
|
@@ -438,7 +393,7 @@ export default defineComponent({
|
|
|
438
393
|
:options="preparedRepos"
|
|
439
394
|
:clearable="true"
|
|
440
395
|
:searchable="true"
|
|
441
|
-
:reduce="
|
|
396
|
+
:reduce="(e) => e"
|
|
442
397
|
:rules="[reposRules]"
|
|
443
398
|
:status="status(hasError.repo)"
|
|
444
399
|
:option-label="'name'"
|
|
@@ -457,7 +412,7 @@ export default defineComponent({
|
|
|
457
412
|
:label="t(`gitPicker.${ type }.branch.inputLabel`)"
|
|
458
413
|
:options="preparedBranches"
|
|
459
414
|
:clearable="false"
|
|
460
|
-
:reduce="
|
|
415
|
+
:reduce="(e) => e"
|
|
461
416
|
:searchable="true"
|
|
462
417
|
:rules="[branchesRules]"
|
|
463
418
|
:status="status(hasError.branch)"
|
|
@@ -486,7 +441,7 @@ export default defineComponent({
|
|
|
486
441
|
>
|
|
487
442
|
<template #cell:index="{row}">
|
|
488
443
|
<RadioButton
|
|
489
|
-
:value="
|
|
444
|
+
:value="selectedCommit.commitId"
|
|
490
445
|
:val="row.commitId"
|
|
491
446
|
@input="final($event)"
|
|
492
447
|
/>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { computed, ComputedRef } from 'vue';
|
|
2
2
|
|
|
3
3
|
interface CompactInputProps {
|
|
4
|
-
compact?: boolean
|
|
4
|
+
compact?: boolean;
|
|
5
5
|
label?: string;
|
|
6
6
|
labelKey?: string;
|
|
7
7
|
}
|
|
@@ -13,7 +13,7 @@ interface UseCompactInput {
|
|
|
13
13
|
export const useCompactInput = (props: CompactInputProps): UseCompactInput => {
|
|
14
14
|
const isCompact = computed(() => {
|
|
15
15
|
// Compact if explicitly set - otherwise compact if there is no label
|
|
16
|
-
return
|
|
16
|
+
return props.compact !== null ? !!props.compact : !(props.label || props.labelKey);
|
|
17
17
|
});
|
|
18
18
|
|
|
19
19
|
return { isCompact };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script>
|
|
2
|
+
import Vue from 'vue';
|
|
2
3
|
import CreateEditView from '@shell/mixins/create-edit-view';
|
|
3
4
|
import Footer from '@shell/components/form/Footer';
|
|
4
5
|
import { LabeledInput } from '@components/Form/LabeledInput';
|
|
@@ -39,6 +40,21 @@ export default {
|
|
|
39
40
|
return this.$store.getters['cluster/all'](NAMESPACE)[0]?.id;
|
|
40
41
|
}
|
|
41
42
|
},
|
|
43
|
+
|
|
44
|
+
methods: {
|
|
45
|
+
onTargetChange(isGit) {
|
|
46
|
+
// reset entered value when switching options
|
|
47
|
+
if (isGit) {
|
|
48
|
+
Vue.set(this.value.spec, 'url', '');
|
|
49
|
+
} else {
|
|
50
|
+
Vue.set(this.value.spec, 'gitRepo', '');
|
|
51
|
+
|
|
52
|
+
if (!!this.value.spec.gitBranch) {
|
|
53
|
+
Vue.set(this.value.spec, 'gitBranch', '');
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
},
|
|
42
58
|
};
|
|
43
59
|
</script>
|
|
44
60
|
|
|
@@ -60,6 +76,7 @@ export default {
|
|
|
60
76
|
:labels="[t('catalog.repo.target.http'), t('catalog.repo.target.git')]"
|
|
61
77
|
:mode="mode"
|
|
62
78
|
data-testid="clusterrepo-radio-input"
|
|
79
|
+
@input="onTargetChange"
|
|
63
80
|
/>
|
|
64
81
|
</div>
|
|
65
82
|
</div>
|
|
@@ -97,6 +114,7 @@ export default {
|
|
|
97
114
|
:label="t('catalog.repo.url.label')"
|
|
98
115
|
:placeholder="t('catalog.repo.url.placeholder', null, true)"
|
|
99
116
|
:mode="mode"
|
|
117
|
+
data-testid="clusterrepo-helm-url-input"
|
|
100
118
|
/>
|
|
101
119
|
|
|
102
120
|
<SelectOrCreateAuthSecret
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { PropType,
|
|
2
|
+
import Vue, { PropType, VueConstructor } from 'vue';
|
|
3
3
|
import CreateEditView from '@shell/mixins/create-edit-view';
|
|
4
4
|
import CruResource from '@shell/components/CruResource.vue';
|
|
5
5
|
import PodSecurityAdmission from '@shell/components/PodSecurityAdmission.vue';
|
|
@@ -9,7 +9,7 @@ import { PSA, PSAConfig, PSADefaults, PSAExemptions } from '@shell/types/pod-sec
|
|
|
9
9
|
import { PSADimensions } from '@shell/config/pod-security-admission';
|
|
10
10
|
import { MANAGEMENT } from '@shell/config/types';
|
|
11
11
|
|
|
12
|
-
export default
|
|
12
|
+
export default (Vue as VueConstructor<Vue & InstanceType<typeof CreateEditView>>).extend({
|
|
13
13
|
mixins: [CreateEditView],
|
|
14
14
|
components: {
|
|
15
15
|
CruResource,
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { PropType
|
|
2
|
+
import Vue, { PropType } from 'vue';
|
|
3
3
|
|
|
4
4
|
interface Badge {
|
|
5
5
|
stateBackground: string;
|
|
@@ -11,7 +11,7 @@ interface Badge {
|
|
|
11
11
|
* <p>Represents a badge whose label and color is either taken from the value property or
|
|
12
12
|
* from the label and color properties. The state property takes precedence.</p>
|
|
13
13
|
*/
|
|
14
|
-
export default
|
|
14
|
+
export default Vue.extend({
|
|
15
15
|
props: {
|
|
16
16
|
/**
|
|
17
17
|
* A value having the properties `stateBackground` and `stateDisplay`
|
|
@@ -59,7 +59,7 @@ export default defineComponent({
|
|
|
59
59
|
</script>
|
|
60
60
|
|
|
61
61
|
<template>
|
|
62
|
-
<span :class="
|
|
62
|
+
<span :class="{'badge-state': true, [bg]: true}">
|
|
63
63
|
<i
|
|
64
64
|
v-if="icon"
|
|
65
65
|
class="icon"
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import
|
|
2
|
+
import Vue from 'vue';
|
|
3
3
|
import { nlToBr } from '@shell/utils/string';
|
|
4
4
|
import { stringify } from '@shell/utils/error';
|
|
5
5
|
|
|
6
|
-
export default
|
|
6
|
+
export default Vue.extend({
|
|
7
7
|
props: {
|
|
8
8
|
/**
|
|
9
9
|
* A color class that represents the color of the banner.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import
|
|
2
|
+
import Vue from 'vue';
|
|
3
3
|
|
|
4
|
-
export default
|
|
4
|
+
export default Vue.extend({
|
|
5
5
|
name: 'Card',
|
|
6
6
|
props: {
|
|
7
7
|
/**
|
|
@@ -22,7 +22,7 @@ export default defineComponent({
|
|
|
22
22
|
* The function to invoke when the default action button is clicked.
|
|
23
23
|
*/
|
|
24
24
|
buttonAction: {
|
|
25
|
-
type: Function
|
|
25
|
+
type: Function,
|
|
26
26
|
default: (): void => { }
|
|
27
27
|
},
|
|
28
28
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { PropType
|
|
2
|
+
import Vue, { PropType } from 'vue';
|
|
3
3
|
import { _EDIT, _VIEW } from '@shell/config/query-params';
|
|
4
4
|
import { addObject, removeObject } from '@shell/utils/array';
|
|
5
5
|
import cloneDeep from 'lodash/cloneDeep';
|
|
6
6
|
|
|
7
|
-
export default
|
|
7
|
+
export default Vue.extend({
|
|
8
8
|
name: 'Checkbox',
|
|
9
9
|
|
|
10
10
|
props: {
|
|
@@ -140,7 +140,7 @@ export default defineComponent({
|
|
|
140
140
|
/**
|
|
141
141
|
* Toggles the checked state for the checkbox and emits an 'input' event.
|
|
142
142
|
*/
|
|
143
|
-
clicked(event: MouseEvent
|
|
143
|
+
clicked(event: MouseEvent): boolean | void {
|
|
144
144
|
if ((event.target as HTMLLinkElement).tagName === 'A' && (event.target as HTMLLinkElement).href) {
|
|
145
145
|
// Ignore links inside the checkbox label so you can click them
|
|
146
146
|
return true;
|
|
@@ -5,7 +5,7 @@ describe('component: LabeledInput', () => {
|
|
|
5
5
|
it('should emit input only once', () => {
|
|
6
6
|
const value = '2';
|
|
7
7
|
const delay = 1;
|
|
8
|
-
const wrapper = mount(LabeledInput, {
|
|
8
|
+
const wrapper = mount(LabeledInput as any, {
|
|
9
9
|
propsData: { delay },
|
|
10
10
|
mocks: { $store: { getters: { 'i18n/t': jest.fn() } } }
|
|
11
11
|
});
|