@rancher/shell 0.3.9 → 0.3.11

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 (132) hide show
  1. package/assets/translations/en-us.yaml +19 -24
  2. package/assets/translations/zh-hans.yaml +82 -16
  3. package/chart/istio.vue +11 -11
  4. package/chart/rancher-backup/S3.vue +1 -1
  5. package/components/AsyncButton.vue +2 -2
  6. package/components/ButtonGroup.vue +1 -1
  7. package/components/CompoundStatusBadge.vue +1 -1
  8. package/components/CopyCode.vue +1 -1
  9. package/components/DetailText.vue +1 -0
  10. package/components/DetailTop.vue +1 -1
  11. package/components/ExplorerProjectsNamespaces.vue +3 -3
  12. package/components/GlobalRoleBindings.vue +1 -1
  13. package/components/HarvesterServiceAddOnConfig.vue +2 -117
  14. package/components/ResourceDetail/Masthead.vue +1 -1
  15. package/components/ResourceList/Masthead.vue +0 -6
  16. package/components/ResourceList/ResourceLoadingIndicator.vue +1 -9
  17. package/components/ResourceList/index.vue +7 -6
  18. package/components/ResourceTable.vue +13 -3
  19. package/components/SortableTable/THead.vue +4 -3
  20. package/components/SortableTable/index.vue +3 -3
  21. package/components/Tabbed/Tab.vue +1 -1
  22. package/components/Tabbed/index.vue +1 -1
  23. package/components/Wizard.vue +9 -6
  24. package/components/__tests__/NamespaceFilter.test.ts +26 -7
  25. package/components/auth/RoleDetailEdit.vue +1 -1
  26. package/components/auth/SelectPrincipal.vue +1 -1
  27. package/components/fleet/FleetRepos.vue +1 -1
  28. package/components/form/ArrayList.vue +1 -1
  29. package/components/form/ChangePassword.vue +3 -0
  30. package/components/form/KeyValue.vue +3 -2
  31. package/components/form/Labels.vue +34 -14
  32. package/components/form/Members/ClusterPermissionsEditor.vue +1 -1
  33. package/components/form/NameNsDescription.vue +1 -1
  34. package/components/form/PlusMinus.vue +2 -2
  35. package/components/form/Probe.vue +1 -1
  36. package/components/form/ProjectMemberEditor.vue +8 -4
  37. package/components/form/ResourceQuota/NamespaceRow.vue +1 -1
  38. package/components/form/ServicePorts.vue +2 -2
  39. package/components/form/Tolerations.vue +30 -3
  40. package/components/form/WorkloadPorts.vue +2 -1
  41. package/components/form/__tests__/KeyValue.test.ts +17 -0
  42. package/components/formatter/ClusterLink.vue +3 -3
  43. package/components/formatter/LiveDate.vue +1 -1
  44. package/components/formatter/PodImages.vue +1 -1
  45. package/components/formatter/RKETemplateName.vue +1 -1
  46. package/components/formatter/Shortened.vue +1 -1
  47. package/components/nav/Header.vue +7 -7
  48. package/components/nav/NamespaceFilter.vue +103 -54
  49. package/config/labels-annotations.js +8 -5
  50. package/config/settings.ts +2 -5
  51. package/config/types.js +6 -4
  52. package/core/plugin-routes.ts +26 -7
  53. package/core/plugins-loader.js +2 -0
  54. package/detail/helm.cattle.io.projecthelmchart.vue +2 -2
  55. package/detail/provisioning.cattle.io.cluster.vue +4 -4
  56. package/edit/cis.cattle.io.clusterscan.vue +1 -1
  57. package/edit/k8s.cni.cncf.io.networkattachmentdefinition.vue +19 -149
  58. package/edit/logging-flow/index.vue +2 -2
  59. package/edit/logging.banzaicloud.io.output/providers/elasticsearch.vue +12 -0
  60. package/edit/logging.banzaicloud.io.output/providers/opensearch.vue +12 -0
  61. package/edit/management.cattle.io.project.vue +7 -0
  62. package/edit/monitoring.coreos.com.alertmanagerconfig/index.vue +1 -1
  63. package/edit/monitoring.coreos.com.alertmanagerconfig/routeConfig.vue +2 -2
  64. package/edit/monitoring.coreos.com.prometheusrule/GroupRules.vue +11 -8
  65. package/edit/networking.k8s.io.networkpolicy/PolicyRule.vue +2 -2
  66. package/edit/networking.k8s.io.networkpolicy/PolicyRuleTarget.vue +12 -4
  67. package/edit/networking.k8s.io.networkpolicy/__tests__/PolicyRuleTarget.spec.ts +140 -0
  68. package/edit/networking.k8s.io.networkpolicy/__tests__/utils/mock.json +158 -0
  69. package/edit/networking.k8s.io.networkpolicy/__tests__/utils/selectors.ts +45 -0
  70. package/edit/networking.k8s.io.networkpolicy/index.vue +1 -1
  71. package/edit/provisioning.cattle.io.cluster/AgentConfiguration.vue +1 -1
  72. package/edit/provisioning.cattle.io.cluster/MachinePool.vue +1 -1
  73. package/edit/provisioning.cattle.io.cluster/RegistryConfigs.vue +1 -1
  74. package/edit/provisioning.cattle.io.cluster/RegistryMirrors.vue +2 -2
  75. package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +143 -169
  76. package/edit/provisioning.cattle.io.cluster/rke2.vue +15 -6
  77. package/edit/resources.cattle.io.restore.vue +2 -2
  78. package/edit/service.vue +22 -3
  79. package/edit/storage.k8s.io.storageclass/index.vue +1 -1
  80. package/edit/token.vue +1 -0
  81. package/edit/workload/Job.vue +2 -2
  82. package/edit/workload/index.vue +1 -1
  83. package/edit/workload/mixins/workload.js +7 -1
  84. package/edit/workload/storage/__tests__/Storage.test.ts +84 -5
  85. package/initialize/index.js +1 -0
  86. package/layouts/default.vue +1 -1
  87. package/mixins/resource-fetch-namespaced.js +19 -27
  88. package/mixins/resource-fetch.js +0 -5
  89. package/models/__tests__/namespace.test.ts +125 -0
  90. package/models/management.cattle.io.project.js +6 -1
  91. package/models/persistentvolume.js +1 -1
  92. package/models/workload.service.js +22 -7
  93. package/package.json +17 -5
  94. package/pages/account/index.vue +3 -0
  95. package/pages/auth/login.vue +46 -49
  96. package/pages/c/_cluster/apps/charts/chart.vue +1 -1
  97. package/pages/c/_cluster/apps/charts/install.vue +42 -51
  98. package/pages/c/_cluster/explorer/index.vue +1 -1
  99. package/pages/c/_cluster/monitoring/index.vue +1 -1
  100. package/pages/c/_cluster/settings/performance.vue +53 -18
  101. package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +1 -1
  102. package/pages/c/_cluster/uiplugins/index.vue +16 -5
  103. package/pages/home.vue +1 -1
  104. package/pkg/vue.config.js +1 -0
  105. package/plugins/clean-html-directive.js +1 -1
  106. package/plugins/clean-tooltip-directive.js +33 -0
  107. package/plugins/dashboard-store/actions.js +4 -2
  108. package/plugins/dashboard-store/getters.js +6 -0
  109. package/plugins/dashboard-store/mutations.js +2 -2
  110. package/plugins/plugin.js +6 -1
  111. package/plugins/steve/actions.js +1 -1
  112. package/plugins/steve/getters.js +14 -3
  113. package/plugins/steve/resourceWatcher.js +36 -62
  114. package/plugins/steve/subscribe.js +164 -21
  115. package/plugins/steve/worker/index.js +8 -1
  116. package/plugins/steve/worker/web-worker.advanced.js +26 -8
  117. package/plugins/steve/worker/web-worker.basic.js +23 -4
  118. package/rancher-components/components/Form/Checkbox/Checkbox.vue +2 -2
  119. package/rancher-components/components/Form/Radio/RadioGroup.vue +2 -2
  120. package/rancher-components/components/LabeledTooltip/LabeledTooltip.vue +1 -1
  121. package/store/index.js +16 -61
  122. package/store/store-types.js +5 -0
  123. package/store/type-map.js +1 -1
  124. package/types/shell/index.d.ts +23 -7
  125. package/utils/__tests__/create-yaml.test.ts +63 -0
  126. package/utils/array.ts +4 -0
  127. package/utils/create-yaml.js +5 -5
  128. package/utils/namespace-filter.js +17 -5
  129. package/utils/projectAndNamespaceFiltering.utils.ts +62 -0
  130. package/utils/selector.js +6 -5
  131. package/utils/settings.ts +5 -7
  132. package/models/k8s.cni.cncf.io.networkattachmentdefinition.js +0 -93
