Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions charts/opskubedbcom-cassandraopsrequest-editor/ui/create-ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -196,18 +196,22 @@ step:
example, 'zone=us-central1-a' ensures workloads are deployed in that zone.
type: label-element
- elements:
- label: Key
schema: temp/topologyKey
type: input
- type: input
label: Key
schema: schema/properties/spec/properties/verticalScaling/properties/node/properties/topology/properties/key
validation:
name: isVerticalScaleTopologyRequired
type: custom
- label: Value
schema: temp/topologyValue
type: input
name: isVerticalScaleTopologyRequired|node|key
watchPaths:
- schema/properties/spec/properties/verticalScaling/properties/node/properties/topology/properties/value
- type: input
label: Value
schema: schema/properties/spec/properties/verticalScaling/properties/node/properties/topology/properties/value
validation:
name: isVerticalScaleTopologyRequired
type: custom
name: isVerticalScaleTopologyRequired|node|value
watchPaths:
- schema/properties/spec/properties/verticalScaling/properties/node/properties/topology/properties/key
type: horizontal-layout
label: Node Selection
showLabels: true
Expand Down
28 changes: 13 additions & 15 deletions charts/opskubedbcom-cassandraopsrequest-editor/ui/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -1648,24 +1648,22 @@ export const useFunc = (model) => {
return 'IfReady'
}

