Skip to content

Commit

Permalink
Fix archiver initiate issue (#720)
Browse files Browse the repository at this point in the history
* Fix archiver initiate issue

Signed-off-by: samiul <[email protected]>

* handle onArchiver false condition

Signed-off-by: SayedTahsin <[email protected]>

---------

Signed-off-by: samiul <[email protected]>
Signed-off-by: SayedTahsin <[email protected]>
Co-authored-by: SayedTahsin <[email protected]>
  • Loading branch information
SamiulSourav and SayedTahsin authored Feb 4, 2025
1 parent de14e44 commit 44e01d4
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,7 @@ steps:
type: single-step-form
- elements:
- label:
text: labels.storageClass.toggle
text: labels.tls.toggle
schema:
$ref: schema#/properties/spec/properties/admin/properties/tls/properties/toggle
type: switch
Expand Down
10 changes: 8 additions & 2 deletions charts/kubedbcom-mariadb-editor-options/ui/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ const modeDetails = {
text: 'Standalone',
},
Replicaset: {
description: 'MongoDB Galera cluster for high availability.',
description: 'Mariadb Galera cluster for high availability.',
text: 'Galera Cluster',
},
}
Expand Down Expand Up @@ -841,12 +841,17 @@ function onArchiverChange({ model, getValue, commit }) {
value: found.annotation,
force: true,
})
else
commit('wizard/model$update', {
path: '/spec/archiverName',
value: '',
force: true,
})
}

function showArchiverAlert({ watchDependency, model, getValue, commit }) {
watchDependency('model#/spec/admin/storageClasses/default')

watchDependency('model#/spec/mode')
const mode = getValue(model, '/spec/mode')
if (mode === 'Standalone') return false

Expand All @@ -861,6 +866,7 @@ function showArchiverAlert({ watchDependency, model, getValue, commit }) {
value: false,
force: true,
})
else onArchiverChange({ model, getValue, commit })

return show
}
Expand Down
9 changes: 7 additions & 2 deletions charts/kubedbcom-mongodb-editor-options/ui/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,6 @@ async function getArchiverName({ axios, storeGet }) {

function onArchiverChange({ model, getValue, commit }) {
const isArchiverOn = getValue(model, '/spec/admin/archiver/enable/default')

const stClass = getValue(model, '/spec/admin/storageClasses/default')
const found = archiverMap.find((item) => item.storageClass === stClass)

Expand All @@ -978,12 +977,17 @@ function onArchiverChange({ model, getValue, commit }) {
value: found.annotation,
force: true,
})
else
commit('wizard/model$update', {
path: '/spec/archiverName',
value: '',
force: true,
})
}

function showArchiverAlert({ watchDependency, model, getValue, commit }) {
watchDependency('model#/spec/admin/storageClasses/default')

watchDependency('model#/spec/mode')
const mode = getValue(model, '/spec/mode')
if (mode === 'Standalone') return false

Expand All @@ -998,6 +1002,7 @@ function showArchiverAlert({ watchDependency, model, getValue, commit }) {
value: false,
force: true,
})
else onArchiverChange({ model, getValue, commit })

return show
}
Expand Down
8 changes: 7 additions & 1 deletion charts/kubedbcom-mssqlserver-editor-options/ui/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -917,12 +917,17 @@ function onArchiverChange({ model, getValue, commit }) {
value: found.annotation,
force: true,
})
else
commit('wizard/model$update', {
path: '/spec/archiverName',
value: '',
force: true,
})
}

function showArchiverAlert({ watchDependency, model, getValue, commit }) {
watchDependency('model#/spec/admin/storageClasses/default')

watchDependency('model#/spec/mode')
const mode = getValue(model, '/spec/mode')
if (mode === 'Standalone') return false

Expand All @@ -937,6 +942,7 @@ function showArchiverAlert({ watchDependency, model, getValue, commit }) {
value: false,
force: true,
})
else onArchiverChange({ model, getValue, commit })

return show
}
Expand Down
8 changes: 7 additions & 1 deletion charts/kubedbcom-mysql-editor-options/ui/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -845,12 +845,17 @@ function onArchiverChange({ model, getValue, commit }) {
value: found.annotation,
force: true,
})
else
commit('wizard/model$update', {
path: '/spec/archiverName',
value: '',
force: true,
})
}

function showArchiverAlert({ watchDependency, model, getValue, commit }) {
watchDependency('model#/spec/admin/storageClasses/default')

watchDependency('model#/spec/mode')
const mode = getValue(model, '/spec/mode')
if (mode === 'Standalone') return false

Expand All @@ -865,6 +870,7 @@ function showArchiverAlert({ watchDependency, model, getValue, commit }) {
value: false,
force: true,
})
else onArchiverChange({ model, getValue, commit })

return show
}
Expand Down
8 changes: 7 additions & 1 deletion charts/kubedbcom-postgres-editor-options/ui/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -1013,12 +1013,17 @@ function onArchiverChange({ model, getValue, commit }) {
value: found.annotation,
force: true,
})
else
commit('wizard/model$update', {
path: '/spec/archiverName',
value: '',
force: true,
})
}

function showArchiverAlert({ watchDependency, model, getValue, commit }) {
watchDependency('model#/spec/admin/storageClasses/default')

watchDependency('model#/spec/mode')
const mode = getValue(model, '/spec/mode')
if (mode === 'Standalone') return false

Expand All @@ -1033,6 +1038,7 @@ function showArchiverAlert({ watchDependency, model, getValue, commit }) {
value: false,
force: true,
})
else onArchiverChange({ model, getValue, commit })

return show
}
Expand Down

0 comments on commit 44e01d4

Please sign in to comment.