Skip to content

Commit

Permalink
TS-936 Municipality
Browse files Browse the repository at this point in the history
  • Loading branch information
birkirkristmunds committed Dec 3, 2024
1 parent a621cbe commit c9399dc
Show file tree
Hide file tree
Showing 29 changed files with 591 additions and 380 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { useI18n } from '@island.is/skilavottord-web/i18n'
import Sidenav from '../Sidenav/Sidenav'

export const NavigationLinks = ({
activeSection,
}: {
activeSection: number
}) => {
const {
t: { recyclingFundSidenav: sidenavText, routes },
} = useI18n()

return (
<Sidenav
title={sidenavText.title}
sections={[
{
icon: 'car',
title: `${sidenavText.recycled}`,
link: `${routes.recycledVehicles}`,
},
{
icon: 'people',
title: `${sidenavText.municipalities}`,
link: `${routes.municipalities.baseRoute}`,
},
{
icon: 'business',
title: `${sidenavText.companies}`,
link: `${routes.recyclingCompanies.baseRoute}`,
},
{
icon: 'lockClosed',
title: `${sidenavText.accessControl}`,
link: `${routes.accessControl}`,
},
]}
activeSection={activeSection}
/>
)
}
export default NavigationLinks
30 changes: 30 additions & 0 deletions apps/skilavottord/web/components/PageHeader/PageHeader.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { FC } from 'react'

import {
Box,
GridColumn,
GridRow,
Text,
Tooltip,
} from '@island.is/island-ui/core'

export const PageHeader: FC<{ title: string; info: string }> = ({
title,
info,
}) => {
return (
<Box display="flex" alignItems="flexStart" justifyContent="spaceBetween">
<GridRow>
<GridColumn order={[2, 1]}>
<Text variant="h1" as="h1" marginBottom={4}>
{title}
</Text>
</GridColumn>
<GridColumn order={[1, 2]}>
<Tooltip text={info} />
</GridColumn>
</GridRow>
</Box>
)
}
export default PageHeader
2 changes: 1 addition & 1 deletion apps/skilavottord/web/components/Sidenav/Sidenav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ interface SidenavProps {
activeSection: number
}

type SidenavIcon = 'car' | 'business' | 'lockClosed'
type SidenavIcon = 'car' | 'business' | 'lockClosed' | 'municipality'

