@rancher/shell 0.3.5 → 0.3.7

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 (120) hide show
  1. package/assets/images/providers/outscale.svg +19 -0
  2. package/assets/styles/base/_basic.scss +18 -0
  3. package/assets/styles/base/_mixins.scss +0 -11
  4. package/assets/styles/base/_variables.scss +2 -4
  5. package/assets/styles/global/_button.scss +12 -2
  6. package/assets/translations/en-us.yaml +35 -1
  7. package/assets/translations/zh-hans.yaml +30 -10
  8. package/chart/gatekeeper.vue +3 -2
  9. package/chart/istio.vue +29 -3
  10. package/components/BrandImage.vue +1 -4
  11. package/components/Carousel.vue +85 -37
  12. package/components/EtcdInfoBanner.vue +7 -3
  13. package/components/ExplorerMembers.vue +100 -5
  14. package/components/ExplorerProjectsNamespaces.vue +32 -2
  15. package/components/GrafanaDashboard.vue +9 -2
  16. package/components/SortableTable/index.vue +23 -11
  17. package/components/SortableTable/selection.js +58 -50
  18. package/components/Wizard.vue +4 -2
  19. package/components/auth/AuthBanner.vue +6 -0
  20. package/components/auth/RoleDetailEdit.vue +2 -2
  21. package/components/form/HookOption.vue +14 -10
  22. package/components/form/Labels.vue +32 -27
  23. package/components/form/MatchExpressions.vue +2 -2
  24. package/components/form/Members/ClusterPermissionsEditor.vue +32 -7
  25. package/components/form/NameNsDescription.vue +1 -1
  26. package/components/form/ProjectMemberEditor.vue +46 -21
  27. package/components/form/Tolerations.vue +4 -1
  28. package/components/form/ValueFromResource.vue +14 -9
  29. package/components/form/WorkloadPorts.vue +2 -2
  30. package/components/form/__tests__/NameNsDescription.ts +27 -0
  31. package/components/formatter/WorkloadHealthScale.vue +8 -2
  32. package/components/nav/NamespaceFilter.vue +8 -0
  33. package/{nuxt/components → components/nuxt}/nuxt.js +1 -1
  34. package/{nuxt → config}/middleware.js +8 -8
  35. package/config/product/explorer.js +24 -3
  36. package/config/query-params.js +1 -0
  37. package/config/router.js +1 -1
  38. package/{nuxt → config}/store.js +82 -79
  39. package/config/table-headers.js +46 -12
  40. package/config/types.js +7 -0
  41. package/core/plugin.ts +4 -2
  42. package/core/types.ts +258 -1
  43. package/creators/app/files/tsconfig.json +0 -1
  44. package/creators/app/files/vue.config.js +0 -1
  45. package/creators/pkg/files/.github/workflows/build-extension.yml +3 -4
  46. package/creators/pkg/files/tsconfig.json +0 -1
  47. package/creators/pkg/pkg.package.json +3 -3
  48. package/detail/constraints.gatekeeper.sh.constraint.vue +14 -7
  49. package/detail/fleet.cattle.io.clustergroup.vue +7 -1
  50. package/edit/auth/ldap/config.vue +21 -1
  51. package/edit/auth/saml.vue +132 -37
  52. package/edit/fleet.cattle.io.gitrepo.vue +16 -1
  53. package/edit/logging.banzaicloud.io.output/index.vue +18 -5
  54. package/edit/logging.banzaicloud.io.output/providers/loki.vue +1 -0
  55. package/edit/namespace.vue +12 -8
  56. package/edit/provisioning.cattle.io.cluster/MachinePool.vue +11 -4
  57. package/edit/provisioning.cattle.io.cluster/import.vue +23 -25
  58. package/edit/provisioning.cattle.io.cluster/rke2.vue +96 -18
  59. package/edit/workload/mixins/workload.js +6 -7
  60. package/edit/workload/storage/Mount.vue +3 -3
  61. package/initialize/App.js +206 -0
  62. package/{nuxt → initialize}/client.js +406 -360
  63. package/{nuxt → initialize}/index.js +21 -22
  64. package/layouts/standalone.vue +13 -0
  65. package/list/catalog.cattle.io.clusterrepo.vue +1 -0
  66. package/list/rbac.authorization.k8s.io.clusterrolebinding.vue +48 -0
  67. package/list/workload.vue +6 -4
  68. package/mixins/chart.js +29 -1
  69. package/mixins/fetch.client.js +95 -0
  70. package/{nuxt/mixins → mixins}/fetch.server.js +30 -26
  71. package/mixins/labeled-form-element.ts +2 -2
  72. package/models/constraints.gatekeeper.sh.constraint.js +37 -0
  73. package/models/pod.js +4 -0
  74. package/models/rbac.authorization.k8s.io.clusterrolebinding.js +16 -0
  75. package/models/rbac.authorization.k8s.io.rolebinding.js +16 -0
  76. package/package.json +9 -13
  77. package/pages/c/_cluster/apps/charts/install.vue +61 -39
  78. package/pages/diagnostic.vue +32 -25
  79. package/pages/rio/mesh.vue +1 -2
  80. package/pkg/tsconfig.json +0 -1
  81. package/plugins/clean-html-directive.js +3 -0
  82. package/plugins/dashboard-store/index.js +1 -1
  83. package/plugins/plugin.js +0 -14
  84. package/plugins/portal-vue.js +4 -0
  85. package/rancher-components/components/Banner/Banner.test.ts +3 -5
  86. package/rancher-components/components/Banner/Banner.vue +1 -0
  87. package/rancher-components/components/Form/Radio/RadioButton.test.ts +31 -0
  88. package/rancher-components/components/Form/Radio/RadioButton.vue +14 -3
  89. package/scripts/extension/publish +42 -23
  90. package/scripts/serve-pkgs +6 -2
  91. package/store/type-map.js +1 -1
  92. package/tsconfig.json +0 -1
  93. package/types/rancher/index.d.ts +2 -0
  94. package/types/shell/index.d.ts +353 -284
  95. package/utils/__tests__/grafana.test.ts +44 -0
  96. package/utils/axios.js +190 -0
  97. package/{nuxt → utils}/cookie-universal-nuxt.js +7 -6
  98. package/utils/dom.js +15 -0
  99. package/utils/gc/gc.ts +1 -1
  100. package/utils/grafana.js +35 -16
  101. package/{nuxt/utils.js → utils/nuxt.js} +265 -236
  102. package/utils/router.scrollBehavior.js +1 -1
  103. package/vue.config.js +30 -19
  104. package/nuxt/App.js +0 -210
  105. package/nuxt/axios.js +0 -186
  106. package/nuxt/empty.js +0 -1
  107. package/nuxt/jsonp.js +0 -82
  108. package/nuxt/loading.html +0 -39
  109. package/nuxt/mixins/fetch.client.js +0 -90
  110. package/nuxt/portal-vue.js +0 -4
  111. package/nuxt/server.js +0 -312
  112. package/nuxt/views/app.template.html +0 -9
  113. package/nuxt/views/error.html +0 -23
  114. package/plugins/dashboard-store/extensions.js +0 -22
  115. /package/{nuxt/components → components/nuxt}/nuxt-build-indicator.vue +0 -0
  116. /package/{nuxt/components → components/nuxt}/nuxt-child.js +0 -0
  117. /package/{nuxt/components → components/nuxt}/nuxt-error.vue +0 -0
  118. /package/{nuxt/components → components/nuxt}/nuxt-link.client.js +0 -0
  119. /package/{nuxt/components → components/nuxt}/nuxt-link.server.js +0 -0
  120. /package/{nuxt/components → components/nuxt}/nuxt-loading.vue +0 -0
