diff --git a/frontend/src/components/DocumentUnitDecisionSummary.vue b/frontend/src/components/DocumentUnitDecisionSummary.vue
index c37286709..aec56d8d2 100644
--- a/frontend/src/components/DocumentUnitDecisionSummary.vue
+++ b/frontend/src/components/DocumentUnitDecisionSummary.vue
@@ -1,19 +1,25 @@
@@ -53,16 +71,39 @@ async function copySummary() {
label="Fehlende Daten"
/>
-
-
-
+
+
+
+
+
+
diff --git a/frontend/src/components/ExtraContentSidePanel.vue b/frontend/src/components/ExtraContentSidePanel.vue
index c596ff773..7a36cf9b5 100644
--- a/frontend/src/components/ExtraContentSidePanel.vue
+++ b/frontend/src/components/ExtraContentSidePanel.vue
@@ -1,4 +1,5 @@
@@ -85,7 +99,6 @@ async function searchForDocumentUnit() {
:icon="toRaw(statusBadge.icon)"
:label="statusBadge.label"
/>
-
|
{
extraContentSidePanelStore.togglePanel(true)
extraContentSidePanelStore.setSidePanelMode("preview")
break
- case "k":
+ case "r":
if (featureToggle.value) {
extraContentSidePanelStore.togglePanel(true)
extraContentSidePanelStore.setSidePanelMode("category-import")
diff --git a/frontend/src/stores/extraContentSidePanelStore.ts b/frontend/src/stores/extraContentSidePanelStore.ts
index 702a59c94..99cf2d189 100644
--- a/frontend/src/stores/extraContentSidePanelStore.ts
+++ b/frontend/src/stores/extraContentSidePanelStore.ts
@@ -9,6 +9,7 @@ export const useExtraContentSidePanelStore = defineStore(
() => {
const panelMode = ref(undefined)
const isExpanded = ref(false)
+ const importDocumentNumber = ref(undefined)
const currentAttachmentIndex = ref(0)
const { pushQueryToRoute } = useQuery()
@@ -71,6 +72,7 @@ export const useExtraContentSidePanelStore = defineStore(
selectAttachments,
togglePanel,
onAttachmentDeleted,
+ importDocumentNumber,
isExpanded,
currentAttachmentIndex,
panelMode,
diff --git a/frontend/test/components/activeCitations.spec.ts b/frontend/test/components/activeCitations.spec.ts
index ecd0eaa9e..450f81aa1 100644
--- a/frontend/test/components/activeCitations.spec.ts
+++ b/frontend/test/components/activeCitations.spec.ts
@@ -1,6 +1,6 @@
import { createTestingPinia } from "@pinia/testing"
import { userEvent } from "@testing-library/user-event"
-import { fireEvent, render, screen } from "@testing-library/vue"
+import { fireEvent, render, screen, waitFor } from "@testing-library/vue"
import { http, HttpResponse } from "msw"
import { setupServer } from "msw/node"
import { createRouter, createWebHistory } from "vue-router"
@@ -9,6 +9,7 @@ import ActiveCitation from "@/domain/activeCitation"
import { CitationType } from "@/domain/citationType"
import DocumentUnit, { Court, DocumentType } from "@/domain/documentUnit"
import documentUnitService from "@/services/documentUnitService"
+import featureToggleService from "@/services/featureToggleService"
import routes from "~/test-helper/routes"
const server = setupServer(
@@ -110,6 +111,10 @@ describe("active citations", () => {
beforeAll(() => server.listen())
afterAll(() => server.close())
beforeEach(() => {
+ vi.spyOn(featureToggleService, "isEnabled").mockResolvedValue({
+ status: 200,
+ data: true,
+ })
vi.spyOn(
documentUnitService,
"searchByRelatedDocumentation",
@@ -507,6 +512,32 @@ describe("active citations", () => {
)
})
+ it("should render parallel decision icons for 'Teilweise Parallelentscheidung'", async () => {
+ renderComponent([
+ generateActiveCitation({
+ citationStyle: {
+ label: "Teilweise Parallelentscheidung",
+ },
+ }),
+ ])
+ await waitFor(() => {
+ expect(screen.getByTestId("import-categories")).toBeVisible()
+ })
+ })
+
+ it("should render parallel decision icons for 'Parallelentscheidung'", async () => {
+ renderComponent([
+ generateActiveCitation({
+ citationStyle: {
+ label: "Parallelentscheidung",
+ },
+ }),
+ ])
+ await waitFor(() => {
+ expect(screen.getByTestId("import-categories")).toBeVisible()
+ })
+ })
+
describe("keyboard navigation", () => {
it("should copy text of active citation summary", async () => {
const { user } = renderComponent([generateActiveCitation()])
diff --git a/frontend/test/components/ensuingDecisions.spec.ts b/frontend/test/components/ensuingDecisions.spec.ts
index ad3ef9fd7..314974715 100644
--- a/frontend/test/components/ensuingDecisions.spec.ts
+++ b/frontend/test/components/ensuingDecisions.spec.ts
@@ -8,6 +8,7 @@ import EnsuingDecisions from "@/components/EnsuingDecisions.vue"
import DocumentUnit, { Court, DocumentType } from "@/domain/documentUnit"
import EnsuingDecision from "@/domain/ensuingDecision"
import documentUnitService from "@/services/documentUnitService"
+import featureToggleService from "@/services/featureToggleService"
import routes from "~/test-helper/routes"
const server = setupServer(
@@ -97,40 +98,46 @@ function generateEnsuingDecision(options?: {
describe("EnsuingDecisions", () => {
beforeAll(() => server.listen())
afterAll(() => server.close())
- vi.spyOn(
- documentUnitService,
- "searchByRelatedDocumentation",
- ).mockImplementation(() =>
- Promise.resolve({
+ beforeEach(() => {
+ vi.spyOn(featureToggleService, "isEnabled").mockResolvedValue({
status: 200,
- data: {
- content: [
- new EnsuingDecision({
- uuid: "123",
- court: {
- type: "type1",
- location: "location1",
- label: "label1",
- },
- decisionDate: "2022-02-01",
- documentType: {
- jurisShortcut: "documentTypeShortcut1",
- label: "documentType1",
- },
- fileNumber: "test fileNumber1",
- }),
- ],
- size: 0,
- number: 0,
- numberOfElements: 20,
- first: true,
- last: false,
- empty: false,
- },
- }),
- )
+ data: true,
+ })
+ vi.spyOn(
+ documentUnitService,
+ "searchByRelatedDocumentation",
+ ).mockImplementation(() =>
+ Promise.resolve({
+ status: 200,
+ data: {
+ content: [
+ new EnsuingDecision({
+ uuid: "123",
+ court: {
+ type: "type1",
+ location: "location1",
+ label: "label1",
+ },
+ decisionDate: "2022-02-01",
+ documentType: {
+ jurisShortcut: "documentTypeShortcut1",
+ label: "documentType1",
+ },
+ fileNumber: "test fileNumber1",
+ }),
+ ],
+ size: 0,
+ number: 0,
+ numberOfElements: 20,
+ first: true,
+ last: false,
+ empty: false,
+ },
+ }),
+ )
- vi.spyOn(window, "scrollTo").mockImplementation(() => vi.fn())
+ vi.spyOn(window, "scrollTo").mockImplementation(() => vi.fn())
+ })
it("renders empty ensuing decision in edit mode, when no ensuingDecisions in list", async () => {
renderComponent()
diff --git a/frontend/test/components/previousDecisions.spec.ts b/frontend/test/components/previousDecisions.spec.ts
index 052354473..7d9003e42 100644
--- a/frontend/test/components/previousDecisions.spec.ts
+++ b/frontend/test/components/previousDecisions.spec.ts
@@ -8,6 +8,7 @@ import PreviousDecisions from "@/components/PreviousDecisions.vue"
import DocumentUnit, { Court, DocumentType } from "@/domain/documentUnit"
import PreviousDecision from "@/domain/previousDecision"
import documentUnitService from "@/services/documentUnitService"
+import featureToggleService from "@/services/featureToggleService"
import routes from "~/test-helper/routes"
const server = setupServer(
@@ -97,40 +98,47 @@ describe("PreviousDecisions", () => {
beforeAll(() => server.listen())
afterAll(() => server.close())
- vi.spyOn(
- documentUnitService,
- "searchByRelatedDocumentation",
- ).mockImplementation(() =>
- Promise.resolve({
+ beforeEach(() => {
+ vi.spyOn(featureToggleService, "isEnabled").mockResolvedValue({
status: 200,
- data: {
- content: [
- new PreviousDecision({
- uuid: "123",
- court: {
- type: "type1",
- location: "location1",
- label: "label1",
- },
- decisionDate: "2022-02-01",
- documentType: {
- jurisShortcut: "documentTypeShortcut1",
- label: "documentType1",
- },
- fileNumber: "test fileNumber1",
- }),
- ],
- size: 0,
- number: 0,
- numberOfElements: 20,
- first: true,
- last: false,
- empty: false,
- },
- }),
- )
+ data: true,
+ })
+
+ vi.spyOn(
+ documentUnitService,
+ "searchByRelatedDocumentation",
+ ).mockImplementation(() =>
+ Promise.resolve({
+ status: 200,
+ data: {
+ content: [
+ new PreviousDecision({
+ uuid: "123",
+ court: {
+ type: "type1",
+ location: "location1",
+ label: "label1",
+ },
+ decisionDate: "2022-02-01",
+ documentType: {
+ jurisShortcut: "documentTypeShortcut1",
+ label: "documentType1",
+ },
+ fileNumber: "test fileNumber1",
+ }),
+ ],
+ size: 0,
+ number: 0,
+ numberOfElements: 20,
+ first: true,
+ last: false,
+ empty: false,
+ },
+ }),
+ )
- vi.spyOn(window, "scrollTo").mockImplementation(() => vi.fn())
+ vi.spyOn(window, "scrollTo").mockImplementation(() => vi.fn())
+ })
it("renders empty previous decision in edit mode, when no previousDecisions in list", async () => {
renderComponent()
diff --git a/frontend/test/e2e/caselaw/categories/editableLists/relatedDocumentations/active-citations.spec.ts b/frontend/test/e2e/caselaw/categories/editableLists/relatedDocumentations/active-citations.spec.ts
index 22f82eca5..787b399ca 100644
--- a/frontend/test/e2e/caselaw/categories/editableLists/relatedDocumentations/active-citations.spec.ts
+++ b/frontend/test/e2e/caselaw/categories/editableLists/relatedDocumentations/active-citations.spec.ts
@@ -90,4 +90,52 @@ test.describe("active citations", () => {
await expect(page.getByText("Fehlende Daten")).toBeHidden()
})
+
+ test("Import categories possible, when citation style 'Parallelentscheidung'", async ({
+ page,
+ documentNumber,
+ prefilledDocumentUnit,
+ }) => {
+ await handoverDocumentationUnit(
+ page,
+ prefilledDocumentUnit.documentNumber || "",
+ )
+ await navigateToCategories(page, documentNumber)
+
+ await fillActiveCitationInputs(page, {
+ citationType: "Parallelentscheidung",
+ })
+ await fillActiveCitationInputs(page, {
+ court: prefilledDocumentUnit.coreData.court?.label,
+ fileNumber: prefilledDocumentUnit.coreData.fileNumbers?.[0],
+ documentType: prefilledDocumentUnit.coreData.documentType?.label,
+ decisionDate: "31.12.2019",
+ })
+ const activeCitationContainer = page.getByLabel("Aktivzitierung")
+ await activeCitationContainer.getByLabel("Nach Entscheidung suchen").click()
+
+ await expect(page.getByText("1 Ergebnis gefunden")).toBeVisible()
+
+ await expect(
+ page.getByText(
+ `AG Aachen, 31.12.2019, ${prefilledDocumentUnit.coreData.fileNumbers?.[0]}, Anerkenntnisurteil`,
+ ),
+ ).toBeVisible()
+
+ await page.getByLabel("Treffer übernehmen").click()
+
+ await expect(
+ page.getByText(
+ `Parallelentscheidung, AG Aachen, 31.12.2019, ${prefilledDocumentUnit.coreData.fileNumbers?.[0]}, Anerkenntnisurteil`,
+ ),
+ ).toBeVisible()
+
+ const importButton = page.getByTestId("import-categories")
+ await expect(importButton).toBeVisible()
+ await importButton.click()
+ await expect(page.getByText("Rubriken importieren")).toBeVisible()
+ await expect(page.getByLabel("Dokumentnummer Eingabefeld")).toHaveValue(
+ prefilledDocumentUnit.documentNumber,
+ )
+ })
})
diff --git a/frontend/test/routes/[documentNumber].spec.ts b/frontend/test/routes/[documentNumber].spec.ts
index 37dc33a84..651f85626 100644
--- a/frontend/test/routes/[documentNumber].spec.ts
+++ b/frontend/test/routes/[documentNumber].spec.ts
@@ -302,14 +302,14 @@ describe("Document Number Route", () => {
).toBeVisible()
})
- it('detects "k" keypress and opens category import', async () => {
+ it('detects "r" keypress and opens category import', async () => {
const { user, router } = renderComponent()
await router.push({
path: "/caselaw/documentUnit/1234567891234/references?showAttachmentPanel=false",
})
expect(screen.queryByTestId("category-import")).not.toBeInTheDocument()
- await user.keyboard("k")
+ await user.keyboard("r")
expect(screen.getByTestId("category-import")).toBeInTheDocument()
})