generated from digitalservicebund/java-application-template
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
45 changed files
with
316 additions
and
373 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,97 @@ | ||
<script setup lang="ts"> | ||
import DocumentNumberPreviewLink from "@/components/DocumentNumberLink.vue" | ||
<script lang="ts" setup> | ||
import { computed, toRaw } from "vue" | ||
import type { Component } from "vue" | ||
import { DisplayMode } from "@/components/enumDisplayMode" | ||
import FlexContainer from "@/components/FlexContainer.vue" | ||
import RelatedDocumentation from "@/domain/relatedDocumentation" | ||
import IconBadge from "@/components/IconBadge.vue" | ||
import { useStatusBadge } from "@/composables/useStatusBadge" | ||
import { PublicationStatus } from "@/domain/publicationStatus" | ||
import { useDocumentUnitStore } from "@/stores/documentUnitStore" | ||
import { useExtraContentSidePanelStore } from "@/stores/extraContentSidePanelStore" | ||
import BaselineArrowOutward from "~icons/ic/baseline-arrow-outward" | ||
type Props<T extends RelatedDocumentation> = { | ||
decision: T | ||
interface Props { | ||
summary: string | ||
status?: PublicationStatus | ||
documentNumber?: string | ||
displayMode?: DisplayMode | ||
icon?: Component | ||
} | ||
const props = defineProps<Props<RelatedDocumentation>>() | ||
const props = withDefaults(defineProps<Props>(), { | ||
displayMode: DisplayMode.TAB, | ||
status: undefined, | ||
documentNumber: undefined, | ||
icon: undefined, | ||
}) | ||
const statusBadge = computed(() => useStatusBadge(props.status).value) | ||
const documentUnitStore = useDocumentUnitStore() | ||
const extraContentSidePanelStore = useExtraContentSidePanelStore() | ||
async function openSidePanel(documentUnitNumber?: string) { | ||
if (documentUnitNumber) { | ||
await documentUnitStore.loadDocumentUnit(documentUnitNumber) | ||
extraContentSidePanelStore.togglePanel(true) | ||
} | ||
} | ||
const summary = computed(() => | ||
props.status ? `${props.summary}, ` : props.summary, | ||
) | ||
const divider = computed(() => (props.documentNumber ? ` | ` : undefined)) | ||
</script> | ||
|
||
<template> | ||
<FlexContainer | ||
:data-testid="'decision-summary-' + props.decision.documentNumber" | ||
> | ||
{{ decision.renderDecision }} | ||
<DocumentNumberPreviewLink | ||
:decision="props.decision" | ||
:display-mode="displayMode" | ||
/> | ||
</FlexContainer> | ||
<div class="flex justify-between"> | ||
<div class="flex flex-row items-center"> | ||
<component :is="icon" v-if="icon" class="mr-8 min-w-24" /> | ||
<span class="mr-8" :data-testid="'decision-summary-' + documentNumber"> | ||
<span> | ||
{{ summary }} | ||
<IconBadge | ||
v-if="status" | ||
:background-color="statusBadge.backgroundColor" | ||
class="ml-4 inline-block" | ||
:color="statusBadge.color" | ||
:icon="toRaw(statusBadge.icon)" | ||
:label="statusBadge.label" | ||
/> | ||
{{ divider }} | ||
|
||
<!-- open preview in new tab --> | ||
<RouterLink | ||
v-if="documentNumber && props.displayMode === DisplayMode.TAB" | ||
class="ds-link-01-bold whitespace-nowrap leading-24 no-underline focus:outline-none focus-visible:outline-4 focus-visible:outline-offset-4 focus-visible:outline-blue-800" | ||
:data-testid="'document-number-link-' + documentNumber" | ||
tabindex="-1" | ||
target="_blank" | ||
:to="{ | ||
name: 'caselaw-documentUnit-documentNumber-preview', | ||
params: { documentNumber: documentNumber }, | ||
}" | ||
> | ||
{{ documentNumber }} | ||
<BaselineArrowOutward class="mb-4 inline w-24" /> | ||
</RouterLink> | ||
<!-- or open preview in sidepanel --> | ||
<span | ||
v-else-if=" | ||
documentNumber && props.displayMode === DisplayMode.SIDEPANEL | ||
" | ||
> | ||
<button | ||
class="ds-link-01-bold whitespace-nowrap leading-24 no-underline focus:outline-none focus-visible:outline-4 focus-visible:outline-offset-4 focus-visible:outline-blue-800" | ||
:data-testid="'document-number-link-' + documentNumber" | ||
@click="openSidePanel(documentNumber)" | ||
> | ||
{{ documentNumber }} | ||
<BaselineArrowOutward class="mb-4 inline w-24" /> | ||
</button> | ||
</span> | ||
</span> | ||
</span> | ||
</div> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.