@@ -1191,16 +1191,29 @@ export default {
1191
1191
  }
1192
1192
  }
1193
1193
 
1194
- /* Chart custom UI components have the ability to edit CRD chart values
1195
- apply those values in addition to the global values being copied over frm the primary chart
1194
+ /* Chart custom UI components have the ability to edit CRD chart values eg gatekeeper-crd has values.enableRuntimeDefaultSeccompProfile
1195
+ like the main chart, only CRD values that differ from defaults should be sent on install/upgrade
1196
+ CRDs should be installed with the same global values as the main chart
1196
1197
  */
1197
1198
  for (const versionInfo of this.autoInstallInfo) {
1199
+ // allValues are the values potentially changed in the installation ui: any previously customized values + defaults
1200
+ // values are default values from the chart
1201
+ const { allValues, values: crdValues } = versionInfo;
1202
+
1203
+ // only save crd values that differ from the defaults defined in chart values.yaml
1204
+ const customizedCrdValues = diff(crdValues, allValues);
1205
+
1206
+ // CRD globals should be overwritten by main chart globals
1207
+ // we want to avoid including globals present on crd values and not main chart values
1208
+ // that covers the scenario where a global value was customized on a previous install (and so is present in crd global vals) and the user has reverted it to default on this update (no longer present in main chart global vals)
1209
+ const crdValuesToInstall = { ...customizedCrdValues, global: values.global };
1210
+
1198
1211
  out.charts.unshift({
1199
1212
  chartName: versionInfo.chart.name,
1200
1213
  version: versionInfo.chart.version,
1201
1214
  releaseName: versionInfo.chart.annotations[CATALOG_ANNOTATIONS.RELEASE_NAME] || chart.name,
1202
1215
  projectId: this.project,
1203
- values: merge(versionInfo.values, this.addGlobalValuesTo({ global: values.global }))
1216
+ values: crdValuesToInstall
1204
1217
  });
1205
1218
  }
