dashboard-shell-shell 1.0.112 → 1.0.113

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 (161) hide show
  1. package/.DS_Store +0 -0
  2. package/assets/icons/demo.css +539 -0
  3. package/assets/icons/demo_index.html +1131 -0
  4. package/assets/icons/iconfont.css +200 -0
  5. package/assets/icons/iconfont.js +1 -0
  6. package/assets/icons/iconfont.json +296 -0
  7. package/assets/icons/iconfont.ttf +0 -0
  8. package/assets/icons/iconfont.woff +0 -0
  9. package/assets/icons/iconfont.woff2 +0 -0
  10. package/assets/images/API.svg +3 -0
  11. package/assets/images/login/password.svg +20 -0
  12. package/assets/images/login/user.svg +6 -0
  13. package/assets/images/login-bg.png +0 -0
  14. package/assets/images/login-left.png +0 -0
  15. package/assets/images/login-logo.svg +19 -0
  16. package/assets/images/logo.png +0 -0
  17. package/assets/images/pl/harvester.png +0 -0
  18. package/assets/images/promp-yellow.svg +5 -0
  19. package/assets/images/user.png +0 -0
  20. package/assets/styles/all.scss +63 -0
  21. package/assets/styles/app.scss +2 -0
  22. package/assets/styles/base/_basic.scss +8 -2
  23. package/assets/styles/base/_helpers.scss +4 -0
  24. package/assets/styles/base/_typography.scss +2 -1
  25. package/assets/styles/base/_variables.scss +10 -2
  26. package/assets/styles/global/_button.scss +37 -25
  27. package/assets/styles/global/_columns.scss +3 -1
  28. package/assets/styles/global/_form.scss +45 -13
  29. package/assets/styles/global/_labeled-input.scss +50 -25
  30. package/assets/styles/global/_layout.scss +9 -3
  31. package/assets/styles/global/_select.scss +20 -13
  32. package/assets/styles/global/_table.scss +1 -1
  33. package/assets/styles/global/_tooltip.scss +47 -6
  34. package/assets/styles/themes/_dark.scss +1 -0
  35. package/assets/styles/themes/_light.scss +59 -46
  36. package/assets/styles/themes/_suse.scss +1 -0
  37. package/assets/styles/vendor/vue-select.scss +18 -7
  38. package/assets/translations/en-us.yaml +93 -12
  39. package/assets/translations/zh-hans.yaml +278 -141
  40. package/components/ActionDropdown.vue +1 -1
  41. package/components/ActionDropdownShell.vue +71 -0
  42. package/components/ActionMenu.vue +2 -2
  43. package/components/ActionMenuShell.vue +1 -0
  44. package/components/AppModal.vue +78 -6
  45. package/components/AssignTo.vue +25 -11
  46. package/components/AsyncButton.vue +24 -7
  47. package/components/BannerGraphic.vue +1 -0
  48. package/components/ButtonDropdown.vue +26 -4
  49. package/components/ButtonGroup.vue +4 -0
  50. package/components/ButtonMultiAction.vue +1 -0
  51. package/components/CommunityLinks.vue +3 -3
  52. package/components/ConsumptionGauge.vue +24 -5
  53. package/components/CopyToClipboardText.vue +2 -1
  54. package/components/CruResource.vue +12 -7
  55. package/components/CruResourceFooter.vue +2 -2
  56. package/components/DashboardOptions.vue +21 -15
  57. package/components/DetailText.vue +5 -0
  58. package/components/DisableAuthProviderModal.vue +1 -0
  59. package/components/DotState.vue +84 -0
  60. package/components/ExplorerMembers.vue +1 -1
  61. package/components/ExplorerProjectsNamespaces.vue +56 -14
  62. package/components/FixedBanner.vue +19 -12
  63. package/components/GlobalRoleBindings.vue +5 -1
  64. package/components/GrafanaDashboard.vue +4 -4
  65. package/components/GrowlManager.vue +4 -1
  66. package/components/HardwareResourceGauge.vue +39 -3
  67. package/components/InfoBox.vue +3 -3
  68. package/components/InputOrDisplay.vue +28 -2
  69. package/components/LabelValue.vue +16 -1
  70. package/components/LandingPagePreference.vue +5 -3
  71. package/components/LocaleSelector.vue +39 -93
  72. package/components/ModalManager.vue +55 -0
  73. package/components/ModalWithCard.vue +2 -0
  74. package/components/MoveModal.vue +1 -0
  75. package/components/PromptChangePassword.vue +1 -1
  76. package/components/PromptModal.vue +15 -2
  77. package/components/PromptRemove.vue +28 -8
  78. package/components/PromptRestore.vue +1 -0
  79. package/components/ResourceCancelModal.vue +1 -0
  80. package/components/ResourceDetail/Masthead.vue +188 -43
  81. package/components/ResourceDetail/__tests__/Masthead.test.ts +5 -1
  82. package/components/ResourceDetail/index.vue +49 -14
  83. package/components/ResourceList/Masthead.vue +80 -18
  84. package/components/ResourceTable.vue +60 -19
  85. package/components/SideNav.vue +32 -12
  86. package/components/SlideInPanelManager.vue +126 -0
  87. package/components/SortableTable/THead.vue +34 -5
  88. package/components/SortableTable/actions.js +1 -1
  89. package/components/SortableTable/index.vue +649 -142
  90. package/components/SortableTable/paging.js +36 -28
  91. package/components/SortableTable/selection.js +0 -11
  92. package/components/StatusBadge.vue +77 -0
  93. package/components/Tabbed/Tab.vue +3 -3
  94. package/components/Tabbed/index.vue +44 -26
  95. package/components/Wizard.vue +2 -2
  96. package/components/__tests__/AsyncButton.test.ts +2 -2
  97. package/components/__tests__/FixedBanner.test.ts +3 -3
  98. package/components/__tests__/ModalManager.spec.ts +176 -0
  99. package/components/__tests__/SlideInPanelManager.spec.ts +166 -0
  100. package/components/auth/Principal.vue +10 -3
  101. package/components/auth/__tests__/RoleDetailEdit.test.ts +3 -2
  102. package/components/form/ArrayList.vue +123 -85
  103. package/components/form/ArrayListGrouped.vue +10 -2
  104. package/components/form/Command.vue +6 -15
  105. package/components/form/EnvVars.vue +16 -8
  106. package/components/form/Footer.vue +8 -5
  107. package/components/form/HealthCheck.vue +3 -3
  108. package/components/form/HookOption.vue +11 -16
  109. package/components/form/KeyValue.vue +16 -7
  110. package/components/form/LabeledSelect.vue +59 -76
  111. package/components/form/LifecycleHooks.vue +3 -3
  112. package/components/form/MatchExpressions.vue +35 -12
  113. package/components/form/NameNsDescription.vue +147 -115
  114. package/components/form/Networking.vue +20 -12
  115. package/components/form/NodeAffinity.vue +31 -23
  116. package/components/form/NodeScheduling.vue +13 -3
  117. package/components/form/Password.vue +11 -5
  118. package/components/form/PodAffinity.vue +43 -44
  119. package/components/form/Probe.vue +68 -66
  120. package/components/form/ResourceQuota/Project.vue +5 -1
  121. package/components/form/ResourceSelector.vue +7 -9
  122. package/components/form/SSHKnownHosts/KnownHostsEditDialog.vue +6 -3
  123. package/components/form/SSHKnownHosts/__tests__/KnownHostsEditDialog.test.ts +12 -1
  124. package/components/form/SSHKnownHosts/index.vue +16 -2
  125. package/components/form/Security.vue +54 -56
  126. package/components/form/Select.vue +41 -7
  127. package/components/form/ShellInput.vue +5 -1
  128. package/components/form/Tolerations.vue +5 -1
  129. package/components/form/UnitInput.vue +2 -2
  130. package/components/form/ValueFromResource.vue +134 -121
  131. package/components/form/WorkloadPorts.vue +18 -18
  132. package/components/form/__tests__/ArrayList.test.ts +5 -2
  133. package/components/form/__tests__/MatchExpressions.test.ts +12 -12
  134. package/components/form/__tests__/NameNsDescription.test.ts +115 -14
  135. package/components/form/__tests__/Probe.test.ts +12 -8
  136. package/components/form/__tests__/SSHKnownHosts.test.ts +11 -0
  137. package/components/form/__tests__/Select.test.ts +37 -0
  138. package/components/form/__tests__/UnitInput.test.ts +4 -5
  139. package/components/formatter/BadgeStateFormatter.vue +8 -5
  140. package/components/formatter/InternalExternalIP.vue +2 -0
  141. package/components/formatter/SecretData.vue +20 -7
  142. package/components/nav/Favorite.vue +5 -1
  143. package/components/nav/Group.vue +60 -27
  144. package/components/nav/Header.vue +39 -13
  145. package/components/nav/Jump.vue +7 -0
  146. package/components/nav/NamespaceFilter.vue +14 -8
  147. package/components/nav/Pinned.vue +1 -1
  148. package/components/nav/TopLevelMenu.vue +5 -17
  149. package/components/nav/Type.vue +32 -35
  150. package/components/nav/__tests__/TopLevelMenu.test.ts +0 -40
  151. package/components/templates/blank.vue +4 -1
  152. package/components/templates/default.vue +8 -0
  153. package/components/templates/home.vue +10 -1
  154. package/components/templates/plain.vue +10 -1
  155. package/package.json +1 -1
  156. package/store/type-map.js +29 -2
  157. package/utils/error.js +30 -8
  158. package/utils/errorTranslate.json +916 -0
  159. package/components/formatter/ExtensionCache.vue +0 -74
  160. package/components/formatter/Port.vue +0 -24
  161. package/components/formatter/SecretType.vue +0 -41
