Skip to content

Commit

Permalink
use hasgroup: with function for rancher namespaces
Browse files Browse the repository at this point in the history
Signed-off-by: SamiulSourav <[email protected]>
  • Loading branch information
SamiulSourav committed Oct 21, 2024
1 parent 7070092 commit e939ef8
Show file tree
Hide file tree
Showing 27 changed files with 4,803 additions and 5,223 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ steps:
$ref: schema#/properties/spec/properties/sessions/items/properties/encryptionSecret/properties/name
type: input
label:
text: encryptionSecret
text: Encryption Secret
schema:
$ref: schema#/properties/spec/properties/sessions/items/properties/encryptionSecret
show_label: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,7 @@ steps:
- computed: setNamespace
disableUnselect: true
fetch: fetchNamespaces
hasGroup: true
if: isRancherManaged
label:
text: labels.namespace
refresh: true
schema:
$ref: schema#/properties/spec/properties/dataSource/properties/repository/properties/namespace
type: select
- computed: setNamespace
disableUnselect: true
fetch: fetchNamespaces
if: isNotRancherManaged
hasGroup: isRancherManaged
label:
text: labels.namespace
refresh: true
Expand Down Expand Up @@ -107,17 +96,7 @@ steps:
- elements:
- disableUnselect: true
fetch: fetchNamespaces
hasGroup: true
if: isRancherManaged
label:
text: labels.namespace
refresh: true
schema:
$ref: schema#/properties/spec/properties/dataSource/properties/encryptionSecret/properties/namespace
type: select
- disableUnselect: true
fetch: fetchNamespaces
if: isNotRancherManaged
hasGroup: isRancherManaged
label:
text: labels.namespace
refresh: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ function isRancherManaged({ storeGet }) {
return !!found
}

function isNotRancherManaged({ storeGet }) {
return !isRancherManaged({ storeGet })
}