1206
1219
  /*
@@ -1487,42 +1500,44 @@ export default {
1487
1500
  </div>
1488
1501
  </template>
1489
1502
  <template #helmValues>
1490
- <Banner
1491
- v-if="step2Description"
1492
- color="info"
1493
- class="description"
1494
- >
1495
- {{ step2Description }}
1496
- </Banner>
1497
- <div class="step__values__controls">
1498
- <ButtonGroup
1499
- v-model="preFormYamlOption"
1500
- :options="formYamlOptions"
1501
- inactive-class="bg-disabled btn-sm"
1502
- active-class="bg-primary btn-sm"
1503
- :disabled="preFormYamlOption != formYamlOption"
1504
- />
1505
- <div class="step__values__controls--spacer">
1506
- &nbsp;
1507
- </div>
1508
- <ButtonGroup
1509
- v-if="showDiff"
1510
- v-model="diffMode"
1511
- :options="yamlDiffModeOptions"
1512
- inactive-class="bg-disabled btn-sm"
1513
- active-class="bg-primary btn-sm"
1514
- />
1515
- <div
1516
- v-if="hasReadme && !showingReadmeWindow"
1517
- class="btn-group"
1503
+ <div class="sticky-header">
1504
+ <Banner
1505
+ v-if="step2Description"
1506
+ color="info"
1507
+ class="description"
1518
1508
  >
1519
- <button
1520
- type="button"
1521
- class="btn bg-primary btn-sm"
1522
- @click="showSlideIn = !showSlideIn"
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"
1523
1532
  >
1524
- {{ t('catalog.install.steps.helmValues.chartInfo.button') }}
1525
- </button>
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>
1526
1541
  </div>
1527
1542
  </div>
1528
1543
  <div class="scroll__container">
@@ -1945,8 +1960,6 @@ export default {
1945
1960
  .scroll {
1946
1961
  &__container {
1947
1962
  $yaml-height: 200px;
1948
- display: flex;
1949
- flex: 1;
1950
1963
  min-height: $yaml-height;
1951
1964
  height: 0;
1952
1965
  }
@@ -2045,4 +2058,13 @@ export default {
2045
2058
  margin-top: 5px;
2046
2059
  }
2047
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
+
2048
2070
  </style>
@@ -18,7 +18,7 @@ export default {
18
18
  const clusterForCounts = filterHiddenLocalCluster(filterOnlyKubernetesClusters(readyClusters), this.$store);
19
19
  const finalCounts = [];
20
20
  const promises = [];
21
- let topTenForResponseTime = [];
21
+ const topFifteenForResponseTime = [];
22
22
 
23
23
  clusterForCounts.forEach((cluster, i) => {
24
24
  // Necessary to retrieve the proper display name of the cluster
@@ -42,6 +42,7 @@ export default {
42
42
 
43
43
  if (counts) {
44
44
  const sanitizedCount = [];
45
+ let finalCount = [];
45
46
 
46
47
  Object.keys(counts).forEach((key) => {
47
48
  sanitizedCount[key] = counts[key].summary?.count;
@@ -53,20 +54,22 @@ export default {
53
54
 
54
55
  const sortedCount = sortBy(sanitizedCount, 'count:desc');
55
56
 
56
- topTenForResponseTime = topTenForResponseTime.concat(sortedCount);
57
- topTenForResponseTime = sortBy(topTenForResponseTime, 'count:desc');
58
- topTenForResponseTime = topTenForResponseTime.splice(0, 15);
57
+ finalCount = finalCount.concat(sortedCount);
58
+ finalCount = sortBy(finalCount, 'count:desc');
59
+ finalCount = finalCount.splice(0, 15);
59
60
 
60
- topTenForResponseTime.forEach((item, i) => {
61
- topTenForResponseTime[i].id = finalCounts[index].id;
62
- topTenForResponseTime[i].capiId = finalCounts[index].capiId;
61
+ finalCount.forEach((item, i) => {
62
+ finalCount[i].id = finalCounts[index].id;
63
+ finalCount[i].capiId = finalCounts[index].capiId;
63
64
  });
64
65
 
66
+ topFifteenForResponseTime.push(finalCount);
67
+
65
68
  finalCounts[index].counts = sortedCount;
66
69
  }
67
70
  });
68
71
 
69
- this.topTenForResponseTime = topTenForResponseTime;
72
+ this.topFifteenForResponseTime = topFifteenForResponseTime;
70
73
  this.finalCounts = finalCounts;
71
74
  },
72
75
 
@@ -122,12 +125,12 @@ export default {
122
125
 
123
126
  return {
124
127
  systemInformation,
125
- topTenForResponseTime: null,
126
- responseTimes: null,
127
- finalCounts: null,
128
- includeResponseTimes: true,
129
- storeMapping: this.$store?._modules?.root?.state,
130
- latestLogs: console.logs // eslint-disable-line no-console
128
+ topFifteenForResponseTime: null,
129
+ responseTimes: null,
130
+ finalCounts: null,
131
+ includeResponseTimes: true,
132
+ storeMapping: this.$store?._modules?.root?.state,
133
+ latestLogs: console.logs // eslint-disable-line no-console
131
134
  };
132
135
  },
133
136
 
@@ -205,17 +208,21 @@ export default {
205
208
  },
206
209
 
207
210
  async gatherResponseTimes(btnCb) {
208
- return await Promise.all(this.topTenForResponseTime.map((item) => {
209
- const t = Date.now();
210
-
211
- return this.$store.dispatch('management/request', { url: `/k8s/clusters/${ item.capiId }/v1/${ item.resource }` })
212
- .then(() => ({
213
- outcome: 'success', item, durationMs: Date.now() - t
214
- }))
215
- .catch(() => ({
216
- outcome: 'error', item, durationMs: Date.now() - t
217
- }));
218
- })).then((responseTimes) => {
211
+ const promises = this.topFifteenForResponseTime.flatMap((cluster) => {
212
+ return cluster.map((item) => {
213
+ const t = Date.now();
214
+
215
+ return this.$store.dispatch('management/request', { url: `/k8s/clusters/${ item.capiId }/v1/${ item.resource }` })
216
+ .then(() => ({
217
+ outcome: 'success', item, durationMs: Date.now() - t
218
+ }))
219
+ .catch(() => ({
220
+ outcome: 'error', item, durationMs: Date.now() - t
221
+ }));
222
+ });
223
+ });
224
+
225
+ return await Promise.all(promises).then((responseTimes) => {
219
226
  this.responseTimes = responseTimes;
220
227
  this.setResourceResponseTiming(responseTimes);
221
228
  btnCb(true);
@@ -1,5 +1,4 @@
1
1
  <script>
2
- import $ from 'jquery';
3
2
  import { escapeHtml } from '@shell/utils/string';
4
3
 
5
4
  const RADIUS = 5;
@@ -399,7 +398,7 @@ export default {
399
398
  },
400
399
 
401
400
  clicked(event) {
402
- const path = $(event.target).closest('.edgePath');
401
+ const path = event.target.closest('.edgePath');
403
402
 
404
403
  console.log(path); // eslint-disable-line no-console
405
404
  }
package/pkg/tsconfig.json CHANGED
@@ -18,7 +18,6 @@
18
18
  "webpack-env",
19
19
  "@types/node",
20
20
  "@types/jest",
21
- "@nuxt/types"
22
21
  ],
23
22
  "lib": [
24
23
  "esnext",
@@ -25,6 +25,9 @@ export const cleanHtmlDirective = {
25
25
  },
26
26
  componentUpdated(el, binding) {
27
27
  el.innerHTML = purifyHTML(binding.value);
28
+ },
29
+ unbind(el) {
30
+ el.innerHTML = '';
28
31
  }
29
32
  };
30
33
 
@@ -38,7 +38,7 @@ export default (vuexModule, config, init) => {
38
38
  store.registerModule(namespace, vuexModule);
39
39
  store.commit(`${ namespace }/applyConfig`, config);
40
40
 
41
- if ( !process.client || !window.__NUXT__ ) {
41
+ if ( !process.client ) {
42
42
  return;
43
43
  }
44
44
 
package/plugins/plugin.js CHANGED
@@ -2,23 +2,9 @@
2
2
  import { allHashSettled } from '@shell/utils/promise';
3
3
  import { shouldNotLoadPlugin, UI_PLUGIN_BASE_URL } from '@shell/config/uiplugins';
4
4
 
5
- const META_NAME_PREFIX = 'app-autoload-';
6
-
7
5
  export default async function(context) {
8
- // UI Plugins declared in the HTML head
9
- const meta = context.app?.head?.meta || [];
10
6
  const hash = {};
11
7
 
12
- meta.forEach((m) => {
13
- const metaName = m.name || '';
14
-
15
- if (metaName.indexOf(META_NAME_PREFIX) === 0) {
16
- const name = metaName.substr(META_NAME_PREFIX.length);
17
-
18
- hash[name] = context.$plugin.loadAsync(name, m.content);
19
- }
20
- });
21
-
22
8
  // Provide a mechanism to load the UI without the plugins loaded - in case there is a problem
23
9
  let loadPlugins = true;
24
10
 
@@ -0,0 +1,4 @@
1
+ import Vue from 'vue';
2
+ import PortalVue from 'portal-vue';
3
+
4
+ Vue.use(PortalVue);
@@ -1,6 +1,6 @@
1
1
  import { mount } from '@vue/test-utils';
2
2
  import { Banner } from './index';
3
- import { cleanHtmlDirective } from '@shell/plugins/clean-html-directive'
3
+ import { cleanHtmlDirective } from '@shell/plugins/clean-html-directive';
4
4
 
5
5
  describe('component: Banner', () => {
6
6
  it('should display text based on label', () => {
@@ -8,10 +8,8 @@ describe('component: Banner', () => {
8
8
  const wrapper = mount(
9
9
  Banner,
10
10
  {
11
- directives: {
12
- cleanHtmlDirective
13
- },
14
- propsData: { label }
11
+ directives: { cleanHtmlDirective },
12
+ propsData: { label }
15
13
  });
16
14
 
17
15
  const element = wrapper.find('span').element;
@@ -164,6 +164,7 @@ $icon-size: 24px;
164
164
  width: 100%;
165
165
  border-left: solid $left-border-size transparent;
166
166
  display: flex;
167
+ gap: 3px;
167
168
 
168
169
  .primary & {
169
170
  background: var(--primary);
@@ -0,0 +1,31 @@
1
+ import { shallowMount } from '@vue/test-utils';
2
+ import { RadioButton } from './index';
3
+ import { cleanHtmlDirective } from '@shell/plugins/clean-html-directive';
4
+
5
+ describe('RadioButton.vue', () => {
6
+ it('renders label slot contents', () => {
7
+ const wrapper = shallowMount(RadioButton, { slots: { label: 'Test Label' } });
8
+
9
+ expect(wrapper.find('.radio-label').text()).toBe('Test Label');
10
+ });
11
+
12
+ it('renders label prop contents', () => {
13
+ const wrapper = shallowMount(
14
+ RadioButton,
15
+ {
16
+ directives: { cleanHtmlDirective },
17
+ propsData: { label: 'Test Label' }
18
+ });
19
+
20
+ expect(wrapper.find('.radio-label').text()).toBe('Test Label');
21
+ });
22
+
23
+ it('renders slot contents when both slot and label prop are provided', () => {
24
+ const wrapper = shallowMount(RadioButton, {
25
+ slots: { label: 'Test Label - Slot' },
26
+ propsData: { label: 'Test Label - Props' },
27
+ });
28
+
29
+ expect(wrapper.find('.radio-label').text()).toBe('Test Label - Slot');
30
+ });
31
+ });
@@ -96,6 +96,10 @@ export default Vue.extend({
96
96
  hasDescriptionSlot(): boolean {
97
97
  return !!this.$slots.description;
98
98
  },
99
+
100
+ hasLabelSlot(): boolean {
101
+ return !!this.$slots.label || !!this.$scopedSlots.label;
102
+ }
99
103
  },
100
104
 
101
105
  watch: {
@@ -149,12 +153,19 @@ export default Vue.extend({
149
153
  />
150
154
  <div class="labeling">
151
155
  <label
152
- v-if="label"
153
156
  :class="[ muteLabel ? 'text-muted' : '', 'radio-label', 'm-0']"
154
157
  :for="name"
155
- v-clean-html="label"
156
158
  >
157
- <slot name="label">{{ label }}</slot>
159
+ <slot
160
+ v-if="hasLabelSlot"
161
+ name="label"
162
+ >
163
+ <!-- slot content -->
164
+ </slot>
165
+ <span
166
+ v-else-if="label"
167
+ v-clean-html="label"
168
+ />
158
169
  </label>
159
170
  <div
160
171
  v-if="descriptionKey || description"
@@ -81,6 +81,12 @@ echo -e "${CYAN}${BOLD}Publishing UI Plugins${RESET}"
81
81
  pushd ${BASE_DIR} > /dev/null
82
82
 
83
83
  if [ "${GITHUB_BUILD}" == "true" ]; then
84
+ # Determine if gh-pages build is possible
85
+ if [[ "${GITHUB_BRANCH}" == "gh-pages" ]] && ! git show-ref -q gh-pages; then
86
+ echo -e "${YELLOW}'gh-pages' branch not found, this branch must exist before running this script${RESET}"
87
+ exit 1
88
+ fi
89
+
84
90
  echo -e "${CYAN}GitHub Repository: ${GITHUB_SOURCE}${RESET}"
85
91
  echo -e "${CYAN}GitHub Branch : ${GITHUB_BRANCH}${RESET}"
86
92
  else
@@ -188,27 +194,22 @@ for d in pkg/*/ ; do
188
194
  echo -e "${CYAN}Building plugin from source code${RESET}"
