From 2abfcf1f3164286ded4dab95f2935277d6c564ab Mon Sep 17 00:00:00 2001 From: Leonie Koch Date: Mon, 30 Dec 2024 10:51:09 +0100 Subject: [PATCH] Revert "Automatically open preview, if one search result" This reverts commit 3e8bb86695d4857fcedbfe1cc3eb6ca7d9b8acde. --- .../PeriodicalEditionReferenceInput.vue | 26 ++----------------- frontend/test/e2e/caselaw/e2e-utils.ts | 10 ++----- .../editing-evaluation-references.spec.ts | 7 +++-- 3 files changed, 7 insertions(+), 36 deletions(-) diff --git a/frontend/src/components/periodical-evaluation/references/PeriodicalEditionReferenceInput.vue b/frontend/src/components/periodical-evaluation/references/PeriodicalEditionReferenceInput.vue index 1ac963ec5..23edfa8e7 100644 --- a/frontend/src/components/periodical-evaluation/references/PeriodicalEditionReferenceInput.vue +++ b/frontend/src/components/periodical-evaluation/references/PeriodicalEditionReferenceInput.vue @@ -26,9 +26,7 @@ import ComboboxItemService from "@/services/comboboxItemService" import documentUnitService from "@/services/documentUnitService" import FeatureToggleService from "@/services/featureToggleService" import { ResponseError } from "@/services/httpClient" -import { useDocumentUnitStore } from "@/stores/documentUnitStore" import { useEditionStore } from "@/stores/editionStore" -import { useExtraContentSidePanelStore } from "@/stores/extraContentSidePanelStore" import StringsUtil from "@/utils/stringsUtil" const props = defineProps<{ @@ -46,8 +44,6 @@ const emit = defineEmits<{ const containerRef = ref(null) const store = useEditionStore() -const documentUnitStore = useDocumentUnitStore() -const extraContentSidePanelStore = useExtraContentSidePanelStore() const reference = ref(new Reference({ ...props.modelValue })) const validationStore = useValidationStore() const pageNumber = ref(0) @@ -272,18 +268,6 @@ async function deleteReferenceAndDocUnit() { deleteReference() } -async function openSidePanel(documentUnitNumber?: string) { - if (documentUnitNumber) { - await documentUnitStore.loadDocumentUnit(documentUnitNumber) - extraContentSidePanelStore.togglePanel(true) - } -} - -async function closeSidePanel() { - await documentUnitStore.unloadDocumentUnit() - extraContentSidePanelStore.togglePanel(false) -} - /* Relates the legal periodical of edition to the reference */ @@ -326,16 +310,10 @@ watch( ) /** watches the changes of query related documentations params - * resets the page if change took place. If one search results, open side panel. + * resets the page if change took place. */ -watch(searchResultsCurrentPage, async () => { +watch(searchResultsCurrentPage, () => { pageNumber.value = 0 - - if (searchResults.value && searchResults.value.length == 1) { - await openSidePanel(searchResults.value[0].decision.documentNumber) - } else { - await closeSidePanel() - } }) onMounted(async () => { diff --git a/frontend/test/e2e/caselaw/e2e-utils.ts b/frontend/test/e2e/caselaw/e2e-utils.ts index f6ab02a9f..33c6c5629 100644 --- a/frontend/test/e2e/caselaw/e2e-utils.ts +++ b/frontend/test/e2e/caselaw/e2e-utils.ts @@ -660,17 +660,11 @@ export async function searchForDocUnitWithFileNumberAndDecisionDate( date: string, ) { await fillInput(page, "Gericht", "AG Aachen") - await page - .getByLabel("dropdown-option") - .getByText("AG Aachen", { exact: true }) - .click() + await page.getByText("AG Aachen", { exact: true }).click() await fillInput(page, "Aktenzeichen", fileNumber) await fillInput(page, "Entscheidungsdatum", date) await fillInput(page, "Dokumenttyp", "AnU") - await page - .getByLabel("dropdown-option") - .getByText("Anerkenntnisurteil", { exact: true }) - .click() + await page.getByText("Anerkenntnisurteil", { exact: true }).click() await page.getByText("Suchen").click() } diff --git a/frontend/test/e2e/caselaw/periodical-evaluation/editing-evaluation-references.spec.ts b/frontend/test/e2e/caselaw/periodical-evaluation/editing-evaluation-references.spec.ts index 0ae270d08..f9f1369ff 100644 --- a/frontend/test/e2e/caselaw/periodical-evaluation/editing-evaluation-references.spec.ts +++ b/frontend/test/e2e/caselaw/periodical-evaluation/editing-evaluation-references.spec.ts @@ -52,12 +52,13 @@ test.describe("Editing and deleting references in periodical evaluation", () => ).not.toBeEditable() }) - await test.step("should automatically open preview, when only one search result", async () => { + await test.step("should open and close document preview in side panel", async () => { await searchForDocUnitWithFileNumberAndDecisionDate( page, fileNumber, "31.12.2019", ) + await openExtraContentSidePanelPreview(page, fileNumber) await expect(page.getByLabel("Seitenpanel öffnen")).toBeHidden() await closeExtraContentSidePanelPreview(page) @@ -162,9 +163,7 @@ test.describe("Editing and deleting references in periodical evaluation", () => await expect(decisionElement.nth(1)).toBeVisible() await expect( - page - .getByTestId("editable-list-container") - .getByText(`MMG 2024, 5${suffix} (LT)`, { exact: true }), + page.getByText(`MMG 2024, 5${suffix} (LT)`, { exact: true }), ).toBeVisible() })