async function fetchNamespacesApi({ axios, storeGet }) {
const params = storeGet('/route/params')
const { user, cluster, group, version, resource } = params
Expand Down Expand Up @@ -388,7 +384,6 @@ return {
isConsole,
initMetadata,
isRancherManaged,
isNotRancherManaged,
fetchNamespacesApi,
setNamespace,
getDbs,
Expand Down
40 changes: 5 additions & 35 deletions charts/kubedbcom-elasticsearch-editor/ui/edit-ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -932,17 +932,7 @@ steps:
elements:
- computed: getDefault|/resources/coreKubestashComBackupConfiguration/spec/backends|storageRef|namespace
fetch: fetchNamespaces
hasGroup: true
if: isRancherManaged
label:
text: Namespace
onChange: onInputChange|resources/coreKubestashComBackupConfiguration/spec/backends|storageRef|namespace|storageRefNamespace
schema:
$ref: discriminator#/storageRefNamespace
type: select
- computed: getDefault|/resources/coreKubestashComBackupConfiguration/spec/backends|storageRef|namespace
fetch: fetchNamespaces
if: isNotRancherManaged
hasGroup: isRancherManaged
label:
text: Namespace
onChange: onInputChange|resources/coreKubestashComBackupConfiguration/spec/backends|storageRef|namespace|storageRefNamespace
Expand All @@ -969,17 +959,7 @@ steps:
elements:
- computed: getDefault|/resources/coreKubestashComBackupConfiguration/spec/backends|retentionPolicy|namespace
fetch: fetchNamespaces
hasGroup: true
if: isRancherManaged
label:
text: Namespace
onChange: onInputChange|resources/coreKubestashComBackupConfiguration/spec/backends|retentionPolicy|namespace|retentionPolicyNamespace
schema:
$ref: discriminator#/retentionPolicyNamespace
type: select
- computed: getDefault|/resources/coreKubestashComBackupConfiguration/spec/backends|retentionPolicy|namespace
fetch: fetchNamespaces
if: isNotRancherManaged
hasGroup: isRancherManaged
label:
text: Namespace
onChange: onInputChange|resources/coreKubestashComBackupConfiguration/spec/backends|retentionPolicy|namespace|retentionPolicyNamespace
Expand All @@ -995,7 +975,7 @@ steps:
$ref: discriminator#/retentionPolicyName
type: select
label:
text: retentionPolicy
text: Retention Policy
show_label: true
type: single-step-form
- discriminator:
Expand All @@ -1006,17 +986,7 @@ steps:
elements:
- computed: getDefault|/resources/coreKubestashComBackupConfiguration/spec/sessions|encryptionSecret|namespace
fetch: fetchNamespaces
hasGroup: true
if: isRancherManaged
label:
text: Namespace
onChange: onInputChange|/resources/coreKubestashComBackupConfiguration/spec/sessions|encryptionSecret|namespace|encryptionSecretNamespace
schema:
$ref: discriminator#/encryptionSecretNamespace
type: select
- computed: getDefault|/resources/coreKubestashComBackupConfiguration/spec/sessions|encryptionSecret|namespace
fetch: fetchNamespaces
if: isNotRancherManaged
hasGroup: isRancherManaged
label:
text: Namespace
onChange: onInputChange|/resources/coreKubestashComBackupConfiguration/spec/sessions|encryptionSecret|namespace|encryptionSecretNamespace
Expand All @@ -1032,7 +1002,7 @@ steps:
$ref: discriminator#/encryptionSecretName
type: select
label:
text: encryptionSecret
text: Encryption Secret
show_label: true
type: single-step-form
if: showInvokerForm|backupConfiguration
Expand Down
5 changes: 0 additions & 5 deletions charts/kubedbcom-elasticsearch-editor/ui/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2623,10 +2623,6 @@ function isRancherManaged({ storeGet }) {
return !!found
}

function isNotRancherManaged({ storeGet }) {
return !isRancherManaged({ storeGet })
}

async function fetchNamespaces({ axios, storeGet }) {
const username = storeGet('/route/params/user')
const clusterName = storeGet('/route/params/cluster')
Expand Down Expand Up @@ -2783,7 +2779,6 @@ return {
fetchNames,
fetchNamespaces,
isRancherManaged,
isNotRancherManaged,
onInputChangeSchedule,
getDefaultSchedule,
getBlueprints,
Expand Down
30 changes: 3 additions & 27 deletions charts/kubedbcom-mariadb-editor-options/ui/create-ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,7 @@ steps:
type: input
- elements:
- fetch: fetchNamespaces
hasGroup: true
if: isClusterRancherManaged|rancher
label:
text: Namespace
schema:
$ref: schema#/properties/spec/properties/init/properties/archiver/properties/encryptionSecret/properties/namespace
type: select
- fetch: fetchNamespaces
if: isClusterRancherManaged|notRancher
hasGroup: isClusterRancherManaged|rancher
label:
text: Namespace
schema:
Expand All @@ -217,15 +209,7 @@ steps:
type: single-step-form
- elements:
- fetch: fetchNamespaces
hasGroup: true
if: isClusterRancherManaged|rancher
label:
text: Namespace
schema:
$ref: schema#/properties/spec/properties/init/properties/archiver/properties/fullDBRepository/properties/namespace
type: select
- fetch: fetchNamespaces
if: isClusterRancherManaged|notRancher
hasGroup: isClusterRancherManaged|rancher
label:
text: Namespace
schema:
Expand All @@ -245,15 +229,7 @@ steps:
type: single-step-form
- elements:
- fetch: fetchNamespaces
hasGroup: true
if: isClusterRancherManaged|rancher
label:
text: Namespace
schema:
$ref: schema#/properties/spec/properties/init/properties/archiver/properties/manifestRepository/properties/namespace
type: select
- fetch: fetchNamespaces
if: isClusterRancherManaged|notRancher
hasGroup: isClusterRancherManaged|rancher
label:
text: Namespace
schema:
Expand Down
40 changes: 5 additions & 35 deletions charts/kubedbcom-mariadb-editor/ui/edit-ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -498,17 +498,7 @@ steps:
elements:
- computed: getDefault|/resources/coreKubestashComBackupConfiguration/spec/backends|storageRef|namespace
fetch: fetchNamespaces
hasGroup: true
if: isRancherManaged
label:
text: Namespace
onChange: onInputChange|resources/coreKubestashComBackupConfiguration/spec/backends|storageRef|namespace|storageRefNamespace
schema:
$ref: discriminator#/storageRefNamespace
type: select
- computed: getDefault|/resources/coreKubestashComBackupConfiguration/spec/backends|storageRef|namespace
fetch: fetchNamespaces
if: isNotRancherManaged
hasGroup: isRancherManaged
label:
text: Namespace
onChange: onInputChange|resources/coreKubestashComBackupConfiguration/spec/backends|storageRef|namespace|storageRefNamespace
Expand All @@ -535,17 +525,7 @@ steps:
elements:
- computed: getDefault|/resources/coreKubestashComBackupConfiguration/spec/backends|retentionPolicy|namespace
fetch: fetchNamespaces
hasGroup: true
if: isRancherManaged
label:
text: Namespace
onChange: onInputChange|resources/coreKubestashComBackupConfiguration/spec/backends|retentionPolicy|namespace|retentionPolicyNamespace
schema:
$ref: discriminator#/retentionPolicyNamespace
type: select
- computed: getDefault|/resources/coreKubestashComBackupConfiguration/spec/backends|retentionPolicy|namespace
fetch: fetchNamespaces
if: isNotRancherManaged
hasGroup: isRancherManaged
label:
text: Namespace
onChange: onInputChange|resources/coreKubestashComBackupConfiguration/spec/backends|retentionPolicy|namespace|retentionPolicyNamespace
Expand All @@ -561,7 +541,7 @@ steps:
$ref: discriminator#/retentionPolicyName
type: select
label:
text: retentionPolicy
text: Retention Policy
show_label: true
type: single-step-form
- discriminator:
Expand All @@ -572,17 +552,7 @@ steps:
elements:
- computed: getDefault|/resources/coreKubestashComBackupConfiguration/spec/sessions|encryptionSecret|namespace
fetch: fetchNamespaces
hasGroup: true
if: isRancherManaged
label:
text: Namespace
onChange: onInputChange|/resources/coreKubestashComBackupConfiguration/spec/sessions|encryptionSecret|namespace|encryptionSecretNamespace
schema:
$ref: discriminator#/encryptionSecretNamespace
type: select
- computed: getDefault|/resources/coreKubestashComBackupConfiguration/spec/sessions|encryptionSecret|namespace
fetch: fetchNamespaces
if: isNotRancherManaged
hasGroup: isRancherManaged
label:
text: Namespace
onChange: onInputChange|/resources/coreKubestashComBackupConfiguration/spec/sessions|encryptionSecret|namespace|encryptionSecretNamespace
Expand All @@ -598,7 +568,7 @@ steps:
$ref: discriminator#/encryptionSecretName
type: select
label:
text: encryptionSecret
text: Encryption Secret
show_label: true
type: single-step-form
if: showInvokerForm|backupConfiguration
Expand Down
5 changes: 0 additions & 5 deletions charts/kubedbcom-mariadb-editor/ui/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -1828,10 +1828,6 @@ function isRancherManaged({ storeGet }) {
return !!found
}

function isNotRancherManaged({ storeGet }) {
return !isRancherManaged({ storeGet })
}

async function fetchNamespaces({ axios, storeGet }) {
const username = storeGet('/route/params/user')
const clusterName = storeGet('/route/params/cluster')
Expand Down Expand Up @@ -1987,7 +1983,6 @@ return {
setInitSchedule,
fetchNames,
isRancherManaged,
isNotRancherManaged,
fetchNamespaces,
onInputChangeSchedule,
getDefaultSchedule,
Expand Down
30 changes: 3 additions & 27 deletions charts/kubedbcom-mongodb-editor-options/ui/create-ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -426,15 +426,7 @@ steps:
type: input
- elements:
- fetch: fetchNamespaces
hasGroup: true
if: isClusterRancherManaged|rancher
label:
text: Namespace
schema:
$ref: schema#/properties/spec/properties/init/properties/archiver/properties/encryptionSecret/properties/namespace
type: select
- fetch: fetchNamespaces
if: isClusterRancherManaged|notRancher
hasGroup: isClusterRancherManaged|rancher
label:
text: Namespace
schema:
Expand All @@ -454,15 +446,7 @@ steps:
type: single-step-form
- elements:
- fetch: fetchNamespaces
hasGroup: true
if: isClusterRancherManaged|rancher
label:
text: Namespace
schema:
$ref: schema#/properties/spec/properties/init/properties/archiver/properties/fullDBRepository/properties/namespace
type: select
- fetch: fetchNamespaces
if: isClusterRancherManaged|notRancher
hasGroup: isClusterRancherManaged|rancher
label:
text: Namespace
schema:
Expand All @@ -482,15 +466,7 @@ steps:
type: single-step-form
- elements:
- fetch: fetchNamespaces
hasGroup: true
if: isClusterRancherManaged|rancher
label:
text: Namespace
schema:
$ref: schema#/properties/spec/properties/init/properties/archiver/properties/manifestRepository/properties/namespace
type: select
- fetch: fetchNamespaces
if: isClusterRancherManaged|notRancher
hasGroup: isClusterRancherManaged|rancher
label:
text: Namespace
schema:
Expand Down
Loading

0 comments on commit e939ef8

Please sign in to comment.