Skip to content

Commit

Permalink
Remove feature flag of terminierte Abgabe (#2421)
Browse files Browse the repository at this point in the history
RISDEV-5234
  • Loading branch information
anne-ds authored Dec 10, 2024
1 parent 2fe2e6c commit f543c5c
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 71 deletions.
15 changes: 3 additions & 12 deletions frontend/src/components/DocumentUnitList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import PopupModal from "@/components/PopupModal.vue"
import TableHeader from "@/components/TableHeader.vue"
import TableRow from "@/components/TableRow.vue"
import TableView from "@/components/TableView.vue"
import { useFeatureToggle } from "@/composables/useFeatureToggle"
import { useStatusBadge } from "@/composables/useStatusBadge"
import { PublicationState } from "@/domain/publicationStatus"
import { ResponseError } from "@/services/httpClient"
Expand Down Expand Up @@ -92,8 +91,6 @@ const publicationDate = (listEntry: DocumentUnitListEntry) => {
}
}
const schedulingFeatureToggle = useFeatureToggle("neuris.scheduledPublishing")
/**
* Stops propagation of scrolling event, and toggles the showModal value
*/
Expand Down Expand Up @@ -158,17 +155,15 @@ function onDelete() {
<CellHeaderItem>
<div class="flex flex-row">
Datum
<IconArrowDown
v-if="!showPublicationDate && schedulingFeatureToggle"
/>
<IconArrowDown v-if="!showPublicationDate" />
</div>
</CellHeaderItem>
<CellHeaderItem> Aktenzeichen</CellHeaderItem>
<CellHeaderItem> Spruchkörper</CellHeaderItem>
<CellHeaderItem> Typ</CellHeaderItem>
<CellHeaderItem> Status</CellHeaderItem>
<CellHeaderItem> Fehler</CellHeaderItem>
<CellHeaderItem v-if="showPublicationDate && schedulingFeatureToggle">
<CellHeaderItem v-if="showPublicationDate">
<div class="flex flex-row items-center">
jDV Übergabe <IconArrowDown /></div
></CellHeaderItem>
Expand Down Expand Up @@ -219,7 +214,6 @@ function onDelete() {
</Tooltip>

<Tooltip
v-if="schedulingFeatureToggle"
:text="schedulingTooltip(listEntry.scheduledPublicationDateTime)"
>
<IconClock
Expand Down Expand Up @@ -294,10 +288,7 @@ function onDelete() {
/>
<span v-else>-</span>
</CellItem>
<CellItem
v-if="showPublicationDate && schedulingFeatureToggle"
data-testid="publicationDate"
>
<CellItem v-if="showPublicationDate" data-testid="publicationDate">
{{ publicationDate(listEntry) }}
</CellItem>
<CellItem class="flex">
Expand Down
14 changes: 4 additions & 10 deletions frontend/src/components/DocumentUnitSearchEntryForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import InputField, { LabelPosition } from "@/components/input/InputField.vue"
import TextButton from "@/components/input/TextButton.vue"
import TextInput from "@/components/input/TextInput.vue"
import { DropdownItem, ValidationError } from "@/components/input/types"
import { useFeatureToggle } from "@/composables/useFeatureToggle"
import useQuery, { Query } from "@/composables/useQueryFromRoute"
import { useValidationStore } from "@/composables/useValidationStore"
import { PublicationState } from "@/domain/publicationStatus"
Expand Down Expand Up @@ -197,8 +196,6 @@ function handleSearch() {
}
}
const schedulingFeatureToggle = useFeatureToggle("neuris.scheduledPublishing")
watch(
route,
() => {
Expand Down Expand Up @@ -244,12 +241,12 @@ export type DocumentUnitSearchParameter =
<div class="ds-body-01-reg flex flex-row items-center">Gericht</div>
<div class="ds-body-01-reg flex flex-row items-center">Datum</div>
<div
v-if="myDocOfficeOnly && schedulingFeatureToggle"
v-if="myDocOfficeOnly"
class="ds-body-01-reg flex flex-row items-center"
>
jDV Übergabe
</div>
<div v-if="!myDocOfficeOnly || !schedulingFeatureToggle" />
<div v-if="!myDocOfficeOnly" />
<div></div>
<!-- Column 2 -->
<div>
Expand Down Expand Up @@ -334,10 +331,7 @@ export type DocumentUnitSearchParameter =
></DateInput>
</InputField>
</div>
<div
v-if="myDocOfficeOnly && schedulingFeatureToggle"
class="flex flex-row gap-20"
>
<div v-if="myDocOfficeOnly" class="flex flex-row gap-20">
<InputField
id="publicationDate"
v-slot="{ id, hasError }"
Expand Down Expand Up @@ -377,7 +371,7 @@ export type DocumentUnitSearchParameter =
/>
</InputField>
</div>
<div v-if="!myDocOfficeOnly || !schedulingFeatureToggle" />
<div v-if="!myDocOfficeOnly" />
<div class="pl-32"></div>
<!-- Column 3 -->
<div class="ds-body-01-reg flex flex-row items-center pl-24 lg:pl-48">
Expand Down
10 changes: 2 additions & 8 deletions frontend/src/components/HandoverDocumentationUnitView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import LoadingSpinner from "@/components/LoadingSpinner.vue"
import PopupModal from "@/components/PopupModal.vue"
import ScheduledPublishingDateTime from "@/components/ScheduledPublishingDateTime.vue"
import TitleElement from "@/components/TitleElement.vue"
import { useFeatureToggle } from "@/composables/useFeatureToggle"
import ActiveCitation, { activeCitationLabels } from "@/domain/activeCitation"
import { longTextLabels, shortTextLabels } from "@/domain/documentUnit"
import EnsuingDecision, {
Expand Down Expand Up @@ -301,8 +300,6 @@ const isDecisionReasonsInvalid = computed<boolean>(
!!store.documentUnit?.longTexts.decisionReasons,
)
const schedulingFeatureToggle = useFeatureToggle("neuris.scheduledPublishing")
const isScheduled = computed<boolean>(
() => !!store.documentUnit!.managementData.scheduledPublicationDateTime,
)
Expand Down Expand Up @@ -627,17 +624,14 @@ const isPublishable = computed<boolean>(
aria-label="Dokumentationseinheit an jDV übergeben"
button-type="primary"
class="w-fit"
:disabled="!isPublishable || (schedulingFeatureToggle && isScheduled)"
:disabled="!isPublishable || isScheduled"
:icon="IconCheck"
label="Dokumentationseinheit an jDV übergeben"
size="medium"
@click="handoverDocumentUnit"
/>

<ScheduledPublishingDateTime
v-if="schedulingFeatureToggle"
:is-publishable="isPublishable"
/>
<ScheduledPublishingDateTime :is-publishable="isPublishable" />

<div aria-label="Letzte Ereignisse">
<h2 class="ds-label-01-bold mb-16">Letzte Ereignisse</h2>
Expand Down
15 changes: 0 additions & 15 deletions frontend/test/components/documentUnit/documentUnitList.spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import { createTestingPinia } from "@pinia/testing"
import { userEvent } from "@testing-library/user-event"
import { render, screen } from "@testing-library/vue"
import { nextTick } from "vue"
import { createRouter, createWebHistory } from "vue-router"
import DocumentUnitList from "@/components/DocumentUnitList.vue"
import DocumentUnitListEntry from "@/domain/documentUnitListEntry"
import { PublicationState } from "@/domain/publicationStatus"
import { User } from "@/domain/user"
import errorMessages from "@/i18n/errors.json"
import featureToggleService from "@/services/featureToggleService"
import { ResponseError } from "@/services/httpClient"
import routes from "~/test-helper/routes"

Expand Down Expand Up @@ -59,13 +57,6 @@ function renderComponent(options?: {
}

describe("documentUnit list", () => {
beforeEach(() => {
vi.spyOn(featureToggleService, "isEnabled").mockResolvedValue({
status: 200,
data: true,
})
})

test("initial state feedback", async () => {
renderComponent({})

Expand Down Expand Up @@ -324,8 +315,6 @@ describe("documentUnit list", () => {
showPublicationDate: true,
})

await nextTick() // can be removed after feature flag removal

expect(screen.getByText("jDV Übergabe")).toBeInTheDocument()
})

Expand All @@ -342,8 +331,6 @@ describe("documentUnit list", () => {
showPublicationDate: true,
})

await nextTick() // should be removed after feature flag removal

expect(screen.getByText("24.01.2100 00:00")).toBeInTheDocument()
expect(
screen.getByLabelText("Terminierte Übergabe am 24.01.2100 00:00"),
Expand All @@ -364,8 +351,6 @@ describe("documentUnit list", () => {
showPublicationDate: true,
})

await nextTick() // should be removed after feature flag removal

expect(screen.getByText("24.01.2000 00:00")).toBeInTheDocument()
expect(
screen.getByLabelText("Keine Übergabe terminiert"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import DocumentUnitListEntry from "@/domain/documentUnitListEntry"
import authService from "@/services/authService"
import ComboboxItemService from "@/services/comboboxItemService"
import documentUnitService from "@/services/documentUnitService"
import featureToggleService from "@/services/featureToggleService"
import routes from "~/test-helper/routes"

function renderComponent(
Expand Down Expand Up @@ -39,13 +38,6 @@ function renderComponent(
}

describe("Documentunit Search", () => {
beforeEach(() => {
vi.spyOn(featureToggleService, "isEnabled").mockResolvedValue({
status: 200,
data: true,
})
})

vi.spyOn(authService, "getName").mockImplementation(() =>
Promise.resolve({
status: 200,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { render, screen } from "@testing-library/vue"
import { expect } from "vitest"
import { createRouter, createWebHistory } from "vue-router"
import DocumentUnitSearchEntryForm from "@/components/DocumentUnitSearchEntryForm.vue"
import featureToggleService from "@/services/featureToggleService"

async function renderComponent(options?: { isLoading: boolean }) {
const props = {
Expand Down Expand Up @@ -32,13 +31,6 @@ async function renderComponent(options?: { isLoading: boolean }) {
}

describe("Documentunit search form", () => {
beforeEach(() => {
vi.spyOn(featureToggleService, "isEnabled").mockResolvedValue({
status: 200,
data: true,
})
})

test("renders correctly", async () => {
await renderComponent()
;[
Expand Down
10 changes: 0 additions & 10 deletions frontend/test/components/handoverDocument.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@ import { userEvent } from "@testing-library/user-event"
import { render, fireEvent, screen } from "@testing-library/vue"
import { Stubs } from "@vue/test-utils/dist/types"
import { beforeEach } from "vitest"
import { nextTick } from "vue"
import { createRouter, createWebHistory } from "vue-router"
import HandoverDocumentationUnitView from "@/components/HandoverDocumentationUnitView.vue"
import DocumentUnit from "@/domain/documentUnit"
import { EventRecordType, HandoverMail, Preview } from "@/domain/eventRecord"
import LegalForce from "@/domain/legalForce"
import NormReference from "@/domain/normReference"
import SingleNorm from "@/domain/singleNorm"
import featureToggleService from "@/services/featureToggleService"
import handoverDocumentationUnitService from "@/services/handoverDocumentationUnitService"

const router = createRouter({
Expand Down Expand Up @@ -75,11 +73,6 @@ describe("HandoverDocumentationUnitView:", () => {
success: true,
}),
})

vi.spyOn(featureToggleService, "isEnabled").mockResolvedValue({
status: 200,
data: true,
})
})
describe("renders plausibility check", () => {
it("with all required fields filled", async () => {
Expand Down Expand Up @@ -602,9 +595,6 @@ describe("HandoverDocumentationUnitView:", () => {
it("should show the scheduling component", async () => {
renderComponent()

// wait for feature flag to be loaded, can be removed when scheduledPublication flag is removed.
await nextTick()

expect(screen.getByLabelText("Terminiertes Datum")).toBeVisible()
})

Expand Down

0 comments on commit f543c5c

Please sign in to comment.