-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(skilavottord): Add municipality #17109
Open
birkirkristmunds
wants to merge
5
commits into
main
Choose a base branch
from
feat/skilavottord-add-municipality
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,158
−655
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
c9399dc
TS-936 Municipality
birkirkristmunds 14a326c
Merge branch 'main' into feat/skilavottord-add-municipality
birkirkristmunds 525e7f7
TS-936 Municipality
birkirkristmunds d1108ea
TS-936 Municipality
birkirkristmunds a2ce8ec
TS-936 Municipality
birkirkristmunds File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
53 changes: 53 additions & 0 deletions
53
apps/skilavottord/web/components/NavigationLinks/NavigationLinks.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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { hasMunicipalityRole } from '@island.is/skilavottord-web/auth/utils' | ||
import { UserContext } from '@island.is/skilavottord-web/context' | ||
import { useI18n } from '@island.is/skilavottord-web/i18n' | ||
import { useContext } from 'react' | ||
import Sidenav from '../Sidenav/Sidenav' | ||
|
||
export const NavigationLinks = ({ | ||
activeSection, | ||
}: { | ||
activeSection: number | ||
}) => { | ||
const { | ||
t: { recyclingFundSidenav: sidenavText, routes }, | ||
} = useI18n() | ||
|
||
const { user } = useContext(UserContext) | ||
|
||
let title = sidenavText.title | ||
if (hasMunicipalityRole(user?.role)) { | ||
title = sidenavText.municipalityTitle | ||
} | ||
|
||
return ( | ||
<Sidenav | ||
title={title} | ||
sections={[ | ||
{ | ||
icon: 'car', | ||
title: `${sidenavText.recycled}`, | ||
link: `${routes.recycledVehicles}`, | ||
}, | ||
{ | ||
icon: 'people', | ||
title: `${sidenavText.municipalities}`, | ||
link: `${routes.municipalities.baseRoute}`, | ||
hidden: hasMunicipalityRole(user?.role), | ||
}, | ||
{ | ||
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
30
apps/skilavottord/web/components/PageHeader/PageHeader.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 |
---|---|---|
@@ -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 |
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 |
---|---|---|
|
@@ -365,9 +365,11 @@ | |
}, | ||
"recyclingFundSidenav": { | ||
"title": "Service", | ||
"municipalityTitle": "Municipality", | ||
"recycled": "Recycled cars", | ||
"companies": "Recycling companies", | ||
"accessControl": "Access Control" | ||
"accessControl": "Access Control", | ||
"municipalities": "Municipalities" | ||
}, | ||
"recyclingCompanies": { | ||
"title": "Recycling companies", | ||
|
@@ -390,7 +392,8 @@ | |
}, | ||
"buttons": { | ||
"add": "Add recycling company", | ||
"view": "View" | ||
"view": "View", | ||
"addMunicipality": "Add municipality" | ||
}, | ||
"recyclingCompany": { | ||
"view": { | ||
|
@@ -409,32 +412,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" | ||
} | ||
}, | ||
|
@@ -575,6 +578,13 @@ | |
"rules": { | ||
"required": "Partner is required" | ||
} | ||
}, | ||
"municipality": { | ||
"label": "Municipality", | ||
"placeholder": "Municipality", | ||
"rules": { | ||
"required": "Municipality is required" | ||
} | ||
} | ||
}, | ||
"buttons": { | ||
|
@@ -627,6 +637,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.", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix non-English content in English locale file. These strings are in Icelandic instead of English:
Also applies to: 657-657 |
||
"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" | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Enhance tooltip accessibility
The Tooltip component should have proper ARIA attributes for better screen reader support.
📝 Committable suggestion