@rancher/shell 0.5.1 → 0.5.3

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 (70) hide show
  1. package/assets/translations/en-us.yaml +8 -4
  2. package/components/ClusterIconMenu.vue +24 -9
  3. package/components/CodeMirror.vue +79 -18
  4. package/components/FixedBanner.vue +1 -0
  5. package/components/ResourceDetail/index.vue +1 -4
  6. package/components/ResourceYaml.vue +29 -5
  7. package/components/SideNav.vue +42 -64
  8. package/components/SortableTable/index.vue +1 -1
  9. package/components/YamlEditor.vue +1 -0
  10. package/components/__tests__/CodeMirror.spec.ts +99 -0
  11. package/components/form/BannerSettings.vue +3 -0
  12. package/components/form/FileSelector.vue +1 -0
  13. package/components/form/KeyValue.vue +1 -0
  14. package/components/formatter/WorkloadDetailEndpoints.vue +12 -22
  15. package/components/formatter/__tests__/WorkloadDetailEndpoints.test.ts +81 -0
  16. package/components/nav/Header.vue +1 -0
  17. package/components/nav/Jump.vue +19 -9
  18. package/components/nav/TopLevelMenu.vue +37 -15
  19. package/components/nav/Type.vue +15 -4
  20. package/components/nav/__tests__/TopLevelMenu.test.ts +1 -1
  21. package/components/nav/__tests__/Type.test.ts +30 -0
  22. package/core/types-provisioning.ts +7 -0
  23. package/detail/__tests__/provisioning.cattle.io.cluster.test.ts +77 -0
  24. package/detail/fleet.cattle.io.bundle.vue +1 -1
  25. package/detail/provisioning.cattle.io.cluster.vue +19 -4
  26. package/edit/management.cattle.io.setting.vue +1 -0
  27. package/edit/monitoring.coreos.com.alertmanagerconfig/types/opsgenie.vue +1 -1
  28. package/edit/monitoring.coreos.com.alertmanagerconfig/types/pagerduty.vue +1 -2
  29. package/edit/monitoring.coreos.com.alertmanagerconfig/types/slack.vue +1 -1
  30. package/edit/provisioning.cattle.io.cluster/index.vue +23 -10
  31. package/edit/provisioning.cattle.io.cluster/rke2.vue +22 -50
  32. package/edit/provisioning.cattle.io.cluster/tabs/Basics.vue +9 -11
  33. package/edit/provisioning.cattle.io.cluster/tabs/registries/RegistryConfigs.vue +3 -1
  34. package/edit/provisioning.cattle.io.cluster/tabs/registries/index.vue +3 -0
  35. package/edit/token.vue +1 -0
  36. package/list/catalog.cattle.io.app.vue +1 -0
  37. package/list/management.cattle.io.setting.vue +1 -0
  38. package/machine-config/amazonec2.vue +1 -0
  39. package/models/__tests__/provisioning.cattle.io.cluster.test.ts +151 -0
  40. package/models/__tests__/secret.test.ts +37 -0
  41. package/models/__tests__/storage.k8s.io.storageclass.test.ts +22 -0
  42. package/models/management.cattle.io.kontainerdriver.js +2 -1
  43. package/models/provisioning.cattle.io.cluster.js +36 -1
  44. package/models/secret.js +9 -0
  45. package/models/storage.k8s.io.storageclass.js +1 -1
  46. package/package.json +1 -1
  47. package/pages/c/_cluster/settings/DefaultLinksEditor.vue +1 -0
  48. package/pages/c/_cluster/settings/brand.vue +3 -0
  49. package/pages/c/_cluster/uiplugins/AddExtensionRepos.vue +4 -4
  50. package/pages/c/_cluster/uiplugins/SetupUIPlugins.vue +5 -2
  51. package/pages/c/_cluster/uiplugins/__tests__/AddExtensionRepos.test.ts +96 -0
  52. package/pages/c/_cluster/uiplugins/__tests__/SetupUIPlugins.test.ts +128 -0
  53. package/plugins/dashboard-store/__tests__/actions.test.ts +196 -111
  54. package/plugins/dashboard-store/actions.js +4 -6
  55. package/plugins/dashboard-store/getters.js +60 -2
  56. package/plugins/dashboard-store/resource-class.js +6 -2
  57. package/plugins/steve/__tests__/getters.spec.ts +10 -0
  58. package/plugins/steve/__tests__/resource-utils.test.ts +159 -0
  59. package/plugins/steve/actions.js +3 -37
  60. package/plugins/steve/getters.js +6 -0
  61. package/plugins/steve/resource-utils.ts +38 -0
  62. package/scripts/extension/parse-tag-name +3 -3
  63. package/store/__tests__/type-map.test.ts +1122 -0
  64. package/store/index.js +3 -2
  65. package/store/plugins.js +7 -6
  66. package/store/type-map.js +145 -75
  67. package/types/shell/index.d.ts +2 -0
  68. package/utils/__tests__/create-yaml.test.ts +10 -0
  69. package/utils/create-yaml.js +5 -1
  70. package/utils/object.js +10 -0
@@ -1,14 +1,14 @@
1
1
  import https from 'https';
