From 7c2b7d9062e0ed0b41ec3436f98f001858fbf88d Mon Sep 17 00:00:00 2001 From: Katrin Yordanova Date: Thu, 17 Nov 2022 11:52:55 +0200 Subject: [PATCH] Remove handle/slug on resource create --- client/web/admin/src/views/System/Connection/Editor.vue | 2 +- client/web/compose/src/views/Namespace/Edit.vue | 2 +- lib/js/src/api-clients/compose.ts | 9 --------- lib/js/src/api-clients/system.ts | 9 --------- lib/js/tools/codegen/corteza-api-client.js | 2 +- locale/en/corteza-webapp-compose/chart.yaml | 2 +- locale/en/corteza-webapp-compose/namespace.yaml | 2 +- locale/en/corteza-webapp-workflow/general.yaml | 2 +- 8 files changed, 6 insertions(+), 24 deletions(-) diff --git a/client/web/admin/src/views/System/Connection/Editor.vue b/client/web/admin/src/views/System/Connection/Editor.vue index e7daf7426..308d69daf 100644 --- a/client/web/admin/src/views/System/Connection/Editor.vue +++ b/client/web/admin/src/views/System/Connection/Editor.vue @@ -133,7 +133,7 @@ export default { }, handleState () { - return this.connection.handle ? handle.handleState(this.connection.handle) : false + return handle.handleState(this.connection.handle) }, saveDisabled () { diff --git a/client/web/compose/src/views/Namespace/Edit.vue b/client/web/compose/src/views/Namespace/Edit.vue index e57b8f632..0f7113c2a 100644 --- a/client/web/compose/src/views/Namespace/Edit.vue +++ b/client/web/compose/src/views/Namespace/Edit.vue @@ -445,7 +445,7 @@ export default { if (this.isClone) { this.namespace.name = `${ns.name} (${this.$t('cloneSuffix')})` - this.namespace.slug = `${ns.slug}_${this.$t('cloneSuffix')}` + this.namespace.slug = ns.slug ? `${ns.slug}_${this.$t('cloneSuffix')}` : '' } this.fetchApplication() diff --git a/lib/js/src/api-clients/compose.ts b/lib/js/src/api-clients/compose.ts index 8af1c5b88..0dbb8baac 100644 --- a/lib/js/src/api-clients/compose.ts +++ b/lib/js/src/api-clients/compose.ts @@ -288,12 +288,6 @@ export default class Compose { if (!namespaceID) { throw Error('field namespaceID is empty') } - if (!name) { - throw Error('field name is empty') - } - if (!slug) { - throw Error('field slug is empty') - } const cfg: AxiosRequestConfig = { ...extra, method: 'post', @@ -387,9 +381,6 @@ export default class Compose { if (!name) { throw Error('field name is empty') } - if (!slug) { - throw Error('field slug is empty') - } const cfg: AxiosRequestConfig = { ...extra, method: 'post', diff --git a/lib/js/src/api-clients/system.ts b/lib/js/src/api-clients/system.ts index ee636674f..e43872cac 100644 --- a/lib/js/src/api-clients/system.ts +++ b/lib/js/src/api-clients/system.ts @@ -1745,9 +1745,6 @@ export default class System { meta, config, } = (a as KV) || {} - if (!handle) { - throw Error('field handle is empty') - } if (!type) { throw Error('field type is empty') } @@ -1787,9 +1784,6 @@ export default class System { if (!connectionID) { throw Error('field connectionID is empty') } - if (!handle) { - throw Error('field handle is empty') - } if (!type) { throw Error('field type is empty') } @@ -1986,9 +1980,6 @@ export default class System { if (!applicationID) { throw Error('field applicationID is empty') } - if (!name) { - throw Error('field name is empty') - } const cfg: AxiosRequestConfig = { ...extra, method: 'put', diff --git a/lib/js/tools/codegen/corteza-api-client.js b/lib/js/tools/codegen/corteza-api-client.js index bf65d93f9..033420cfe 100644 --- a/lib/js/tools/codegen/corteza-api-client.js +++ b/lib/js/tools/codegen/corteza-api-client.js @@ -13,7 +13,7 @@ if (process.argv.length >= 3) { // Assume "standard" dev environment // where corteza server source could be found // next to this lib - path = '../corteza-server' + path = '../../server' } const dst = `${__dirname}/../../src/api-clients` diff --git a/locale/en/corteza-webapp-compose/chart.yaml b/locale/en/corteza-webapp-compose/chart.yaml index 6f1359b85..f630c2316 100644 --- a/locale/en/corteza-webapp-compose/chart.yaml +++ b/locale/en/corteza-webapp-compose/chart.yaml @@ -153,7 +153,7 @@ edit: import: 'Import chart(s):' newLabel: 'Create a new chart:' name: Chart name * -handle: Handle * +handle: Handle notification: loadFailed: Could not load chart saveFailed: Could not save this chart diff --git a/locale/en/corteza-webapp-compose/namespace.yaml b/locale/en/corteza-webapp-compose/namespace.yaml index 4dd7c72c1..4317478e9 100644 --- a/locale/en/corteza-webapp-compose/namespace.yaml +++ b/locale/en/corteza-webapp-compose/namespace.yaml @@ -41,7 +41,7 @@ searchPlaceholder: Type here to search among all namespaces... setPermissions: Set namespace permissions slug: description: The short name will be used in the URL - label: Short name * + label: Short name placeholder: Enter a short name for the namespace invalid-handle-characters: Should be at least 2 characters long and start with a letter. Can contain only letters, numbers, dashes, underscores and dots subtitle: diff --git a/locale/en/corteza-webapp-workflow/general.yaml b/locale/en/corteza-webapp-workflow/general.yaml index 749b6beb1..c869fe613 100644 --- a/locale/en/corteza-webapp-workflow/general.yaml +++ b/locale/en/corteza-webapp-workflow/general.yaml @@ -5,7 +5,7 @@ error: Error error-expression: Error message (expression) export: Export general: General -handle: Handle * +handle: Handle import: json: Import JSON label: Import