export const Sidenav = ({ title, sections, activeSection }: SidenavProps) => (
<Box background="blue100" padding={4} borderRadius="large">
Expand Down
57 changes: 43 additions & 14 deletions apps/skilavottord/web/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,8 @@
"title": "Service",
"recycled": "Recycled cars",
"companies": "Recycling companies",
"accessControl": "Access Control"
"accessControl": "Access Control",
"municipalities": "Municipalities"
},
"recyclingCompanies": {
"title": "Recycling companies",
Expand All @@ -390,7 +391,8 @@
},
"buttons": {
"add": "Add recycling company",
"view": "View"
"view": "View",
"addMunicipality": "Add municipality"
},
"recyclingCompany": {
"view": {
Expand All @@ -409,32 +411,32 @@
"form": {
"inputs": {
"companyId": {
"label": "Company ID",
"placeholder": "Company ID",
"label": "ID",
"placeholder": "ID",
"rules": {
"required": "Company ID is required"
"required": "ID is required"
}
},
"companyName": {
"label": "Company name",
"placeholder": "Company name",
"label": "Name",
"placeholder": "Name",
"rules": {
"required": "Company name is required"
"required": "Name is required"
}
},
"nationalId": {
"label": "Company national ID",
"placeholder": "Company national ID",
"label": "National ID",
"placeholder": "National ID",
"rules": {
"required": "Company national ID is required",
"required": "National ID is required",
"validate": "National ID is incorrect"
}
},
"email": {
"label": "Company email",
"placeholder": "Company email",
"label": "Email",
"placeholder": "Email",
"rules": {
"required": "Company email is required",
"required": "Email is required",
"validate": "Invalid email"
}
},
Expand Down Expand Up @@ -575,6 +577,10 @@
"rules": {
"required": "Partner is required"
}
},
"municipality": {
"label": "Municipality",
"placeholder": "Municipality"
}
},
"buttons": {
Expand Down Expand Up @@ -627,6 +633,29 @@
"baseRoute": "/en/company-info",
"add": "/en/company-info/edit",
"edit": "/en/company-info/add"
},
"municipalities": {
"baseRoute": "/en/municipalities",
"add": "/en/municipalities/add",
"edit": "/en/municipalities/[id]"
}
},
"municipalities": {
"title": "Municipalities",
"municipality": {
"view": {
"title": "Municipality",
"breadcrumb": "View",
"info": "Þú getur annaðhvort uppfært eða eytt móttökuaðila. Vinsamlegast staðfestið að upplýsingar fyrirtækis séu rétt slegnar inn.",
"updated": "Updated",
"deleted": "Deleted"
},
"add": {
"title": "Add municipality",
"breadcrumb": "Add new",
"info": "Þegar nýju sveitarfélagi er bætt við, verður hann aðgengilegur í aðgangsstýringu. Vinsamlegast staðfestið að upplýsingar fyrirtækis séu rétt slegnar inn.",
"added": "Added"
}
}
}
}
59 changes: 44 additions & 15 deletions apps/skilavottord/web/i18n/locales/is.json
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,8 @@
"title": "Úrvinnslusjóður",
"recycled": "Meðhöndluð ökutæki",
"companies": "Móttökuaðilar",
"accessControl": "Aðgangsstýring"
"accessControl": "Aðgangsstýring",
"municipalities": "Sveitarfélög"
},
"recyclingCompanies": {
"title": "Móttökuaðilar",
Expand All @@ -390,7 +391,8 @@
},
"buttons": {
"add": "Bæta við móttökuaðila",
"view": "Skoða"
"view": "Skoða",
"addMunicipality": "Bæta við sveitarfélagi"
},
"recyclingCompany": {
"view": {
Expand All @@ -409,32 +411,32 @@
"form": {
"inputs": {
"companyId": {
"label": "Auðkenni fyrirtækis (ID)",
"placeholder": "Auðkenni fyrirtækis",
"label": "Auðkenni (ID)",
"placeholder": "Auðkenni",
"rules": {
"required": "Skylda er að fylla út auðkenni fyrirtækis"
"required": "Skylda er að fylla út auðkenni"
}
},
"companyName": {
"label": "Nafn fyrirtækis",
"placeholder": "Nafn fyrirtækis",
"label": "Nafn",
"placeholder": "Nafn",
"rules": {
"required": "Skylda er að fylla út nafn fyrirtækis"
"required": "Skylda er að fylla út nafn"
}
},
"nationalId": {
"label": "Kennitala fyrirtækis",
"placeholder": "Kennitala fyrirtækis",
"label": "Kennitala",
"placeholder": "Kennitala",
"rules": {
"required": "Skylda er að fylla út kennitölu fyrirtækis",
"required": "Skylda er að fylla út kennitölu",
"validate": "Kennitalan er ekki gild kennitala"
}
},
"email": {
"label": "Netfang fyrirtækis",
"placeholder": "Netfang fyrirtækis",
"label": "Netfang",
"placeholder": "Netfang",
"rules": {
"required": "Skylda er að fylla út netfang fyrirtækis",
"required": "Skylda er að fylla út netfang",
"validate": "Netfang er ekki réttu formi"
}
},
Expand Down Expand Up @@ -479,12 +481,16 @@
"rules": {
"required": "Skylda er að fylla út virkni"
}
},
"municipality": {
"label": "Sveitarfélag",
"placeholder": "Sveitarfélag"
}
},
"buttons": {
"cancel": "Hætta við",
"continue": "Halda áfram",
"confirm": "Staðfesta",
"confirm": "Vista",
"goBack": "Til baka"
}
}
Expand Down Expand Up @@ -627,6 +633,29 @@
"baseRoute": "/company-info",
"add": "/company-info/add",
"edit": "/company-info/edit/[id]"
},
"municipalities": {
"baseRoute": "/municipalities",
"add": "/municipalities/add",
"edit": "/municipalities/[id]"
}
},
"municipalities": {
"title": "Sveitarfélög",
"municipality": {
"view": {
"title": "Sveitarfélag",
"breadcrumb": "Skoða",
"info": "Þú getur annaðhvort uppfært eða eytt móttökuaðila. Vinsamlegast staðfestið að upplýsingar fyrirtækis séu rétt slegnar inn.",
"updated": "Uppfært",
"deleted": "Eytt"
},
"add": {
"title": "Bæta við sveitarfélagi",
"breadcrumb": "Bæta við",
"info": "Þegar nýju sveitarfélagi er bætt við, verður það aðgengilegt í aðgangsstýringu. Vinsamlegast staðfestið að upplýsingar sveitarfélags séu rétt slegnar inn.",
"added": "Bætt við"
}
}
}
}
23 changes: 22 additions & 1 deletion apps/skilavottord/web/i18n/locales/translation.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export interface Translation {
notFound: NotFound
errorBoundary: ErrorBoundary
routes: Routes
municipalities: Municipalities
}

