diff --git a/legalconsenthub/app/components/FormStepperWithNavigation.vue b/legalconsenthub/app/components/FormStepperWithNavigation.vue index c6bbb89..aa7e069 100644 --- a/legalconsenthub/app/components/FormStepperWithNavigation.vue +++ b/legalconsenthub/app/components/FormStepperWithNavigation.vue @@ -1,83 +1,149 @@ + + diff --git a/legalconsenthub/app/composables/useFormElementVisibility.ts b/legalconsenthub/app/composables/useFormElementVisibility.ts index 05c0099..46a3cfc 100644 --- a/legalconsenthub/app/composables/useFormElementVisibility.ts +++ b/legalconsenthub/app/composables/useFormElementVisibility.ts @@ -1,5 +1,9 @@ import type { FormElementDto, FormElementVisibilityCondition, VisibilityConditionOperator } from '~~/.api-client' -import { VisibilityConditionOperator as VCOperator, VisibilityConditionType as VCType, FormElementType } from '~~/.api-client' +import { + VisibilityConditionOperator as VCOperator, + VisibilityConditionType as VCType, + FormElementType +} from '~~/.api-client' export function useFormElementVisibility() { /** @@ -60,13 +64,13 @@ export function useFormElementVisibility() { // Special handling for CHECKBOX with multiple options if (sourceElement.type === FormElementType.Checkbox && sourceElement.options.length > 1) { const operator = condition.formElementOperator || VCOperator.Equals - const conditionMet = evaluateCheckboxCondition(sourceElement, condition.formElementExpectedValue, operator) + const conditionMet = evaluateCheckboxCondition(sourceElement, condition.formElementExpectedValue || '', operator) return condition.formElementConditionType === VCType.Show ? conditionMet : !conditionMet } const sourceValue = getFormElementValue(sourceElement) const operator = condition.formElementOperator || VCOperator.Equals - const conditionMet = evaluateCondition(sourceValue, condition.formElementExpectedValue, operator) + const conditionMet = evaluateCondition(sourceValue, condition.formElementExpectedValue || '', operator) return condition.formElementConditionType === VCType.Show ? conditionMet : !conditionMet } @@ -91,9 +95,7 @@ export function useFormElementVisibility() { expectedValue: string, operator: VisibilityConditionOperator ): boolean { - const selectedLabels = element.options - .filter((option) => option.value === 'true') - .map((option) => option.label) + const selectedLabels = element.options.filter((option) => option.value === 'true').map((option) => option.label) switch (operator) { case VCOperator.Equals: diff --git a/legalconsenthub/app/pages/application-forms/[id]/[sectionIndex].vue b/legalconsenthub/app/pages/application-forms/[id]/[sectionIndex].vue index b8283b8..d926ef6 100644 --- a/legalconsenthub/app/pages/application-forms/[id]/[sectionIndex].vue +++ b/legalconsenthub/app/pages/application-forms/[id]/[sectionIndex].vue @@ -30,19 +30,17 @@ diff --git a/legalconsenthub/app/pages/create.vue b/legalconsenthub/app/pages/create.vue index 2cdf7e4..91e63f5 100644 --- a/legalconsenthub/app/pages/create.vue +++ b/legalconsenthub/app/pages/create.vue @@ -15,26 +15,24 @@