Skip to content

Commit

Permalink
Show link when editing linked ensuing decsions
Browse files Browse the repository at this point in the history
RISDEV-3059
  • Loading branch information
HPrinz committed Jan 9, 2024
1 parent f59e357 commit 522ce4e
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 4 deletions.
13 changes: 9 additions & 4 deletions frontend/src/components/EditableListCaselaw.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,17 @@ onMounted(() => {
:key="index"
ref="elementList"
aria-label="Listen Eintrag"
class="border-b-1 border-gray-400"
:class="{
'!border-none':
noHorizontalSeparators ||
(index === editIndex && !entry.showSummaryOnEdit),
}"
>
<div
v-if="index !== editIndex"
v-if="index !== editIndex || entry.showSummaryOnEdit"
:key="index"
class="group flex cursor-pointer items-center justify-between gap-8 border-b-1 border-gray-400 py-8"
:class="{ '!border-none': noHorizontalSeparators }"
class="group flex cursor-pointer items-center gap-8 py-8"
>
<component
:is="summaryComponent"
Expand Down Expand Up @@ -146,7 +151,7 @@ onMounted(() => {

<component
:is="editComponent"
v-else
v-if="index === editIndex"
v-model="modelValueList[index]"
:class="modelValueList.length == 1 ? 'py-0' : 'py-24'"
:model-value-list="modelValueList"
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/domain/activeCitation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ export default class ActiveCitation
return !!this.citationType?.uuid
}

get showSummaryOnEdit(): boolean {
return false
}

private fieldIsEmpty(
value: ActiveCitation[(typeof ActiveCitation.fields)[number]],
): boolean {
Expand Down
1 change: 1 addition & 0 deletions frontend/src/domain/editableListItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ export default interface EditableListItem {
renderDecision: string
hasMissingRequiredFields: boolean
missingRequiredFields: string[]
showSummaryOnEdit: boolean
}
4 changes: 4 additions & 0 deletions frontend/src/domain/ensuingDecision.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ export default class EnsuingDecision
return isEmpty
}

get showSummaryOnEdit(): boolean {
return this.hasForeignSource
}

private fieldIsEmpty(
fieldName: keyof EnsuingDecision,
value: EnsuingDecision[(typeof EnsuingDecision.fields)[number]],
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/domain/normReference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ export default class NormReference implements EditableListItem {
return isEmpty
}

get showSummaryOnEdit(): boolean {
return false
}

private fieldIsEmpty(
value: NormReference[(typeof NormReference.fields)[number]],
) {
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/domain/previousDecision.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ export default class PreviousDecision
return isEmpty
}

get showSummaryOnEdit(): boolean {
return false
}

private fieldIsEmpty(
fieldName: keyof PreviousDecision,
value: PreviousDecision[(typeof PreviousDecision.fields)[number]],
Expand Down

0 comments on commit 522ce4e

Please sign in to comment.