189
195
  FORCE_COLOR=1 yarn build-pkg $pkg | cat
190
196
 
191
- if [ "${GITHUB_BUILD}" == "false" ]; then
192
- # Build the docker image
193
- ${SCRIPT_DIR}/bundle ${pkg} ${PKG_VERSION} ${REGISTRY} ${REGISTRY_ORG} ${IMAGE_PREFIX} ${PUSH}
194
- else
195
- echo -e "${CYAN}Adding plugin code ...${RESET}"
197
+ echo -e "${CYAN}Adding plugin code ...${RESET}"
196
198
 
197
- EXT_FOLDER=${BASE_DIR}/extensions/${pkg}/${PKG_VERSION}
198
- PKG_DIST="${BASE_DIR}/dist-pkg/${PKG_NAME}"
199
+ EXT_FOLDER=${BASE_DIR}/extensions/${pkg}/${PKG_VERSION}
200
+ PKG_DIST="${BASE_DIR}/dist-pkg/${PKG_NAME}"
199
201
 
200
- rm -rf ${EXT_FOLDER}
202
+ rm -rf ${EXT_FOLDER}
201
203
 
202
- mkdir -p ${EXT_FOLDER}/plugin
204
+ mkdir -p ${EXT_FOLDER}/plugin
203
205
 
