@rancher/shell 0.3.3 → 0.3.4

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.
@@ -403,7 +403,7 @@ export default {
403
403
  <template #cell:name="{row}">
404
404
  <div class="namespace-name">
405
405
  <n-link
406
- v-if="row.detailLocation"
406
+ v-if="row.detailLocation && !row.hideDetailLocation"
407
407
  :to="row.detailLocation"
408
408
  >
409
409
  {{ row.name }}
@@ -94,78 +94,81 @@ function checkExtensionRouteBinding($route, locationConfig) {
94
94
  export function getApplicableExtensionEnhancements(pluginCtx, actionType, uiArea, currRoute, translationCtx = pluginCtx) {
95
95
  const extensionEnhancements = [];
96
96
 
97
- const actions = pluginCtx.$plugin.getUIConfig(actionType, uiArea);
98
-
99
- actions.forEach((action, i) => {
100
- if (checkExtensionRouteBinding(currRoute, action.locationConfig)) {
101
- // ADD CARD PLUGIN UI ENHANCEMENT
102
- if (actionType === ExtensionPoint.CARD) {
103
- // intercept to apply translation
104
- if (uiArea === CardLocation.CLUSTER_DASHBOARD_CARD && action.labelKey) {
105
- actions[i].label = translationCtx.t(action.labelKey);
106
- }
107
-
108
- // ADD ACTION PLUGIN UI ENHANCEMENT
109
- } else if (actionType === ExtensionPoint.ACTION) {
110
- // TABLE ACTION
111
- if (uiArea === ActionLocation.TABLE) {
97
+ // gate it so that we prevent errors on older versions of dashboard
98
+ if (pluginCtx.$plugin?.getUIConfig) {
99
+ const actions = pluginCtx.$plugin.getUIConfig(actionType, uiArea);
100
+
101
+ actions.forEach((action, i) => {
102
+ if (checkExtensionRouteBinding(currRoute, action.locationConfig)) {
103
+ // ADD CARD PLUGIN UI ENHANCEMENT
104
+ if (actionType === ExtensionPoint.CARD) {
112
105
  // intercept to apply translation
113
- if (action.labelKey) {
106
+ if (uiArea === CardLocation.CLUSTER_DASHBOARD_CARD && action.labelKey) {
114
107
  actions[i].label = translationCtx.t(action.labelKey);
115
108
  }
116
109
 
117
- // sets the enabled flag to true if omitted on the config
118
- if (!Object.keys(action).includes('enabled')) {
119
- actions[i].enabled = true;
120
- }
121
-
122
- // bulkable flag
123
- actions[i].bulkable = actions[i].multiple || actions[i].bulkable;
124
-
125
- // populate action identifier to prevent errors
126
- if (!actions[i].action) {
127
- actions[i].action = `custom-table-action-${ randomStr(10).toLowerCase() }`;
110
+ // ADD ACTION PLUGIN UI ENHANCEMENT
111
+ } else if (actionType === ExtensionPoint.ACTION) {
112
+ // TABLE ACTION
113
+ if (uiArea === ActionLocation.TABLE) {
114
+ // intercept to apply translation
115
+ if (action.labelKey) {
116
+ actions[i].label = translationCtx.t(action.labelKey);
117
+ }
118
+
119
+ // sets the enabled flag to true if omitted on the config
120
+ if (!Object.keys(action).includes('enabled')) {
121
+ actions[i].enabled = true;
122
+ }
123
+
124
+ // bulkable flag
125
+ actions[i].bulkable = actions[i].multiple || actions[i].bulkable;
126
+
127
+ // populate action identifier to prevent errors
128
+ if (!actions[i].action) {
129
+ actions[i].action = `custom-table-action-${ randomStr(10).toLowerCase() }`;
130
+ }
128
131
  }
129
- }
130
132
 
131
- // extract simplified shortcut definition on plugin - HEADER ACTION
132
- if (uiArea === ActionLocation.HEADER && action.shortcut) {
133
- // if it's a string, then assume CTRL for windows and META for mac
134
- if (typeof action.shortcut === 'string') {
135
- actions[i].shortcutLabel = () => {
136
- return isMac ? `(\u2318-${ action.shortcut.toUpperCase() })` : `(Ctrl-${ action.shortcut.toUpperCase() })`;
137
- };
138
- actions[i].shortcutKey = { windows: ['ctrl', action.shortcut], mac: ['meta', action.shortcut] };
139
- // correct check for an Object type in JS... handle the object passed
140
- } else if (typeof action.shortcut === 'object' && !Array.isArray(action.shortcut) && action.shortcut !== null) {
141
- actions[i].shortcutKey = action.shortcut;
142
- const keyboardCombo = isMac ? actions[i].shortcut.mac : actions[i].shortcut.windows ? actions[i].shortcut.windows : [];
143
- let scLabel = '';
144
-
145
- keyboardCombo.forEach((key, i) => {
146
- if (i < keyboardCombo.length - 1) {
147
- if (key === 'meta') {
148
- key = '\u2318';
133
+ // extract simplified shortcut definition on plugin - HEADER ACTION
134
+ if (uiArea === ActionLocation.HEADER && action.shortcut) {
135
+ // if it's a string, then assume CTRL for windows and META for mac
136
+ if (typeof action.shortcut === 'string') {
137
+ actions[i].shortcutLabel = () => {
138
+ return isMac ? `(\u2318-${ action.shortcut.toUpperCase() })` : `(Ctrl-${ action.shortcut.toUpperCase() })`;
139
+ };
140
+ actions[i].shortcutKey = { windows: ['ctrl', action.shortcut], mac: ['meta', action.shortcut] };
141
+ // correct check for an Object type in JS... handle the object passed
142
+ } else if (typeof action.shortcut === 'object' && !Array.isArray(action.shortcut) && action.shortcut !== null) {
143
+ actions[i].shortcutKey = action.shortcut;
144
+ const keyboardCombo = isMac ? actions[i].shortcut.mac : actions[i].shortcut.windows ? actions[i].shortcut.windows : [];
145
+ let scLabel = '';
146
+
147
+ keyboardCombo.forEach((key, i) => {
148
+ if (i < keyboardCombo.length - 1) {
149
+ if (key === 'meta') {
150
+ key = '\u2318';
151
+ } else {
152
+ key = ucFirst(key);
153
+ }
154
+ scLabel += `${ key }`;
155
+ scLabel += '-';
149
156
  } else {
150
- key = ucFirst(key);
157
+ scLabel += `${ key.toUpperCase() }`;
151
158
  }
152
- scLabel += `${ key }`;
153
- scLabel += '-';
154
- } else {
155
- scLabel += `${ key.toUpperCase() }`;
156
- }
157
- });
158
-
159
- actions[i].shortcutLabel = () => {
160
- return `(${ scLabel })`;
161
- };
159
+ });
160
+
161
+ actions[i].shortcutLabel = () => {
162
+ return `(${ scLabel })`;
163
+ };
164
+ }
162
165
  }
163
166
  }
164
- }
165
167
 
166
- extensionEnhancements.push(actions[i]);
167
- }
168
- });
168
+ extensionEnhancements.push(actions[i]);
169
+ }
170
+ });
171
+ }
169
172
 
170
173
  return extensionEnhancements;
171
174
  }
@@ -187,11 +187,7 @@ export default class Namespace extends SteveModel {
187
187
  }
188
188
 
189
189
  get _detailLocation() {
190
- let _detailLocation = super._detailLocation;
191
-
192
- if (this.$rootGetters['currentProduct'].hideNamespaceLocation) {
193
- _detailLocation = false;
194
- }
190
+ const _detailLocation = super._detailLocation;
195
191
 
196
192
  return _detailLocation;
197
193
  }
@@ -260,4 +256,8 @@ export default class Namespace extends SteveModel {
260
256
  this.metadata.labels[PROJECT] = project;
261
257
  }
262
258
  }
259
+
260
+ get hideDetailLocation() {
261
+ return !!this.$rootGetters['currentProduct'].hideNamespaceLocation;
262
+ }
263
263
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rancher/shell",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "description": "Rancher Dashboard Shell",
5
5
  "repository": "https://github.com/rancherlabs/dashboard",
6
6
  "license": "Apache-2.0",
package/store/type-map.js CHANGED
@@ -224,29 +224,32 @@ export function DSL(store, product, module = 'type-map') {
224
224
  },
225
225
 
226
226
  headers(type, headers) {
227
- const extensionCols = store.$plugin.getUIConfig(ExtensionPoint.TABLE_COL, TableColumnLocation.RESOURCE);
227
+ // gate it so that we prevent errors on older versions of dashboard
228
+ if (store.$plugin?.getUIConfig) {
229
+ const extensionCols = store.$plugin.getUIConfig(ExtensionPoint.TABLE_COL, TableColumnLocation.RESOURCE);
228
230
 
229
- // Try and insert the columns before the Age column, if that is the last column
230
- let insertPosition = headers.length;
231
+ // Try and insert the columns before the Age column, if that is the last column
232
+ let insertPosition = headers.length;
231
233
 
232
- if (headers.length > 0) {
233
- const lastColumn = headers[headers.length - 1];
234
+ if (headers.length > 0) {
235
+ const lastColumn = headers[headers.length - 1];
234
236
 
235
- if (lastColumn?.name === AGE.name) {
236
- insertPosition--;
237
+ if (lastColumn?.name === AGE.name) {
238
+ insertPosition--;
239
+ }
237
240
  }
238
- }
239
241
 
240
- // adding extension defined cols to the correct header config
241
- extensionCols.forEach((col) => {
242
- if (col.locationConfig.resource) {
243
- col.locationConfig.resource.forEach((resource) => {
244
- if (resource && type === resource) {
245
- headers.splice(insertPosition, 0, col);
246
- }
247
- });
248
- }
249
- });
242
+ // adding extension defined cols to the correct header config
243
+ extensionCols.forEach((col) => {
244
+ if (col.locationConfig.resource) {
245
+ col.locationConfig.resource.forEach((resource) => {
246
+ if (resource && type === resource) {
247
+ headers.splice(insertPosition, 0, col);
248
+ }
249
+ });
250
+ }
251
+ });
252
+ }
250
253
 
251
254
  headers.forEach((header) => {
252
255
  // If on the client, then use the value getter if there is one
package/yarn-error.log ADDED
@@ -0,0 +1,196 @@
1
+ Arguments:
2
+ /Users/aalves/.nvm/versions/node/v16.16.0/bin/node /Users/aalves/.nvm/versions/node/v16.16.0/bin/yarn publish . --new-version 0.3.3 --no-git-tag-version --access public
3
+
4
+ PATH:
5
+ /Users/aalves/.nvm/versions/node/v16.16.0/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
6
+
7
+ Yarn version:
8
+ 1.22.19
9
+
10
+ Node version:
11
+ 16.16.0
12
+
13
+ Platform:
14
+ darwin arm64
15
+
16
+ Trace:
17
+ Error: https://registry.yarnpkg.com/-/user/org.couchdb.user:aalves08: failed to authenticate: Could not authenticate aalves08: bad password
18
+ at Request.params.callback [as _callback] (/Users/aalves/.nvm/versions/node/v16.16.0/lib/node_modules/yarn/lib/cli.js:66145:18)
19
+ at Request.self.callback (/Users/aalves/.nvm/versions/node/v16.16.0/lib/node_modules/yarn/lib/cli.js:140890:22)
20
+ at Request.emit (node:events:527:28)
21
+ at Request.<anonymous> (/Users/aalves/.nvm/versions/node/v16.16.0/lib/node_modules/yarn/lib/cli.js:141862:10)
22
+ at Request.emit (node:events:527:28)
23
+ at IncomingMessage.<anonymous> (/Users/aalves/.nvm/versions/node/v16.16.0/lib/node_modules/yarn/lib/cli.js:141784:12)
24
+ at Object.onceWrapper (node:events:641:28)
25
+ at IncomingMessage.emit (node:events:539:35)
26
+ at endReadableNT (node:internal/streams/readable:1345:12)
27
+ at processTicksAndRejections (node:internal/process/task_queues:83:21)
28
+
29
+ npm manifest:
30
+ {
31
+ "name": "@rancher/shell",
32
+ "version": "0.3.3",
33
+ "description": "Rancher Dashboard Shell",
34
+ "repository": "https://github.com/rancherlabs/dashboard",
35
+ "license": "Apache-2.0",
36
+ "author": "SUSE",
37
+ "private": false,
38
+ "engines": {
39
+ "node": ">=12"
40
+ },
41
+ "files": [
42
+ "**/*"
43
+ ],
44
+ "scripts": {
45
+ "clean": "./scripts/clean",
46
+ "lint": "./node_modules/.bin/eslint --max-warnings 0 --ext .ts,.js,.vue .",
47
+ "test": "./node_modules/.bin/nyc ava --serial --verbose",
48
+ "nuxt": "./node_modules/.bin/nuxt",
49
+ "dev": "./node_modules/.bin/nuxt dev",
50
+ "mem-dev": "node --max-old-space-size=8192 ./node_modules/.bin/nuxt dev",
51
+ "docker-dev": "docker run --rm --name dashboard-dev -p 8005:8005 -e API=$API -v $(pwd):/src -v dashboard_node:/src/node_modules rancher/dashboard:dev",
52
+ "build": "./node_modules/.bin/nuxt build --devtools",
53
+ "analyze": "./node_modules/.bin/nuxt build --analyze",
54
+ "start": "./node_modules/.bin/nuxt start",
55
+ "generate": "./node_modules/.bin/nuxt generate",
56
+ "dev-debug": "node --inspect ./node_modules/.bin/nuxt",
57
+ "cy:run": "cypress run",
58
+ "cy:open": "cypress open",
59
+ "e2e:pre": "NODE_ENV=dev yarn build",
60
+ "e2e:run": "NODE_ENV=dev START_SERVER_AND_TEST_INSECURE=1 start-server-and-test start https://localhost:8005/ cy:run",
61
+ "e2e:dev": "start-server-and-test dev https://localhost:8005 cy:open"
62
+ },
63
+ "dependencies": {
64
+ "@aws-sdk/client-ec2": "3.1.0",
65
+ "@aws-sdk/client-eks": "3.1.0",
66
+ "@aws-sdk/client-kms": "3.8.1",
67
+ "@babel/plugin-proposal-optional-chaining": "7.14.5",
68
+ "@babel/plugin-proposal-private-property-in-object": "7.14.5",
69
+ "@babel/preset-typescript": "7.16.7",
70
+ "@innologica/vue-dropdown-menu": "0.1.3",
71
+ "@novnc/novnc": "1.2.0",
72
+ "@nuxt/types": "2.14.6",
73
+ "@nuxt/typescript-build": "2.1.0",
74
+ "@nuxtjs/axios": "5.12.0",
75
+ "@nuxtjs/eslint-config-typescript": "6.0.1",
76
+ "@nuxtjs/eslint-module": "1.2.0",
77
+ "@nuxtjs/proxy": "1.3.3",
78
+ "@nuxtjs/style-resources": "1.2.1",
79
+ "@nuxtjs/webpack-profile": "0.1.0",
80
+ "@popperjs/core": "2.4.4",
81
+ "@types/node": "16.4.3",
82
+ "@typescript-eslint/eslint-plugin": "4.33.0",
83
+ "@typescript-eslint/parser": "4.33.0",
84
+ "@vue/cli-plugin-babel": "4.5.15",
85
+ "@vue/cli-plugin-typescript": "4.5.15",
86
+ "@vue/cli-service": "4.5.15",
87
+ "@vue/test-utils": "1.2.1",
88
+ "@vue/vue2-jest": "27.0.0",
89
+ "add": "2.0.6",
90
+ "ansi_up": "5.0.0",
91
+ "babel-eslint": "10.1.0",
92
+ "babel-plugin-module-resolver": "4.0.0",
93
+ "babel-preset-vue": "2.0.2",
94
+ "browser-env": "3.3.0",
95
+ "cookie": "0.5.0",
96
+ "cookie-universal-nuxt": "2.1.4",
97
+ "core-js": "3.21.1",
98
+ "cron-validator": "1.2.0",
99
+ "cronstrue": "1.95.0",
100
+ "cross-env": "6.0.3",
101
+ "css-loader": "4.3.0",
102
+ "csv-loader": "3.0.3",
103
+ "cypress": "10.3.1",
104
+ "d3": "7.3.0",
105
+ "d3-selection": "1.4.1",
106
+ "dagre-d3": "0.6.4",
107
+ "dayjs": "1.8.29",
108
+ "diff2html": "2.11.2",
109
+ "dompurify": "2.0.12",
110
+ "eslint": "7.32.0",
111
+ "eslint-config-standard": "16.0.3",
112
+ "eslint-import-resolver-node": "0.3.4",
113
+ "eslint-module-utils": "2.6.1",
114
+ "eslint-plugin-cypress": "2.12.1",
115
+ "eslint-plugin-import": "2.23.4",
116
+ "eslint-plugin-jest": "24.4.0",
117
+ "eslint-plugin-n": "15.2.0",
118
+ "eslint-plugin-vue": "7.14.0",
119
+ "event-target-shim": "5.0.1",
120
+ "express": "4.17.1",
121
+ "file-saver": "2.0.2",
122
+ "frontmatter-markdown-loader": "3.7.0",
123
+ "identicon.js": "2.3.3",
124
+ "intl-messageformat": "7.8.4",
125
+ "is-url": "1.2.4",
126
+ "jest": "27.5.1",
127
+ "jest-serializer-vue": "2.0.2",
128
+ "jexl": "2.2.2",
129
+ "jquery": "3.5.1",
130
+ "js-cookie": "2.2.1",
131
+ "js-yaml": "4.1.0",
132
+ "js-yaml-loader": "1.2.2",
133
+ "jsdiff": "1.1.1",
134
+ "jsdom-global": "3.0.2",
135
+ "jsonpath-plus": "6.0.1",
136
+ "jsrsasign": "10.2.0",
137
+ "jszip": "3.7.0",
138
+ "lodash": "4.17.21",
139
+ "marked": "4.0.17",
140
+ "nodemon": "2.0.4",
141
+ "nuxt": "2.15.8",
142
+ "nyc": "15.1.0",
143
+ "papaparse": "5.3.0",
144
+ "portal-vue": "2.1.7",
145
+ "rancher-icons": "rancher/icons#v2.0.13",
146
+ "require-extension-hooks": "0.3.3",
147
+ "require-extension-hooks-babel": "1.0.0",
148
+ "require-extension-hooks-vue": "3.0.0",
149
+ "sass": "1.51.0",
150
+ "sass-loader": "10.2.1",
151
+ "serve-static": "1.14.1",
152
+ "set-cookie-parser": "2.4.6",
153
+ "shell-quote": "1.7.3",
154
+ "sinon": "8.1.1",
155
+ "start-server-and-test": "1.13.1",
156
+ "style-loader": "1.2.1",
157
+ "ts-node": "8.10.2",
158
+ "typescript": "4.1.6",
159
+ "url-parse": "1.5.10",
160
+ "v-tooltip": "2.0.3",
161
+ "vue": "2.6.14",
162
+ "vue-clipboard2": "0.3.1",
163
+ "vue-codemirror": "4.0.6",
164
+ "vue-js-modal": "1.3.35",
165
+ "vue-resize": "0.4.5",
166
+ "vue-select": "3.18.3",
167
+ "vue-server-renderer": "2.6.14",
168
+ "vue-shortkey": "3.1.7",
169
+ "vue-template-compiler": "2.6.14",
170
+ "vue-virtual-scroll-list": "^2.3.4",
171
+ "vue2-transitions": "0.3.0",
172
+ "vuedraggable": "2.24.3",
173
+ "vuex": "3.6.2",
174
+ "webpack-bundle-analyzer": "4.5.0",
175
+ "webpack-virtual-modules": "0.4.3",
176
+ "xterm": "5.0.0",
177
+ "xterm-addon-fit": "0.6.0",
178
+ "xterm-addon-search": "0.10.0",
179
+ "xterm-addon-web-links": "0.7.0",
180
+ "xterm-addon-webgl": "0.13.0",
181
+ "worker-loader": "3.0.8",
182
+ "yarn": "1.22.18"
183
+ },
184
+ "nyc": {
185
+ "extension": [
186
+ ".js",
187
+ ".vue"
188
+ ]
189
+ }
190
+ }
191
+
192
+ yarn manifest:
193
+ No manifest
194
+
195
+ Lockfile:
196
+ No lockfile