@rancher/shell 1.2.5 → 1.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/core/types.ts CHANGED
@@ -237,6 +237,16 @@ export interface ProductOptions {
237
237
  */
238
238
  to?: Location;
239
239
 
240
+ /**
241
+ * Alternative to the icon property. Uses require
242
+ */
243
+ svg?: Function;
244
+
245
+ /**
246
+ * Product name
247
+ */
248
+ name?: string;
249
+
240
250
  /**
241
251
  * Leaving these here for completeness but I don't think these should be advertised as useable to plugin creators.
242
252
  */
@@ -373,10 +383,25 @@ export interface ConfigureTypeOptions {
373
383
  }
374
384
 
375
385
  export interface ConfigureVirtualTypeOptions extends ConfigureTypeOptions {
386
+ /**
387
+ * Only load the product if the type is present
388
+ */
389
+ ifHave?: string;
390
+
391
+ /**
392
+ * Only load the product if the type is present
393
+ */
394
+ ifHaveType?: string | RegExp | Object;
395
+
396
+ /**
397
+ * The label that this type should display
398
+ */
399
+ label?: string;
400
+
376
401
  /**
377
402
  * The translation key displayed anywhere this type is referenced
378
403
  */
379
- labelKey: string;
404
+ labelKey?: string;
380
405
 
381
406
  /**
382
407
  * An identifier that should be unique across all types
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rancher/shell",
3
- "version": "1.2.5",
3
+ "version": "1.2.6",
4
4
  "description": "Rancher Dashboard Shell",
5
5
  "repository": "https://github.com/rancherlabs/dashboard",
6
6
  "license": "Apache-2.0",
@@ -1,10 +1,8 @@
1
1
  annotations:
2
2
  catalog.cattle.io/certified: rancher # Any application we are adding as a helm chart
3
- catalog.cattle.io/kube-version: '>= 1.16.0-0 < 1.29.0-0'
4
3
  catalog.cattle.io/namespace: cattle-ui-plugin-system # Must prefix with cattle- and suffix with -system=
5
4
  catalog.cattle.io/os: linux
6
5
  catalog.cattle.io/permits-os: linux, windows
7
- catalog.cattle.io/rancher-version: '>= 2.7.0-0 < 2.9.0-0'
8
6
  catalog.cattle.io/scope: management
9
7
  catalog.cattle.io/ui-component: plugins
10
8
  apiVersion: v2
@@ -4,27 +4,36 @@ GITHUB_RELEASE_TAG=$1
4
4
  GITHUB_RUN_ID=$2
5
5
  GITHUB_WORKFLOW_TYPE=$3
6
6
 
7
- # Check packages for released tag name
8
- if [[ "${GITHUB_WORKFLOW_TYPE}" == "container" ]]; then
7
+ echo "Parse tag name - evaluating release tag $GITHUB_RELEASE_TAG"
8
+
9
+ # Ensure "catalog" workflow release tag name matches the root <pkg-name>
10
+ if [[ "${GITHUB_WORKFLOW_TYPE}" == "catalog" ]]; then
11
+ BASE_EXT=$(jq -r .name package.json)
12
+ EXT_VERSION=$(jq -r .version package.json)
13
+
14
+ if [[ "${GITHUB_RELEASE_TAG}" != "${BASE_EXT}-${EXT_VERSION}" ]]; then
15
+ echo -e "release tag doesn't match catalog tag: release tag -> ${GITHUB_RELEASE_TAG} ::: curr catalog tag -> ${BASE_EXT}-${EXT_VERSION}"
16
+ gh run cancel ${GITHUB_RUN_ID}
17
+ exit 1
18
+ fi
19
+ # Ensure "chart" workflow release tag name matches some pkg/<pkg-name>
20
+ else
21
+ NO_MATCHES="true"
22
+
9
23
  for d in pkg/*/ ; do
10
24
  pkg=$(basename $d)
11
25
 
12
26
  PKG_VERSION=$(jq -r .version pkg/${pkg}/package.json)
13
- PKG_NAME="${pkg}-${PKG_VERSION}"
27
+ CURR_PKG_TAG="${pkg}-${PKG_VERSION}"
14
28
 
15
- if [[ "${GITHUB_RELEASE_TAG}" == "${PKG_NAME}" ]]; then
16
- gh run cancel ${GITHUB_RUN_ID}
17
- else
18
- continue
29
+ if [[ "${GITHUB_RELEASE_TAG}" == "${CURR_PKG_TAG}" ]]; then
30
+ NO_MATCHES="false"
19
31
  fi
20
32
  done
21
- else
22
- # Check base extension name for tag name
23
- BASE_EXT=$(jq -r .name package.json)
24
- EXT_VERSION=$(jq -r .version package.json)
25
33
 
26
- if [[ "${GITHUB_RELEASE_TAG}" == "${BASE_EXT}-${EXT_VERSION}" ]]; then
27
- echo -e "tag: ${GITHUB_RELEASE_TAG}"
34
+ if [[ "${NO_MATCHES}" == "true" ]]; then
35
+ echo -e "release tag doesn't match any chart tag: ${GITHUB_RELEASE_TAG}. Check your pkg/<!-YOUR-EXT-> folders and corresponding versions to complete the match"
28
36
  gh run cancel ${GITHUB_RUN_ID}
37
+ exit 1
29
38
  fi
30
- fi
39
+ fi
@@ -64,6 +64,13 @@ function publish() {
64
64
  PUBLISH_ARGS="$PUBLISH_ARGS --tag legacy-v1"
65
65
  fi
66
66
 
67
+ # when testing the workflow, we don't want to actually do an npm publish but only a dry run
68
+ if [ ${DRY_RUN} == "true" ]; then
69
+ PUBLISH_ARGS="$PUBLISH_ARGS --dry-run"
70
+ fi
71
+
72
+ echo "Publish to NPM - arguments ::: ${PUBLISH_ARGS}"
73
+
67
74
  # Make a note of dependency versions, if required
68
75
  node ${SCRIPT_DIR}/record-deps.js
69
76
 
@@ -31,9 +31,11 @@ ${BASE_DIR}/node_modules/.bin/tsc ${SHELL_DIR}/plugins/dashboard-store/normalize
31
31
  ${BASE_DIR}/node_modules/.bin/tsc ${SHELL_DIR}/plugins/dashboard-store/resource-class.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/plugins/dashboard-store/ > /dev/null
32
32
  ${BASE_DIR}/node_modules/.bin/tsc ${SHELL_DIR}/plugins/dashboard-store/classify.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/plugins/dashboard-store/ > /dev/null
33
33
  ${BASE_DIR}/node_modules/.bin/tsc ${SHELL_DIR}/plugins/dashboard-store/actions.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/plugins/dashboard-store/ > /dev/null
34
+ ${BASE_DIR}/node_modules/.bin/tsc ${SHELL_DIR}/plugins/steve/steve-class.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/plugins/steve/ > /dev/null
34
35
 
35
36
  # # mixins
36
37
  ${BASE_DIR}/node_modules/.bin/tsc ${SHELL_DIR}/mixins/create-edit-view/index.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/mixins/create-edit-view > /dev/null
38
+ ${BASE_DIR}/node_modules/.bin/tsc ${SHELL_DIR}/mixins/resource-fetch.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/mixins > /dev/null
37
39
 
38
40
  # # models
39
41
  ${BASE_DIR}/node_modules/.bin/tsc ${SHELL_DIR}/models/namespace.js --declaration --allowJs --emitDeclarationOnly --outDir ${SHELL_DIR}/tmp/models/ > /dev/null
@@ -93,4 +95,4 @@ function processDir() {
93
95
 
94
96
  processDir ${SHELL_DIR}/tmp @shell
95
97
 
96
- rm -rf ${SHELL_DIR}/tmp
98
+ rm -rf ${SHELL_DIR}/tmp
@@ -2147,6 +2147,64 @@ export default _default;
2147
2147
  import Vue from "vue";
2148
2148
  }
2149
2149
 
2150
+ // @shell/mixins/resource-fetch
2151
+
2152
+ declare module '@shell/mixins/resource-fetch' {
2153
+ declare namespace _default {
2154
+ const mixins: any[];
2155
+ function data(): {
2156
+ perfConfig: {};
2157
+ init: boolean;
2158
+ multipleResources: any[];
2159
+ loadResources: any[];
2160
+ hasManualRefresh: boolean;
2161
+ watch: boolean;
2162
+ isTooManyItemsToAutoUpdate: boolean;
2163
+ force: boolean;
2164
+ incremental: boolean;
2165
+ fetchedResourceType: any[];
2166
+ };
2167
+ function data(): {
2168
+ perfConfig: {};
2169
+ init: boolean;
2170
+ multipleResources: any[];
2171
+ loadResources: any[];
2172
+ hasManualRefresh: boolean;
2173
+ watch: boolean;
2174
+ isTooManyItemsToAutoUpdate: boolean;
2175
+ force: boolean;
2176
+ incremental: boolean;
2177
+ fetchedResourceType: any[];
2178
+ };
2179
+ function beforeDestroy(): void;
2180
+ function beforeDestroy(): void;
2181
+ namespace computed {
2182
+ function rows(): any;
2183
+ function rows(): any;
2184
+ function loading(): any;
2185
+ function loading(): any;
2186
+ const refreshFlag: import("vuex").Computed;
2187
+ }
2188
+ namespace watch {
2189
+ function refreshFlag(neu: any): void;
2190
+ function refreshFlag(neu: any): void;
2191
+ }
2192
+ namespace methods {
2193
+ function $initializeFetchData(type: any, multipleResources: any[], storeType: any): void;
2194
+ function $initializeFetchData(type: any, multipleResources: any[], storeType: any): void;
2195
+ function $fetchType(type: any, multipleResources: any[], storeType: any): any;
2196
+ function $fetchType(type: any, multipleResources: any[], storeType: any): any;
2197
+ function __getCountForResources(resourceNames: any, namespace: any, storeType: any): any;
2198
+ function __getCountForResources(resourceNames: any, namespace: any, storeType: any): any;
2199
+ function __getCountForResource(resourceName: any, namespace: any, storeType: any): any;
2200
+ function __getCountForResource(resourceName: any, namespace: any, storeType: any): any;
2201
+ function __gatherResourceFetchData(resourceName: any, multipleResources: any, currStore: any): void;
2202
+ function __gatherResourceFetchData(resourceName: any, multipleResources: any, currStore: any): void;
2203
+ }
2204
+ }
2205
+ export default _default;
2206
+ }
2207
+
2150
2208
  // @shell/models/namespace
2151
2209
 
2152
2210
  declare module '@shell/models/namespace' {
@@ -2857,6 +2915,40 @@ export default class Resource {
2857
2915
  }
2858
2916
  }
2859
2917
 
2918
+ // @shell/plugins/steve/hybrid-class
2919
+
2920
+ declare module '@shell/plugins/steve/hybrid-class' {
2921
+ export function cleanHybridResources(data: any): any;
2922
+ export default class HybridModel {
2923
+ constructor(data: any, ctx: any, rehydrateNamespace?: any, setClone?: boolean);
2924
+ get labels(): any;
2925
+ setLabels(val: any): void;
2926
+ metadata: {};
2927
+ setLabel(key: any, val: any): void;
2928
+ get annotations(): any;
2929
+ setAnnotations(val: any): void;
2930
+ setAnnotation(key: any, val: any): void;
2931
+ get state(): any;
2932
+ }
2933
+ }
2934
+
2935
+ // @shell/plugins/steve/steve-class
2936
+
2937
+ declare module '@shell/plugins/steve/steve-class' {
2938
+ export default class SteveModel extends HybridModel {
2939
+ constructor(data: any, ctx: any, rehydrateNamespace?: any, setClone?: boolean);
2940
+ get name(): any;
2941
+ get namespace(): any;
2942
+ /**
2943
+ * Set description based on the type of model available with private fallback
2944
+ */
2945
+ set description(arg: any);
2946
+ get description(): any;
2947
+ _description: any;
2948
+ }
2949
+ import HybridModel from "./hybrid-class";
2950
+ }
2951
+
2860
2952
  // @shell/store/features
2861
2953
 
2862
2954
  declare module '@shell/store/features' {