@rancher/shell 2.0.0 → 2.0.2-rc.1

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 (154) hide show
  1. package/assets/translations/en-us.yaml +69 -29
  2. package/assets/translations/zh-hans.yaml +1 -0
  3. package/components/AlertTable.vue +17 -7
  4. package/components/AssignTo.vue +2 -0
  5. package/components/GrafanaDashboard.vue +6 -4
  6. package/components/PromptRemove.vue +1 -0
  7. package/components/Questions/index.vue +2 -2
  8. package/components/auth/RoleDetailEdit.vue +5 -4
  9. package/components/form/KeyValue.vue +1 -0
  10. package/components/form/Members/ClusterPermissionsEditor.vue +1 -1
  11. package/components/form/ProjectMemberEditor.vue +1 -1
  12. package/components/form/ResourceLabeledSelect.vue +11 -3
  13. package/components/form/Taints.vue +13 -7
  14. package/components/form/__tests__/Taints.test.ts +70 -0
  15. package/components/form/labeled-select-utils/labeled-select.utils.ts +1 -1
  16. package/components/nav/Header.vue +1 -1
  17. package/components/nav/TopLevelMenu.vue +1 -4
  18. package/config/pagination-table-headers.js +5 -4
  19. package/config/product/auth.js +1 -1
  20. package/config/roles.ts +34 -19
  21. package/config/router/navigation-guards/attempt-first-login.js +1 -1
  22. package/config/router/navigation-guards/authentication.js +1 -1
  23. package/config/router/navigation-guards/i18n.js +13 -0
  24. package/config/router/navigation-guards/index.js +3 -1
  25. package/config/router/navigation-guards/load-initial-settings.js +1 -1
  26. package/config/router/navigation-guards/runtime-extension-route.js +31 -0
  27. package/config/router/routes.js +10 -1
  28. package/config/uiplugins.js +130 -61
  29. package/core/plugin.ts +5 -0
  30. package/core/plugins.js +7 -1
  31. package/detail/__tests__/provisioning.cattle.io.cluster.test.ts +42 -0
  32. package/detail/provisioning.cattle.io.cluster.vue +4 -4
  33. package/dialog/DeactivateDriverDialog.vue +30 -11
  34. package/edit/auth/__tests__/oidc.test.ts +2 -2
  35. package/edit/provisioning.cattle.io.cluster/__tests__/Basics.test.ts +86 -13
  36. package/edit/provisioning.cattle.io.cluster/__tests__/DirectoryConfig.test.ts +3 -134
  37. package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +209 -0
  38. package/edit/provisioning.cattle.io.cluster/index.vue +8 -4
  39. package/edit/provisioning.cattle.io.cluster/rke2.vue +115 -17
  40. package/edit/provisioning.cattle.io.cluster/tabs/AddOnAdditionalManifest.vue +50 -0
  41. package/edit/provisioning.cattle.io.cluster/tabs/AddOnConfig.vue +29 -64
  42. package/edit/provisioning.cattle.io.cluster/tabs/Basics.vue +42 -3
  43. package/edit/provisioning.cattle.io.cluster/tabs/DirectoryConfig.vue +22 -86
  44. package/edit/provisioning.cattle.io.cluster/tabs/registries/RegistryConfigs.vue +8 -2
  45. package/edit/provisioning.cattle.io.cluster/tabs/registries/__tests__/RegistryConfigs.test.ts +61 -0
  46. package/edit/token.vue +2 -1
  47. package/initialize/entry-helpers.js +4 -24
  48. package/list/management.cattle.io.feature.vue +4 -2
  49. package/middleware/authenticated.js +0 -19
  50. package/mixins/__tests__/chart.test.ts +4 -1
  51. package/mixins/auth-config.js +1 -1
  52. package/mixins/chart.js +30 -14
  53. package/models/__tests__/apps.deployment.test.ts +93 -0
  54. package/models/apps.deployment.js +18 -4
  55. package/models/driver.js +3 -2
  56. package/models/kontainerdriver.js +30 -13
  57. package/models/management.cattle.io.authconfig.js +2 -2
  58. package/models/management.cattle.io.cluster.js +2 -2
  59. package/models/management.cattle.io.user.js +3 -3
  60. package/models/nodedriver.js +35 -13
  61. package/models/provisioning.cattle.io.cluster.js +4 -0
  62. package/package.json +3 -2
  63. package/pages/404.vue +15 -0
  64. package/pages/auth/login.vue +4 -1
  65. package/pages/auth/setup.vue +4 -1
  66. package/pages/c/_cluster/apps/charts/install.vue +3 -2
  67. package/pages/c/_cluster/explorer/index.vue +5 -0
  68. package/pages/c/_cluster/manager/drivers/kontainerDriver/index.vue +0 -3
  69. package/pages/c/_cluster/manager/drivers/nodeDriver/index.vue +1 -4
  70. package/pages/c/_cluster/manager/jwt.authentication/index.vue +10 -4
  71. package/pages/c/_cluster/settings/performance.vue +2 -2
  72. package/pages/c/_cluster/uiplugins/InstallDialog.vue +2 -1
  73. package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +7 -10
  74. package/pages/c/_cluster/uiplugins/index.vue +24 -16
  75. package/pages/home.vue +1 -13
  76. package/plugins/dashboard-store/actions.js +1 -1
  77. package/plugins/dashboard-store/getters.js +1 -1
  78. package/plugins/steve/__tests__/getters.test.ts +5 -5
  79. package/plugins/steve/getters.js +6 -4
  80. package/plugins/steve/hybrid-class.js +1 -5
  81. package/promptRemove/pod.vue +15 -7
  82. package/scripts/extension/helm/charts/ui-plugin-server/Chart.yaml +1 -1
  83. package/scripts/publish-shell.sh +54 -55
  84. package/scripts/test-plugins-build.sh +45 -39
  85. package/shell/types/shell/index.d.ts +2 -0
  86. package/store/auth.js +1 -1
  87. package/store/index.js +1 -1
  88. package/store/type-map.js +4 -2
  89. package/types/store/pagination.types.ts +1 -1
  90. package/utils/__tests__/kontainer.test.ts +89 -1
  91. package/utils/auth.js +1 -1
  92. package/utils/cluster.js +9 -0
  93. package/utils/kontainer.ts +5 -1
  94. package/utils/settings.ts +3 -1
  95. package/utils/version.js +2 -1
  96. package/creators/app/app.package.json +0 -13
  97. package/creators/app/files/.eslintignore +0 -16
  98. package/creators/app/files/.eslintrc.js +0 -173
  99. package/creators/app/files/.gitignore +0 -70
  100. package/creators/app/files/.gitlab-ci.yml +0 -14
  101. package/creators/app/files/.vscode/settings.json +0 -21
  102. package/creators/app/files/babel.config.js +0 -1
  103. package/creators/app/files/tsconfig.json +0 -42
  104. package/creators/app/files/vue.config.js +0 -6
  105. package/creators/app/init +0 -120
  106. package/creators/app/package.json +0 -25
  107. package/creators/pkg/files/.github/workflows/build-extension-catalog.yml +0 -24
  108. package/creators/pkg/files/.github/workflows/build-extension-charts.yml +0 -22
  109. package/creators/pkg/files/babel.config.js +0 -1
  110. package/creators/pkg/files/index.ts +0 -14
  111. package/creators/pkg/files/tsconfig.json +0 -53
  112. package/creators/pkg/files/vue.config.js +0 -1
  113. package/creators/pkg/init +0 -286
  114. package/creators/pkg/package.json +0 -19
  115. package/creators/pkg/pkg.package.json +0 -21
  116. package/creators/pkg/vue-shim.ts +0 -4
  117. package/creators/update/init +0 -56
  118. package/creators/update/package.json +0 -20
  119. package/creators/update/upgrade +0 -56
  120. package/rancher-components/components/Accordion/Accordion.test.ts +0 -45
  121. package/rancher-components/components/Accordion/Accordion.vue +0 -86
  122. package/rancher-components/components/Accordion/index.ts +0 -1
  123. package/rancher-components/components/BadgeState/BadgeState.test.ts +0 -12
  124. package/rancher-components/components/BadgeState/BadgeState.vue +0 -111
  125. package/rancher-components/components/BadgeState/index.ts +0 -1
  126. package/rancher-components/components/Banner/Banner.test.ts +0 -59
  127. package/rancher-components/components/Banner/Banner.vue +0 -244
  128. package/rancher-components/components/Banner/index.ts +0 -1
  129. package/rancher-components/components/Card/Card.test.ts +0 -37
  130. package/rancher-components/components/Card/Card.vue +0 -167
  131. package/rancher-components/components/Card/index.ts +0 -1
  132. package/rancher-components/components/Form/Checkbox/Checkbox.test.ts +0 -68
  133. package/rancher-components/components/Form/Checkbox/Checkbox.vue +0 -421
  134. package/rancher-components/components/Form/Checkbox/index.ts +0 -1
  135. package/rancher-components/components/Form/LabeledInput/LabeledInput.test.ts +0 -40
  136. package/rancher-components/components/Form/LabeledInput/LabeledInput.vue +0 -402
  137. package/rancher-components/components/Form/LabeledInput/index.ts +0 -1
  138. package/rancher-components/components/Form/Radio/RadioButton.test.ts +0 -33
  139. package/rancher-components/components/Form/Radio/RadioButton.vue +0 -293
  140. package/rancher-components/components/Form/Radio/RadioGroup.test.ts +0 -30
  141. package/rancher-components/components/Form/Radio/RadioGroup.vue +0 -259
  142. package/rancher-components/components/Form/Radio/index.ts +0 -2
  143. package/rancher-components/components/Form/TextArea/TextAreaAutoGrow.vue +0 -172
  144. package/rancher-components/components/Form/TextArea/index.ts +0 -1
  145. package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.test.ts +0 -94
  146. package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.vue +0 -152
  147. package/rancher-components/components/Form/ToggleSwitch/index.ts +0 -1
  148. package/rancher-components/components/Form/index.ts +0 -5
  149. package/rancher-components/components/LabeledTooltip/LabeledTooltip.vue +0 -156
  150. package/rancher-components/components/LabeledTooltip/index.ts +0 -1
  151. package/rancher-components/components/StringList/StringList.test.ts +0 -754
  152. package/rancher-components/components/StringList/StringList.vue +0 -650
  153. package/rancher-components/components/StringList/index.ts +0 -1
  154. package/types/shell/index.d.ts +0 -4585