204
- # Copy the code into the folder
205
- cp -R ${PKG_DIST}/* ${EXT_FOLDER}/plugin
206
+ # Copy the code into the folder
207
+ cp -R ${PKG_DIST}/* ${EXT_FOLDER}/plugin
206
208
 
207
- pushd ${BASE_DIR}/extensions/${pkg}/${PKG_VERSION} > /dev/null
208
- rm -f plugin/report.html
209
- find plugin -type f | sort > files.txt
210
- popd > /dev/null
211
- fi
209
+ pushd ${BASE_DIR}/extensions/${pkg}/${PKG_VERSION} > /dev/null
210
+ rm -f plugin/report.html
211
+ find plugin -type f | sort > files.txt
212
+ popd > /dev/null
212
213
 
213
214
  rm -rf ${TMP}/container
214
215
 
@@ -248,7 +249,7 @@ for d in pkg/*/ ; do
248
249
  rm *.yaml
249
250
  mv temp.cr cr.yaml
250
251
  ENDPOINT=https://raw.githubusercontent.com/${GITHUB_SOURCE}/${GITHUB_BRANCH}/extensions/${pkg}/${PKG_VERSION}
251
- sed -i.bak -e 's@endpoint: .*@endpoint: '"${ENDPOINT}"'@g' cr.yaml
252
+ sed -i.bak -e 's@endpoint: .*@endpoint: '"${ENDPOINT}"'@g' cr.yaml
252
253
  rm *.bak