@@ -1500,46 +1500,45 @@ export default {
1500
1500
  </div>
1501
1501
  </template>
1502
1502
  <template #helmValues>
1503
- <div class="sticky-header">
1504
- <Banner
1505
- v-if="step2Description"
1506
- color="info"
1507
- class="description"
1503
+ <Banner
1504
+ v-if="step2Description"
1505
+ color="info"
1506
+ class="description"
1507
+ >
1508
+ {{ step2Description }}
1509
+ </Banner>
1510
+ <div class="step__values__controls">
1511
+ <ButtonGroup
1512
+ v-model="preFormYamlOption"
1513
+ :options="formYamlOptions"
1514
+ inactive-class="bg-disabled btn-sm"
1515
+ active-class="bg-primary btn-sm"
1516
+ :disabled="preFormYamlOption != formYamlOption"
1517
+ />
1518
+ <div class="step__values__controls--spacer">
1519
+ &nbsp;
1520
+ </div>
1521
+ <ButtonGroup
1522
+ v-if="showDiff"
1523
+ v-model="diffMode"
1524
+ :options="yamlDiffModeOptions"
1525
+ inactive-class="bg-disabled btn-sm"
1526
+ active-class="bg-primary btn-sm"
1527
+ />
1528
+ <div
1529
+ v-if="hasReadme && !showingReadmeWindow"
1530
+ class="btn-group"
1508
1531
  >
1509
- {{ step2Description }}
1510
- </Banner>
1511
- <div class="step__values__controls">
1512
- <ButtonGroup
1513
- v-model="preFormYamlOption"
1514
- :options="formYamlOptions"
1515
- inactive-class="bg-disabled btn-sm"
1516
- active-class="bg-primary btn-sm"
1517
- :disabled="preFormYamlOption != formYamlOption"
1518
- />
1519
- <div class="step__values__controls--spacer">
1520
- &nbsp;
1521
- </div>
1522
- <ButtonGroup
1523
- v-if="showDiff"
1524
- v-model="diffMode"
1525
- :options="yamlDiffModeOptions"
1526
- inactive-class="bg-disabled btn-sm"
1527
- active-class="bg-primary btn-sm"
1528
- />
1529
- <div
1530
- v-if="hasReadme && !showingReadmeWindow"
1531
- class="btn-group"
1532
+ <button
1533
+ type="button"
1534
+ class="btn bg-primary btn-sm"
1535
+ @click="showSlideIn = !showSlideIn"
1532
1536
  >
1533
- <button
1534
- type="button"
1535
- class="btn bg-primary btn-sm"
1536
- @click="showSlideIn = !showSlideIn"
1537
- >
1538
- {{ t('catalog.install.steps.helmValues.chartInfo.button') }}
1539
- </button>
1540
- </div>
1537
+ {{ t('catalog.install.steps.helmValues.chartInfo.button') }}
1538
+ </button>
1541
1539
  </div>
1542
1540
  </div>
1541
+
1543
1542
  <div class="scroll__container">
1544
1543
  <div class="scroll__content">
1545
1544
  <!-- Values (as Custom Component in ./shell/charts/) -->
@@ -1726,7 +1725,7 @@ export default {
1726
1725
  {{ t('catalog.install.steps.helmValues.chartInfo.label') }}
1727
1726
  <div class="slideIn__header__buttons">
1728
1727
  <div
1729
- v-tooltip="t('catalog.install.slideIn.dock')"
1728
+ v-clean-tooltip="t('catalog.install.slideIn.dock')"
1730
1729
  class="slideIn__header__button"
1731
1730
  @click="showSlideIn = false; showReadmeWindow()"
1732
1731
  >
@@ -1782,7 +1781,6 @@ export default {
1782
1781
  </div>
1783
1782
  </div>
1784
1783
  </div>
1785
-
1786
1784
  <Banner
1787
1785
  color="warning"
1788
1786
  class="description"
@@ -1816,7 +1814,7 @@ export default {
1816
1814
 
1817
1815
  .install-steps {
1818
1816
  padding-top: 0;
1819
-
1817
+ height: 0;
1820
1818
  position: relative;
1821
1819
  overflow: hidden;
1822
1820
 
@@ -1961,14 +1959,16 @@ export default {
1961
1959
  &__container {
1962
1960
  $yaml-height: 200px;
1963
1961
  min-height: $yaml-height;
1964
- height: 0;
1962
+ margin-bottom: 60px;
1963
+ overflow: auto;
1964
+ display: flex;
1965
+ flex: 1;
1965
1966
  }
1966
1967
  &__content {
1967
1968
  display: flex;
1968
1969
  flex: 1;
1969
1970
  overflow: auto;
1970
1971
  }
1971
-
1972
1972
  }
1973
1973
 
1974
1974
  ::v-deep .yaml-editor {
@@ -1978,8 +1978,8 @@ export default {
1978
1978
  .outer-container {
1979
1979
  display: flex;
1980
1980
  flex-direction: column;
1981
- flex: 1;
1982
1981
  padding: 0;
1982
+ height: calc(100% - 112px);
1983
1983
  }
1984
1984
 
1985
1985
  .header {
@@ -2058,13 +2058,4 @@ export default {
2058
2058
  margin-top: 5px;
2059
2059
  }
2060
2060
 
2061
- .sticky-header {
2062
- position: sticky;
2063
- top: 0;
2064
- z-index: 10;
2065
- display: flex;
2066
- flex-direction: column;
2067
- background: var(--primary-text);
2068
- }
2069
-
2070
2061
  </style>
@@ -459,7 +459,7 @@ export default {
459
459
  </div>
460
460
  <p
461
461
  v-if="displayPspDeprecationBanner && hidePspDeprecationBanner"
462
- v-tooltip="t('landing.deprecatedPsp')"
462
+ v-clean-tooltip="t('landing.deprecatedPsp')"
463
463
  class="alt-psp-deprecation-info"
464
464
  >
465
465
  <span>{{ t('landing.psps') }}</span>
@@ -170,7 +170,7 @@ export default {
170
170
  <a
171
171
  v-for="fel in externalLinks"
172
172
  :key="fel.label"
173
- v-tooltip="
173
+ v-clean-tooltip="
174
174
  !fel.enabled ? t('monitoring.overview.linkedList.na') : undefined
175
175
  "
176
176
  :href="fel.enabled ? fel.link : void 0"
@@ -9,6 +9,18 @@ import { DEFAULT_PERF_SETTING, SETTING } from '@shell/config/settings';
9
9
  import { _EDIT, _VIEW } from '@shell/config/query-params';
10
10
  import UnitInput from '@shell/components/form/UnitInput';
11
11
 
12
+ const incompatible = {
13
+ incrementalLoading: ['forceNsFilterV2'],
14
+ manualRefresh: ['forceNsFilterV2'],
15
+ forceNsFilterV2: ['incrementalLoading', 'manualRefresh'],
16
+ };
17
+
18
+ const l10n = {
19
+ incrementalLoading: 'incrementalLoad',
20
+ manualRefresh: 'manualRefresh',
21
+ forceNsFilterV2: 'nsFiltering',
22
+ };
23
+
12
24
  export default {
13
25
  layout: 'authenticated',
14
26
  components: {
@@ -102,8 +114,42 @@ export default {
102
114
  this.errors.push(err);
103
115
  btnCB(false);
104
116
  }
117
+ },
118
+
119
+ compatibleWarning(property, enabled) {
120
+ if (!enabled) {
121
+ // Disabling a preference won't automatically turn on an incompatible one, so just set and exit
122
+ this.value[property].enabled = false;
123
+
124
+ return;
125
+ }
126
+
127
+ // We're enabling a preference. Are there any incomaptible preferences?
128
+ if ((incompatible[property] || []).every(p => !this.value[p].enabled)) {
129
+ // No, just set and exit
130
+ this.value[property].enabled = true;
131
+
132
+ return;
133
+ }
134
+
135
+ // Incompatible preferences found, so confirm with user before applying
136
+ this.$store.dispatch('cluster/promptModal', {
137
+ component: 'GenericPrompt',
138
+ componentProps: {
139
+ applyMode: 'enable',
140
+ applyAction: (buttonDone) => {
141
+ this.value[property].enabled = true;
142
+ (incompatible[property] || []).forEach((incompatible) => {
143
+ this.value[incompatible].enabled = false;
144
+ });
145
+ buttonDone(true);
146
+ },
147
+ title: this.t('promptRemove.title', {}, true),
148
+ body: this.t(`performance.${ l10n[property] }.incompatibleDescription`, {}, true),
149
+ },
150
+ });
105
151
  }
106
- }
152
+ },
107
153
  };
108
154
  </script>
109
155
  <template>
@@ -159,11 +205,12 @@ export default {
159
205
  <h2>{{ t('performance.incrementalLoad.label') }}</h2>
160
206
  <p>{{ t('performance.incrementalLoad.description') }}</p>
161
207
  <Checkbox
162
- v-model="value.incrementalLoading.enabled"
208
+ :value="value.incrementalLoading.enabled"
163
209
  :mode="mode"
164
210
  :label="t('performance.incrementalLoad.checkboxLabel')"
165
211
  class="mt-10 mb-20"
166
212
  :primary="true"
213
+ @input="compatibleWarning('incrementalLoading', $event)"
167
214
  />
168
215
  <div class="ml-20">
169
216
  <p :class="{ 'text-muted': !value.incrementalLoading.enabled }">
@@ -189,11 +236,12 @@ export default {
189
236
  label-key="performance.experimental"
190
237
  />
191
238
  <Checkbox
192
- v-model="value.manualRefresh.enabled"
239
+ :value="value.manualRefresh.enabled"
193
240
  :mode="mode"
194
241
  :label="t('performance.manualRefresh.checkboxLabel')"
195
242
  class="mt-10 mb-20"
196
243
  :primary="true"
244
+ @input="compatibleWarning('manualRefresh', $event)"
197
245
  />
198
246
  <div class="ml-20">
199
247
  <p :class="{ 'text-muted': !value.manualRefresh.enabled }">
@@ -299,26 +347,13 @@ export default {
299
347
  label-key="performance.experimental"
300
348
  />
301
349
  <Checkbox
302
- v-model="value.forceNsFilter.enabled"
350
+ :value="value.forceNsFilterV2.enabled"
303
351
  :mode="mode"
304
352
  :label="t('performance.nsFiltering.checkboxLabel')"
305
353
  class="mt-10 mb-20"
306
354
  :primary="true"
355
+ @input="compatibleWarning('forceNsFilterV2', $event)"
307
356
  />
308
- <div class="ml-20">
309
- <p :class="{ 'text-muted': !value.forceNsFilter.enabled }">
310
- {{ t('performance.nsFiltering.count.description') }}
311
- </p>
312
- <LabeledInput
313
- v-model="value.forceNsFilter.threshold"
314
- :mode="mode"
315
- :label="t('performance.nsFiltering.count.inputLabel')"
316
- :disabled="!value.forceNsFilter.enabled"
317
- class="input"
318
- type="number"
319
- min="0"
320
- />
321
- </div>
322
357
  </div>
323
358
  <!-- Advanced Websocket Worker -->
324
359
  <div class="mt-40">
@@ -206,7 +206,7 @@ export default {
206
206
  :key="v.version"
207
207
  >
208
208
  <a
209
- v-tooltip="v.requiredUiVersion ? t('plugins.info.requiresVersion', { version: v.requiredUiVersion }) : ''"
209
+ v-clean-tooltip="v.requiredUiVersion ? t('plugins.info.requiresVersion', { version: v.requiredUiVersion }) : ''"
210
210
  class="version-link"
211
211
  :class="{'version-active': v.version === infoVersion, 'disabled': !v.isCompatibleWithUi}"
212
212
  @click="loadPluginVersionInfo(v.version)"
@@ -400,6 +400,13 @@ export default {
400
400
  },
401
401
 
402
402
  methods: {
403
+ async refreshCharts() {
404
+ await this.$store.dispatch('catalog/load');
405
+ const c = this.$store.getters['catalog/rawCharts'];
406
+
407
+ this.charts = Object.values(c);
408
+ },
409
+
403
410
  async updateInstallStatus() {
404
411
  let hasService;
405
412
 
@@ -415,6 +422,10 @@ export default {
415
422
  hasService = false;
416
423
  }
417
424
 
425
+ if (hasService) {
426
+ this.refreshCharts();
427
+ }
428
+
418
429
  Vue.set(this, 'hasService', hasService);
419
430
 
420
431
  return hasService;
@@ -671,7 +682,7 @@ export default {
671
682
  <span>{{ plugin.displayVersion }}</span>
672
683
  <span
673
684
  v-if="plugin.upgrade"
674
- v-tooltip="t('plugins.upgradeAvailable')"
685
+ v-clean-tooltip="t('plugins.upgradeAvailable')"
675
686
  > -> {{ plugin.upgrade }}</span>
676
687
  <p
677
688
  v-if="plugin.incompatibleDisclaimer"
@@ -694,13 +705,13 @@ export default {
694
705
  >
695
706
  <div
696
707
  v-if="!plugin.certified"
697
- v-tooltip="t('plugins.descriptions.third-party')"
708
+ v-clean-tooltip="t('plugins.descriptions.third-party')"
698
709
  >
699
710
  {{ t('plugins.labels.third-party') }}
700
711
  </div>
701
712
  <div
702
713
  v-if="plugin.experimental"
703
- v-tooltip="t('plugins.descriptions.experimental')"
714
+ v-clean-tooltip="t('plugins.descriptions.experimental')"
704
715
  >
705
716
  {{ t('plugins.labels.experimental') }}
706
717
  </div>
@@ -710,7 +721,7 @@ export default {
710
721
  <div class="plugin-actions">
711
722
  <template v-if="plugin.error">
712
723
  <div
713
- v-tooltip="plugin.error"
724
+ v-clean-tooltip="plugin.error"
714
725
  class="plugin-error"
715
726
  >
716
727
  <i class="icon icon-warning" />
@@ -719,7 +730,7 @@ export default {
719
730
  <!-- plugin status -->
720
731
  <div
721
732
  v-if="plugin.helmError"
722
- v-tooltip="t('plugins.helmError')"
733
+ v-clean-tooltip="t('plugins.helmError')"
723
734
  class="plugin-error"
724
735
  >
725
736
  <i class="icon icon-warning" />
package/pages/home.vue CHANGED
@@ -406,7 +406,7 @@ export default {
406
406
  </span>
407
407
  <i
408
408
  v-if="row.unavailableMachines"
409
- v-tooltip="row.unavailableMachines"
409
+ v-clean-tooltip="row.unavailableMachines"
410
410
  class="conditions-alert-icon icon-alert icon"
411
411
  />
412
412
  </div>
package/pkg/vue.config.js CHANGED
@@ -82,6 +82,7 @@ module.exports = function(dir) {
82
82
  // These modules will be externalised and not included with the build of a package library
83
83
  // This helps reduce the package size, but these dependencies must be provided by the hosting application
84
84
  config.externals = {
85
+ jquery: '$',
85
86
  jszip: '__jszip',
86
87
  'js-yaml': '__jsyaml'
87
88
  };
@@ -17,7 +17,7 @@ const ALLOWED_TAGS = [
17
17
  'strong',
18
18
  ];
19
19
 
20
- const purifyHTML = value => DOMPurify.sanitize(value, { ALLOWED_TAGS });
20
+ export const purifyHTML = value => DOMPurify.sanitize(value, { ALLOWED_TAGS });
21
21
 
22
22
  export const cleanHtmlDirective = {
23
23
  inserted(el, binding) {
@@ -0,0 +1,33 @@
1
+ import Vue from 'vue';
2
+ import { VTooltip } from 'v-tooltip';
3
+ import { purifyHTML } from './clean-html-directive';
4
+
5
+ function purifyContent(value) {
6
+ const type = typeof value;
7
+
8
+ if (type === 'string') {
9
+ return purifyHTML(value);
10
+ } else if (value && type === 'object' && typeof value.content === 'string') {
11
+ return { ...value, content: purifyHTML(value.content) };
12
+ } else {
13
+ return value;
14
+ }
15
+ }
16
+
17
+ function bind(el, { value, oldValue, modifiers }) {
18
+ const purifiedValue = purifyContent(value);
19
+
20
+ VTooltip.bind(
21
+ el,
22
+ {
23
+ value: purifiedValue, oldValue, modifiers
24
+ });
25
+ }
26
+
27
+ const VCleanTooltip = {
28
+ ...VTooltip,
29
+ bind,
30
+ update: bind,
31
+ };
32
+
33
+ Vue.directive('clean-tooltip', VCleanTooltip);
@@ -317,13 +317,15 @@ export default {
317
317
 
318
318
  // ToDo: SM if we start a "bigger" watch (such as watch without a namespace vs a watch with a namespace), we should stop the stop the "smaller" watch so we don't have duplicate events coming back
319
319
  if ( opt.watch !== false ) {
320
- dispatch('watch', {
320
+ const args = {
321
321
  type,
322
322
  revision: out.revision,
323
323
  namespace: opt.watchNamespace || opt.namespaced, // it could be either apparently
324
324
  // ToDo: SM namespaced is sometimes a boolean and sometimes a string, I don't see it as especially broken but we should refactor that in the future
325
325
  force: opt.forceWatch === true,
326
- });
326
+ };
327
+
328
+ dispatch('watch', args);
327
329
  }
328
330
 
329
331
  const all = getters.all(type);
@@ -274,6 +274,12 @@ export default {
274
274
  return false;
275
275
  },
276
276
 
277
+ haveNamespace: (state, getters) => (type) => {
278
+ type = getters.normalizeType(type);
279
+
280
+ return state.types[type]?.haveNamespace || null;
281
+ },
282
+
277
283
  haveSelector: (state, getters) => (type, selector) => {
278
284
  type = getters.normalizeType(type);
279
285
  const entry = state.types[type];
@@ -209,9 +209,9 @@ export function batchChanges(state, { ctx, batch }) {
209
209
  const removeAtIndexes = [];
210
210
 
211
211
  // looping through the batch, executing changes, deferring creates and removes since they change the array length
212
- Object.keys(batch[normalizedType]).forEach((id) => {
212
+ Object.keys(combinedBatch[normalizedType]).forEach((id) => {
213
213
  const index = typeCacheIndexMap[id];
214
- const resource = batch[normalizedType][id];
214
+ const resource = combinedBatch[normalizedType][id];
215
215
 
216
216
  // an empty resource passed into batch changes is how we'll signal which ones to delete
217
217
  if (Object.keys(resource).length === 0 && index !== undefined) {
package/plugins/plugin.js CHANGED
@@ -40,7 +40,12 @@ export default async function(context) {
40
40
  });
41
41
  }
42
42
  } catch (e) {
43
- console.error('Could not load UI Plugin list', e); // eslint-disable-line no-console
43
+ if (e?.code === 404) {
44
+ // Not found, so extensions operator probably not installed
45
+ console.log('Could not load UI Extensions list (Extensions Operator may not be installed)'); // eslint-disable-line no-console
46
+ } else {
47
+ console.error('Could not load UI Extensions list', e); // eslint-disable-line no-console
48
+ }
44
49
  }
45
50
 
46
51
  // Load all of the plugins
@@ -11,7 +11,7 @@ import jsyaml from 'js-yaml';
11
11
 
12
12
  export default {
13
13
 
14
- // Need to override this, so that thhe 'this' context is correct (this class not the base class)
14
+ // Need to override this, so that the 'this' context is correct (this class not the base class)
15
15
  async loadSchemas(ctx, watch = true) {
16
16
  return await loadSchemas(ctx, watch);
17
17
  },
@@ -8,6 +8,7 @@ import HybridModel, { cleanHybridResources } from './hybrid-class';
8
8
  import NormanModel from './norman-class';
9
9
  import { urlFor } from '@shell/plugins/dashboard-store/getters';
10
10
  import { normalizeType } from '@shell/plugins/dashboard-store/normalize';
11
+ import pAndNFiltering from '@shell/utils/projectAndNamespaceFiltering.utils';
11
12
 
12
13
  export const STEVE_MODEL_TYPES = {
13
14
  NORMAN: 'norman',
@@ -42,6 +43,15 @@ export default {
42
43
  });
43
44
  });
44
45
  }
46
+
47
+ // `opt.namespaced` is either
48
+ // - a string representing a single namespace - add restriction to the url
49
+ // - an array of namespaces or projects - add restriction as a param
50
+ const namespaceProjectFilter = pAndNFiltering.checkAndCreateParam(opt);
51
+
52
+ if (namespaceProjectFilter) {
53
+ url += `${ (url.includes('?') ? '&' : '?') + namespaceProjectFilter }`;
54
+ }
45
55
  // End: Filter
46
56
 
47
57
  // Limit
@@ -72,12 +82,13 @@ export default {
72
82
  urlFor: (state, getters) => (type, id, opt) => {
73
83
  let url = urlFor(state, getters)(type, id, opt);
74
84
 
75
- if (opt.namespaced) {
85
+ // `namespaced` is either
86
+ // - a string representing a single namespace - add restriction to the url
87
+ // - an array of namespaces or projects - add restriction as a param
88
+ if (opt.namespaced && !pAndNFiltering.isApplicable(opt)) {
76
89
  const parts = url.split('/');
77
90
 
78
91
  url = `${ parts.join('/') }/${ opt.namespaced }`;
79
-
80
- return url;
81
92
  }
82
93
 
83
94
  return url;