Skip to content

Commit 877a2f1

Browse files
authored
Merge pull request #220 from fractal-analytics-platform/show_custom_property_key_as_title
Show custom property key as title and enable different descriptions for siblings properties.
2 parents 33342d0 + 6d3c965 commit 877a2f1

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/lib/components/common/jschema/ArrayProperty.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
{#if schemaProperty }
3131
<div class='d-flex flex-column p-2'>
3232
<div class='property-metadata d-flex flex-column w-100'>
33-
<span class='fs-5 {schemaProperty.isRequired() ? "fw-bold" : ""}'>{ schemaProperty.title }</span>
34-
<span class='small'>{schemaProperty.description }</span>
33+
<span class='fs-5 {schemaProperty.isRequired() ? "fw-bold" : ""}'>{ schemaProperty.title || "" }</span>
34+
<span class='small'>{schemaProperty.description || "" }</span>
3535
</div>
3636
<div class='array-items my-2'>
3737

src/lib/components/common/jschema/ObjectProperty.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<div class='d-flex flex-column p-2'>
3939
<div class='property-metadata d-flex flex-column w-100'>
4040
<span class='fs-5 {objectSchema.isRequired() ? "fw-bold" : ""}'>{ objectSchema.title }</span>
41-
<span class='small'>{ objectSchema.description }</span>
41+
<span class='small'>{ objectSchema.description || "" }</span>
4242
</div>
4343
<div class='object-properties my-2'>
4444
<div class='accordion' id='{accordionParentKey}'>

src/lib/components/common/jschema/schema_management.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ export class SchemaProperty {
154154
if (this.type === undefined && this.$ref !== undefined) {
155155
const resolvedSchema = resolveSchemaReference(this.$ref, this.globalSchema);
156156
Object.keys(resolvedSchema).forEach(schemaKey => {
157-
this[schemaKey] = resolvedSchema[schemaKey];
157+
if (this[schemaKey] === undefined)
158+
this[schemaKey] = resolvedSchema[schemaKey];
158159
});
159160
}
160161

@@ -254,7 +255,8 @@ export class SchemaProperty {
254255
}
255256

256257
// This should resolve the reference to the inner schema within the global schema
257-
this.properties[namedKey] = this.referenceSchema.additionalProperties;
258+
this.properties[namedKey] = JSON.parse(JSON.stringify(this.referenceSchema.additionalProperties));
259+
this.properties[namedKey].title = namedKey;
258260
this.properties[namedKey].value = propertyValue;
259261
}
260262
}

0 commit comments

Comments
 (0)