@@ -30,6 +30,16 @@ export default {
30
30
  type: {
31
31
  type: String,
32
32
  required: true
33
+ },
34
+
35
+ close: {
36
+ type: Function,
37
+ required: true
38
+ },
39
+
40
+ doneLocation: {
41
+ type: Object,
42
+ default: () => {}
33
43
  }
34
44
  },
35
45
 
@@ -69,23 +79,21 @@ export default {
69
79
 
70
80
  methods: {
71
81
  async remove(confirm) {
72
- const parentComponent = this.$parent.$parent.$parent;
73
-
74
82
  let goTo;
75
83
 
76
- if (parentComponent.doneLocation) {
84
+ if (this.doneLocation) {
77
85
  // doneLocation will recompute to undefined when delete request completes
78
- goTo = { ...parentComponent.doneLocation };
86
+ goTo = { ...this.doneLocation };
79
87
  }
80
88
 
81
89
  try {
82
90
  await Promise.all(this.value.map((resource) => this.removePod(resource)));
83
91
  if ( goTo && !isEmpty(goTo) ) {
84
- parentComponent.currentRouter.push(goTo);
92
+ this.value?.[0]?.currentRouter().push(goTo);
85
93
  }
86
- parentComponent.close();
94
+ this.close();
87
95
  } catch (err) {
88
- parentComponent.error = err;
96
+ this.$emit('errors', err);
89
97
  confirm(false);
90
98
  }
91
99
  },
@@ -1,6 +1,6 @@
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'
3
+ catalog.cattle.io/kube-version: '>= 1.16.0-0'
4
4
  catalog.cattle.io/namespace: cattle-ui-plugin-system # Must prefix with cattle- and suffix with -system=
5
5
  catalog.cattle.io/os: linux
6
6
  catalog.cattle.io/permits-os: linux, windows
@@ -6,10 +6,15 @@ BASE_DIR="$(
6
6
  pwd
7
7
  )"
8
8
  SHELL_DIR=$BASE_DIR/shell/
9
- TMP_DIR=$BASE_DIR/tmp
10
- PUBLISH_ARGS="--no-git-tag-version --access public $PUBLISH_ARGS"
9
+ CREATORS_DIR=$BASE_DIR/creators/extension
11
10
  FORCE_PUBLISH_TO_NPM="false"
12
- DEFAULT_YARN_REGISTRY="https://registry.npmjs.org"
11
+ DEFAULT_NPM_REGISTRY="https://registry.npmjs.org"
12
+
13
+ # if TAG doesn't exist, we can exit as it's needed for any type of publish.
14
+ if [ -z "$TAG" ]; then
15
+ echo "You need to set the TAG variable first!"
16
+ exit 1
17
+ fi
13
18
 
14
19
  if [ ! -d "${BASE_DIR}/node_modules" ]; then
15
20
  echo "You need to run 'yarn install' first"
@@ -23,72 +28,49 @@ if [ "$1" == "--npm" ]; then
23
28
  fi
24
29
 
25
30
  if [ "$FORCE_PUBLISH_TO_NPM" == "true" ]; then
26
- export YARN_REGISTRY=$DEFAULT_YARN_REGISTRY
31
+ export NPM_REGISTRY=$DEFAULT_NPM_REGISTRY
27
32
  fi
28
33
 
29
- # We use the version from the shell package for the creator packages
30
- # Need to copy them to a temporary location, so we can patch the version number
31
- # before publishing
32
-
33
- # To set a token for NPM registry auth: `npm config set //registry.npmjs.org/:_authToken <TOKEN>``
34
-
35
- PKG_DIST=$BASE_DIR/dist-pkg/creators
36
- mkdir -p ${PKG_DIST}
37
- rm -rf ${PKG_DIST}/app
38
- rm -rf ${PKG_DIST}/pkg
39
- rm -rf ${PKG_DIST}/update
34
+ PUBLISH_ARGS="--no-git-tag-version --access public --registry $NPM_REGISTRY"
40
35
 
41
36
  pushd ${SHELL_DIR} >/dev/null
42
37
 
43
- PKG_VERSION=$(node -p "require('./package.json').version")
44
- popd >/dev/null
45
-
46
- echo "Publishing version: $PKG_VERSION"
47
-
48
- cp -R ${SHELL_DIR}/creators/app ${PKG_DIST}
49
- cp -R ${SHELL_DIR}/creators/pkg ${PKG_DIST}
50
- cp -R ${SHELL_DIR}/creators/update ${PKG_DIST}
51
-
52
- sed -i.bak -e "s/\"0.0.0/"\"$PKG_VERSION"/g" ${PKG_DIST}/app/package.json
53
- sed -i.bak -e "s/\"0.0.0/"\"$PKG_VERSION"/g" ${PKG_DIST}/pkg/package.json
54
- sed -i.bak -e "s/\"0.0.0/"\"$PKG_VERSION"/g" ${PKG_DIST}/update/package.json
55
-
56
- rm ${PKG_DIST}/app/package.json.bak
57
- rm ${PKG_DIST}/pkg/package.json.bak
58
- rm ${PKG_DIST}/update/package.json.bak
59
-
60
38
  function publish() {
61
39
  NAME=$1
62
40
  FOLDER=$2
63
41
 
42
+ # if we pass a third arg, that is the version number
43
+ # that we want to actually publish on NPM
44
+ # they should match with the package.json version stated
45
+ # because of the check in the "Check Tags Version Matching" step in the workflow
46
+ if [ -n "$3" ]; then
47
+ PKG_VERSION=$3
48
+ fi
49
+
64
50
  echo "Publishing ${NAME} from ${FOLDER}"
65
51
  pushd ${FOLDER} >/dev/null
66
52
 
67
53
  # For now, copy the rancher components into the shell and ship them with it
68
54
  if [ "$NAME" == "Shell" ]; then
69
55
  echo "Adding Rancher Components"
56
+ rm -rf ./rancher-components
70
57
  cp -R ${BASE_DIR}/pkg/rancher-components/src/components ./rancher-components/
71
58
  fi
72
59
 
73
- if [ "$NAME" == "Update" ]; then
74
- # Add files from the app and pkg creators to the update package
75
- mkdir -p ./app
76
- mkdir -p ./pkg
77
- cp -R ${BASE_DIR}/shell/creators/app/* ./app
78
- cp -R ${BASE_DIR}/shell/creators/pkg/* ./pkg
79
- # Remove index.ts from pkg files, as we don't want to replace that
80
- rm -f ./pkg/files/index.ts
81
-
82
- # Update the package.json for the app
83
- cd app
84
- node ${SCRIPT_DIR}/record-deps.js
85
- cd ..
60
+ # if the PKG_VERSION has a - it means it will be a pre-release of legacy-v2
61
+ if [[ $PKG_VERSION == *"-"* ]]; then
62
+ PUBLISH_ARGS="$PUBLISH_ARGS --tag legacy-v2-pre-release"
63
+ else
64
+ # If we need to release shell, we tag it as legacy-v2
65
+ PUBLISH_ARGS="$PUBLISH_ARGS --tag legacy-v2"
86
66
  fi
87
67
 
88
68
  # Make a note of dependency versions, if required
89
69
  node ${SCRIPT_DIR}/record-deps.js
90
70
 
91
- yarn publish . --new-version ${PKG_VERSION} ${PUBLISH_ARGS}
71
+ echo "Publishing to registry: $NPM_REGISTRY with args: $PUBLISH_ARGS"
72
+
73
+ npm publish ${PUBLISH_ARGS}
92
74
  RET=$?
93
75
 
94
76
  popd >/dev/null
@@ -99,15 +81,32 @@ function publish() {
99
81
  fi
100
82
  }
101
83
 
102
- # Generate the type definitions for the shell
103
- ${SCRIPT_DIR}/typegen.sh
104
-
105
- # Publish the packages - don't tag the git repo and don't auto-increment the version number
106
- publish "Shell" ${SHELL_DIR}
107
- publish "Application creator" ${PKG_DIST}/app/
108
- publish "Package creator" ${PKG_DIST}/pkg/
109
- publish "Update" ${PKG_DIST}/update/
84
+ echo "TAG ${TAG}"
85
+
86
+ # let's get the package name and version from the tag
87
+ PKG_NAME=$(sed 's/-pkg-v.*//' <<< "$TAG")
88
+ PKG_V=$(sed 's/.*-pkg-v//'<<< "$TAG")
110
89
 
111
- echo "Done"
90
+ echo "PKG_NAME ${PKG_NAME}"
91
+ echo "PKG_V ${PKG_V}"
112
92
 
93
+ # Generate the type definitions for the shell
94
+ if [ ${PKG_NAME} == "shell" ]; then
95
+ ${SCRIPT_DIR}/typegen.sh
96
+ fi
113
97
 
98
+ # version comparison checks
99
+ case $PKG_NAME in
100
+ "shell")
101
+ echo "Publishing only Shell pkg via tagged release"
102
+ publish "Shell" ${SHELL_DIR} ${PKG_V}
103
+ ;;
104
+ "creators")
105
+ echo "Publishing only Creators pkg via tagged release"
106
+ publish "Extension creator" ${CREATORS_DIR} ${PKG_V}
107
+ ;;
108
+ *)
109
+ echo "something went wrong with the tagging name => TAG: ${TAG} , PKG_NAME: ${PKG_NAME}. Admissable names are 'shell' and 'creator'"
110
+ exit 1
111
+ ;;
112
+ esac
@@ -8,8 +8,8 @@ SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
8
8
  BASE_DIR="$( cd $SCRIPT_DIR && cd ../.. & pwd)"
