From 53ae14b4a4e7d3a8fdc553126e2b44f9b4cfc7b0 Mon Sep 17 00:00:00 2001 From: Jonas Van Hoof Date: Tue, 14 Jan 2025 14:36:56 +0100 Subject: [PATCH] lmb-181: make it possible to let the label show the isRequird pill --- .../rdf-input-fields/custom-address-input.hbs | 1 + .../rdf-input-fields/custom-date-input.hbs | 1 + .../rdf-input-fields/custom-field-wrapper.hbs | 15 +--------- .../rdf-input-fields/custom-field-wrapper.js | 30 +++++++++++++++++++ .../rdf-input-fields/custom-number-input.hbs | 1 + .../rdf-input-fields/custom-string-input.hbs | 1 + .../rdf-input-fields/custom-text-input.hbs | 1 + 7 files changed, 36 insertions(+), 14 deletions(-) diff --git a/app/components/rdf-input-fields/custom-address-input.hbs b/app/components/rdf-input-fields/custom-address-input.hbs index 667c43539..225ceeb7f 100644 --- a/app/components/rdf-input-fields/custom-address-input.hbs +++ b/app/components/rdf-input-fields/custom-address-input.hbs @@ -1,6 +1,7 @@
diff --git a/app/components/rdf-input-fields/custom-date-input.hbs b/app/components/rdf-input-fields/custom-date-input.hbs index 826137fc7..dd07c8914 100644 --- a/app/components/rdf-input-fields/custom-date-input.hbs +++ b/app/components/rdf-input-fields/custom-date-input.hbs @@ -2,6 +2,7 @@ @inline={{true}} @field={{@field}} @form={{@form}} + @graphs={{@graphs}} @formStore={{@formStore}} >
- {{this.title}} + {{this.title}}
- - {{#each this.errors as |error|}} - {{error.resultMessage}} - {{/each}} - - {{#each this.warnings as |warning|}} - {{warning.resultMessage}} - {{/each}} {{/unless}} + constraint.type.value === + 'http://lblod.data.gift/vocabularies/forms/RequiredConstraint' + ) + ); + } + + get constraints() { + return validationsForFieldWithType(this.args.field.uri, this.storeOptions); + } + + get storeOptions() { + return { + formGraph: this.args.graphs.formGraph, + sourceGraph: this.args.graphs.sourceGraph, + metaGraph: this.args.graphs.metaGraph, + sourceNode: this.args.sourceNode, + store: this.args.formStore, + path: this.args.field.rdflibPath, + scope: this.args.field.rdflibScope, + }; + } } diff --git a/app/components/rdf-input-fields/custom-number-input.hbs b/app/components/rdf-input-fields/custom-number-input.hbs index 953782456..4236f4e71 100644 --- a/app/components/rdf-input-fields/custom-number-input.hbs +++ b/app/components/rdf-input-fields/custom-number-input.hbs @@ -2,6 +2,7 @@ @inline={{true}} @field={{@field}} @form={{@form}} + @graphs={{@graphs}} @formStore={{@formStore}} >