@rancher/shell 0.3.28 → 0.4.0

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.
Files changed (72) hide show
  1. package/.DS_Store +0 -0
  2. package/assets/translations/en-us.yaml +16 -2
  3. package/assets/translations/zh-hans.yaml +1 -1
  4. package/chart/monitoring/grafana/index.vue +2 -2
  5. package/components/AsyncButton.vue +9 -0
  6. package/components/CopyCode.vue +6 -2
  7. package/components/CopyToClipboard.vue +2 -1
  8. package/components/CopyToClipboardText.vue +14 -9
  9. package/components/EtcdInfoBanner.vue +4 -4
  10. package/components/Markdown.vue +16 -12
  11. package/components/ResourceDetail/Masthead.vue +9 -6
  12. package/components/SortableTable/THead.vue +7 -9
  13. package/components/SortableTable/index.vue +1 -2
  14. package/components/StatusTable.vue +5 -1
  15. package/components/__tests__/CopyCode.test.ts +5 -4
  16. package/components/fleet/FleetBundles.vue +5 -11
  17. package/components/fleet/FleetStatus.vue +3 -3
  18. package/components/fleet/FleetSummary.vue +35 -30
  19. package/components/fleet/__tests__/FleetSummary.test.ts +316 -0
  20. package/components/form/Password.vue +3 -1
  21. package/components/nav/Header.vue +1 -1
  22. package/config/home-links.js +1 -1
  23. package/core/plugin-helpers.js +3 -5
  24. package/creators/app/files/.gitlab-ci.yml +14 -0
  25. package/creators/app/init +19 -0
  26. package/detail/provisioning.cattle.io.cluster.vue +2 -1
  27. package/edit/monitoring.coreos.com.prometheusrule/AlertingRule.vue +12 -3
  28. package/edit/monitoring.coreos.com.prometheusrule/GroupRules.vue +2 -1
  29. package/edit/provisioning.cattle.io.cluster/__tests__/CustomCommand.tests.ts +3 -1
  30. package/edit/workload/Upgrading.vue +3 -2
  31. package/edit/workload/index.vue +2 -1
  32. package/edit/workload/storage/persistentVolumeClaim/persistentvolumeclaim.vue +2 -1
  33. package/initialize/index.js +24 -5
  34. package/machine-config/__tests__/vmwarevsphere.test.ts +72 -0
  35. package/machine-config/vmwarevsphere.vue +68 -13
  36. package/models/__tests__/management.cattle.io.cluster.test.ts +4 -0
  37. package/models/management.cattle.io.cluster.js +7 -3
  38. package/models/provisioning.cattle.io.cluster.js +19 -1
  39. package/package.json +3 -2
  40. package/pages/c/_cluster/apps/charts/index.vue +64 -43
  41. package/plugins/clean-html-directive.js +1 -19
  42. package/plugins/clean-html.js +53 -0
  43. package/plugins/clean-tooltip-directive.js +1 -1
  44. package/plugins/index.js +11 -0
  45. package/rancher-components/BadgeState/BadgeState.vue +5 -1
  46. package/rancher-components/Banner/Banner.test.ts +51 -1
  47. package/rancher-components/Banner/Banner.vue +134 -53
  48. package/rancher-components/Card/Card.test.ts +37 -0
  49. package/rancher-components/Card/Card.vue +24 -7
  50. package/rancher-components/Form/Checkbox/Checkbox.test.ts +20 -29
  51. package/rancher-components/Form/Checkbox/Checkbox.vue +45 -20
  52. package/rancher-components/Form/LabeledInput/LabeledInput.test.ts +2 -8
  53. package/rancher-components/Form/LabeledInput/LabeledInput.vue +22 -10
  54. package/rancher-components/Form/Radio/RadioButton.test.ts +31 -0
  55. package/rancher-components/Form/Radio/RadioButton.vue +30 -13
  56. package/rancher-components/Form/Radio/RadioGroup.vue +26 -7
  57. package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +7 -6
  58. package/rancher-components/Form/ToggleSwitch/ToggleSwitch.test.ts +25 -38
  59. package/rancher-components/Form/ToggleSwitch/ToggleSwitch.vue +23 -11
  60. package/rancher-components/LabeledTooltip/LabeledTooltip.vue +19 -5
  61. package/rancher-components/StringList/StringList.test.ts +453 -49
  62. package/rancher-components/StringList/StringList.vue +92 -58
  63. package/scripts/.DS_Store +0 -0
  64. package/scripts/extension/bundle +19 -7
  65. package/scripts/extension/helm/scripts/package +11 -3
  66. package/scripts/extension/publish +20 -9
  67. package/scripts/verdaccio.log +205 -0
  68. package/store/index.js +3 -4
  69. package/types/shell/index.d.ts +15 -9
  70. package/utils/clipboard.js +5 -0
  71. package/yarn-error.log +200 -0
  72. package/plugins/vue-clipboard2.js +0 -4
