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
2 changes: 2 additions & 0 deletions src/endpoints/forms/prepareFormProps/utils/prepare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export const prepare = async ({
hiddenPaths,
expandedPaths,
persistedPaths,
sortPaths,
propertiesToApply: properties,
requiredToApply: required,
} = processOverride({
Expand Down Expand Up @@ -94,6 +95,7 @@ export const prepare = async ({
hiddenPaths: hiddenPaths || [],
expandedPaths: uniqExpanded,
persistedPaths: uniqPersisted,
sortPaths,
kindName,
isNamespaced,
formPrefills: formsPrefillsData?.items.find(item => item.spec.customizationId === customizationId),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ export const processOverride = ({
hiddenPaths?: string[][]
expandedPaths?: string[][]
persistedPaths?: string[][]
sortPaths?: string[][]
propertiesToApply: { [name: string]: OpenAPIV2.SchemaObject }
requiredToApply?: string[]
} => {
let hiddenPaths
let expandedPaths
let persistedPaths
let sortPaths
let propertiesToApply = newProperties
let requiredToApply

Expand All @@ -40,6 +42,10 @@ export const processOverride = ({
persistedPaths = specificCustomOverrides.spec.persisted
}

if (specificCustomOverrides.spec.sort) {
sortPaths = specificCustomOverrides.spec.sort
}

// full replace
if (specificCustomOverrides.spec.strategy === 'fullReplace') {
if (specificCustomOverrides.spec.schema.properties) {
Expand Down Expand Up @@ -101,5 +107,5 @@ export const processOverride = ({
requiredToApply = bodyParametersSchema.required
}

return { hiddenPaths, expandedPaths, persistedPaths, propertiesToApply, requiredToApply }
return { hiddenPaths, expandedPaths, persistedPaths, sortPaths, propertiesToApply, requiredToApply }
}
1 change: 1 addition & 0 deletions src/localTypes/endpoints/forms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export type TPrepareFormRes =
hiddenPaths: string[][] | undefined
expandedPaths: string[][] | undefined
persistedPaths: string[][] | undefined
sortPaths: string[][] | undefined
kindName: string | undefined
isNamespaced: boolean
formPrefills?: TFormPrefill
Expand Down
1 change: 1 addition & 0 deletions src/localTypes/formExtensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export type TFormOverride = {
hidden?: string[][]
expanded?: string[][]
persisted?: string[][]
sort?: string[][]
}
}

Expand Down