@@ -103,9 +103,6 @@ export default {
103
103
 
104
104
  <template>
105
105
  <div>
106
- <p class="set-landing-leadin">
107
- {{ t('landing.landingPrefs.body') }}
108
- </p>
109
106
  <RadioGroup
110
107
  id="login-route"
111
108
  :value="afterLoginRoute"
@@ -113,6 +110,11 @@ export default {
113
110
  :options="routeRadioOptions"
114
111
  @update:value="updateLoginRoute"
115
112
  >
113
+ <template #label>
114
+ <p class="set-landing-leadin">
115
+ {{ t('landing.landingPrefs.body') }}
116
+ </p>
117
+ </template>
116
118
  <template #2="{option}">
117
119
  <div class="custom-page">
118
120
  <RadioButton
@@ -1,11 +1,17 @@
1
1
  <script>
2
2
  import { mapGetters } from 'vuex';
3
3
  import Select from '@shell/components/form/Select.vue';
4
+ import { RcDropdown, RcDropdownTrigger, RcDropdownItem } from '@components/RcDropdown';
4
5
 
5
6
  export default {
6
7
  name: 'LocalSelector',
7
8
 
8
- components: { Select },
9
+ components: {
10
+ Select,
11
+ RcDropdown,
12
+ RcDropdownItem,
13
+ RcDropdownTrigger,
14
+ },
9
15
 
10
16
  props: {
11
17
  mode: {
@@ -65,111 +71,51 @@ export default {
65
71
  <template>
66
72
  <div>
67
73
  <div v-if="mode === 'login'">
68
- <div
69
- v-if="showLocale"
70
- role="menu"
71
- :aria-label="t('locale.menu')"
72
- class="locale-login-container"
73
- tabindex="0"
74
- @click="openLocaleSelector"
75
- @blur.capture="closeLocaleSelector"
76
- @keyup.enter="openLocaleSelector"
77
- @keyup.space="openLocaleSelector"
78
- >
79
- <v-dropdown
80
- popperClass="localeSelector"
81
- :shown="isLocaleSelectorOpen"
82
- placement="top"
83
- distance="8"
84
- skidding="12"
85
- :triggers="[]"
86
- :autoHide="false"
87
- :flip="false"
88
- :container="false"
89
- @focus.capture="openLocaleSelector"
74
+ <rc-dropdown v-if="showLocale">
75
+ <rc-dropdown-trigger
76
+ data-testid="locale-selector"
77
+ link
78
+ class="baseline"
79
+ :aria-label="t('locale.menu')"
90
80
  >
91
- <a
92
- data-testid="locale-selector"
93
- class="locale-chooser"
81
+ {{ selectedLocaleLabel }}
82
+ <template
83
+ v-if="showIcon"
84
+ #after
94
85
  >
95
- {{ selectedLocaleLabel }}
96
- <i
97
- v-if="showIcon"
98
- class="icon icon-fw icon-sort-down"
99
- />
100
- </a>
101
- <template #popper>
102
- <ul
103
- class="list-unstyled dropdown"
104
- style="margin: -1px;"
105
- >
106
- <li
107
- v-if="showNone"
108
- v-t="'locale.none'"
109
- class="hand"
110
- tabindex="0"
111
- role="menuitem"
112
- @click.stop="switchLocale('none')"
113
- @keyup.enter.stop="switchLocale('none')"
114
- @keyup.space.stop="switchLocale('none')"
115
- />
116
- <li
117
- v-for="(label, name) in availableLocales"
118
- :key="name"
119
- tabindex="0"
120
- role="menuitem"
121
- class="hand"
122
- @click.stop="switchLocale(name)"
123
- @keyup.enter.stop="switchLocale(name)"
124
- @keyup.space.stop="switchLocale(name)"
125
- >
126
- {{ label }}
127
- </li>
128
- </ul>
86
+ <i class="icon icon-fw icon-sort-down" />
129
87
  </template>
130
- </v-dropdown>
131
- </div>
88
+ </rc-dropdown-trigger>
89
+ <template #dropdownCollection>
90
+ <rc-dropdown-item
91
+ v-if="showNone"
92
+ v-t="'locale.none'"
93
+ @click="switchLocale('none')"
94
+ />
95
+ <rc-dropdown-item
96
+ v-for="(label, name) in availableLocales"
97
+ :key="name"
98
+ :lang="name"
99
+ @click.stop="switchLocale(name)"
100
+ >
101
+ {{ label }}
102
+ </rc-dropdown-item>
103
+ </template>
104
+ </rc-dropdown>
132
105
  </div>
133
106
  <div v-else>
134
107
  <Select
135
108
  :value="selectedOption"
136
109
  :options="localesOptions"
110
+ :is-lang-select="true"
137
111
  @update:value="switchLocale($event)"
138
112
  />
139
113
  </div>
140
114
  </div>
141
115
  </template>
142
116
 
143
- <style lang="scss" scoped>
144
- .advanced {
145
- user-select: none;
146
- padding: 0 5px;
147
- line-height: 40px;
148
- font-size: 15px;
149
- font-weight: 500;
150
- }
151
- .content {
152
- background: var(--nav-active);
153
- padding: 10px;
154
- margin-top: 6px;
155
- border-radius: 4px;
156
- }
157
-
158
- .hand:focus-visible {
159
- @include focus-outline;
160
- outline-offset: 4px;
161
- }
162
-
163
- .locale-chooser {
164
- cursor: pointer;
165
-
166
- &:hover {
167
- text-decoration: none;
117
+ <style lang="scss">
118
+ .baseline {
119
+ align-items: baseline;
168
120
  }
169
- }
170
-
171
- .locale-login-container:focus-visible {
172
- @include focus-outline;
173
- outline-offset: 2px;
174
- }
175
121
  </style>
@@ -0,0 +1,55 @@
1
+ <script lang="ts" setup>
2
+ import { computed, ref } from 'vue';
3
+ import { useStore } from 'vuex';
4
+
5
+ import AppModal from '@shell/components/AppModal.vue';
6
+
7
+ const store = useStore();
8
+
9
+ const isOpen = computed(() => store.getters['modal/isOpen']);
10
+ const component = computed(() => store.getters['modal/component']);
11
+ const componentProps = computed(() => store.getters['modal/componentProps']);
12
+ const resources = computed(() => store.getters['modal/resources']);
13
+ const closeOnClickOutside = computed(() => store.getters['modal/closeOnClickOutside']);
14
+ const modalWidth = computed(() => store.getters['modal/modalWidth']);
15
+ // const modalSticky = computed(() => store.getters['modal/modalSticky']); // TODO: Implement sticky modals
16
+
17
+ const backgroundClosing = ref<Function | null>(null);
18
+
19
+ function close() {
20
+ if (!isOpen.value) return;
21
+
22
+ if (backgroundClosing.value) {
23
+ backgroundClosing.value();
24
+ }
25
+
26
+ store.commit('modal/closeModal');
27
+ }
28
+
29
+ function registerBackgroundClosing(fn: Function) {
30
+ backgroundClosing.value = fn;
31
+ }
32
+ </script>
33
+
34
+ <template>
35
+ <Teleport to="#modals">
36
+ <app-modal
37
+ v-if="isOpen && component"
38
+ :click-to-close="closeOnClickOutside"
39
+ :width="modalWidth"
40
+ :style="{ '--prompt-modal-width': modalWidth }"
41
+ :trigger-focus-trap="true"
42
+ tabindex="0"
43
+ @close="close"
44
+ >
45
+ <component
46
+ :is="component"
47
+ v-bind="componentProps || {}"
48
+ data-testid="modal-manager-component"
49
+ :resources="resources"
50
+ :register-background-closing="registerBackgroundClosing"
51
+ @close="close"
52
+ />
53
+ </app-modal>
54
+ </Teleport>
55
+ </template>
@@ -65,6 +65,7 @@ export default {
65
65
  v-bind="$attrs"
66
66
  class="modal"
67
67
  data-testid="mvc__card"
68
+ :trigger-focus-trap="true"
68
69
  @close="$emit('finish', $event)"
69
70
  >
70
71
  <Card
@@ -132,6 +133,7 @@ export default {
132
133
 
133
134
  &.card-container {
134
135
  box-shadow: none;
136
+ padding: 14px;
135
137
  }
136
138
  }
137
139
  </style>
@@ -93,6 +93,7 @@ export default {
93
93
  :name="modalName"
94
94
  :width="440"
95
95
  height="auto"
96
+ :trigger-focus-trap="true"
96
97
  @close="close"
97
98
  >
98
99
  <Loading v-if="$fetchState.pending" />
@@ -42,7 +42,7 @@ export default {
42
42
  custom-class="change-password-modal"
43
43
  data-testid="change-password__modal"
44
44
  name="password-modal"
45
- :width="500"
45
+ :width="700"
46
46
  :height="465"
47
47
  :trigger-focus-trap="true"
48
48
  @close="show(false)"
@@ -13,7 +13,11 @@ export default {
13
13
  components: { AppModal },
14
14
 
15
15
  data() {
16
- return { opened: false, backgroundClosing: null };
16
+ return {
17
+ opened: false,
18
+ backgroundClosing: null,
19
+ componentRendered: false
20
+ };
17
21
  },
18
22
 
19
23
  computed: {
@@ -54,10 +58,15 @@ export default {
54
58
  watch: {
55
59
  showModal(show) {
56
60
  this.opened = show;
57
- },
61
+ }
58
62
  },
59
63
 
60
64
  methods: {
65
+ onSlotComponentMounted() {
66
+ // variable for the watcher based focus-trap
67
+ // so that we know when the component is rendered
68
+ this.componentRendered = true;
69
+ },
61
70
  close() {
62
71
  if (!this.opened) {
63
72
  return;
@@ -69,6 +78,7 @@ export default {
69
78
  this.backgroundClosing();
70
79
  }
71
80
 
81
+ this.componentRendered = false;
72
82
  this.opened = false;
73
83
  },
74
84
 
@@ -85,6 +95,8 @@ export default {
85
95
  v-if="opened && component"
86
96
  :click-to-close="closeOnClickOutside"
87
97
  :width="modalWidth"
98
+ :trigger-focus-trap-watcher-based="true"
99
+ :focus-trap-watcher-based-variable="componentRendered"
88
100
  @close="close()"
89
101
  >
90
102
  <component
@@ -92,6 +104,7 @@ export default {
92
104
  :is="component"
93
105
  :resources="resources"
94
106
  :register-background-closing="registerBackgroundClosing"
107
+ @vue:mounted="onSlotComponentMounted"
95
108
  @close="close()"
96
109
  />
97
110
  </app-modal>
@@ -12,6 +12,7 @@ import { CATALOG as CATALOG_ANNOTATIONS } from '@shell/config/labels-annotations
12
12
  import { CATALOG } from '@shell/config/types';
13
13
  import { LabeledInput } from '@components/Form/LabeledInput';
14
14
  import AppModal from '@shell/components/AppModal.vue';
15
+ import { translateError } from '@shell/utils/error';
15
16
 
16
17
  export default {
17
18
  name: 'PromptRemove',
@@ -213,6 +214,7 @@ export default {
213
214
  },
214
215
 
215
216
  methods: {
217
+ translateError,
216
218
  resourceNames,
217
219
  escapeHtml,
218
220
  close() {
@@ -336,9 +338,10 @@ export default {
336
338
  v-if="showModal"
337
339
  custom-class="remove-modal"
338
340
  name="promptRemove"
339
- :width="400"
341
+ :width="460"
340
342
  height="auto"
341
343
  styles="max-height: 100vh;"
344
+ :trigger-focus-trap="true"
342
345
  @close="close"
343
346
  >
344
347
  <Card
@@ -347,6 +350,11 @@ export default {
347
350
  >
348
351
  <template #title>
349
352
  <h4 class="text-default-text">
353
+ <img
354
+ src="@shell/assets/images/promp-yellow.svg"
355
+ class="img-span"
356
+ alt=""
357
+ >
350
358
  {{ t('promptRemove.title') }}
351
359
  </h4>
352
360
  </template>
@@ -354,7 +362,7 @@ export default {
354
362
  <div class="mb-10">
355
363
  <template v-if="!hasCustomRemove">
356
364
  {{ t('promptRemove.attemptingToRemove', { type }) }} <span
357
- v-clean-html="resourceNames(names, t)"
365
+ v-clean-html="resourceNames(names, null, t)"
358
366
  />
359
367
  </template>
360
368
 
@@ -395,14 +403,14 @@ export default {
395
403
  {{ warning }}
396
404
  </div>
397
405
  <div class="text-error mb-10 mt-10">
398
- {{ error }}
406
+ {{ translateError(error) }}
399
407
  </div>
400
- <div
408
+ <!-- <div
401
409
  v-if="!needsConfirm"
402
410
  class="text-info mt-20"
403
411
  >
404
412
  {{ protip }}
405
- </div>
413
+ </div> -->
406
414
  </LabeledInput>
407
415
  <div v-else-if="!hasCustomRemove">
408
416
  <div
@@ -436,7 +444,7 @@ export default {
436
444
  <div class="spacer" />
437
445
  <AsyncButton
438
446
  mode="delete"
439
- class="btn bg-error ml-10"
447
+ class="btn ml-10"
440
448
  :disabled="deleteDisabled"
441
449
  :data-testid="componentTestid + '-confirm-button'"
442
450
  @click="remove"
@@ -460,12 +468,24 @@ export default {
460
468
  text-align: right;
461
469
  }
462
470
 
463
- .card-actions {
471
+ /* .card-actions {
464
472
  display: flex;
465
473
 
466
474
  .spacer {
467
475
  flex: 1;
468
476
  }
469
- }
477
+ } */
470
478
  }
471
479
  </style>
480
+
481
+ <style scoped>
482
+ .text-default-text{
483
+ line-height: 20px;
484
+ margin: 0px;
485
+ display: flex;
486
+ align-items: center;
487
+ }
488
+ .img-span{
489
+ margin-right: 8px;
490
+ }
491
+ </style>
@@ -213,6 +213,7 @@ export default {
213
213
  styles="background-color: var(--nav-bg); border-radius: var(--border-radius); max-height: 100vh;"
214
214
  height="auto"
215
215
  :scrollable="true"
216
+ :trigger-focus-trap="true"
216
217
  @close="close"
217
218
  >
218
219
  <Card
@@ -56,6 +56,7 @@ export default {
56
56
  name="cancel-modal"
57
57
  :width="440"
58
58
  height="auto"
59
+ :trigger-focus-trap="true"
59
60
  @close="cancelCancel"
60
61
  >
61
62
  <div class="header">