Skip to content

Commit

Permalink
Merge pull request #1011 from digitalservicebund/remove-delta
Browse files Browse the repository at this point in the history
Remove non time-boundary stuff from RisModForm
  • Loading branch information
malte-laukoetter authored Feb 18, 2025
2 parents 8b3e27c + cf1ef3a commit 1159612
Show file tree
Hide file tree
Showing 19 changed files with 87 additions and 2,377 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,10 @@

import de.bund.digitalservice.ris.norms.adapter.input.restapi.mapper.NormResponseMapper;
import de.bund.digitalservice.ris.norms.adapter.input.restapi.schema.NormResponseSchema;
import de.bund.digitalservice.ris.norms.adapter.input.restapi.schema.UpdateModRequestSchema;
import de.bund.digitalservice.ris.norms.adapter.input.restapi.schema.UpdateModResponseSchema;
import de.bund.digitalservice.ris.norms.adapter.input.restapi.schema.UpdateModsRequestSchema;
import de.bund.digitalservice.ris.norms.adapter.input.restapi.schema.UpdateModsResponseSchema;
import de.bund.digitalservice.ris.norms.application.port.input.*;
import de.bund.digitalservice.ris.norms.domain.entity.eli.DokumentExpressionEli;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotEmpty;
import java.time.Instant;
import java.util.Map;
import java.util.Optional;
import org.springframework.http.HttpStatusCode;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

Expand Down Expand Up @@ -127,75 +119,4 @@ public ResponseEntity<String> updateAmendingLaw(

return ResponseEntity.ok(updatedAmendingLaw);
}

/**
* Update an amending command of an amending law and consecutively creates/updates the ZF0 the
* affected document.
*
* @param eli Eli of the request
* @param eid the eId of the akn:mod within the amending law
* @param updateModRequestSchema the new data about the akn:mod element
* @param dryRun Should the save operation only be previewed and not actually persisted?
* @return A {@link ResponseEntity} containing the updated xml of the amending law.
* <p>Returns HTTP 200 (OK) if both amending law and zf0 successfully uddated.
* <p>Returns HTTP 404 (Not Found) if amending law, target law or node within target law not
* found.
* @deprecated
*/
@PutMapping(
path = "/mods/{eid}",
consumes = { APPLICATION_JSON_VALUE },
produces = { APPLICATION_JSON_VALUE }
)
@Deprecated(forRemoval = true)
public ResponseEntity<UpdateModResponseSchema> updateMod(
final DokumentExpressionEli eli,
@PathVariable final String eid,
@RequestBody @Valid final UpdateModRequestSchema updateModRequestSchema,
@RequestParam(defaultValue = "false") final Boolean dryRun
) {
return ResponseEntity
.status(
HttpStatusCode.valueOf(
501 // Not implemented
)
)
.build();
}

/**
* Update multiple akn:mod elements of an amending law and consecutively creates/updates all ZF0
* of all affected documents.
*
* @param eli Eli of the request
* @param updateModsRequestSchema the eids and changes for the amending commands to update
* @param dryRun Should the save operation only be previewed and not actually persisted?
* @return A {@link ResponseEntity} containing the updated xmls of the norms.
* <p>Returns HTTP 200 (OK) if the amending law and all zf0 successfully updated.
* <p>Returns HTTP 404 (Not Found) if amending law, target law or node within target law not
* found.
* @deprecated
*/
@PatchMapping(
path = "/mods",
consumes = { APPLICATION_JSON_VALUE },
produces = { APPLICATION_JSON_VALUE }
)
@Deprecated(forRemoval = true)
public ResponseEntity<UpdateModsResponseSchema> updateMods(
final DokumentExpressionEli eli,
@RequestBody @Valid @NotEmpty final Map<
String,
UpdateModsRequestSchema.ModUpdate
> updateModsRequestSchema,
@RequestParam(defaultValue = "false") final Boolean dryRun
) {
return ResponseEntity
.status(
HttpStatusCode.valueOf(
501 // Not implemented
)
)
.build();
}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

