Skip to content

Commit 8855eae

Browse files
committed
add sorting fields
Signed-off-by: Andrei Kvapil <[email protected]>
1 parent 055ffd4 commit 8855eae

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

src/endpoints/forms/formPrepare/utils/prepare.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export const prepare = async ({
6060
hiddenPaths,
6161
expandedPaths,
6262
persistedPaths,
63+
sortPaths,
6364
propertiesToApply: properties,
6465
requiredToApply: required,
6566
} = processOverride({
@@ -75,6 +76,7 @@ export const prepare = async ({
7576
hiddenPaths: hiddenPaths || [],
7677
expandedPaths,
7778
persistedPaths,
79+
sortPaths,
7880
kindName,
7981
isNamespaced,
8082
formPrefills: formsPrefillsData?.items.find(item => item.spec.customizationId === customizationId),

src/endpoints/forms/formPrepare/utils/processOverride.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ export const processOverride = ({
1818
hiddenPaths?: string[][]
1919
expandedPaths?: string[][]
2020
persistedPaths?: string[][]
21+
sortPaths?: string[][]
2122
propertiesToApply: { [name: string]: OpenAPIV2.SchemaObject }
2223
requiredToApply?: string[]
2324
} => {
2425
let hiddenPaths
2526
let expandedPaths
2627
let persistedPaths
28+
let sortPaths
2729
let propertiesToApply = newProperties
2830
let requiredToApply
2931

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

45+
if (specificCustomOverrides.spec.sort) {
46+
sortPaths = specificCustomOverrides.spec.sort
47+
}
48+
4349
// full replace
4450
if (specificCustomOverrides.spec.strategy === 'fullReplace') {
4551
if (specificCustomOverrides.spec.schema.properties) {
@@ -101,5 +107,5 @@ export const processOverride = ({
101107
requiredToApply = bodyParametersSchema.required
102108
}
103109

104-
return { hiddenPaths, expandedPaths, persistedPaths, propertiesToApply, requiredToApply }
110+
return { hiddenPaths, expandedPaths, persistedPaths, sortPaths, propertiesToApply, requiredToApply }
105111
}

src/localTypes/endpoints/forms.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export type TPrepareFormRes =
4343
hiddenPaths: string[][] | undefined
4444
expandedPaths: string[][] | undefined
4545
persistedPaths: string[][] | undefined
46+
sortPaths: string[][] | undefined
4647
kindName: string | undefined
4748
isNamespaced: boolean
4849
formPrefills?: TFormPrefill

src/localTypes/formExtensions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export type TFormOverride = {
2323
hidden?: string[][]
2424
expanded?: string[][]
2525
persisted?: string[][]
26+
sort?: string[][]
2627
}
2728
}
2829

0 commit comments

Comments
 (0)