-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add delete and cancel functionality for service form
- Loading branch information
Showing
7 changed files
with
163 additions
and
69 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
25 changes: 23 additions & 2 deletions
25
apps/service-catalog/app/catalogs/[catalogId]/public-services/[serviceId]/edit/page.tsx
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,7 +1,28 @@ | ||
export default async function EditPublicServicePage() { | ||
import { getOrganization } from '@catalog-frontend/data-access'; | ||
import { Organization, Service } from '@catalog-frontend/types'; | ||
import { Breadcrumbs, PageBanner } from '@catalog-frontend/ui'; | ||
import { getTranslateText, localization } from '@catalog-frontend/utils'; | ||
import { getPublicServices } from 'apps/service-catalog/app/actions/public-services/actions'; | ||
import ServiceForm from 'apps/service-catalog/app/components/service-form'; | ||
import { Params } from 'next/dist/shared/lib/router/utils/route-matcher'; | ||
|
||
export default async function EditPublicServicePage({ params }: Params) { | ||
const { catalogId, serviceId } = params; | ||
const services: Service[] = await getPublicServices(catalogId); | ||
const service: Service | undefined = services.find((s) => s.id === serviceId); | ||
const organization: Organization = await getOrganization(catalogId).then((res) => res.json()); | ||
|
||
return ( | ||
<div> | ||
<h1>Rediger offentlig tjeneste</h1> | ||
<Breadcrumbs /> | ||
<PageBanner | ||
title={localization.catalogType.service} | ||
subtitle={getTranslateText(organization?.prefLabel).toString()} | ||
/> | ||
<ServiceForm | ||
catalogId={catalogId} | ||
service={service} | ||
/> | ||
</div> | ||
); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.cancelLink { | ||
text-decoration: none; | ||
} | ||
|
||
.formCard { | ||
padding-top: 50px; | ||
padding-bottom: 20px; | ||
} | ||
|
||
.buttonRow { | ||
display: flex; | ||
gap: 15px; | ||
padding-top: 40px; | ||
padding-bottom: 40px; | ||
} |
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