package/.DS_Store ADDED
Binary file
@@ -691,6 +691,15 @@ asyncButton:
691
691
  successIcon: checkmark
692
692
  waiting: ''
693
693
  waitingIcon: refresh
694
+ manual-refresh:
695
+ action: ''
696
+ actionIcon: refresh
697
+ error: ''
698
+ errorIcon: error
699
+ success: ''
700
+ successIcon: checkmark
701
+ waiting: ''
702
+ waitingIcon: refresh
694
703
  remove:
695
704
  action: Remove
696
705
  success: Removed
@@ -865,7 +874,7 @@ catalog:
865
874
  versionWindowsIncompatible: Linux only version
866
875
  header: Charts
867
876
  featuredCharts: Featured Charts
868
- noCharts: 'There are no charts available, have you added any repos?'
877
+ noCharts: 'There are no charts available, have you added any repos or set filters?'
869
878
  noWindows: Your repos do not contain any charts capable of being deployed on a cluster with Windows nodes.
870
879
  noWindowsAndLinux: Your repos do not contain any charts capable of being deployed on a cluster with both Windows and Linux worker nodes.
871
880
  operatingSystems:
@@ -1525,6 +1534,9 @@ cluster:
1525
1534
  host:
1526
1535
  label: Host
1527
1536
  note: Specific host to create VM on (leave blank for standalone ESXi or for cluster with DRS)
1537
+ gracefulShutdownTimeout:
1538
+ label: Graceful Shutdown Timeout
1539
+ note: The time in seconds to wait before forcing deleting VMs in the infrastructure. Zero means disable graceful shutdown.
1528
1540
  instanceOptions:
1529
1541
  label: Instance Options
1530
1542
  description: Choose the size and OS of the virtual machine
@@ -5858,7 +5870,9 @@ workload:
5858
5870
  exec: Command run inside the container exits with status 0
5859
5871
  image: Container Image
5860
5872
  imagePullPolicy: Pull Policy
5861
- imagePullSecrets: Pull Secrets
5873
+ imagePullSecrets:
5874
+ label: Pull Secrets
5875
+ tooltip: Must be of Type `kubernetes.io/dockercfg` or `kubernetes.io/dockerconfigjson`
5862
5876
  init: Init Container
5863
5877
  lifecycleHook:
5864
5878
  postStart:
@@ -2080,7 +2080,7 @@ drainNode:
2080
2080
  etcdInfoBanner:
2081
2081
  hasLeader: "ETCD 有一个 Leader:"
2082
2082
  leaderChanges: "Leader 变化的次数:"
2083
- failedProposals: "失败的 proposal 数量"
2083
+ failedProposals: "失败的 proposal 数量:"
2084
2084
 
2085
2085
  fleet:
2086
2086
  dashboard:
