Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
Signed-off-by: Nihal Azmain <[email protected]>
  • Loading branch information
Nihal-Azmain committed Dec 20, 2024
1 parent accd700 commit 50bfe15
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
16 changes: 16 additions & 0 deletions charts/kubedbcom-mysql-editor/ui/edit-ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1277,4 +1277,20 @@ steps:
type: single-step-form
id: storage-autoscaler
title: steps.10.label
- form:
discriminator:
binding:
default: false
type: boolean
elements:
- computed: isBindingAlreadyOn
label:
text: Expose Binding
onChange: addOrRemoveBinding
type: switch
schema:
$ref: discriminator#/properties/binding
type: single-step-form
id: binding
title: steps.11.label
type: multi-step-form
23 changes: 23 additions & 0 deletions charts/kubedbcom-mysql-editor/ui/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2349,6 +2349,27 @@ function objectCopy(obj) {
return JSON.parse(temp)
}

function isBindingAlreadyOn({ model, getValue }) {
const value = getValue(model, '/resources')
const keys = Object.keys(value)
isExposeBinding = !!keys.find((str) => str === 'catalogAppscodeComMySQLBinding')
console.log(isExposeBinding, keys)
return isExposeBinding
}

function addOrRemoveBinding({ commit, model, getValue, discriminator }) {
const value = getValue(discriminator, `/binding`)
const resources = getValue(model, '/resources')

if (value) {
commit('wizard/model$update', {
path: '/resources/kubedbComMySQL/spec/storage/storageClassName',
value: storageClass,
force: true,
})
}
}

return {
handleUnit,
isConsole,
Expand Down Expand Up @@ -2495,4 +2516,6 @@ return {
onArchiverChange,
onBackupTypeChange,
getNamespaceArray,
isBindingAlreadyOn,
addOrRemoveBinding,
}

0 comments on commit 50bfe15

Please sign in to comment.