253
254
  popd > /dev/null
254
255
  fi
@@ -266,6 +267,15 @@ for d in pkg/*/ ; do
266
267
 
267
268
  if [ -f "${HELM_INDEX}" ]; then
268
269
  UPDATE="--merge ${HELM_INDEX}"
270
+ elif [ "${GITHUB_BUILD}" == "true" ] && [[ -n ${GITHUB_SOURCE} ]]; then
271
+ GITHUB_SOURCE=$(echo -e "${GITHUB_SOURCE}" | sed 's/https:\/\///g')
272
+
273
+ # Check if git branch contains index.yaml
274
+ wget -P ${BASE_DIR} https://raw.githubusercontent.com/${GITHUB_SOURCE}/${GITHUB_BRANCH}/index.yaml
275
+
276
+ if [ -f "${HELM_INDEX}" ]; then
277
+ UPDATE="--merge ${HELM_INDEX}"
278
+ fi
269
279
  fi
270
280
 
271
281
  # Base URL referencing assets directly from GitHub
@@ -292,6 +302,21 @@ for d in pkg/*/ ; do
292
302
  fi
293
303
  done
294
304
 
305
+ if [ "${GITHUB_BUILD}" == "false" ]; then
306
+ BASE=$(basename ${BASE_DIR})
307
+ EXT_VERSION=$(jq -r .version ${BASE_DIR}/package.json)
308
+
309
+ if [ -z ${EXT_VERSION} ]; then
310
+ EXT_VERSION="0.0.0"
311
+ fi
312
+
313
+ echo -e "${CYAN}Base extension: ${BASE}${RESET}"
314
+ echo -e "${CYAN}Extension version: ${EXT_VERSION}${RESET}"
315
+
316
+ # Build the docker image
317
+ ${SCRIPT_DIR}/bundle ${BASE} ${EXT_VERSION} ${REGISTRY} ${REGISTRY_ORG} ${IMAGE_PREFIX} ${PUSH}
318
+ fi
319
+
295
320
  if [ "${GITHUB_BUILD}" == "true" ]; then