@@ -136,7 +136,7 @@ export default {
136
136
  newValsOut = {
137
137
  accessModes: null,
138
138
  storageClassName: null,
139
- size: null,
139
+ size: '10Gi',
140
140
  subPath: null,
141
141
  type: 'pvc',
142
142
  annotations: null,
@@ -148,7 +148,7 @@ export default {
148
148
  newValsOut = {
149
149
  accessModes: null,
150
150
  storageClassName: null,
151
- size: null,
151
+ size: '10Gi',
152
152
  subPath: null,
153
153
  type: 'statefulset',
154
154
  enabled: true,
@@ -273,6 +273,7 @@ export default Vue.extend<{ phase: string}, any, any, any>({
273
273
  :data-testid="componentTestid + '-async-button'"
274
274
  @click="clicked"
275
275
  >
276
+ <span v-if="mode === 'manual-refresh'">{{ t('action.refresh') }}</span>
276
277
  <i
277
278
  v-if="displayIcon"
278
279
  v-clean-tooltip="tooltip"
@@ -285,3 +286,11 @@ export default Vue.extend<{ phase: string}, any, any, any>({
285
286
  />
286
287
  </button>
287
288
  </template>
289
+
290
+ <style lang="scss" scoped>
291
+ // refresh mode has icon + text. We need to fix the positioning of the icon and sizing
292
+ .manual-refresh i {
293
+ margin: 0 0 0 8px !important;
294
+ font-size: 1rem !important;
295
+ }
296
+ </style>
@@ -1,5 +1,7 @@
1
1
  <script>
2
2
  import { isArray } from '@shell/utils/array';
3
+ import { copyTextToClipboard } from '@shell/utils/clipboard';
4
+ import { exceptionToErrorsArray } from '@shell/utils/error';
3
5
 
4
6
  function flatten(node) {
5
7
  if ( node.text ) {
@@ -27,14 +29,16 @@ export default {
27
29
 
28
30
  const content = flatten(this.$slots.default).trim();
29
31
 
30
- this.$copyText(content).then(() => {
32
+ copyTextToClipboard(content).then(() => {
31
33
  this.copied = true;
32
34
 
33
35
  setTimeout(() => {
34
36
  this.copied = false;
35
37
  }, 2000);
38
+ this.$emit('copied');
39
+ }).catch((e) => {
40
+ this.$emit('error', exceptionToErrorsArray(e));
36
41
  });
37
- this.$emit('copied');
38
42
  },
39
43
  },
40
44
 
@@ -1,5 +1,6 @@
1
1
  <script>
2
2
  import AsyncButton from '@shell/components/AsyncButton';
3
+ import { copyTextToClipboard } from '@shell/utils/clipboard';
3
4
 
4
5
  export default {
5
6
  components: { AsyncButton },
@@ -18,7 +19,7 @@ export default {
18
19
 
19
20
  methods: {
20
21
  clicked(buttonCb) {
21
- this.$copyText(this.text).then(() => {
22
+ copyTextToClipboard(this.text).then(() => {
22
23
  buttonCb(true);
23
24
  }).catch(() => {
24
25
  buttonCb(false);
@@ -1,4 +1,6 @@
1
1
  <script>
2
+ import { copyTextToClipboard } from '@shell/utils/clipboard';
3
+ import { exceptionToErrorsArray } from '@shell/utils/error';
2
4
  export default {
3
5
  props: {
4
6
  text: {
@@ -20,17 +22,20 @@ export default {
20
22
  clicked(event) {
21
23
  if (!this.copied) {
22
24
  event.preventDefault();
23
- this.$copyText(this.text);
24
- this.copied = true;
25
+ copyTextToClipboard(this.text).then(() => {
26
+ this.copied = true;
25
27
 
26
- let t = event.target;
28
+ let t = event.target;
27
29
 
28
- if (t.tagName === 'I') {
29
- t = t.parentElement || t;
30
- }
31
- setTimeout(() => {
32
- this.copied = false;
33
- }, 500);
30
+ if (t.tagName === 'I') {
31
+ t = t.parentElement || t;
32
+ }
33
+ setTimeout(() => {
34
+ this.copied = false;
35
+ }, 500);
36
+ }).catch((e) => {
37
+ this.$emit('error', exceptionToErrorsArray(e));
38
+ });
34
39
  }
35
40
  },
36
41
  }
@@ -23,13 +23,13 @@ export default {
23
23
 
24
24
  const leader = await hasLeader(monitoringVersion, this.$store.dispatch, this.currentCluster.id);
25
25
 
26
- this.hasLeader = leader ? this.t('generic.yes') : this.t('generic.no');
26
+ this.hasLeader = leader ? 'Yes' : 'No';
27
27
  this.leaderChanges = await leaderChanges(monitoringVersion, this.$store.dispatch, this.currentCluster.id);
28
28
  this.failedProposals = await failedProposals(monitoringVersion, this.$store.dispatch, this.currentCluster.id);
29
29
  },
30
30
  data() {
31
31
  return {
32
- hasLeader: this.t('generic.no'),
32
+ hasLeader: 'No',
33
33
  leaderChanges: 0,
34
34
  failedProposals: 0
35
35
  };
@@ -46,10 +46,10 @@ export default {
46
46
  color="info"
47
47
  >
48
48
  <div class="datum">
49
- <label>{{ t('etcdInfoBanner.hasLeader') }}</label> {{ hasLeader }}
49
+ <label>{{ t('etcdInfoBanner.hasLeader') }}</label> {{ hasLeader }},
50
50
  </div>
51
51
  <div class="datum">
52
- <label>{{ t('etcdInfoBanner.leaderChanges') }}</label> {{ leaderChanges }}
52
+ <label>{{ t('etcdInfoBanner.leaderChanges') }}</label> {{ leaderChanges }},
53
53
  </div>
54
54
  <div class="datum">
55
55
  <label>{{ t('etcdInfoBanner.failedProposals') }}</label> {{ failedProposals }}
@@ -13,9 +13,8 @@ export default {
13
13
 
14
14
  data() {
15
15
  return {
16
- loaded: false,
17
- marked: null,
18
- dompurify: null,
16
+ loaded: false,
17
+ marked: null,
19
18
  };
20
19
  },
21
20
 
@@ -26,15 +25,10 @@ export default {
26
25
  breaks: true
27
26
  });
28
27
  },
29
-
30
- sanitized() {
31
- return this.dompurify.sanitize(this.html);
32
- },
33
28
  },
34
29
 
35
30
  async mounted() {
36
31
  const marked = (await import(/* webpackChunkName: "markdown" */ 'marked'));
37
- const dompurify = (await import(/* webpackChunkName: "markdown" */ 'dompurify')).default;
38
32
 
39
33
  const renderer = new marked.Renderer();
40
34
  const linkRenderer = renderer.link;
@@ -63,11 +57,8 @@ export default {
63
57
  return rendered;
64
58
  };
65
59
 
66
- dompurify.setConfig({ ADD_ATTR: ['target'] });
67
-
68
60
  this.marked = marked;
69
61
  this.markedRenderer = renderer;
70
- this.dompurify = dompurify;
71
62
  this.loaded = true;
72
63
  this.$emit('loaded', true);
73
64
  }
@@ -77,7 +68,7 @@ export default {
77
68
  <template>
78
69
  <div
79
70
  v-if="loaded"
80
- v-clean-html="sanitized"
71
+ v-clean-html="html"
81
72
  class="markdown"
82
73
  />
83
74
  <Loading v-else />
@@ -96,8 +87,20 @@ export default {
96
87
  }
97
88
 
98
89
  .markdown {
90
+ blockquote {
91
+ color: rgb(101, 109, 118);
92
+ border-left: 0.25em solid rgb(208, 215, 222);
93
+ padding: 0 1em;
94
+ margin-bottom: 16px;
95
+ }
96
+
97
+ table {
98
+ border-collapse: collapse;
99
+ }
100
+
99
101
  TH {
100
102
  text-align: left;
103
+ border: 1px solid #e3e7eb;
101
104
  }
102
105
 
103
106
  table tr th {
@@ -118,6 +121,7 @@ export default {
118
121
  text-align: left;
119
122
  margin: 0;
120
123
  padding: 6px 13px;
124
+ border: 1px solid #e3e7eb;
121
125
  }
122
126
 
123
127
  table tr th :first-child, table tr td :first-child {
@@ -177,13 +177,16 @@ export default {
177
177
 
178
178
  project() {
179
179
  if (this.isNamespace) {
180
- const id = (this.value?.metadata?.labels || {})[PROJECT];
181
- const clusterId = this.$store.getters['currentCluster'].id;
180
+ const cluster = this.$store.getters['currentCluster'];
182
181
 
183
- return this.$store.getters['management/byId'](MANAGEMENT.PROJECT, `${ clusterId }/${ id }`);
184
- } else {
185
- return null;
182
+ if (cluster) {
183
+ const id = (this.value?.metadata?.labels || {})[PROJECT];
184
+
185
+ return this.$store.getters['management/byId'](MANAGEMENT.PROJECT, `${ cluster.id }/${ id }`);
186
+ }
186
187
  }
188
+
189
+ return null;
187
190
  },
188
191
 
189
192
  banner() {
@@ -370,7 +373,7 @@ export default {
370
373
  },
371
374
 
372
375
  hideNamespaceLocation() {
373
- return this.$store.getters['currentProduct'].hideNamespaceLocation;
376
+ return this.$store.getters['currentProduct'].hideNamespaceLocation || this.value.namespaceLocation === null;
374
377
  },
375
378
  },
376
379
 
@@ -162,15 +162,13 @@ export default {
162
162
  const menu = document.querySelector('.table-options-container');
163
163
  const elem = document.querySelector('.table-options-btn');
164
164
 
165
- if (!this.tableColsMenuPosition) {
166
- this.tableColsMenuPosition = fitOnScreen(menu, ev || elem, {
167
- overlapX: true,
168
- fudgeX: 26,
169
- fudgeY: -22,
170
- positionX: CENTER,
171
- positionY: AUTO,
172
- });
173
- }
165
+ this.tableColsMenuPosition = fitOnScreen(menu, ev || elem, {
166
+ overlapX: true,
167
+ fudgeX: 326,
168
+ fudgeY: -22,
169
+ positionX: CENTER,
170
+ positionY: AUTO,
171
+ });
174
172
 
175
173
  // toggle visibility
176
174
  this.tableColsOptionsVisibility = !this.tableColsOptionsVisibility;
@@ -1026,9 +1026,8 @@ export default {
1026
1026
  <slot name="header-right" />
1027
1027
  <AsyncButton
1028
1028
  v-if="isTooManyItemsToAutoUpdate"
1029
- v-clean-tooltip="t('performance.manualRefresh.buttonTooltip')"
1030
1029
  class="manual-refresh"
1031
- mode="refresh"
1030
+ mode="manual-refresh"
1032
1031
  :current-phase="currentPhase"
1033
1032
  @click="debouncedRefreshTableData"
1034
1033
  />
@@ -3,6 +3,8 @@ import {
3
3
  LAST_UPDATED, TYPE, REASON, MESSAGE, STATUS
4
4
  } from '@shell/config/table-headers';
5
5
  import SortableTable from '@shell/components/SortableTable';
6
+ import { copyTextToClipboard } from '@shell/utils/clipboard';
7
+ import { exceptionToErrorsArray } from '@shell/utils/error';
6
8
  export default {
7
9
  components: { SortableTable },
8
10
  props: {
@@ -31,12 +33,14 @@ export default {
31
33
  $event.stopPropagation();
32
34
  $event.preventDefault();
33
35
 
34
- this.$copyText(this.$slots.default[0].text).then(() => {
36
+ copyTextToClipboard(this.$slots.default[0].text).then(() => {
35
37
  this.copied = true;
36
38
 
37
39
  setTimeout(() => {
38
40
  this.copied = false;
39
41
  }, 2000);
42
+ }).catch((e) => {
43
+ this.$emit('error', exceptionToErrorsArray(e));
40
44
  });
41
45
  },
42
46
  }
@@ -1,12 +1,13 @@
1
1
  import { mount } from '@vue/test-utils';
2
2
  import CopyCode from '@shell/components/CopyCode.vue';
3
3
 
4
+ jest.mock('@shell/utils/clipboard', () => {
5
+ return { copyTextToClipboard: jest.fn(() => Promise.resolve({})) };
6
+ });
7
+
4
8
  describe('component: CopyCode', () => {
5
9
  it('should emit copied after click', async() => {
6
- const wrapper = mount(CopyCode, {
7
- mocks: { $copyText: () => new Promise(() => undefined) },
8
- slots: { default: '<div></div>' }
9
- });
10
+ const wrapper = mount(CopyCode, { slots: { default: '<div></div>' } });
10
11
 
11
12
  await wrapper.find('code').trigger('click');
12
13
 
@@ -37,8 +37,8 @@ export default {
37
37
 
38
38
  computed: {
39
39
 
40
- allBundles() {
41
- // gitrepo model has getter for bundles.
40
+ allBundlesInRepo() {
41
+ // gitrepo model has getter for its bundles.
42
42
  return this.value.bundles || [];
43
43
  },
44
44
 
@@ -65,13 +65,7 @@ export default {
65
65
  bundles() {
66
66
  const harvester = this.harvesterClusters;
67
67
 
68
- return this.allBundles.filter((bundle) => {
69
- const isRepoBundle = bundle.metadata.name.startsWith(`${ this.value.metadata.name }-`);
70
-
71
- if (!isRepoBundle) {
72
- return false;
73
- }
74
-
68
+ return this.allBundlesInRepo.filter((bundle) => {
75
69
  const targets = bundle.spec?.targets || [];
76
70
 
77
71
  // Filter out any bundle that has one target whose cluster is a harvester cluster
@@ -84,7 +78,7 @@ export default {
84
78
  },
85
79
 
86
80
  hidden() {
87
- return this.allBundles.length - this.bundles.length;
81
+ return this.allBundlesInRepo.length - this.bundles.length;
88
82
  },
89
83
 
90
84
  headers() {
@@ -105,7 +99,6 @@ export default {
105
99
  return out;
106
100
  },
107
101
  },
108
-
109
102
  methods: {
110
103
  displayWarning(row) {
111
104
  return !!row.status?.summary && (row.status.summary.desiredReady !== row.status.summary.ready);
@@ -113,6 +106,7 @@ export default {
113
106
  }
114
107
  };
115
108
  </script>
109
+
116
110
  <template>
117
111
  <div>
118
112
  <Loading v-if="$fetchState.pending" />
@@ -1,7 +1,7 @@
1
1
  <script>
2
2
  import { sortBy } from '@shell/utils/sort';
3
3
  import { get } from '@shell/utils/object';
4
- import { stateSort } from '@shell/plugins/dashboard-store/resource-class';
4
+ import { stateSort, STATES_ENUM } from '@shell/plugins/dashboard-store/resource-class';
5
5
 
6
6
  export default {
7
7
 
@@ -50,8 +50,8 @@ export default {
50
50
  computed: {
51
51
  meta() {
52
52
  return {
53
- total: this.values.map((x) => x.value).reduce((a, b) => a + b),
54
- readyCount: this.values.filter((x) => x.label === 'Success' || x.label === 'Ready').map((x) => x.value).reduce((a, b) => a + b)
53
+ total: this.values.map((x) => x.value).reduce((a, b) => a + b, 0),
54
+ readyCount: this.values.filter((x) => x.status === STATES_ENUM.SUCCESS || x.status === STATES_ENUM.READY).map((x) => x.value).reduce((a, b) => a + b, 0)
55
55
  };
56
56
  },
57
57
 
@@ -1,52 +1,56 @@
1
1
  <script>
2
- import capitalize from 'lodash/capitalize';
3
2
  import { STATES, STATES_ENUM } from '@shell/plugins/dashboard-store/resource-class';
4
3
  import FleetStatus from '@shell/components/fleet/FleetStatus';
5
4
 
6
5
  const getResourceDefaultState = (labelGetter, stateKey) => {
7
6
  return {
8
7
  ready: {
9
- count: 0,
10
- color: STATES[STATES_ENUM.READY].color,
11
- label: labelGetter(`${ stateKey }.${ STATES_ENUM.READY }`, null, STATES[STATES_ENUM.READY].label )
8
+ count: 0,
9
+ color: STATES[STATES_ENUM.READY].color,
10
+ label: labelGetter(`${ stateKey }.${ STATES_ENUM.READY }`, null, STATES[STATES_ENUM.READY].label ),
11
+ status: STATES_ENUM.READY
12
12
  },
13
13
  info: {
14
- count: 0,
15
- color: STATES[STATES_ENUM.INFO].color,
16
- label: labelGetter(`${ stateKey }.${ STATES_ENUM.INFO }`, null, STATES[STATES_ENUM.INFO].label )
14
+ count: 0,
15
+ color: STATES[STATES_ENUM.INFO].color,
16
+ label: labelGetter(`${ stateKey }.${ STATES_ENUM.INFO }`, null, STATES[STATES_ENUM.INFO].label ),
17
+ status: STATES_ENUM.INFO
17
18
  },
18
19
  warning: {
19
- count: 0,
20
- color: STATES[STATES_ENUM.WARNING].color,
21
- label: labelGetter(`${ stateKey }.${ STATES_ENUM.WARNING }`, null, STATES[STATES_ENUM.WARNING].label )
20
+ count: 0,
21
+ color: STATES[STATES_ENUM.WARNING].color,
22
+ label: labelGetter(`${ stateKey }.${ STATES_ENUM.WARNING }`, null, STATES[STATES_ENUM.WARNING].label ),
23
+ status: STATES_ENUM.WARNING
22
24
  },
23
25
  notready: {
24
- count: 0,
25
- color: STATES[STATES_ENUM.NOT_READY].color,
26
- label: labelGetter(`${ stateKey }.${ STATES_ENUM.NOT_READY }`, null, STATES[STATES_ENUM.NOT_READY].label )
26
+ count: 0,
27
+ color: STATES[STATES_ENUM.NOT_READY].color,
28
+ label: labelGetter(`${ stateKey }.${ STATES_ENUM.NOT_READY }`, null, STATES[STATES_ENUM.NOT_READY].label ),
29
+ status: STATES_ENUM.NOT_READY
27
30
  },
28
31
  error: {
29
- count: 0,
30
- color: STATES[STATES_ENUM.ERROR].color,
31
- label: labelGetter(`${ stateKey }.${ STATES_ENUM.ERROR }`, null, STATES[STATES_ENUM.ERROR].label )
32
-
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
33
36
  },
34
37
  errapplied: {
35
- count: 0,
36
- color: STATES[STATES_ENUM.ERR_APPLIED].color,
37
- label: labelGetter(`${ stateKey }.${ STATES_ENUM.ERR_APPLIED }`, null, STATES[STATES_ENUM.ERR_APPLIED].label )
38
-
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,
39
42
  },
40
43
  waitapplied: {
41
- count: 0,
42
- color: STATES[STATES_ENUM.WAIT_APPLIED].color,
43
- label: labelGetter(`${ stateKey }.${ STATES_ENUM.WAIT_APPLIED }`, null, STATES[STATES_ENUM.WAIT_APPLIED].label )
44
-
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
45
48
  },
46
49
  unknown: {
47
- count: 0,
48
- color: STATES[STATES_ENUM.UNKNOWN].color,
49
- label: labelGetter(`${ stateKey }.${ STATES_ENUM.UNKNOWN }`, null, STATES[STATES_ENUM.UNKNOWN].label )
50
+ count: 0,
51
+ color: STATES[STATES_ENUM.UNKNOWN].color,
52
+ label: labelGetter(`${ stateKey }.${ STATES_ENUM.UNKNOWN }`, null, STATES[STATES_ENUM.UNKNOWN].label ),
53
+ status: STATES_ENUM.UNKNOWN
50
54
  }
51
55
  };
52
56
  };
@@ -80,7 +84,7 @@ export default {
80
84
  },
81
85
 
82
86
  bundleCounts() {
83
- const resources = this.bundles.filter((item) => item.metadata.name.startsWith(`${ this.repoName }-`));
87
+ const resources = this.bundles.filter((item) => item.repoName === this.repoName);
84
88
 
85
89
  if (!resources.length) {
86
90
  return [];
@@ -174,7 +178,6 @@ export default {
174
178
 
175
179
  },
176
180
 
177
- methods: { capitalize },
178
181
  };
179
182
  </script>
180
183
 
@@ -185,11 +188,13 @@ export default {
185
188
  title="Bundles"
186
189
  :values="bundleCounts"
187
190
  value-key="count"
191
+ data-testid="gitrepo-bundle-summary"
188
192
  />
189
193
  <FleetStatus
190
194
  title="Resources"
191
195
  :values="resourceCounts"
192
196
  value-key="count"
197
+ data-testid="gitrepo-deployment-summary"
193
198
  />
194
199
  </div>
195
200
  </template>