6 changes: 3 additions & 3 deletions frontend/e2e/amending-laws-article-editor-common.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ test.describe("Navigation", () => {
)

await expect(
page.getByRole("textbox", {
name: "Neuer Text Inhalt",
page.getByRole("combobox", {
name: "Zeitgrenze",
}),
).toHaveValue("1. Beispiel")
).toHaveText("01.02.1001")
})
})

Expand Down
35 changes: 0 additions & 35 deletions frontend/e2e/amending-laws-article-editor-quoted-structure.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@ test.describe("Load mod details", () => {
})
await expect(modFormSection).toBeVisible()

// Textual Mode Type
const textualModeTypeElement = modFormSection.getByRole("textbox", {
name: "Änderungstyp",
})
await expect(textualModeTypeElement).toBeVisible()
await expect(textualModeTypeElement).toHaveValue("Ersetzen")
await expect(textualModeTypeElement).toHaveAttribute("readonly", "")

// Time Boundaries
const timeBoundariesElement = modFormSection.getByRole("combobox", {
name: "Zeitgrenze",
Expand All @@ -52,33 +44,6 @@ test.describe("Load mod details", () => {

const timeBoundaryOptionElements = sharedPage.getByRole("option")
await expect(timeBoundaryOptionElements).toHaveCount(3)

// // Destination Href Eli
const destinationHrefEliElement = modFormSection.getByRole("textbox", {
name: "ELI Zielgesetz",
})
await expect(destinationHrefEliElement).toBeVisible()
await expect(destinationHrefEliElement).toHaveValue(
"eli/bund/bgbl-1/1002/1/1002-01-01/1/deu/regelungstext-1",
)
await expect(destinationHrefEliElement).toHaveAttribute("readonly", "")

const elementToBeReplacedField = sharedPage.getByTestId(
"elementToBeReplaced",
)

const selectedElementLocator = elementToBeReplacedField.getByRole(
"button",
{ name: "long title", exact: true },
)

await expect(selectedElementLocator).toBeInViewport()

await expect(selectedElementLocator).toHaveClass(/selected/)

await expect(sharedPage.getByTestId("replacingElement")).toHaveText(
"Fiktives Beispielgesetz für das Ersetzen von Strukturen und Gliederungseinheiten mit Änderungsbefehlen (Strukturänderungsgesetz)",
)
})
})

Expand Down
48 changes: 0 additions & 48 deletions frontend/e2e/amending-laws-article-editor-quoted-text.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,54 +11,6 @@ test.describe("Editing a single mod", () => {
test.afterEach(async ({ authenticatedRequest: request }) => {
await uploadAmendingLaw(request, "bgbl-1_2017_s419/aenderungsgesetz.xml")
})

test(
"editing and saving the eid mod change by highlighting",
{ tag: ["@RISDEV-4553"] },
async ({ page }) => {
const amendingLawSection = page.getByRole("region", {
name: "Änderungsbefehle",
})

await amendingLawSection.getByText("§ 20 Absatz 1 Satz 2").click()

const modFormSection = page.getByRole("region", {
name: "Änderungsbefehl bearbeiten",
})

await expect(
modFormSection.getByRole("textbox", {
name: "zu ersetzende Textstelle",
}),
).toHaveValue(
"hauptteil-1_art-1_abs-1_untergl-1_listenelem-2_inhalt-1_text-1/9-34.xml",
)

const textBoundingBox = await modFormSection
.getByLabel("Zu ersetzender Text")
.getByText("entgegen § 9")
.boundingBox()

await page.mouse.dblclick(textBoundingBox!.x + 50, textBoundingBox!.y + 5)
await page.mouse.click(0, 0)

await expect(
modFormSection.getByRole("textbox", {
name: "zu ersetzende Textstelle",
}),
).not.toHaveValue(
"hauptteil-1_art-1_abs-1_untergl-1_listenelem-2_inhalt-1_text-1/9-34.xml",
)

await expect(
modFormSection.getByRole("textbox", {
name: "zu ersetzende Textstelle",
}),
).toHaveValue(
"hauptteil-1_art-1_abs-1_untergl-1_listenelem-2_inhalt-1_text-1/0-8.xml",
)
},
)
})

test.describe("Editing multiple mods", () => {
Expand Down
Loading

0 comments on commit 1159612

Please sign in to comment.