9
9
  SHELL_DIR=$BASE_DIR/shell/
10
10
  SHELL_VERSION="99.99.99"
11
- DEFAULT_YARN_REGISTRY="https://registry.npmjs.org"
12
- VERDACCIO_YARN_REGISTRY="http://localhost:4873"
11
+ DEFAULT_NPM_REGISTRY="https://registry.npmjs.org/"
12
+ VERDACCIO_NPM_REGISTRY="http://localhost:4873"
13
13
 
14
14
  echo ${SCRIPT_DIR}
15
15
 
@@ -69,11 +69,11 @@ else
69
69
  rm -rf ~/.config/verdaccio/storage/@rancher/*
70
70
  fi
71
71
 
72
- export YARN_REGISTRY=$VERDACCIO_YARN_REGISTRY
72
+ export NPM_REGISTRY=$VERDACCIO_NPM_REGISTRY
73
73
  export NUXT_TELEMETRY_DISABLED=1
74
74
 
75
75
  # Remove test package from previous run, if present
76
- if [ $TEST_PERSIST_BUILD != "true" ]; then
76
+ if [ "${TEST_PERSIST_BUILD}" != "true" ]; then
77
77
  echo "Removing folder ${BASE_DIR}/pkg/test-pkg"
78
78
  rm -rf ${BASE_DIR}/pkg/test-pkg
79
79
  fi
@@ -81,20 +81,34 @@ fi
81
81
  # We need to patch the version number of the shell, otherwise if we are running
82
82
  # with the currently published version, things will fail as those versions
83
83
  # are already published and Verdaccio will check, since it is a read-through cache
84
- sed -i.bak -e "s/\"version\": \"[0-9]*.[0-9]*.[0-9]*\(-alpha\.[0-9]*\|-release[0-9]*.[0-9]*.[0-9]*\|-rc\.[0-9]*\)\{0,1\}\",/\"version\": \"${SHELL_VERSION}\",/g" ${SHELL_DIR}/package.json
85
- rm ${SHELL_DIR}/package.json.bak
84
+ update_version_in_package_json() {
85
+ local package_json_path="$1"
86
+ local version="$2"
86
87
 
87
- # Same as above for Rancher Components
88
- # We might have bumped the version number but its not published yet, so this will fail
89
- sed -i.bak -e "s/\"version\": \"[0-9]*.[0-9]*.[0-9]*\(-alpha\.[0-9]*\|-release[0-9]*.[0-9]*.[0-9]*\|-rc\.[0-9]*\)\{0,1\}\",/\"version\": \"${SHELL_VERSION}\",/g" ${BASE_DIR}/pkg/rancher-components/package.json
88
+ sed -i.bak -e "s/\"version\": \"[0-9]*.[0-9]*.[0-9]*\(-alpha\.[0-9]*\|-release[0-9]*.[0-9]*.[0-9]*\|-rc\.[0-9]*\)\{0,1\}\",/\"version\": \"${version}\",/g" "$package_json_path"
89
+ rm "${package_json_path}.bak"
90
+ }
91
+
92
+ update_version_in_package_json "${SHELL_DIR}/package.json" "${SHELL_VERSION}"
93
+ update_version_in_package_json "${BASE_DIR}/pkg/rancher-components/package.json" "${SHELL_VERSION}"
94
+ update_version_in_package_json "${BASE_DIR}/creators/extension/package.json" "${SHELL_VERSION}"
90
95
 
91
- # Publish shell
92
- echo "Publishing shell packages to local registry"
96
+ # Publish shell pkg (tag is needed as publish-shell is optimized to work with release-shell-pkg workflow)
97
+ echo "Publishing Shell package to local registry"
93
98
  yarn install
99
+ export TAG="shell-pkg-v${SHELL_VERSION}"
100
+ ${SHELL_DIR}/scripts/publish-shell.sh
101
+
102
+ # Publish creators pkg (tag is needed as publish-shell is optimized to work with release-shell-pkg workflow)
103
+ echo "Publishing Creators package to local registry"
104
+ export TAG="creators-pkg-v${SHELL_VERSION}"
94
105
  ${SHELL_DIR}/scripts/publish-shell.sh
95
106
 
96
107
  # Publish rancher components
97
108
  yarn build:lib
109
+
110
+ npm set registry ${VERDACCIO_NPM_REGISTRY}
111
+ yarn config set registry ${VERDACCIO_NPM_REGISTRY}
98
112
  yarn publish:lib
99
113
 
100
114
  # We pipe into cat for cleaner logging - we need to set pipefail
@@ -107,26 +121,18 @@ if [ "${SKIP_STANDALONE}" == "false" ]; then
107
121
 
108
122
  echo "Using temporary directory ${DIR}"
109
123
 
110
- echo "Verifying app creator package"
124
+ echo "Verifying extension creator"
111
125
 
112
- yarn create @rancher/app test-app
113
- pushd test-app
114
- yarn install
126
+ FORCE_COLOR=true yarn create @rancher/extension test-pkg --app-name test-app | cat
115
127
 
116
- echo "Building skeleton app"
128
+ pushd test-app > /dev/null
117
129
 
130
+ yarn install
118
131
  FORCE_COLOR=true yarn build | cat
119
132
 
120
- # Package creator
121
- echo "Verifying package creator package"
122
- yarn create @rancher/pkg test-pkg -i
123
-
124
- echo "Building test package"
125
- FORCE_COLOR=true yarn build-pkg test-pkg | cat
126
-
127
133
  # Add test list component to the test package
128
134
  # Validates rancher-components imports
129
- mkdir pkg/test-pkg/list
135
+ mkdir -p pkg/test-pkg/list
130
136
  cp ${SHELL_DIR}/list/catalog.cattle.io.clusterrepo.vue pkg/test-pkg/list
131
137
 
132
138
  FORCE_COLOR=true yarn build-pkg test-pkg | cat
@@ -134,7 +140,7 @@ if [ "${SKIP_STANDALONE}" == "false" ]; then
134
140
  echo "Cleaning temporary dir"
135
141
  popd > /dev/null
136
142
 
137
- if [ $TEST_PERSIST_BUILD != "true" ]; then
143
+ if [ "${TEST_PERSIST_BUILD}" != "true" ]; then
138
144
  echo "Removing folder ${DIR}"
139
145
  rm -rf ${DIR}
140
146
  fi
@@ -147,15 +153,16 @@ echo "Validating in-tree package"
147
153
 
148
154
  yarn install
149
155
 
150
- if [ $TEST_PERSIST_BUILD != "true" ]; then
156
+ if [ "${TEST_PERSIST_BUILD}" != "true" ]; then
151
157
  echo "Removing folder ./pkg/test-pkg"
152
158
  rm -rf ./pkg/test-pkg
153
159
  fi
154
160
 
155
- yarn create @rancher/pkg test-pkg -t -i
161
+ yarn create @rancher/extension test-pkg -i
156
162
  cp ${SHELL_DIR}/list/catalog.cattle.io.clusterrepo.vue ./pkg/test-pkg/list
157
163
  FORCE_COLOR=true yarn build-pkg test-pkg | cat
158
- if [ $TEST_PERSIST_BUILD != "true" ]; then
164
+
165
+ if [ "${TEST_PERSIST_BUILD}" != "true" ]; then
159
166
  echo "Removing folder ./pkg/test-pkg"
160
167
  rm -rf ./pkg/test-pkg
161
168
  fi
@@ -168,9 +175,9 @@ function clone_repo_test_extension_build() {
168
175
  echo -e "\nSetting up $REPO_NAME repository locally\n"
169
176
 
170
177
  # set registry to default (to install all of the other dependencies)
171
- yarn config set registry ${DEFAULT_YARN_REGISTRY}
178
+ yarn config set registry ${DEFAULT_NPM_REGISTRY}
172
179
 
173
- if [ $TEST_PERSIST_BUILD != "true" ]; then
180
+ if [ "${TEST_PERSIST_BUILD}" != "true" ]; then
174
181
  echo "Removing folder ${BASE_DIR}/$REPO_NAME"
175
182
  rm -rf ${BASE_DIR}/$REPO_NAME
176
183
  fi
@@ -183,7 +190,7 @@ function clone_repo_test_extension_build() {
183
190
  yarn install
184
191
 
185
192
  # set registry to local verdaccio (to install new shell)
186
- yarn config set registry ${VERDACCIO_YARN_REGISTRY}
193
+ yarn config set registry ${VERDACCIO_NPM_REGISTRY}
187
194
 
188
195
  # update package.json to use a specific version of shell
189
196
  sed -i.bak -e "s/\"\@rancher\/shell\": \"[0-9]*.[0-9]*.[0-9]*\",/\"\@rancher\/shell\": \"${SHELL_VERSION}\",/g" package.json
@@ -209,16 +216,15 @@ function clone_repo_test_extension_build() {
209
216
  popd
210
217
 
211
218
  # delete folder
212
- if [ $TEST_PERSIST_BUILD != "true" ]; then
213
- echo "Removing folder ${BASE_DIR}/$REPO_NAME"
214
- rm -rf ${BASE_DIR}/$REPO_NAME
215
- fi
216
- yarn config set registry ${DEFAULT_YARN_REGISTRY}
219
+ echo "Removing folder ${BASE_DIR}/$REPO_NAME"
220
+ rm -rf ${BASE_DIR}/$REPO_NAME
221
+ yarn config set registry ${DEFAULT_NPM_REGISTRY}
217
222
  }
218
223
 
219
224
  # Here we just add the extension that we want to include as a check (all our official extensions should be included here)
220
225
  # Don't forget to add the unit tests exception to clone_repo_test_extension_build function if a new extension has those
221
- clone_repo_test_extension_build "kubewarden-ui" "kubewarden"
222
- clone_repo_test_extension_build "elemental-ui" "elemental"
226
+ # clone_repo_test_extension_build "kubewarden-ui" "kubewarden"
227
+ # clone_repo_test_extension_build "elemental-ui" "elemental"
228
+ # clone_repo_test_extension_build "capi-ui-extension" "capi"
223
229
 
224
- echo "All done"
230
+ echo "All done"
@@ -0,0 +1,2 @@
1
+ // Auto-generated type definitions for shell
2
+ // Do not modify this file as changes will get overwritten
package/store/auth.js CHANGED
@@ -13,7 +13,7 @@ export const BASE_SCOPES = {
13
13
  googleoauth: ['openid profile email'],
14
14
  azuread: [],
15
15
  keycloakoidc: ['openid profile email'],
16
- oidc: ['openid profile email'],
16
+ genericoidc: ['openid profile email'],
17
17
  };
18
18
 
19
19
  const KEY = 'rc_nonce';
package/store/index.js CHANGED
@@ -594,7 +594,7 @@ export const getters = {
594
594
  },
595
595
 
596
596
  releaseNotesUrl(state, getters) {
597
- const version = getters['management/byId'](MANAGEMENT.SETTING, 'server-version')?.value;
597
+ const version = getters['management/byId'](MANAGEMENT.SETTING, SETTING.VERSION_RANCHER)?.value;
598
598
 
599
599
  const base = 'https://github.com/rancher/rancher/releases';
600
600
 
package/store/type-map.js CHANGED
@@ -2021,8 +2021,10 @@ function hasCustom(state, rootState, kind, key, fallback) {
2021
2021
  return cache[key];
2022
2022
  }
2023
2023
 
2024
- // Check to see if the custom kind is provided by a plugin
2025
- if (!!rootState.$plugin.getDynamic(kind, key)) {
2024
+ // Check to see if the custom kind is provided by a plugin (ignore booleans)
2025
+ const pluginComponent = rootState.$plugin.getDynamic(kind, key);
2026
+
2027
+ if (typeof pluginComponent !== 'boolean' && !!pluginComponent) {
2026
2028
  cache[key] = true;
2027
2029
 
2028
2030
  return cache[key];
@@ -227,7 +227,7 @@ export class PaginationParamFilter extends PaginationParam {
227
227
  /**
228
228
  * Convenience method when you just want an instance of {@link PaginationParamFilter} with a simple `filter=x=y` param
229
229
  */
