@rancher/shell 3.0.2-rc.5 → 3.0.2
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/providers/nutanix.svg +12 -1
- package/assets/styles/base/_basic.scss +2 -1
- package/assets/styles/base/_helpers.scss +4 -0
- package/assets/styles/base/_variables.scss +2 -0
- package/assets/styles/global/_labeled-input.scss +5 -13
- package/assets/styles/global/_layout.scss +4 -1
- package/assets/styles/global/_select.scss +5 -0
- package/assets/styles/themes/_dark.scss +1 -3
- package/assets/styles/themes/_light.scss +5 -1
- package/assets/translations/en-us.yaml +130 -23
- package/assets/translations/zh-hans.yaml +0 -3
- package/cloud-credential/azure.vue +1 -1
- package/components/ActionMenuShell.vue +105 -0
- package/components/AppModal.vue +2 -2
- package/components/AsyncButton.vue +2 -0
- package/components/ButtonGroup.vue +9 -2
- package/components/ClusterBadge.vue +1 -0
- package/components/ClusterIconMenu.vue +3 -0
- package/components/ClusterProviderIcon.vue +14 -1
- package/components/CodeMirror.vue +96 -5
- package/components/Collapse.vue +16 -3
- package/components/CruResource.vue +9 -0
- package/components/CruResourceFooter.vue +1 -1
- package/components/ExplorerMembers.vue +2 -1
- package/components/FixedBanner.vue +19 -12
- package/components/Import.vue +14 -1
- package/components/LandingPagePreference.vue +4 -2
- package/components/PodSecurityAdmission.vue +8 -6
- package/components/PromptChangePassword.vue +1 -0
- package/components/PromptRemove.vue +23 -21
- package/components/ResourceDetail/Masthead.vue +30 -11
- package/components/ResourceDetail/__tests__/Masthead.test.ts +61 -0
- package/components/ResourceDetail/index.vue +6 -0
- package/components/ResourceTable.vue +6 -1
- package/components/ResourceYaml.vue +1 -0
- package/components/Setting.vue +115 -0
- package/components/SortableTable/THead.vue +2 -0
- package/components/SortableTable/index.vue +7 -12
- package/components/StatusBadge.vue +71 -0
- package/components/Tabbed/index.vue +16 -15
- package/components/Wizard.vue +108 -104
- package/components/YamlEditor.vue +12 -2
- package/components/__tests__/Collapse.test.ts +2 -2
- package/components/__tests__/FixedBanner.test.ts +3 -3
- package/components/auth/Principal.vue +29 -17
- package/components/auth/__tests__/Principal.test.ts +40 -0
- package/components/auth/login/ldap.vue +7 -0
- package/components/fleet/FleetBundles.vue +1 -1
- package/components/fleet/FleetRepos.vue +1 -1
- package/components/fleet/FleetResources.vue +0 -2
- package/components/fleet/FleetSummary.vue +60 -65
- package/components/fleet/ForceDirectedTreeChart/index.vue +5 -1
- package/components/fleet/__tests__/FleetSummary.test.ts +49 -9
- package/components/form/ArrayList.vue +6 -2
- package/components/form/ColorInput.vue +1 -0
- package/components/form/KeyValue.vue +11 -12
- package/components/form/LabeledSelect.vue +15 -3
- package/components/form/Labels.vue +8 -1
- package/components/form/Members/MembershipEditor.vue +230 -222
- package/components/form/Members/__tests__/MembershipEditor.test.ts +62 -0
- package/components/form/Password.vue +3 -0
- package/components/form/ProjectMemberEditor.vue +6 -3
- package/components/form/ResourceTabs/index.vue +15 -13
- package/components/form/SSHKnownHosts/KnownHostsEditDialog.vue +5 -4
- package/components/form/SchedulingCustomization.vue +85 -0
- package/components/form/Select.vue +3 -2
- package/components/form/SelectOrCreateAuthSecret.vue +2 -1
- package/components/form/UnitInput.vue +3 -4
- package/components/form/__tests__/ArrayList.test.ts +9 -6
- package/components/form/__tests__/LabeledSelect.test.ts +37 -0
- package/components/form/__tests__/SelectOrCreateAuthSecret.test.ts +34 -0
- package/components/form/__tests__/UnitInput.test.ts +4 -5
- package/components/formatter/LiveDate.vue +3 -1
- package/components/formatter/ServiceType.vue +12 -4
- package/components/formatter/WorkloadHealthScale.vue +2 -1
- package/components/nav/Header.vue +35 -2
- package/components/nav/HeaderPageActionMenu.vue +11 -40
- package/components/nav/Jump.vue +8 -2
- package/components/nav/NamespaceFilter.vue +5 -4
- package/components/nav/Pinned.vue +1 -1
- package/components/nav/TopLevelMenu.helper.ts +5 -5
- package/components/nav/TopLevelMenu.vue +1 -12
- package/components/nav/WindowManager/ContainerLogs.vue +96 -58
- package/components/nav/WindowManager/ContainerShell.vue +99 -18
- package/components/nav/WindowManager/index.vue +74 -6
- package/components/nav/__tests__/TopLevelMenu.test.ts +0 -40
- package/components/templates/default.vue +2 -47
- package/config/features.js +1 -0
- package/config/labels-annotations.js +11 -1
- package/config/router/navigation-guards/index.js +2 -1
- package/config/router/navigation-guards/record-last-route.js +24 -0
- package/config/settings.ts +66 -98
- package/config/version.js +1 -1
- package/core/types-provisioning.ts +7 -0
- package/detail/fleet.cattle.io.bundle.vue +7 -0
- package/detail/fleet.cattle.io.cluster.vue +0 -3
- package/detail/fleet.cattle.io.gitrepo.vue +8 -15
- package/detail/provisioning.cattle.io.cluster.vue +8 -2
- package/dialog/DeactivateDriverDialog.vue +5 -5
- package/dialog/GitRepoForceUpdateDialog.vue +132 -0
- package/directives/strip-html-aria-label.js +19 -0
- package/edit/__tests__/cis.cattle.io.clusterscan.test.ts +87 -0
- package/edit/__tests__/fleet.cattle.io.gitrepo.test.ts +217 -37
- package/edit/auth/__tests__/oidc.test.ts +60 -12
- package/edit/auth/ldap/__tests__/config.test.ts +40 -0
- package/edit/auth/ldap/config.vue +67 -89
- package/edit/auth/oidc.vue +16 -2
- package/edit/catalog.cattle.io.clusterrepo.vue +12 -8
- package/edit/cis.cattle.io.clusterscan.vue +13 -1
- package/edit/fleet.cattle.io.gitrepo.vue +198 -72
- package/edit/logging-flow/Match.vue +0 -21
- package/edit/management.cattle.io.project.vue +1 -1
- package/edit/monitoring.coreos.com.prometheusrule/AlertingRule.vue +10 -3
- package/edit/monitoring.coreos.com.prometheusrule/RecordingRule.vue +5 -1
- package/edit/monitoring.coreos.com.prometheusrule/index.vue +5 -2
- package/edit/provisioning.cattle.io.cluster/CustomCommand.vue +8 -1
- package/edit/provisioning.cattle.io.cluster/SelectCredential.vue +2 -0
- package/edit/provisioning.cattle.io.cluster/__tests__/Advanced.test.ts +0 -2
- package/edit/provisioning.cattle.io.cluster/__tests__/CustomCommand.test.ts +55 -15
- package/edit/provisioning.cattle.io.cluster/index.vue +28 -30
- package/edit/provisioning.cattle.io.cluster/rke2.vue +64 -13
- package/edit/provisioning.cattle.io.cluster/tabs/AgentConfiguration.vue +37 -2
- package/edit/provisioning.cattle.io.cluster/tabs/etcd/index.vue +3 -2
- package/edit/resources.cattle.io.backup.vue +150 -15
- package/edit/secret/__tests__/ssh.test.ts +79 -0
- package/edit/secret/ssh.vue +7 -1
- package/edit/service.vue +0 -3
- package/edit/workload/Job.vue +8 -8
- package/edit/workload/__tests__/Job.test.ts +0 -1
- package/edit/workload/index.vue +3 -1
- package/initialize/install-directives.js +2 -0
- package/initialize/install-plugins.js +6 -1
- package/list/catalog.cattle.io.app.vue +21 -4
- package/list/fleet.cattle.io.bundle.vue +1 -1
- package/list/management.cattle.io.setting.vue +34 -132
- package/list/provisioning.cattle.io.cluster.vue +11 -3
- package/machine-config/vmwarevsphere.vue +15 -8
- package/mixins/__tests__/auth-config.test.ts +74 -0
- package/mixins/__tests__/chart.test.ts +5 -4
- package/mixins/__tests__/create-edit-view.test.ts +38 -0
- package/mixins/auth-config.js +8 -0
- package/mixins/chart.js +2 -2
- package/mixins/create-edit-view/impl.js +4 -1
- package/mixins/vue-select-overrides.js +10 -0
- package/models/__tests__/catalog.cattle.io.app.test.ts +148 -0
- package/models/__tests__/fleet.cattle.io.gitrepo.test.ts +157 -0
- package/models/__tests__/secret.test.ts +56 -13
- package/models/catalog.cattle.io.app.js +112 -37
- package/models/cluster.js +11 -0
- package/models/fleet.cattle.io.bundle.js +40 -2
- package/models/fleet.cattle.io.gitrepo.js +169 -109
- package/models/management.cattle.io.fleetworkspace.js +4 -0
- package/models/management.cattle.io.kontainerdriver.js +7 -0
- package/models/nodedriver.js +4 -1
- package/models/provisioning.cattle.io.cluster.js +24 -0
- package/models/secret.js +1 -1
- package/package.json +5 -5
- package/pages/auth/login.vue +5 -11
- package/pages/auth/verify.vue +11 -1
- package/pages/c/_cluster/apps/charts/index.vue +6 -4
- package/pages/c/_cluster/apps/charts/install.vue +1 -1
- package/pages/c/_cluster/explorer/ConfigBadge.vue +3 -5
- package/pages/c/_cluster/explorer/EventsTable.vue +3 -2
- package/pages/c/_cluster/explorer/__tests__/index.test.ts +9 -9
- package/pages/c/_cluster/explorer/index.vue +33 -35
- package/pages/c/_cluster/explorer/tools/index.vue +3 -3
- package/pages/c/_cluster/fleet/index.vue +0 -5
- package/pages/c/_cluster/legacy/project/index.vue +1 -1
- package/pages/c/_cluster/settings/performance.vue +52 -53
- package/pages/c/_cluster/uiplugins/index.vue +19 -22
- package/pages/home.vue +17 -12
- package/pages/prefs.vue +5 -1
- package/plugins/shortkey.js +10 -1
- package/plugins/steve/steve-pagination-utils.ts +58 -8
- package/promptRemove/management.cattle.io.fleetworkspace.vue +98 -0
- package/promptRemove/management.cattle.io.globalrole.vue +1 -1
- package/promptRemove/management.cattle.io.project.vue +2 -8
- package/promptRemove/management.cattle.io.roletemplate.vue +1 -1
- package/promptRemove/mixin/roleDeletionCheck.js +1 -7
- package/promptRemove/pod.vue +7 -28
- package/rancher-components/Card/Card.vue +9 -1
- package/rancher-components/Form/Checkbox/Checkbox.vue +42 -6
- package/rancher-components/Form/LabeledInput/LabeledInput.vue +30 -3
- package/rancher-components/Form/Radio/RadioButton.vue +18 -3
- package/rancher-components/Form/Radio/RadioGroup.vue +39 -5
- package/rancher-components/LabeledTooltip/LabeledTooltip.vue +13 -1
- package/rancher-components/RcButton/RcButton.test.ts +97 -0
- package/rancher-components/RcButton/RcButton.vue +14 -9
- package/rancher-components/RcDropdown/RcDropdown.vue +3 -1
- package/rancher-components/RcDropdown/RcDropdownItem.vue +8 -2
- package/rancher-components/RcDropdown/RcDropdownMenu.vue +66 -0
- package/rancher-components/RcDropdown/index.ts +1 -0
- package/rancher-components/RcDropdown/types.ts +27 -0
- package/rancher-components/RcDropdown/useDropdownContext.ts +5 -2
- package/scripts/extension/helm/charts/ui-plugin-server/templates/_helpers.tpl +2 -2
- package/scripts/typegen.sh +1 -0
- package/store/__tests__/auth.test.ts +120 -0
- package/store/action-menu.js +13 -3
- package/store/auth.js +14 -9
- package/store/aws.js +9 -2
- package/store/catalog.js +14 -7
- package/store/features.js +1 -0
- package/store/prefs.js +9 -28
- package/store/type-map.utils.ts +4 -0
- package/types/resources/settings.d.ts +27 -20
- package/types/shell/index.d.ts +18 -12
- package/utils/__tests__/array.test.ts +13 -1
- package/utils/__tests__/string.test.ts +80 -1
- package/utils/array.ts +13 -0
- package/utils/auth.js +4 -0
- package/utils/banners.js +0 -45
- package/utils/cluster.js +1 -1
- package/{edit/monitoring.coreos.com.prometheusrule → utils}/duration.js +5 -3
- package/utils/object.js +0 -3
- package/utils/pagination-utils.ts +15 -2
- package/utils/string.js +31 -7
- package/utils/validators/formRules/__tests__/index.test.ts +27 -0
- package/utils/validators/formRules/index.ts +16 -0
- package/edit/provisioning.cattle.io.cluster/import.vue +0 -198
|
@@ -2,57 +2,47 @@
|
|
|
2
2
|
import { STATES, STATES_ENUM } from '@shell/plugins/dashboard-store/resource-class';
|
|
3
3
|
import FleetStatus from '@shell/components/fleet/FleetStatus';
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
return
|
|
7
|
-
|
|
5
|
+
const getResourcesDefaultState = (labelGetter, stateKey) => {
|
|
6
|
+
return [
|
|
7
|
+
STATES_ENUM.READY,
|
|
8
|
+
STATES_ENUM.NOT_READY,
|
|
9
|
+
STATES_ENUM.WAIT_APPLIED,
|
|
10
|
+
STATES_ENUM.MODIFIED,
|
|
11
|
+
STATES_ENUM.MISSING,
|
|
12
|
+
STATES_ENUM.ORPHANED,
|
|
13
|
+
STATES_ENUM.UNKNOWN,
|
|
14
|
+
].reduce((acc, state) => {
|
|
15
|
+
acc[state] = {
|
|
8
16
|
count: 0,
|
|
9
|
-
color: STATES[
|
|
10
|
-
label: labelGetter(`${ stateKey }.${
|
|
11
|
-
status:
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
error: {
|
|
32
|
-
count: 0,
|
|
33
|
-
color: STATES[STATES_ENUM.ERROR].color,
|
|
34
|
-
label: labelGetter(`${ stateKey }.${ STATES_ENUM.ERROR }`, null, STATES[STATES_ENUM.ERROR].label ),
|
|
35
|
-
status: STATES_ENUM.ERROR
|
|
36
|
-
},
|
|
37
|
-
errapplied: {
|
|
38
|
-
count: 0,
|
|
39
|
-
color: STATES[STATES_ENUM.ERR_APPLIED].color,
|
|
40
|
-
label: labelGetter(`${ stateKey }.${ STATES_ENUM.ERR_APPLIED }`, null, STATES[STATES_ENUM.ERR_APPLIED].label ),
|
|
41
|
-
status: STATES_ENUM.ERR_APPLIED,
|
|
42
|
-
},
|
|
43
|
-
waitapplied: {
|
|
44
|
-
count: 0,
|
|
45
|
-
color: STATES[STATES_ENUM.WAIT_APPLIED].color,
|
|
46
|
-
label: labelGetter(`${ stateKey }.${ STATES_ENUM.WAIT_APPLIED }`, null, STATES[STATES_ENUM.WAIT_APPLIED].label ),
|
|
47
|
-
status: STATES_ENUM.WAIT_APPLIED
|
|
48
|
-
},
|
|
49
|
-
unknown: {
|
|
17
|
+
color: STATES[state].color,
|
|
18
|
+
label: labelGetter(`${ stateKey }.${ state }`, null, STATES[state].label ),
|
|
19
|
+
status: state
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
return acc;
|
|
23
|
+
}, {});
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const getBundlesDefaultState = (labelGetter, stateKey) => {
|
|
27
|
+
return [
|
|
28
|
+
STATES_ENUM.READY,
|
|
29
|
+
STATES_ENUM.INFO,
|
|
30
|
+
STATES_ENUM.WARNING,
|
|
31
|
+
STATES_ENUM.NOT_READY,
|
|
32
|
+
STATES_ENUM.ERROR,
|
|
33
|
+
STATES_ENUM.ERR_APPLIED,
|
|
34
|
+
STATES_ENUM.WAIT_APPLIED,
|
|
35
|
+
STATES_ENUM.UNKNOWN,
|
|
36
|
+
].reduce((acc, state) => {
|
|
37
|
+
acc[state] = {
|
|
50
38
|
count: 0,
|
|
51
|
-
color: STATES[
|
|
52
|
-
label: labelGetter(`${ stateKey }.${
|
|
53
|
-
status:
|
|
54
|
-
}
|
|
55
|
-
|
|
39
|
+
color: STATES[state].color,
|
|
40
|
+
label: labelGetter(`${ stateKey }.${ state }`, null, STATES[state].label ),
|
|
41
|
+
status: state
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
return acc;
|
|
45
|
+
}, {});
|
|
56
46
|
};
|
|
57
47
|
|
|
58
48
|
export default {
|
|
@@ -83,14 +73,18 @@ export default {
|
|
|
83
73
|
return this.value.metadata.name;
|
|
84
74
|
},
|
|
85
75
|
|
|
76
|
+
repoNamespace() {
|
|
77
|
+
return this.value.metadata.namespace;
|
|
78
|
+
},
|
|
79
|
+
|
|
86
80
|
bundleCounts() {
|
|
87
|
-
const resources = this.bundles.filter((item) => item.repoName === this.repoName);
|
|
81
|
+
const resources = this.bundles.filter((item) => item.namespace === this.repoNamespace && item.repoName === this.repoName);
|
|
88
82
|
|
|
89
83
|
if (!resources.length) {
|
|
90
84
|
return [];
|
|
91
85
|
}
|
|
92
86
|
|
|
93
|
-
const out = { ...
|
|
87
|
+
const out = { ...getBundlesDefaultState(this.$store.getters['i18n/withFallback'], this.stateKey) };
|
|
94
88
|
|
|
95
89
|
resources.forEach(({ status, metadata }) => {
|
|
96
90
|
if (!status) {
|
|
@@ -99,7 +93,7 @@ export default {
|
|
|
99
93
|
return;
|
|
100
94
|
}
|
|
101
95
|
|
|
102
|
-
const k = status?.summary
|
|
96
|
+
const k = status?.summary?.ready > 0 && status?.summary.desiredReady === status?.summary?.ready;
|
|
103
97
|
|
|
104
98
|
if (k) {
|
|
105
99
|
out.ready.count += 1;
|
|
@@ -155,19 +149,20 @@ export default {
|
|
|
155
149
|
},
|
|
156
150
|
|
|
157
151
|
resourceCounts() {
|
|
158
|
-
const
|
|
159
|
-
const
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
152
|
+
const out = { ...getResourcesDefaultState(this.$store.getters['i18n/withFallback'], this.stateKey) };
|
|
153
|
+
const resourceStatuses = this.value.allResourceStatuses;
|
|
154
|
+
|
|
155
|
+
Object.entries(resourceStatuses.states)
|
|
156
|
+
.filter(([_, count]) => count > 0)
|
|
157
|
+
.forEach(([state, count]) => {
|
|
158
|
+
const k = state?.toLowerCase();
|
|
159
|
+
|
|
160
|
+
if (out[k]) {
|
|
161
|
+
out[k].count += count;
|
|
162
|
+
} else {
|
|
163
|
+
out.unknown.count += count;
|
|
164
|
+
}
|
|
165
|
+
});
|
|
171
166
|
|
|
172
167
|
return Object.values(out).map((item) => {
|
|
173
168
|
item.value = item.count;
|
|
@@ -238,8 +238,12 @@ export default {
|
|
|
238
238
|
},
|
|
239
239
|
zoomFit() {
|
|
240
240
|
const rootNode = d3.select('.root-node');
|
|
241
|
-
const paddingBuffer = 30;
|
|
242
241
|
|
|
242
|
+
if (!rootNode?.node()) {
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
const paddingBuffer = 30;
|
|
243
247
|
const chartDimentions = rootNode.node().getBoundingClientRect();
|
|
244
248
|
const chartCoordinates = rootNode.node().getBBox();
|
|
245
249
|
const parent = rootNode.node().parentElement;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { mount } from '@vue/test-utils';
|
|
2
|
+
import GitRepo from '@shell/models/fleet.cattle.io.gitrepo';
|
|
2
3
|
import FleetSummary from '@shell/components/fleet/FleetSummary.vue';
|
|
3
4
|
|
|
4
5
|
const REPO_NAME = 'testrepo';
|
|
@@ -13,12 +14,12 @@ const mockedBundlesInRepo = [{
|
|
|
13
14
|
apiVersion: 'fleet.cattle.io/v1alpha1',
|
|
14
15
|
kind: 'Bundle',
|
|
15
16
|
repoName: REPO_NAME,
|
|
17
|
+
namespace: 'fleet-default',
|
|
16
18
|
metadata: {
|
|
17
19
|
labels: {
|
|
18
20
|
'fleet.cattle.io/commit': '3640888439d1b7b6a53dbeee291a533eea2632ab',
|
|
19
21
|
'fleet.cattle.io/repo-name': REPO_NAME
|
|
20
22
|
},
|
|
21
|
-
|
|
22
23
|
name: `${ REPO_NAME }-${ CLUSTER_NAME }-1234`,
|
|
23
24
|
namespace: 'fleet-default',
|
|
24
25
|
state: {
|
|
@@ -53,12 +54,12 @@ const mockedBundlesInRepo = [{
|
|
|
53
54
|
apiVersion: 'fleet.cattle.io/v1alpha1',
|
|
54
55
|
kind: 'Bundle',
|
|
55
56
|
repoName: REPO_NAME,
|
|
57
|
+
namespace: 'fleet-default',
|
|
56
58
|
metadata: {
|
|
57
59
|
labels: {
|
|
58
60
|
'fleet.cattle.io/commit': '3640888439d1b7b6a53dbeee291a533eea2632ab',
|
|
59
61
|
'fleet.cattle.io/repo-name': REPO_NAME
|
|
60
62
|
},
|
|
61
|
-
|
|
62
63
|
name: `${ REPO_NAME }-${ CLUSTER_NAME }-5678`,
|
|
63
64
|
namespace: 'fleet-default',
|
|
64
65
|
state: {
|
|
@@ -94,14 +95,54 @@ const mockedBundlesOutOfRepo = [{
|
|
|
94
95
|
apiVersion: 'fleet.cattle.io/v1alpha1',
|
|
95
96
|
kind: 'Bundle',
|
|
96
97
|
repoName: REPO_NAME_VARIANT,
|
|
98
|
+
namespace: 'custom-namespace',
|
|
97
99
|
metadata: {
|
|
98
100
|
labels: {
|
|
99
101
|
'fleet.cattle.io/commit': '3640888439d1b7b6a53dbeee291a533eea2632ab',
|
|
100
102
|
'fleet.cattle.io/repo-name': REPO_NAME_VARIANT
|
|
101
103
|
},
|
|
102
|
-
|
|
103
104
|
name: `${ REPO_NAME_VARIANT }-${ CLUSTER_NAME }-1234`,
|
|
104
|
-
namespace: '
|
|
105
|
+
namespace: 'custom-namespace',
|
|
106
|
+
state: {
|
|
107
|
+
error: false,
|
|
108
|
+
message: 'Resource is Ready',
|
|
109
|
+
name: 'active',
|
|
110
|
+
transitioning: false
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
spec: {
|
|
114
|
+
correctDrift: { },
|
|
115
|
+
forceSyncGeneration: 2,
|
|
116
|
+
ignore: { },
|
|
117
|
+
namespace: 'custom-namespace-name',
|
|
118
|
+
resources: [
|
|
119
|
+
{
|
|
120
|
+
content: 'apiVersion: v1\nkind: ConfigMap\nmetadata:\n name: configmap-test\n annotations:\n {}\n# key: string\n labels:\n {}\n# key: string\ndata:\n key1: val1\n key2: val2\n key3: val3',
|
|
121
|
+
name: 'test-configmap.yaml'
|
|
122
|
+
}
|
|
123
|
+
],
|
|
124
|
+
targets: [
|
|
125
|
+
{
|
|
126
|
+
clusterName: 'nb-cluster0-28',
|
|
127
|
+
namespace: 'custom-namespace-name'
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
id: `fleet-default/${ REPO_NAME }-${ CLUSTER_NAME }-1234`,
|
|
134
|
+
type: 'fleet.cattle.io.bundle',
|
|
135
|
+
apiVersion: 'fleet.cattle.io/v1alpha1',
|
|
136
|
+
kind: 'Bundle',
|
|
137
|
+
repoName: REPO_NAME,
|
|
138
|
+
namespace: 'custom-namespace',
|
|
139
|
+
metadata: {
|
|
140
|
+
labels: {
|
|
141
|
+
'fleet.cattle.io/commit': '3640888439d1b7b6a53dbeee291a533eea2632ab',
|
|
142
|
+
'fleet.cattle.io/repo-name': REPO_NAME
|
|
143
|
+
},
|
|
144
|
+
name: `${ REPO_NAME }-${ CLUSTER_NAME }-1234`,
|
|
145
|
+
namespace: 'custom-namespace',
|
|
105
146
|
state: {
|
|
106
147
|
error: false,
|
|
107
148
|
message: 'Resource is Ready',
|
|
@@ -134,14 +175,14 @@ const mockedBundlesOutOfRepo = [{
|
|
|
134
175
|
apiVersion: 'fleet.cattle.io/v1alpha1',
|
|
135
176
|
kind: 'Bundle',
|
|
136
177
|
repoName: REPO_NAME_VARIANT,
|
|
178
|
+
namespace: 'custom-namespace',
|
|
137
179
|
metadata: {
|
|
138
180
|
labels: {
|
|
139
181
|
'fleet.cattle.io/commit': '3640888439d1b7b6a53dbeee291a533eea2632ab',
|
|
140
182
|
'fleet.cattle.io/repo-name': REPO_NAME_VARIANT
|
|
141
183
|
},
|
|
142
|
-
|
|
143
184
|
name: `${ REPO_NAME_VARIANT }-${ CLUSTER_NAME }-5678`,
|
|
144
|
-
namespace: '
|
|
185
|
+
namespace: 'custom-namespace',
|
|
145
186
|
state: {
|
|
146
187
|
error: false,
|
|
147
188
|
message: 'Resource is Ready',
|
|
@@ -175,7 +216,6 @@ const mockRepo = {
|
|
|
175
216
|
apiVersion: 'fleet.cattle.io/v1alpha1',
|
|
176
217
|
kind: 'GitRepo',
|
|
177
218
|
metadata: {
|
|
178
|
-
|
|
179
219
|
name: `${ REPO_NAME }`,
|
|
180
220
|
namespace: 'fleet-default',
|
|
181
221
|
state: {
|
|
@@ -296,7 +336,7 @@ describe('component: FleetSummary', () => {
|
|
|
296
336
|
[mockedBundlesInRepo, '2'],
|
|
297
337
|
])('displays the number of bundles associated with the current gitrepo', (bundles: any[], bundleCount: string) => {
|
|
298
338
|
const wrapper = mount(FleetSummary, {
|
|
299
|
-
props: { bundles, value: mockRepo },
|
|
339
|
+
props: { bundles, value: new GitRepo(mockRepo) },
|
|
300
340
|
global: { mocks: { $store: mockStore } }
|
|
301
341
|
});
|
|
302
342
|
|
|
@@ -311,7 +351,7 @@ describe('component: FleetSummary', () => {
|
|
|
311
351
|
|
|
312
352
|
])('displays the number of deployments associated with the current gitrepo', (bundles: any[], bundleCount: string) => {
|
|
313
353
|
const wrapper = mount(FleetSummary, {
|
|
314
|
-
props: { bundles, value: mockRepo },
|
|
354
|
+
props: { bundles, value: new GitRepo(mockRepo) },
|
|
315
355
|
global: { mocks: { $store: mockStore } }
|
|
316
356
|
});
|
|
317
357
|
|
|
@@ -48,6 +48,10 @@ export default {
|
|
|
48
48
|
type: Boolean,
|
|
49
49
|
default: false,
|
|
50
50
|
},
|
|
51
|
+
addIcon: {
|
|
52
|
+
type: String,
|
|
53
|
+
default: '',
|
|
54
|
+
},
|
|
51
55
|
addLabel: {
|
|
52
56
|
type: String,
|
|
53
57
|
default: '',
|
|
@@ -367,8 +371,8 @@ export default {
|
|
|
367
371
|
@click="add()"
|
|
368
372
|
>
|
|
369
373
|
<i
|
|
370
|
-
|
|
371
|
-
class="
|
|
374
|
+
class="mr-5 icon"
|
|
375
|
+
:class="loading ? ['icon-lg', 'icon-spinner','icon-spin']: [addIcon]"
|
|
372
376
|
/>
|
|
373
377
|
{{ _addLabel }}
|
|
374
378
|
</button>
|
|
@@ -97,6 +97,7 @@ export default {
|
|
|
97
97
|
:class="{[mode]:mode, disabled: isDisabled}"
|
|
98
98
|
:data-testid="componentTestid + '-color-input'"
|
|
99
99
|
:tabindex="isDisabled ? -1 : 0"
|
|
100
|
+
@keydown.space.prevent
|
|
100
101
|
@keyup.enter.space.stop="handleKeyup($event)"
|
|
101
102
|
>
|
|
102
103
|
<label class="text-label"><t
|
|
@@ -182,7 +182,7 @@ export default {
|
|
|
182
182
|
},
|
|
183
183
|
addIcon: {
|
|
184
184
|
type: String,
|
|
185
|
-
default: '
|
|
185
|
+
default: '',
|
|
186
186
|
},
|
|
187
187
|
addAllowed: {
|
|
188
188
|
type: Boolean,
|
|
@@ -295,12 +295,6 @@ export default {
|
|
|
295
295
|
*/
|
|
296
296
|
canRemove() {
|
|
297
297
|
return !this.isView && this.removeAllowed;
|
|
298
|
-
},
|
|
299
|
-
/**
|
|
300
|
-
* Filter rows based on toggler, keeping to still emit all the values
|
|
301
|
-
*/
|
|
302
|
-
filteredRows() {
|
|
303
|
-
return this.rows.filter((row) => !(this.isProtected(row.key) && !this.toggleFilter));
|
|
304
298
|
}
|
|
305
299
|
},
|
|
306
300
|
created() {
|
|
@@ -618,8 +612,10 @@ export default {
|
|
|
618
612
|
{{ _keyLabel }}
|
|
619
613
|
<i
|
|
620
614
|
v-if="_protip && !isView && addAllowed"
|
|
621
|
-
v-clean-tooltip="_protip"
|
|
615
|
+
v-clean-tooltip="{content: _protip, triggers: ['hover', 'touch', 'focus'] }"
|
|
616
|
+
v-stripped-aria-label="_protip"
|
|
622
617
|
class="icon icon-info"
|
|
618
|
+
tabindex="0"
|
|
623
619
|
/>
|
|
624
620
|
</label>
|
|
625
621
|
<label
|
|
@@ -663,11 +659,14 @@ export default {
|
|
|
663
659
|
</div>
|
|
664
660
|
</template>
|
|
665
661
|
<template
|
|
666
|
-
v-for="(row,i) in
|
|
662
|
+
v-for="(row,i) in rows"
|
|
667
663
|
v-else
|
|
668
664
|
:key="i"
|
|
669
665
|
>
|
|
670
|
-
<div
|
|
666
|
+
<div
|
|
667
|
+
class="rowgroup"
|
|
668
|
+
:class="{'hide': isProtected(row.key) && !toggleFilter}"
|
|
669
|
+
>
|
|
671
670
|
<div class="row">
|
|
672
671
|
<!-- Key -->
|
|
673
672
|
<div
|
|
@@ -855,8 +854,8 @@ export default {
|
|
|
855
854
|
@click="add()"
|
|
856
855
|
>
|
|
857
856
|
<i
|
|
858
|
-
|
|
859
|
-
class="
|
|
857
|
+
class="mr-5 icon"
|
|
858
|
+
:class="loading ? ['icon-lg', 'icon-spinner','icon-spin']: [addIcon]"
|
|
860
859
|
/> {{ _addLabel }}
|
|
861
860
|
</button>
|
|
862
861
|
<FileSelector
|
|
@@ -5,6 +5,7 @@ import { get } from '@shell/utils/object';
|
|
|
5
5
|
import { LabeledTooltip } from '@components/LabeledTooltip';
|
|
6
6
|
import VueSelectOverrides from '@shell/mixins/vue-select-overrides';
|
|
7
7
|
import { onClickOption, calculatePosition } from '@shell/utils/select';
|
|
8
|
+
import { generateRandomAlphaString } from '@shell/utils/string';
|
|
8
9
|
import LabeledSelectPagination from '@shell/components/form/labeled-select-utils/labeled-select-pagination';
|
|
9
10
|
import { LABEL_SELECT_NOT_OPTION_KINDS } from '@shell/types/components/labeledSelect';
|
|
10
11
|
import { mapGetters } from 'vuex';
|
|
@@ -116,7 +117,8 @@ export default {
|
|
|
116
117
|
data() {
|
|
117
118
|
return {
|
|
118
119
|
selectedVisibility: 'visible',
|
|
119
|
-
shouldOpen: true
|
|
120
|
+
shouldOpen: true,
|
|
121
|
+
uid: generateRandomAlphaString(10)
|
|
120
122
|
};
|
|
121
123
|
},
|
|
122
124
|
|
|
@@ -154,6 +156,10 @@ export default {
|
|
|
154
156
|
methods: {
|
|
155
157
|
// resizeHandler = in mixin
|
|
156
158
|
focusSearch() {
|
|
159
|
+
if (this.isView || this.disabled || this.loading) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
|
|
157
163
|
// we need this override as in a "closeOnSelect" type of component
|
|
158
164
|
// if we don't have this override, it would open again
|
|
159
165
|
if (this.overridesMixinPreventDoubleTriggerKeysOpen) {
|
|
@@ -291,14 +297,18 @@ export default {
|
|
|
291
297
|
]"
|
|
292
298
|
:tabindex="isView || disabled ? -1 : 0"
|
|
293
299
|
@click="focusSearch"
|
|
294
|
-
@keydown.enter
|
|
300
|
+
@keydown.enter="focusSearch"
|
|
301
|
+
@keydown.down.prevent="focusSearch"
|
|
295
302
|
@keydown.space.prevent="focusSearch"
|
|
296
303
|
>
|
|
297
304
|
<div
|
|
298
305
|
:class="{ 'labeled-container': true, raised, empty, [mode]: true }"
|
|
299
306
|
:style="{ border: 'none' }"
|
|
300
307
|
>
|
|
301
|
-
<label
|
|
308
|
+
<label
|
|
309
|
+
v-if="hasLabel"
|
|
310
|
+
:id="`labeled-select-uid-${uid}`"
|
|
311
|
+
>
|
|
302
312
|
<t
|
|
303
313
|
v-if="labelKey"
|
|
304
314
|
:k="labelKey"
|
|
@@ -313,6 +323,7 @@ export default {
|
|
|
313
323
|
</div>
|
|
314
324
|
<v-select
|
|
315
325
|
ref="select-input"
|
|
326
|
+
:aria-labelledby="hasLabel ? `labeled-select-uid-${uid}` : ''"
|
|
316
327
|
v-bind="filteredAttrs"
|
|
317
328
|
class="inline"
|
|
318
329
|
:append-to-body="appendToBody"
|
|
@@ -333,6 +344,7 @@ export default {
|
|
|
333
344
|
:modelValue="value != null && !loading ? value : ''"
|
|
334
345
|
:dropdown-should-open="dropdownShouldOpen"
|
|
335
346
|
:tabindex="-1"
|
|
347
|
+
role="listbox"
|
|
336
348
|
@update:modelValue="$emit('selecting', $event); $emit('update:value', $event)"
|
|
337
349
|
@search:blur="onBlur"
|
|
338
350
|
@search:focus="onFocus"
|
|
@@ -52,7 +52,12 @@ export default {
|
|
|
52
52
|
showLabelTitle: {
|
|
53
53
|
type: Boolean,
|
|
54
54
|
default: true,
|
|
55
|
-
}
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
addIcon: {
|
|
58
|
+
type: String,
|
|
59
|
+
default: '',
|
|
60
|
+
},
|
|
56
61
|
},
|
|
57
62
|
|
|
58
63
|
data() {
|
|
@@ -103,6 +108,7 @@ export default {
|
|
|
103
108
|
:protected-keys="value.systemLabels || []"
|
|
104
109
|
:toggle-filter="toggler"
|
|
105
110
|
:add-label="t('labels.addLabel')"
|
|
111
|
+
:add-icon="addIcon"
|
|
106
112
|
:mode="mode"
|
|
107
113
|
:read-allowed="false"
|
|
108
114
|
:value-can-be-empty="true"
|
|
@@ -121,6 +127,7 @@ export default {
|
|
|
121
127
|
key="annotations"
|
|
122
128
|
:value="value.annotations"
|
|
123
129
|
:add-label="t('labels.addAnnotation')"
|
|
130
|
+
:add-icon="addIcon"
|
|
124
131
|
:mode="mode"
|
|
125
132
|
:protected-keys="value.systemAnnotations || []"
|
|
126
133
|
:toggle-filter="toggler"
|