296
321
  cp index.yaml tmp
297
322
  fi
@@ -306,9 +331,3 @@ rm -rf ${CHART_TMP}
306
331
  if [ "${GITHUB_BUILD}" == "false" ]; then
307
332
  rm -rf ${TMP}
308
333
  fi
309
-
310
- # If the user asked to create a commit, commit the changes
311
- # if [ "${COMMIT}" == "true" ]; then
312
- # echo -e "${CYAN}${BOLD}Creating git commit${RESET}"
313
- # git add --all
314
- # fi
@@ -2,13 +2,17 @@
2
2
 
3
3
  const fs = require('fs-extra');
4
4
  const path = require('path');
5
-
6
- console.log(__dirname);
5
+ const { exit } = require('process');
7
6
 
8
7
  const dir = path.resolve('.');
9
8
  const pkgs = path.join(dir, 'dist-pkg');
10
9
  let port = 4500;
11
10
 
11
+ if (!fs.existsSync(pkgs)) {
12
+ console.log(`\n\x1B[31m%s\x1B[0m\n`, `Error: The 'dist-pkg directory doesn't exist. You likely need to run the 'yarn build-pkg <pkg name>' command first.`);
13
+ exit(1);
14
+ }
15
+
12
16
  const express = require('express');
13
17
  const serveStatic = require('serve-static');
14
18
 
package/store/type-map.js CHANGED
@@ -1163,7 +1163,7 @@ export const getters = {
1163
1163
  return (rawType, subType) => {
1164
1164
  const key = getters.componentFor(rawType, subType);
1165
1165
 
1166
- return hasCustom(state, rootState, 'machine-config', key, key => resolveCloudCredentialComponent(key));
1166
+ return hasCustom(state, rootState, 'cloud-credential', key, key => resolveCloudCredentialComponent(key));
1167
1167
  };
1168
1168
  },
1169
1169
 
package/tsconfig.json CHANGED
@@ -4,7 +4,6 @@
4
4
  "types": [
5
5
  "@types/node",
6
6
  "@types/jest",
7
- "@nuxt/types"
8
7
  ]
9
8
  },
10
9
  "exclude": [
@@ -5,3 +5,5 @@ declare module '@rancher/auto-import' {
5
5
  declare module '@shell/store/type-map' {
6
6
  export function DSL(store: any, name: string): any;
7
7
  }
8
+
9
+ declare module '@shell/plugins/dashboard-store';