export interface AccessControl {
Expand Down Expand Up @@ -464,6 +465,7 @@ export interface RecyclingCompanies {
export interface RecyclingCompaniesButtons {
add: string
view: string
addMunicipality: string
}

export interface RecyclingCompany {
Expand All @@ -472,6 +474,23 @@ export interface RecyclingCompany {
form: RecyclingCompanyForm
}

export interface Municipalities {
title: string
info: string
empty: string
subtitles: RecyclingCompaniesSubtitles
tableHeaders: RecyclingCompaniesTableHeaders
status: AccessControlStatus
buttons: RecyclingCompaniesButtons
municipality: Municipality
}

export interface Municipality {
view: View
add: Add
form: RecyclingCompanyForm
}

export interface Add {
title: string
breadcrumb: string
Expand All @@ -495,6 +514,7 @@ export interface FormInputs {
website: Name
phone: Name
active: Name
municipality: Name
}

export interface View {
Expand Down Expand Up @@ -540,6 +560,7 @@ export interface RecyclingFundSidenav {
recycled: string
companies: string
accessControl: string
municipalities: string
}

export interface Routes {
Expand All @@ -552,7 +573,7 @@ export interface Routes {
accessControlCompany: string
recyclingCompanies: RecyclingCompaniesClass
companyInfo: RecyclingCompaniesClass
deregisterVehicleKM: RoutesDeregisterVehicle
municipalities: RecyclingCompaniesClass
}

export interface RecyclingCompaniesClass {
Expand Down
5 changes: 5 additions & 0 deletions apps/skilavottord/web/pages/en/municipalities/[id].tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Screen } from '@island.is/skilavottord-web/types'
import { withLocale } from '@island.is/skilavottord-web/i18n'
import { RecyclingCompanyUpdate } from '@island.is/skilavottord-web/screens/RecyclingCompanies/RecyclingCompanyUpdate'

export default withLocale('en')(RecyclingCompanyUpdate as Screen)
5 changes: 5 additions & 0 deletions apps/skilavottord/web/pages/en/municipalities/add.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Screen } from '@island.is/skilavottord-web/types'
import { withLocale } from '@island.is/skilavottord-web/i18n'
import { RecyclingCompanyCreate } from '@island.is/skilavottord-web/screens/RecyclingCompanies/RecyclingCompanyCreate'

export default withLocale('en')(RecyclingCompanyCreate as Screen)
5 changes: 5 additions & 0 deletions apps/skilavottord/web/pages/en/municipalities/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Screen } from '@island.is/skilavottord-web/types'
import { withLocale } from '@island.is/skilavottord-web/i18n'
import { RecyclingCompanies } from '@island.is/skilavottord-web/screens'

export default withLocale('en')(RecyclingCompanies as Screen)
5 changes: 5 additions & 0 deletions apps/skilavottord/web/pages/municipalities/[id].tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Screen } from '@island.is/skilavottord-web/types'
import { withLocale } from '@island.is/skilavottord-web/i18n'
import { RecyclingCompanyUpdate } from '@island.is/skilavottord-web/screens/RecyclingCompanies/RecyclingCompanyUpdate'

export default withLocale('is')(RecyclingCompanyUpdate as Screen)
5 changes: 5 additions & 0 deletions apps/skilavottord/web/pages/municipalities/add.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Screen } from '@island.is/skilavottord-web/types'
import { withLocale } from '@island.is/skilavottord-web/i18n'
import { RecyclingCompanyCreate } from '@island.is/skilavottord-web/screens/RecyclingCompanies/RecyclingCompanyCreate'

export default withLocale('is')(RecyclingCompanyCreate as Screen)
Loading

0 comments on commit c9399dc

Please sign in to comment.