230
- static createSingleField(field: { field?: string; value: string; equals?: boolean; }): PaginationParam {
230
+ static createSingleField(field: { field?: string; value: string; equals?: boolean; exact?: boolean }): PaginationParam {
231
231
  return new PaginationParamFilter({ fields: [new PaginationFilterField(field)] });
232
232
  }
233
233
 
@@ -1,4 +1,4 @@
1
- import { diffUpstreamSpec } from '@shell/utils/kontainer';
1
+ import { diffUpstreamSpec, syncUpstreamConfig } from '@shell/utils/kontainer';
2
2
 
3
3
  describe('fx: diffUpstreamSpec', () => {
4
4
  it.each([
@@ -90,3 +90,91 @@ describe('fx: diffUpstreamSpec', () => {
90
90
  expect(diffUpstreamSpec(upstream, local)).toStrictEqual(diff);
91
91
  });
92
92
  });
93
+
94
+ describe('fx: syncUpstreamSpec', () => {
95
+ it('should set any fields defined in upstream spec and not local spec', () => {
96
+ const upstream = {
97
+ string: 'def',
98
+ 'other-string': '123',
99
+ alreadySet: 'abc',
100
+ alreadySetArray: [2, 3, 4],
101
+ alreadySetBooleanFalse: false,
102
+ alreadySetBooleanTrue: true
103
+ };
104
+ const local = {
105
+ alreadySet: 'def',
106
+ alreadySetArray: [1, 2, 3],
107
+ alreadySetBooleanFalse: false,
108
+ alreadySetBooleanTrue: true
109
+ };
110
+
111
+ const expected = {
112
+ string: 'def',
113
+ 'other-string': '123',
114
+ alreadySet: 'def',
115
+ alreadySetArray: [1, 2, 3],
116
+ alreadySetBooleanFalse: false,
117
+ alreadySetBooleanTrue: true
118
+ };
119
+
120
+ const testCluster = { eksConfig: local, eksStatus: { upstreamSpec: upstream } };
121
+
122
+ syncUpstreamConfig( 'eks', testCluster);
123
+
124
+ expect(testCluster.eksConfig).toStrictEqual(expected);
125
+ });
126
+
127
+ it('should not set empty objects or arrays from upstream spec', () => {
128
+ const upstream = {
129
+ emptyArray: [],
130
+ emptyObject: {},
131
+ nonEmptyArray: [1, 2, 3],
132
+ nonEmptyObject: { foo: 'bar' },
133
+ alreadySet: 'abc',
134
+ alreadySetArray: [2, 3, 4],
135
+ };
136
+ const local = {
137
+ alreadySet: 'def',
138
+ alreadySetArray: [1, 2, 3],
139
+ };
140
+
141
+ const expected = {
142
+ nonEmptyArray: [1, 2, 3],
143
+ nonEmptyObject: { foo: 'bar' },
144
+ alreadySet: 'def',
145
+ alreadySetArray: [1, 2, 3],
146
+ };
147
+
148
+ const testCluster = { eksConfig: local, eksStatus: { upstreamSpec: upstream } };
149
+
150
+ syncUpstreamConfig( 'eks', testCluster);
151
+
152
+ expect(testCluster.eksConfig).toStrictEqual(expected);
153
+ });
154
+
155
+ it('should not overwrite boolean values explicitly set false', () => {
156
+ const upstream = {
157
+ falseBoolean: false,
158
+ trueBoolean: true,
159
+ alreadySetBooleanFalse: true,
160
+ alreadySetBooleanTrue: false
161
+ };
162
+ const local = {
163
+ alreadySetBooleanFalse: false,
164
+ alreadySetBooleanTrue: true
165
+ };
166
+
167
+ const expected = {
168
+ falseBoolean: false,
169
+ trueBoolean: true,
170
+ alreadySetBooleanFalse: false,
171
+ alreadySetBooleanTrue: true
172
+ };
173
+
174
+ const testCluster = { eksConfig: local, eksStatus: { upstreamSpec: upstream } };
175
+
176
+ syncUpstreamConfig( 'eks', testCluster);
177
+
178
+ expect(testCluster.eksConfig).toStrictEqual(expected);
179
+ });
180
+ });
package/utils/auth.js CHANGED
@@ -71,7 +71,7 @@ export const authProvidersInfo = async(store) => {
71
71
  const nonLocal = rows.filter((x) => x.name !== 'local');
72
72
  const enabled = nonLocal.filter((x) => x.enabled === true );
73
73
 
74
- const supportedNonLocal = nonLocal.filter((x) => x.id !== 'genericoidc');
74
+ const supportedNonLocal = nonLocal.filter((x) => x.id !== 'oidc');
75
75
 
76
76
  const enabledLocation = enabled.length === 1 ? {
77
77
  name: 'c-cluster-auth-config-id',
package/utils/cluster.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import semver from 'semver';
2
+ import { camelToTitle } from '@shell/utils/string';
2
3
  import { CAPI } from '@shell/config/labels-annotations';
3
4
  import { MANAGEMENT, VIRTUAL_HARVESTER_PROVIDER } from '@shell/config/types';
4
5
  import { SETTING } from '@shell/config/settings';
@@ -90,3 +91,11 @@ export function abbreviateClusterName(input) {
90
91
 
91
92
  return result;
92
93
  }
94
+
95
+ export function labelForAddon(name, configuration = true) {
96
+ const addon = camelToTitle(name.replace(/^(rke|rke2|rancher)-/, ''));
97
+ const fallback = `${ addon } ${ configuration ? 'Configuration' : '' }`;
98
+ const key = `cluster.addonChart."${ name }"${ configuration ? '.configuration' : '.label' }`;
99
+
100
+ return this.$store.getters['i18n/withFallback'](key, null, fallback);
101
+ }
@@ -17,7 +17,11 @@ export function syncUpstreamConfig(configPrefix: string, normanCluster: {[key: s
17
17
 
18
18
  if (!isEmpty(upstreamConfig)) {
19
19
  Object.keys(upstreamConfig).forEach((key) => {
20
- if (isEmpty(rancherConfig[key]) && !isEmpty(upstreamConfig[key])) {
20
+ if (typeof upstreamConfig[key] === 'object') {
21
+ if (isEmpty(rancherConfig[key]) && !isEmpty(upstreamConfig[key])) {
22
+ set(rancherConfig, key, upstreamConfig[key]);
23
+ }
24
+ } else if ((rancherConfig[key] === null || rancherConfig[key] === undefined) && upstreamConfig[key] !== null && upstreamConfig[key] !== undefined) {
21
25
  set(rancherConfig, key, upstreamConfig[key]);
22
26
  }
23
27
  });
package/utils/settings.ts CHANGED
@@ -102,5 +102,7 @@ export const getPerformanceSetting = (rootGetters: Record<string, (arg0: string,
102
102
  }
103
103
 
104
104
  // Start with the default and overwrite the values from the setting - ensures we have defaults for newly added options
105
- return Object.assign(DEFAULT_PERF_SETTING, perfSetting || {});
105
+ const safeDefaults = Object.assign({}, DEFAULT_PERF_SETTING);
106
+
107
+ return Object.assign(safeDefaults, perfSetting || {});
106
108
  };
package/utils/version.js CHANGED
@@ -2,6 +2,7 @@ import { sortableNumericSuffix } from '@shell/utils/sort';
2
2
  import semver from 'semver';
3
3
  import { MANAGEMENT } from '@shell/config/types';
4
4
  import { READ_WHATS_NEW, SEEN_WHATS_NEW } from '@shell/store/prefs';
5
+ import { SETTING } from '@shell/config/settings';
5
6
 
6
7
  export function parse(str) {
7
8
  str = `${ str }`;
@@ -82,7 +83,7 @@ export function isDevBuild(version) {
82
83
  }
83
84
 
84
85
  export function getVersionInfo(store) {
85
- const setting = store.getters['management/byId'](MANAGEMENT.SETTING, 'server-version');
86
+ const setting = store.getters['management/byId'](MANAGEMENT.SETTING, SETTING.VERSION_RANCHER);
86
87
  const fullVersion = setting?.value || 'unknown';
87
88
  let displayVersion = fullVersion;
88
89
 
@@ -1,13 +0,0 @@
1
- {
2
- "name": "NAME",
3
- "version": "0.1.0",
4
- "private": false,
5
- "engines": {
6
- "node": ">=12"
7
- },
8
- "dependencies": {},
9
- "resolutions": {
10
- "**/webpack": "4",
11
- "@types/node": "^16"
12
- }
13
- }
@@ -1,16 +0,0 @@
1
- assets/fonts
2
- coverage
3
- .nyc_output
4
- node_modules/
5
- .npm
6
- .eslintcache
7
- .env
8
- .cache
9
- .next
10
- dist
11
- dist-pkg
12
- .DS_Store
13
- dynamic-importer.js
14
- ksconfig.json
15
- shell/utils/dynamic-importer.js
16
- shell/assets/fonts