2
2
  import { addParam, parse as parseUrl, stringify as unParseUrl } from '@shell/utils/url';
3
3
  import { handleSpoofedRequest, loadSchemas } from '@shell/plugins/dashboard-store/actions';
4
- import { set } from '@shell/utils/object';
4
+ import { dropKeys, set } from '@shell/utils/object';
5
5
  import { deferred } from '@shell/utils/promise';
6
6
  import { streamJson, streamingSupported } from '@shell/utils/stream';
7
7
  import isObject from 'lodash/isObject';
8
8
  import { classify } from '@shell/plugins/dashboard-store/classify';
9
9
  import { NAMESPACE } from '@shell/config/types';
10
- import jsyaml from 'js-yaml';
11
10
  import { handleKubeApiHeaderWarnings } from '@shell/plugins/steve/header-warnings';
11
+ import { steveCleanForDownload } from '@shell/plugins/steve/resource-utils';
12
12
 
13
13
  export default {
14
14
 
@@ -330,31 +330,7 @@ export default {
330
330
 
331
331
  // remove fields added by steve before showing/downloading yamls
332
332
  cleanForDownload(ctx, yaml) {
333
- if (!yaml) {
334
- return;
335
- }
336
- const rootKeys = [
337
- 'id',
338
- 'links',
339
- 'type',
340
- 'actions'
341
- ];
342
- const metadataKeys = [
343
- 'fields',
344
- 'relationships',
345
- 'state',
346
- ];
347
- const conditionKeys = [
348
- 'error',
349
- 'transitioning',
350
- ];
351
- const obj = jsyaml.load(yaml);
352
-
353
- dropKeys(obj, rootKeys);
354
- dropKeys(obj?.metadata, metadataKeys);
355
- (obj?.status?.conditions || []).forEach((condition) => dropKeys(condition, conditionKeys));
356
-
357
- return jsyaml.dump(obj);
333
+ return steveCleanForDownload(yaml);
358
334
  }
359
335
  };
360
336
 
@@ -398,16 +374,6 @@ function dropUnderscores(obj) {
398
374
  }
399
375
  }
400
376
 
401
- function dropKeys(obj, keys) {
402
- if ( !obj ) {
403
- return;
404
- }
405
-
406
- for ( const k of keys ) {
407
- delete obj[k];
408
- }
409
- }
410
-
411
377
  function dropCattleKeys(obj) {
412
378
  if ( !obj ) {
413
379
  return;
@@ -33,6 +33,12 @@ export default {
33
33
  const parsedUrl = parse(url);
34
34
  const isSteve = steveRegEx.test(parsedUrl.path);
35
35
 
36
+ // labelSelector
37
+ if ( opt.labelSelector ) {
38
+ url += `${ url.includes('?') ? '&' : '?' }labelSelector=${ opt.labelSelector }`;
39
+ }
40
+ // End: labelSelector
41
+
36
42
  // Filter
37
43
  if ( opt.filter ) {
38
44
  url += `${ (url.includes('?') ? '&' : '?') }`;
@@ -0,0 +1,38 @@
1
+ import { dropKeys } from '@shell/utils/object';
2
+ import jsyaml from 'js-yaml';
3
+
4
+ export function steveCleanForDownload(yaml: string, keys?: {
5
+ rootKeys?: string[],
6
+ metadataKeys?: string[],
7
+ conditionKeys?: string[]
8
+ }): string | undefined {
9
+ if (!yaml) {
10
+ return;
11
+ }
12
+
13
+ const {
14
+ rootKeys = [
15
+ 'id',
16
+ 'links',
17
+ 'type',
18
+ 'actions'
19
+ ],
20
+ metadataKeys = [
21
+ 'fields',
22
+ 'relationships',
23
+ 'state',
24
+ ],
25
+ conditionKeys = [
26
+ 'error',
27
+ 'transitioning',
28
+ ]
29
+ } = keys || {};
30
+
31
+ const obj: any = jsyaml.load(yaml);
32
+
33
+ dropKeys(obj, rootKeys);
34
+ dropKeys(obj?.metadata, metadataKeys);
35
+ (obj?.status?.conditions || []).forEach((condition: any) => dropKeys(condition, conditionKeys));
36
+
37
+ return jsyaml.dump(obj);
38
+ }
@@ -4,8 +4,8 @@ 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}" == "charts" ]]; then
7
+ # Ensure "catalog" workflow release tag name does not match a pkg/<pkg-name>
8
+ if [[ "${GITHUB_WORKFLOW_TYPE}" == "catalog" ]]; then
9
9
  for d in pkg/*/ ; do
10
10
  pkg=$(basename $d)
11
11
 
@@ -19,7 +19,7 @@ if [[ "${GITHUB_WORKFLOW_TYPE}" == "charts" ]]; then
19
19
  fi
20
20
  done
21
21
  else
22
- # Check base extension name for tag name
22
+ # Ensure "charts" workflow release tag name does not match the root <pkg-name>
23
23
  BASE_EXT=$(jq -r .name package.json)
24
24
  EXT_VERSION=$(jq -r .version package.json)
25
25