@rancher/shell 3.0.0-rc.1 → 3.0.0-rc.3
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/_variables.scss +1 -0
- package/assets/styles/global/_layout.scss +12 -3
- package/assets/styles/global/_select.scss +1 -1
- package/assets/styles/global/_tooltip.scss +47 -69
- package/assets/translations/en-us.yaml +1 -0
- package/components/ActionDropdown.vue +10 -14
- package/components/ActionMenu.vue +1 -1
- package/components/ButtonDropdown.vue +9 -8
- package/components/CodeMirror.vue +82 -67
- package/components/CruResource.vue +61 -61
- package/components/Import.vue +0 -1
- package/components/InputOrDisplay.vue +21 -33
- package/components/LocaleSelector.vue +5 -3
- package/components/Questions/__tests__/Boolean.test.ts +1 -2
- package/components/Questions/__tests__/Float.test.ts +1 -2
- package/components/Questions/__tests__/Int.test.ts +1 -2
- package/components/Questions/__tests__/String.test.ts +1 -2
- package/components/Questions/__tests__/Yaml.test.ts +1 -1
- package/components/Questions/__tests__/utils/questions-defaults.ts +2 -2
- package/components/SideNav.vue +3 -3
- package/components/SortableTable/index.vue +2 -1
- package/components/Wizard.vue +2 -0
- package/components/YamlEditor.vue +1 -1
- package/components/__tests__/CodeMirror.test.ts +91 -94
- package/components/__tests__/ConsumptionGauge.test.ts +2 -2
- package/components/__tests__/ContainerResourceLimit.test.ts +35 -0
- package/components/__tests__/NamespaceFilter.test.ts +10 -7
- package/components/auth/AllowedPrincipals.vue +2 -2
- package/components/auth/RoleDetailEdit.vue +13 -17
- package/components/auth/SelectPrincipal.vue +2 -2
- package/components/fleet/FleetStatus.vue +15 -16
- package/components/form/ArrayList.vue +1 -1
- package/components/form/ArrayListGrouped.vue +18 -5
- package/components/form/LabeledSelect.vue +16 -11
- package/components/form/Labels.vue +11 -13
- package/components/form/Select.vue +17 -1
- package/components/form/UnitInput.vue +2 -0
- package/components/form/__tests__/Command.test.ts +6 -5
- package/components/form/__tests__/Taints.test.ts +9 -9
- package/components/form/__tests__/UnitInput.test.ts +68 -0
- package/components/formatter/AppSummaryGraph.vue +3 -3
- package/components/formatter/FleetSummaryGraph.vue +3 -3
- package/components/formatter/InternalExternalIP.vue +13 -15
- package/components/formatter/MachineSummaryGraph.vue +3 -3
- package/components/formatter/Scale.vue +3 -3
- package/components/formatter/Weight.vue +3 -3
- package/components/nav/Header.vue +31 -14
- package/components/nav/NamespaceFilter.vue +3 -2
- package/components/nav/TopLevelMenu.vue +11 -10
- package/components/nav/WindowManager/ContainerLogs.vue +3 -2
- package/components/nav/WindowManager/ContainerShell.vue +7 -2
- package/components/nav/WindowManager/__tests__/ContainerLogs.test.ts +195 -192
- package/components/nav/WindowManager/__tests__/ContainerShell.test.ts +23 -19
- package/composables/useUserRetentionValidation.test.ts +1 -1
- package/composables/useUserRetentionValidation.ts +1 -1
- package/core/{plugin-helpers.js → plugin-helpers.ts} +25 -7
- package/core/plugin-routes.ts +41 -29
- package/core/plugin.ts +30 -3
- package/core/plugins-loader.js +2 -0
- package/detail/__tests__/autoscaling.horizontalpodautoscaler.test.ts +16 -8
- package/detail/helm.cattle.io.projecthelmchart.vue +32 -35
- package/edit/__tests__/namespace.test.ts +7 -9
- package/edit/__tests__/service.test.ts +14 -2
- package/edit/auth/__tests__/azuread.test.ts +10 -11
- package/edit/auth/azuread.vue +1 -1
- package/edit/auth/ldap/config.vue +280 -280
- package/edit/auth/saml.vue +1 -4
- package/edit/cis.cattle.io.clusterscan.vue +80 -82
- package/edit/cis.cattle.io.clusterscanprofile.vue +29 -31
- package/edit/fleet.cattle.io.clustergroup.vue +3 -3
- package/edit/management.cattle.io.clusterroletemplatebinding.vue +1 -0
- package/edit/management.cattle.io.fleetworkspace.vue +3 -3
- package/edit/management.cattle.io.node.vue +3 -2
- package/edit/management.cattle.io.podsecurityadmissionconfigurationtemplate.vue +3 -2
- package/edit/namespace.vue +3 -1
- package/edit/networking.k8s.io.ingress/index.vue +3 -2
- package/edit/networking.k8s.io.networkpolicy/index.vue +2 -2
- package/edit/node.vue +3 -3
- package/edit/persistentvolume/__tests__/persistentvolume.test.ts +9 -4
- package/edit/persistentvolume/index.vue +3 -3
- package/edit/persistentvolumeclaim.vue +3 -3
- package/edit/policy.poddisruptionbudget.vue +3 -3
- package/edit/provisioning.cattle.io.cluster/__tests__/Basics.test.ts +5 -6
- package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +13 -6
- package/edit/provisioning.cattle.io.cluster/rke2.vue +7 -1
- package/edit/provisioning.cattle.io.cluster/tabs/registries/__tests__/RegistryConfigs.test.ts +6 -7
- package/edit/provisioning.cattle.io.cluster/tabs/registries/index.vue +30 -32
- package/edit/resources.cattle.io.backup.vue +95 -97
- package/edit/resources.cattle.io.restore.vue +96 -98
- package/edit/service.vue +12 -4
- package/edit/serviceaccount.vue +3 -3
- package/edit/storage.k8s.io.storageclass/index.vue +3 -3
- package/edit/workload/Job.vue +2 -2
- package/edit/workload/__tests__/Job.test.ts +5 -5
- package/edit/workload/__tests__/index.test.ts +9 -7
- package/edit/workload/index.vue +17 -11
- package/edit/workload/storage/Mount.vue +7 -4
- package/edit/workload/storage/__tests__/Mount.test.ts +6 -2
- package/edit/workload/storage/index.vue +10 -23
- package/initialize/entry-helpers.js +0 -5
- package/initialize/install-plugins.js +2 -2
- package/mixins/fetch.client.js +2 -1
- package/mixins/page-actions.js +1 -1
- package/package.json +3 -3
- package/pages/auth/login.vue +2 -1
- package/pages/c/_cluster/auth/user.retention/index.vue +1 -1
- package/pages/c/_cluster/istio/index.vue +2 -2
- package/pages/c/_cluster/longhorn/__tests__/longhorn.index.test.ts +3 -2
- package/pages/c/_cluster/monitoring/index.vue +1 -1
- package/pages/c/_cluster/uiplugins/AddExtensionRepos.vue +34 -36
- package/pages/c/_cluster/uiplugins/__tests__/AddExtensionRepos.test.ts +7 -29
- package/pages/index.vue +10 -2
- package/plugins/i18n.js +1 -1
- package/promptRemove/management.cattle.io.roletemplate.vue +3 -5
- package/rancher-components/LabeledTooltip/LabeledTooltip.vue +4 -32
- package/store/type-map.js +3 -2
- package/vue.config.js +409 -391
- package/composables/useStore.ts +0 -16
- package/plugins/clean-html-directive.js +0 -10
- package/plugins/clean-tooltip-directive.js +0 -9
- package/plugins/int-number.js +0 -9
- package/plugins/positive-int-number.js +0 -9
- package/plugins/trim-whitespace.js +0 -10
|
@@ -587,75 +587,74 @@ export default {
|
|
|
587
587
|
</template>
|
|
588
588
|
</template>
|
|
589
589
|
<template #controlsContainer="{showPrevious, next, back, activeStep, canNext, activeStepIndex, visibleSteps}">
|
|
590
|
-
<
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
590
|
+
<CruResourceFooter
|
|
591
|
+
class="cru__footer"
|
|
592
|
+
:mode="mode"
|
|
593
|
+
:is-form="showAsForm"
|
|
594
|
+
:show-cancel="showCancel"
|
|
595
|
+
@cancel-confirmed="confirmCancel"
|
|
596
|
+
>
|
|
597
|
+
<!-- Pass down templates provided by the caller -->
|
|
598
|
+
<template
|
|
599
|
+
v-for="(_, slot) of $slots"
|
|
600
|
+
#[slot]="scope"
|
|
601
|
+
:key="slot"
|
|
597
602
|
>
|
|
598
|
-
|
|
603
|
+
<template v-if="shouldProvideSlot(slot)">
|
|
604
|
+
<slot
|
|
605
|
+
:name="slot"
|
|
606
|
+
v-bind="scope"
|
|
607
|
+
/>
|
|
608
|
+
</template>
|
|
609
|
+
</template>
|
|
610
|
+
<div class="controls-steps">
|
|
611
|
+
<button
|
|
612
|
+
v-if="showYaml"
|
|
613
|
+
type="button"
|
|
614
|
+
class="btn role-secondary"
|
|
615
|
+
@click="showPreviewYaml"
|
|
616
|
+
>
|
|
617
|
+
<t k="cruResource.previewYaml" />
|
|
618
|
+
</button>
|
|
599
619
|
<template
|
|
600
|
-
v-
|
|
601
|
-
|
|
620
|
+
v-if="showPrevious"
|
|
621
|
+
name="back"
|
|
602
622
|
>
|
|
603
|
-
<template v-if="shouldProvideSlot(slot)">
|
|
604
|
-
<slot
|
|
605
|
-
:name="slot"
|
|
606
|
-
v-bind="{ ...$slots[slot]() }"
|
|
607
|
-
/>
|
|
608
|
-
</template>
|
|
609
|
-
</template>
|
|
610
|
-
<div class="controls-steps">
|
|
611
623
|
<button
|
|
612
|
-
v-if="showYaml"
|
|
613
624
|
type="button"
|
|
614
625
|
class="btn role-secondary"
|
|
615
|
-
@click="
|
|
626
|
+
@click="back()"
|
|
616
627
|
>
|
|
617
|
-
<t k="
|
|
628
|
+
<t k="wizard.previous" />
|
|
618
629
|
</button>
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
/>
|
|
642
|
-
</template>
|
|
643
|
-
<template
|
|
644
|
-
v-else
|
|
645
|
-
name="next"
|
|
630
|
+
</template>
|
|
631
|
+
<template
|
|
632
|
+
v-if="activeStepIndex === visibleSteps.length-1"
|
|
633
|
+
name="finish"
|
|
634
|
+
>
|
|
635
|
+
<AsyncButton
|
|
636
|
+
v-if="!showSubtypeSelection && !isView"
|
|
637
|
+
ref="save"
|
|
638
|
+
:disabled="!activeStep.ready"
|
|
639
|
+
:mode="finishButtonMode || mode"
|
|
640
|
+
@click="$emit('finish', $event)"
|
|
641
|
+
/>
|
|
642
|
+
</template>
|
|
643
|
+
<template
|
|
644
|
+
v-else
|
|
645
|
+
name="next"
|
|
646
|
+
>
|
|
647
|
+
<button
|
|
648
|
+
:disabled="!canNext"
|
|
649
|
+
type="button"
|
|
650
|
+
class="btn role-primary"
|
|
651
|
+
@click="next()"
|
|
646
652
|
>
|
|
647
|
-
<
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
>
|
|
653
|
-
<t k="wizard.next" />
|
|
654
|
-
</button>
|
|
655
|
-
</template>
|
|
656
|
-
</div>
|
|
657
|
-
</CruResourceFooter>
|
|
658
|
-
</template>
|
|
653
|
+
<t k="wizard.next" />
|
|
654
|
+
</button>
|
|
655
|
+
</template>
|
|
656
|
+
</div>
|
|
657
|
+
</CruResourceFooter>
|
|
659
658
|
</template>
|
|
660
659
|
</Wizard>
|
|
661
660
|
</div>
|
|
@@ -681,12 +680,13 @@ export default {
|
|
|
681
680
|
<!-- Pass down templates provided by the caller -->
|
|
682
681
|
<template
|
|
683
682
|
v-for="(_, slot) of $slots"
|
|
683
|
+
#[slot]="scope"
|
|
684
684
|
:key="slot"
|
|
685
685
|
>
|
|
686
686
|
<template v-if="shouldProvideSlot(slot)">
|
|
687
687
|
<slot
|
|
688
688
|
:name="slot"
|
|
689
|
-
v-bind="
|
|
689
|
+
v-bind="scope"
|
|
690
690
|
/>
|
|
691
691
|
</template>
|
|
692
692
|
</template>
|
package/components/Import.vue
CHANGED
|
@@ -1,28 +1,9 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import {
|
|
2
|
+
import { h, computed } from 'vue';
|
|
3
3
|
import { _VIEW } from '@shell/config/query-params';
|
|
4
|
-
const vueApp = createApp({});
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
if (this.isView) {
|
|
9
|
-
return h('div',
|
|
10
|
-
{ attrs: { class: 'label' } },
|
|
11
|
-
[
|
|
12
|
-
h('div',
|
|
13
|
-
{ attrs: { class: 'text-label' } },
|
|
14
|
-
this.$slots.name ? this.$slots.name : this.name
|
|
15
|
-
),
|
|
16
|
-
h('div',
|
|
17
|
-
{ attrs: { class: 'value' } },
|
|
18
|
-
this.$slots.value ? this.$slots.value : this.displayValue
|
|
19
|
-
)
|
|
20
|
-
]
|
|
21
|
-
);
|
|
22
|
-
} else {
|
|
23
|
-
return this.$slots.default;
|
|
24
|
-
}
|
|
25
|
-
},
|
|
5
|
+
export default {
|
|
6
|
+
name: 'InputOrDisplay',
|
|
26
7
|
props: {
|
|
27
8
|
name: {
|
|
28
9
|
type: String,
|
|
@@ -37,22 +18,29 @@ const component = vueApp.component('InputOrDisplay', {
|
|
|
37
18
|
default: 'edit'
|
|
38
19
|
}
|
|
39
20
|
},
|
|
40
|
-
|
|
41
|
-
isView()
|
|
42
|
-
return this.mode === _VIEW;
|
|
43
|
-
},
|
|
21
|
+
setup(props, { slots }) {
|
|
22
|
+
const isView = computed(() => props.mode === _VIEW);
|
|
44
23
|
|
|
45
|
-
displayValue() {
|
|
46
|
-
if (Array.isArray(
|
|
24
|
+
const displayValue = computed(() => {
|
|
25
|
+
if (Array.isArray(props.value) && props.value.length === 0) {
|
|
47
26
|
return '';
|
|
48
27
|
} else {
|
|
49
|
-
return
|
|
28
|
+
return props.value;
|
|
50
29
|
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
});
|
|
30
|
+
});
|
|
54
31
|
|
|
55
|
-
|
|
32
|
+
return () => {
|
|
33
|
+
if (isView.value) {
|
|
34
|
+
return h('div', { class: 'label' }, [
|
|
35
|
+
h('div', { class: 'text-label' }, slots.name ? slots.name : props.name),
|
|
36
|
+
h('div', { class: 'value' }, slots.value ? slots.value : displayValue.value)
|
|
37
|
+
]);
|
|
38
|
+
} else {
|
|
39
|
+
return slots.default;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
};
|
|
56
44
|
</script>
|
|
57
45
|
|
|
58
46
|
<style lang="scss" scoped>
|
|
@@ -52,9 +52,11 @@ export default {
|
|
|
52
52
|
<div v-if="mode === 'login'">
|
|
53
53
|
<div v-if="showLocale">
|
|
54
54
|
<v-dropdown
|
|
55
|
-
|
|
55
|
+
popperClass="localeSelector"
|
|
56
56
|
placement="top"
|
|
57
|
-
|
|
57
|
+
distance="8"
|
|
58
|
+
skidding="12"
|
|
59
|
+
:triggers="['click']"
|
|
58
60
|
>
|
|
59
61
|
<a
|
|
60
62
|
data-testid="locale-selector"
|
|
@@ -63,7 +65,7 @@ export default {
|
|
|
63
65
|
{{ selectedLocaleLabel }}
|
|
64
66
|
<i class="icon icon-fw icon-sort-down" />
|
|
65
67
|
</a>
|
|
66
|
-
<template #
|
|
68
|
+
<template #popper>
|
|
67
69
|
<ul
|
|
68
70
|
class="list-unstyled dropdown"
|
|
69
71
|
style="margin: -1px;"
|
|
@@ -3,7 +3,7 @@ import { mount } from '@vue/test-utils';
|
|
|
3
3
|
import { _EDIT } from '@shell/config/query-params';
|
|
4
4
|
import defaults from './utils/questions-defaults';
|
|
5
5
|
|
|
6
|
-
describe
|
|
6
|
+
describe('the Boolean Component', () => {
|
|
7
7
|
it('input field is present', () => {
|
|
8
8
|
const wrapper = mount(Questions, {
|
|
9
9
|
props: {
|
|
@@ -25,7 +25,6 @@ describe.skip('(Vue3 Skip) the Boolean Component', () => {
|
|
|
25
25
|
|
|
26
26
|
const inputFields = wrapper.findAll('[data-testid="boolean-input-var_name"] input[type=checkbox]');
|
|
27
27
|
|
|
28
|
-
// TODO: UNIT TEST - Default stubs give us a tab stub, rendering no input fields
|
|
29
28
|
expect(inputFields).toHaveLength(1);
|
|
30
29
|
|
|
31
30
|
const descriptionFields = wrapper.findAll('[data-testid="boolean-description-var_name"]');
|
|
@@ -3,7 +3,7 @@ import { mount } from '@vue/test-utils';
|
|
|
3
3
|
import { _EDIT } from '@shell/config/query-params';
|
|
4
4
|
import defaults from './utils/questions-defaults';
|
|
5
5
|
|
|
6
|
-
describe
|
|
6
|
+
describe('the float Component', () => {
|
|
7
7
|
it('input field is present', () => {
|
|
8
8
|
const wrapper = mount(Questions, {
|
|
9
9
|
props: {
|
|
@@ -25,7 +25,6 @@ describe.skip('(Vue3 Skip) the float Component', () => {
|
|
|
25
25
|
|
|
26
26
|
const inputFields = wrapper.findAll('[data-testid="float-input-var_name"]');
|
|
27
27
|
|
|
28
|
-
// TODO: UNIT TEST - Default stubs give us a tab stub, rendering no input fields
|
|
29
28
|
expect(inputFields).toHaveLength(1);
|
|
30
29
|
|
|
31
30
|
const descriptionFields = wrapper.findAll('[data-testid="float-description-var_name"]');
|
|
@@ -3,7 +3,7 @@ import { mount } from '@vue/test-utils';
|
|
|
3
3
|
import { _EDIT } from '@shell/config/query-params';
|
|
4
4
|
import defaults from './utils/questions-defaults';
|
|
5
5
|
|
|
6
|
-
describe
|
|
6
|
+
describe('the Int Component', () => {
|
|
7
7
|
it('input field is present', () => {
|
|
8
8
|
const wrapper = mount(Questions, {
|
|
9
9
|
props: {
|
|
@@ -25,7 +25,6 @@ describe.skip('(Vue3 Skip) the Int Component', () => {
|
|
|
25
25
|
|
|
26
26
|
const inputFields = wrapper.findAll('[data-testid="int-input-var_name"]');
|
|
27
27
|
|
|
28
|
-
// TODO: UNIT TEST - Default stubs give us a tab stub, rendering no input fields
|
|
29
28
|
expect(inputFields).toHaveLength(1);
|
|
30
29
|
|
|
31
30
|
const descriptionFields = wrapper.findAll('[data-testid="int-description-var_name"]');
|
|
@@ -3,7 +3,7 @@ import { mount } from '@vue/test-utils';
|
|
|
3
3
|
import { _EDIT } from '@shell/config/query-params';
|
|
4
4
|
import defaults from './utils/questions-defaults';
|
|
5
5
|
|
|
6
|
-
describe
|
|
6
|
+
describe('the String Component', () => {
|
|
7
7
|
it('input field is present', () => {
|
|
8
8
|
const wrapper = mount(Questions, {
|
|
9
9
|
props: {
|
|
@@ -25,7 +25,6 @@ describe.skip('(Vue3 Skip) the String Component', () => {
|
|
|
25
25
|
|
|
26
26
|
const inputFields = wrapper.findAll('[data-testid="string-input-var_name"]');
|
|
27
27
|
|
|
28
|
-
// TODO: UNIT TEST - Default stubs give us a tab stub, rendering no input fields
|
|
29
28
|
expect(inputFields).toHaveLength(1);
|
|
30
29
|
|
|
31
30
|
const descriptionFields = wrapper.findAll('[data-testid="string-description-var_name"]');
|
|
@@ -3,7 +3,7 @@ import { mount } from '@vue/test-utils';
|
|
|
3
3
|
import { _EDIT } from '@shell/config/query-params';
|
|
4
4
|
import defaults from './utils/questions-defaults';
|
|
5
5
|
|
|
6
|
-
describe
|
|
6
|
+
describe('the yaml Component', () => {
|
|
7
7
|
it('input field is present', () => {
|
|
8
8
|
const wrapper = mount(Questions, {
|
|
9
9
|
props: {
|
package/components/SideNav.vue
CHANGED
|
@@ -439,9 +439,9 @@ export default {
|
|
|
439
439
|
<!-- locale selector -->
|
|
440
440
|
<span v-if="isSingleProduct">
|
|
441
441
|
<v-dropdown
|
|
442
|
-
|
|
442
|
+
popperClass="localeSelector"
|
|
443
443
|
placement="top"
|
|
444
|
-
|
|
444
|
+
:triggers="['click']"
|
|
445
445
|
>
|
|
446
446
|
<a
|
|
447
447
|
data-testid="locale-selector"
|
|
@@ -450,7 +450,7 @@ export default {
|
|
|
450
450
|
{{ locale }}
|
|
451
451
|
</a>
|
|
452
452
|
|
|
453
|
-
<template #
|
|
453
|
+
<template #popper>
|
|
454
454
|
<ul
|
|
455
455
|
class="list-unstyled dropdown"
|
|
456
456
|
style="margin: -1px;"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { mapGetters } from 'vuex';
|
|
3
|
+
import { defineAsyncComponent } from 'vue';
|
|
3
4
|
import day from 'dayjs';
|
|
4
5
|
import isEmpty from 'lodash/isEmpty';
|
|
5
6
|
import { dasherize, ucFirst } from '@shell/utils/string';
|
|
@@ -682,7 +683,7 @@ export default {
|
|
|
682
683
|
const pluginFormatter = this.$plugin?.getDynamic('formatters', c.formatter);
|
|
683
684
|
|
|
684
685
|
if (pluginFormatter) {
|
|
685
|
-
component = pluginFormatter;
|
|
686
|
+
component = defineAsyncComponent(pluginFormatter);
|
|
686
687
|
needRef = true;
|
|
687
688
|
}
|
|
688
689
|
}
|
package/components/Wizard.vue
CHANGED
|
@@ -4,6 +4,7 @@ import AsyncButton from '@shell/components/AsyncButton';
|
|
|
4
4
|
import { Banner } from '@components/Banner';
|
|
5
5
|
import Loading from '@shell/components/Loading';
|
|
6
6
|
import { stringify } from '@shell/utils/error';
|
|
7
|
+
import LazyImage from '@shell/components/LazyImage';
|
|
7
8
|
|
|
8
9
|
/*
|
|
9
10
|
Wizard accepts an array of steps (see props), and creates named slots for each step.
|
|
@@ -26,6 +27,7 @@ export default {
|
|
|
26
27
|
AsyncButton,
|
|
27
28
|
Banner,
|
|
28
29
|
Loading,
|
|
30
|
+
LazyImage,
|
|
29
31
|
},
|
|
30
32
|
|
|
31
33
|
props: {
|
|
@@ -1,96 +1,93 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
//
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
describe.skip('(Vue3 Skip) it must have one test', () => {
|
|
93
|
-
it('will pass', () => {
|
|
94
|
-
expect(true).toBe(true);
|
|
1
|
+
import { nextTick } from 'vue';
|
|
2
|
+
import { shallowMount, Wrapper } from '@vue/test-utils';
|
|
3
|
+
import CodeMirror from '@shell/components/CodeMirror.vue';
|
|
4
|
+
import { _EDIT, _YAML } from '@shell/config/query-params';
|
|
5
|
+
|
|
6
|
+
// eslint-disable-next-line jest/no-disabled-tests
|
|
7
|
+
describe('component: CodeMirror.vue', () => {
|
|
8
|
+
let wrapper: Wrapper<InstanceType<typeof CodeMirror>>;
|
|
9
|
+
|
|
10
|
+
const options = {
|
|
11
|
+
readOnly: false,
|
|
12
|
+
gutters: [
|
|
13
|
+
'CodeMirror-lint-markers',
|
|
14
|
+
'CodeMirror-foldgutter'
|
|
15
|
+
],
|
|
16
|
+
mode: 'yaml',
|
|
17
|
+
lint: true,
|
|
18
|
+
lineNumbers: true,
|
|
19
|
+
styleActiveLine: true,
|
|
20
|
+
tabSize: 2,
|
|
21
|
+
indentWithTabs: false,
|
|
22
|
+
cursorBlinkRate: 530,
|
|
23
|
+
extraKeys: { 'Ctrl-Space': 'autocomplete' }
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const mountOptions = {
|
|
27
|
+
propsData: {
|
|
28
|
+
value: '',
|
|
29
|
+
mode: _EDIT,
|
|
30
|
+
options,
|
|
31
|
+
asTextArea: false,
|
|
32
|
+
showKeyMapBox: true,
|
|
33
|
+
},
|
|
34
|
+
global: {
|
|
35
|
+
mocks: {
|
|
36
|
+
$store: {
|
|
37
|
+
getters: {
|
|
38
|
+
currentStore: () => 'current_store',
|
|
39
|
+
'current_store/schemaFor': jest.fn(),
|
|
40
|
+
'current_store/all': jest.fn(),
|
|
41
|
+
'i18n/t': () => 'Vim',
|
|
42
|
+
'prefs/get': () => 'Vim',
|
|
43
|
+
'prefs/theme': jest.fn(),
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
$route: { query: { AS: _YAML } },
|
|
47
|
+
$router: { applyQuery: jest.fn() },
|
|
48
|
+
},
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
// eslint-disable-next-line jest/no-disabled-tests
|
|
54
|
+
describe('keyMap info', () => {
|
|
55
|
+
(window as any).__codeMirrorLoader = () => new Promise((resolve) => {
|
|
56
|
+
resolve(true);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
wrapper = shallowMount(
|
|
60
|
+
CodeMirror,
|
|
61
|
+
mountOptions,
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
it(`should show keyMap preference`, async() => {
|
|
65
|
+
await nextTick();
|
|
66
|
+
|
|
67
|
+
const keyMapBox = wrapper.find('[data-testid="code-mirror-keymap"] .keymap-indicator');
|
|
68
|
+
|
|
69
|
+
const closeIcon = wrapper.find('[data-testid="code-mirror-keymap"] .icon-close');
|
|
70
|
+
|
|
71
|
+
expect(keyMapBox).toBeDefined();
|
|
72
|
+
expect(closeIcon).toBeDefined();
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
it(`should remove keyMap box`, async() => {
|
|
76
|
+
await nextTick();
|
|
77
|
+
|
|
78
|
+
let keyMapBox = wrapper.find('[data-testid="code-mirror-keymap"]');
|
|
79
|
+
|
|
80
|
+
keyMapBox.trigger('mouseenter');
|
|
81
|
+
await nextTick();
|
|
82
|
+
|
|
83
|
+
const closeIcon = keyMapBox.find('.icon-close');
|
|
84
|
+
|
|
85
|
+
closeIcon.element.click();
|
|
86
|
+
await nextTick();
|
|
87
|
+
|
|
88
|
+
keyMapBox = wrapper.find('[data-testid="code-mirror-keymap"]');
|
|
89
|
+
|
|
90
|
+
expect(keyMapBox.exists()).toBe(false);
|
|
91
|
+
});
|
|
95
92
|
});
|
|
96
93
|
});
|
|
@@ -3,7 +3,7 @@ import ConsumptionGauge from '@shell/components/ConsumptionGauge.vue';
|
|
|
3
3
|
import PercentageBar from '@shell/components/PercentageBar.vue';
|
|
4
4
|
|
|
5
5
|
describe('component: ConsumptionGauge', () => {
|
|
6
|
-
it
|
|
6
|
+
it('should render component with the correct data applied', () => {
|
|
7
7
|
const colorStops = {
|
|
8
8
|
0: '--success', 30: '--warning', 70: '--error'
|
|
9
9
|
};
|
|
@@ -36,7 +36,7 @@ describe('component: ConsumptionGauge', () => {
|
|
|
36
36
|
|
|
37
37
|
// checking PercentageBar component render
|
|
38
38
|
expect(percentageBar.exists()).toBe(true);
|
|
39
|
-
expect(
|
|
39
|
+
expect(percentageBar.props().modelValue).toBe(20);
|
|
40
40
|
expect(percentageBar.props().colorStops).toStrictEqual(colorStops);
|
|
41
41
|
});
|
|
42
42
|
|