Skip to content

Commit b2576a8

Browse files
committed
fix calling Generate.uiSchema
1 parent 5427ff9 commit b2576a8

File tree

7 files changed

+23
-5
lines changed

7 files changed

+23
-5
lines changed

packages/vue-vuetify/src/complex/AllOfRenderer.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
:schema="control.schema"
1717
combinatorKeyword="allOf"
1818
:path="path"
19+
:rootSchema="control.rootSchema"
1920
/>
2021
<dispatch-renderer
2122
v-for="(allOfRenderInfo, allOfIndex) in allOfRenderInfos"

packages/vue-vuetify/src/complex/AnyOfRenderer.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
:schema="control.schema"
55
combinatorKeyword="anyOf"
66
:path="path"
7+
:rootSchema="control.rootSchema"
78
/>
89

910
<v-tabs v-model="selectedIndex">

packages/vue-vuetify/src/complex/ObjectRenderer.vue

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,8 @@
2020
import {
2121
Generate,
2222
findUISchema,
23-
isObjectControl,
24-
rankWith,
2523
type ControlElement,
2624
type GroupLayout,
27-
type JsonFormsRendererRegistryEntry,
2825
type UISchemaElement,
2926
} from '@jsonforms/core';
3027
import {
@@ -76,7 +73,12 @@ const controlRenderer = defineComponent({
7673
},
7774
detailUiSchema(): UISchemaElement {
7875
const uiSchemaGenerator = () => {
79-
const uiSchema = Generate.uiSchema(this.control.schema, 'Group');
76+
const uiSchema = Generate.uiSchema(
77+
this.control.schema,
78+
'Group',
79+
undefined,
80+
this.control.rootSchema,
81+
);
8082
if (isEmpty(this.control.path)) {
8183
uiSchema.type = 'VerticalLayout';
8284
} else {

packages/vue-vuetify/src/complex/OneOfRenderer.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
:schema="control.schema"
55
combinatorKeyword="oneOf"
66
:path="path"
7+
:rootSchema="control.rootSchema"
78
/>
89

910
<v-select

packages/vue-vuetify/src/complex/OneOfTabRenderer.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
:schema="control.schema"
55
combinatorKeyword="oneOf"
66
:path="path"
7+
:rootSchema="control.rootSchema"
78
/>
89

910
<v-tabs

packages/vue-vuetify/src/complex/components/AdditionalProperties.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,12 @@ export default defineComponent({
227227
228228
if (propSchema) {
229229
if (propSchema.type === 'object' || propSchema.type === 'array') {
230-
propUiSchema = Generate.uiSchema(propSchema, 'Group');
230+
propUiSchema = Generate.uiSchema(
231+
propSchema,
232+
'Group',
233+
undefined,
234+
control.value.rootSchema,
235+
);
231236
(propUiSchema as GroupLayout).label =
232237
propSchema.title ?? startCase(propName);
233238
} else {

packages/vue-vuetify/src/complex/components/CombinatorProperties.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ interface CombinatorProps {
2323
schema: JsonSchema;
2424
combinatorKeyword: 'oneOf' | 'anyOf' | 'allOf';
2525
path: string;
26+
rootSchema: JsonSchema;
2627
}
2728
2829
export default defineComponent({
@@ -43,6 +44,10 @@ export default defineComponent({
4344
type: String,
4445
required: true,
4546
},
47+
rootSchema: {
48+
type: Object as PropType<JsonSchema>,
49+
required: true,
50+
},
4651
},
4752
setup(props: CombinatorProps) {
4853
const otherProps: JsonSchema = omit(
@@ -52,6 +57,8 @@ export default defineComponent({
5257
const foundUISchema: UISchemaElement = Generate.uiSchema(
5358
otherProps,
5459
'VerticalLayout',
60+
undefined,
61+
props.rootSchema,
5562
);
5663
5764
const isLayout = (uischema: UISchemaElement): uischema is Layout =>

0 commit comments

Comments
 (0)