function isVerticalScaleTopologyRequired() {
// watchDependency('discriminator#/topologyKey')
// watchDependency('discriminator#/topologyValue')
function isVerticalScaleTopologyRequired(type, mode) {
// watchDependency(`discriminator#/topologyKey`)
// watchDependency(`discriminator#/topologyValue`)
const path = `/spec/verticalScaling/${type}/topology`

const key = getValue(discriminator, '/topologyKey')
const value = getValue(discriminator, '/topologyValue')
const path = `/spec/verticalScaling/node/topology`
const key = String(getValue(model, `${path}/key`) ?? '').trim()
const value = String(getValue(model, `${path}/value`) ?? '').trim()

if (key || value) {
commit('wizard/model$update', {
path: path,
value: { key, value },
force: true,
})
return ''
} else {
if (!key && !value) {
commit('wizard/model$delete', path)
return false
}
const missingPair = mode === 'key' ? !key && value : key && !value
if (missingPair) {
return mode === 'key'
? 'Key is required when Value is provided'
: 'Value is required when Key is provided'
}
}

Expand Down
20 changes: 12 additions & 8 deletions charts/opskubedbcom-clickhouseopsrequest-editor/ui/create-ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -196,18 +196,22 @@ step:
example, 'zone=us-central1-a' ensures workloads are deployed in that zone.
type: label-element
- elements:
- label: Key
schema: temp/topologyKey
type: input
- type: input
label: Key
schema: schema/properties/spec/properties/verticalScaling/properties/node/properties/topology/properties/key
validation:
name: isVerticalScaleTopologyRequired
type: custom
- label: Value
schema: temp/topologyValue
type: input
name: isVerticalScaleTopologyRequired|node|key
watchPaths:
- schema/properties/spec/properties/verticalScaling/properties/node/properties/topology/properties/value
- type: input
label: Value
schema: schema/properties/spec/properties/verticalScaling/properties/node/properties/topology/properties/value
validation:
name: isVerticalScaleTopologyRequired
type: custom
name: isVerticalScaleTopologyRequired|node|value
watchPaths:
- schema/properties/spec/properties/verticalScaling/properties/node/properties/topology/properties/key
type: horizontal-layout
label: Node Selection
showLabels: true
Expand Down
28 changes: 13 additions & 15 deletions charts/opskubedbcom-clickhouseopsrequest-editor/ui/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -1660,24 +1660,22 @@ export const useFunc = (model) => {
return 'IfReady'
}

function isVerticalScaleTopologyRequired() {
// watchDependency('discriminator#/topologyKey')
// watchDependency('discriminator#/topologyValue')
function isVerticalScaleTopologyRequired(type, mode) {
// watchDependency(`discriminator#/topologyKey`)
// watchDependency(`discriminator#/topologyValue`)
const path = `/spec/verticalScaling/${type}/topology`

const key = getValue(discriminator, '/topologyKey')
const value = getValue(discriminator, '/topologyValue')
const path = `/spec/verticalScaling/node/topology`
const key = String(getValue(model, `${path}/key`) ?? '').trim()
const value = String(getValue(model, `${path}/value`) ?? '').trim()

if (key || value) {
commit('wizard/model$update', {
path: path,
value: { key, value },
force: true,
})
return ''
} else {
if (!key && !value) {
commit('wizard/model$delete', path)
return false
}
const missingPair = mode === 'key' ? !key && value : key && !value
if (missingPair) {
return mode === 'key'
? 'Key is required when Value is provided'
: 'Value is required when Key is provided'
}
}

Expand Down
20 changes: 12 additions & 8 deletions charts/opskubedbcom-documentdbopsrequest-editor/ui/create-ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -196,18 +196,22 @@ step:
example, 'zone=us-central1-a' ensures workloads are deployed in that zone.
type: label-element
- elements:
- label: Key
schema: temp/topologyKey
type: input
- type: input
label: Key
schema: schema/properties/spec/properties/verticalScaling/properties/documentdb/properties/topology/properties/key
validation:
name: isVerticalScaleTopologyRequired
type: custom
- label: Value
schema: temp/topologyValue
type: input
name: isVerticalScaleTopologyRequired|documentdb|key
watchPaths:
- schema/properties/spec/properties/verticalScaling/properties/documentdb/properties/topology/properties/value
- type: input
label: Value
schema: schema/properties/spec/properties/verticalScaling/properties/documentdb/properties/topology/properties/value
validation:
name: isVerticalScaleTopologyRequired
type: custom
name: isVerticalScaleTopologyRequired|documentdb|value
watchPaths:
- schema/properties/spec/properties/verticalScaling/properties/documentdb/properties/topology/properties/key
type: horizontal-layout
label: Node Selection
showLabels: true
Expand Down
28 changes: 13 additions & 15 deletions charts/opskubedbcom-documentdbopsrequest-editor/ui/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -1659,24 +1659,22 @@ export const useFunc = (model) => {
return 'IfReady'
}

function isVerticalScaleTopologyRequired() {
// watchDependency('discriminator#/topologyKey')
// watchDependency('discriminator#/topologyValue')
function isVerticalScaleTopologyRequired(type, mode) {
// watchDependency(`discriminator#/topologyKey`)
// watchDependency(`discriminator#/topologyValue`)
const path = `/spec/verticalScaling/${type}/topology`

const key = getValue(discriminator, '/topologyKey')
const value = getValue(discriminator, '/topologyValue')
const path = `/spec/verticalScaling/documentdb/topology`
const key = String(getValue(model, `${path}/key`) ?? '').trim()
const value = String(getValue(model, `${path}/value`) ?? '').trim()

if (key || value) {
commit('wizard/model$update', {
path: path,
value: { key, value },
force: true,
})
return ''
} else {
if (!key && !value) {
commit('wizard/model$delete', path)
return false
}
const missingPair = mode === 'key' ? !key && value : key && !value
if (missingPair) {
return mode === 'key'
? 'Key is required when Value is provided'
: 'Value is required when Key is provided'
}
}

Expand Down
72 changes: 56 additions & 16 deletions charts/opskubedbcom-druidopsrequest-editor/ui/create-ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -282,12 +282,22 @@ step:
example, 'zone=us-central1-a' ensures workloads are deployed in that zone.
type: label-element
- elements:
- label: Key
- type: input
label: Key
schema: schema/properties/spec/properties/verticalScaling/properties/middleManagers/properties/topology/properties/key
type: input
- label: Value
validation:
type: custom
name: isVerticalScaleTopologyRequired|middleManagers|key
watchPaths:
- schema/properties/spec/properties/verticalScaling/properties/middleManagers/properties/topology/properties/value
- type: input
label: Value
schema: schema/properties/spec/properties/verticalScaling/properties/middleManagers/properties/topology/properties/value
type: input
validation:
type: custom
name: isVerticalScaleTopologyRequired|middleManagers|value
watchPaths:
- schema/properties/spec/properties/verticalScaling/properties/middleManagers/properties/topology/properties/key
type: horizontal-layout
label: Node Selection
showLabels: true
Expand Down Expand Up @@ -343,12 +353,22 @@ step:
example, 'zone=us-central1-a' ensures workloads are deployed in that zone.
type: label-element
- elements:
- label: Key
- type: input
label: Key
schema: schema/properties/spec/properties/verticalScaling/properties/historicals/properties/topology/properties/key
type: input
- label: Value
validation:
type: custom
name: isVerticalScaleTopologyRequired|historicals|key
watchPaths:
- schema/properties/spec/properties/verticalScaling/properties/historicals/properties/topology/properties/value
- type: input
label: Value
schema: schema/properties/spec/properties/verticalScaling/properties/historicals/properties/topology/properties/value
type: input
validation:
type: custom
name: isVerticalScaleTopologyRequired|historicals|value
watchPaths:
- schema/properties/spec/properties/verticalScaling/properties/historicals/properties/topology/properties/key
type: horizontal-layout
label: Node Selection
showLabels: true
Expand Down Expand Up @@ -404,12 +424,22 @@ step:
example, 'zone=us-central1-a' ensures workloads are deployed in that zone.
type: label-element
- elements:
- label: Key
- type: input
label: Key
schema: schema/properties/spec/properties/verticalScaling/properties/brokers/properties/topology/properties/key
type: input
- label: Value
validation:
type: custom
name: isVerticalScaleTopologyRequired|brokers|key
watchPaths:
- schema/properties/spec/properties/verticalScaling/properties/brokers/properties/topology/properties/value
- type: input
label: Value
schema: schema/properties/spec/properties/verticalScaling/properties/brokers/properties/topology/properties/value
type: input
validation:
type: custom
name: isVerticalScaleTopologyRequired|brokers|value
watchPaths:
- schema/properties/spec/properties/verticalScaling/properties/brokers/properties/topology/properties/key
type: horizontal-layout
label: Node Selection
showLabels: true
Expand Down Expand Up @@ -465,12 +495,22 @@ step:
example, 'zone=us-central1-a' ensures workloads are deployed in that zone.
type: label-element
- elements:
- label: Key
- type: input
label: Key
schema: schema/properties/spec/properties/verticalScaling/properties/coordinators/properties/topology/properties/key
type: input
- label: Value
validation:
type: custom
name: isVerticalScaleTopologyRequired|coordinators|key
watchPaths:
- schema/properties/spec/properties/verticalScaling/properties/coordinators/properties/topology/properties/value
- type: input
label: Value
schema: schema/properties/spec/properties/verticalScaling/properties/coordinators/properties/topology/properties/value
type: input
validation:
type: custom
name: isVerticalScaleTopologyRequired|coordinators|value
watchPaths:
- schema/properties/spec/properties/verticalScaling/properties/coordinators/properties/topology/properties/key
type: horizontal-layout
label: Node Selection
showLabels: true
Expand Down
28 changes: 13 additions & 15 deletions charts/opskubedbcom-druidopsrequest-editor/ui/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -991,24 +991,22 @@ export const useFunc = (model) => {
// VERTICAL SCALING FUNCTIONS
// ============================================================

function isVerticalScaleTopologyRequired(type) {
// watchDependency(`discriminator#/topologyKey-${type}`)
// watchDependency(`discriminator#/topologyValue-${type}`)

const key = getValue(discriminator, `/topologyKey-${type}`)
const value = getValue(discriminator, `/topologyValue-${type}`)
function isVerticalScaleTopologyRequired(type, mode) {
// watchDependency(`discriminator#/topologyKey`)
// watchDependency(`discriminator#/topologyValue`)
const path = `/spec/verticalScaling/${type}/topology`

if (key || value) {
commit('wizard/model$update', {
path: path,
value: { key, value },
force: true,
})
return ''
} else {
const key = String(getValue(model, `${path}/key`) ?? '').trim()
const value = String(getValue(model, `${path}/value`) ?? '').trim()

if (!key && !value) {
commit('wizard/model$delete', path)
return false
}
const missingPair = mode === 'key' ? !key && value : key && !value
if (missingPair) {
return mode === 'key'
? 'Key is required when Value is provided'
: 'Value is required when Key is provided'
}
}

Expand Down
Loading
Loading