Skip to content

Commit

Permalink
feat(signature-collection): Application for Parliamentary Create List (
Browse files Browse the repository at this point in the history
…#15333)

* initial commit

* chore: nx format:write update dirty files

* merge fix

* chore: nx format:write update dirty files

* test

* temp

* temp2

* fix(ui-fields): TableRepeaterField with NationalIdWithName component

* hehe, revert

* tweak

* tweak for item type

* chore: nx format:write update dirty files

* lint

* person in table repeater

* small refactor moving functions to utils

* tweaks

* tweaks

* cleanup

* temp

* chore: nx format:write update dirty files

* rabbit

* cleanup2

* tables

* texts

* fix for undefined

* t

* review tweaks

* chore: nx format:write update dirty files

* tweak overview

* refactor

* cleanup

* keep handleCustomMappedValues in utils tho

* tweak

* added comment in utils

* rabbit review

* cleanup

* dataschema

* format

* tweaks

* tweaks vol 2

* removed any's

* linting tweaks

* adding translationNamespaces

* removed custom component

* chore: nx format:write update dirty files

* renamed template

* review tweaks

---------

Co-authored-by: andes-it <[email protected]>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Jul 5, 2024
1 parent 129bdd3 commit 8d22fae
Show file tree
Hide file tree
Showing 26 changed files with 1,558 additions and 15 deletions.
4 changes: 4 additions & 0 deletions libs/application/template-loader/src/lib/templateLoaders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ const templates: Record<ApplicationTypes, () => Promise<unknown>> = {
import(
'@island.is/application/templates/signature-collection/presidential-list-signing'
),
[ApplicationTypes.PARLIAMENTARY_LIST_CREATION]: () =>
import(
'@island.is/application/templates/signature-collection/parliamentary-list-creation'
),
[ApplicationTypes.CITIZENSHIP]: () =>
import(
'@island.is/application/templates/directorate-of-immigration/citizenship'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4137,11 +4137,11 @@ const Illustration: React.FC<React.PropsWithChildren<unknown>> = () => (
y2="154.319"
gradientUnits="userSpaceOnUse"
>
<stop stop-color="#FF4C84" />
<stop offset="0.3015" stop-color="#C064AF" />
<stop offset="0.6316" stop-color="#827CDA" />
<stop offset="0.8738" stop-color="#5B8BF5" />
<stop offset="1" stop-color="#4C90FF" />
<stop stopColor="#FF4C84" />
<stop offset="0.3015" stopColor="#C064AF" />
<stop offset="0.6316" stopColor="#827CDA" />
<stop offset="0.8738" stopColor="#5B8BF5" />
<stop offset="1" stopColor="#4C90FF" />
</linearGradient>
<linearGradient
id="paint1_linear_3546_23902"
Expand All @@ -4151,11 +4151,11 @@ const Illustration: React.FC<React.PropsWithChildren<unknown>> = () => (
y2="135.619"
gradientUnits="userSpaceOnUse"
>
<stop stop-color="#FF4C84" />
<stop offset="0.3015" stop-color="#C064AF" />
<stop offset="0.6316" stop-color="#827CDA" />
<stop offset="0.8738" stop-color="#5B8BF5" />
<stop offset="1" stop-color="#4C90FF" />
<stop stopColor="#FF4C84" />
<stop offset="0.3015" stopColor="#C064AF" />
<stop offset="0.6316" stopColor="#827CDA" />
<stop offset="0.8738" stopColor="#5B8BF5" />
<stop offset="1" stopColor="#4C90FF" />
</linearGradient>
<linearGradient
id="paint2_linear_3546_23902"
Expand All @@ -4165,9 +4165,9 @@ const Illustration: React.FC<React.PropsWithChildren<unknown>> = () => (
y2="293.826"
gradientUnits="userSpaceOnUse"
>
<stop stop-color="#FF4C84" />
<stop offset="0.6233" stop-color="#8D78D3" />
<stop offset="1" stop-color="#4C90FF" />
<stop stopColor="#FF4C84" />
<stop offset="0.6233" stopColor="#8D78D3" />
<stop offset="1" stopColor="#4C90FF" />
</linearGradient>
<linearGradient
id="paint3_linear_3546_23902"
Expand All @@ -4177,8 +4177,8 @@ const Illustration: React.FC<React.PropsWithChildren<unknown>> = () => (
y2="141.642"
gradientUnits="userSpaceOnUse"
>
<stop stop-color="#4C90FF" />
<stop offset="1" stop-color="#FF4C84" />
<stop stopColor="#4C90FF" />
<stop offset="1" stopColor="#FF4C84" />
</linearGradient>
</defs>
</svg>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"presets": [
[
"@nx/react/babel",
{
"runtime": "automatic",
"useBuiltIns": "usage"
}
]
],
"plugins": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": ["plugin:@nx/react", "../../../../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"rules": {}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# application-templates-parliamentary-list-creation

This library was generated with [Nx](https://nx.dev).

## Running unit tests

Run `nx test application-templates-parliamentary-list-creation` to execute the unit tests via [Jest](https://jestjs.io).
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import React, { FC } from 'react'

export const Logo: FC<React.PropsWithChildren<unknown>> = () => (
<svg
width="80"
height="80"
viewBox="0 0 80 80"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<g clipPath="url(#clip0_8686_17776)">
<g clipPath="url(#clip1_8686_17776)">
<path
d="M37.3702 0.566454L18.3626 9.81752C18.2539 9.87023 18.1623 9.95247 18.0982 10.0548C18.034 10.1572 18 10.2755 18 10.3962V35.9469C18 36.1175 18.0678 36.2812 18.1884 36.4018C18.3091 36.5225 18.4728 36.5903 18.6434 36.5903H37.6511C37.8217 36.5903 37.9854 36.5225 38.106 36.4018C38.2267 36.2812 38.2945 36.1175 38.2945 35.9469V1.14688C38.2943 1.0379 38.2665 0.93074 38.2137 0.835409C38.1608 0.740079 38.0847 0.659682 37.9924 0.601723C37.9002 0.543764 37.7947 0.510131 37.6859 0.503964C37.5771 0.497796 37.4685 0.519295 37.3702 0.566454Z"
fill="#020350"
/>
<path
d="M37.3853 40.088L18.393 48.4965C18.2777 48.5478 18.1797 48.6313 18.1108 48.737C18.042 48.8427 18.0052 48.9661 18.0049 49.0923V79.7663C18.0048 79.8747 18.0317 79.9815 18.0833 80.0768C18.1348 80.1722 18.2094 80.2532 18.3001 80.3125C18.3909 80.3719 18.495 80.4076 18.603 80.4166C18.7111 80.4255 18.8197 80.4073 18.9189 80.3638L37.9113 72.0233C38.0273 71.9724 38.1259 71.8888 38.1951 71.7827C38.2644 71.6765 38.3012 71.5526 38.3011 71.4259V40.6906C38.3021 40.5815 38.2758 40.4739 38.2245 40.3776C38.1732 40.2814 38.0986 40.1995 38.0075 40.1395C37.9164 40.0796 37.8117 40.0435 37.703 40.0345C37.5943 40.0254 37.485 40.0439 37.3853 40.088Z"
fill="#020350"
/>
<path
d="M41.6016 60.1664C41.4278 60.1664 41.2611 60.0973 41.1382 59.9744C41.0153 59.8515 40.9463 59.6849 40.9463 59.5111V37.2455C40.9463 37.1595 40.9632 37.0743 40.9962 36.9947C41.0291 36.9152 41.0774 36.843 41.1382 36.7821C41.1991 36.7213 41.2713 36.673 41.3508 36.6401C41.4303 36.6072 41.5156 36.5902 41.6016 36.5902H60.5871C60.6732 36.5902 60.7584 36.6072 60.8379 36.6401C60.9174 36.673 60.9897 36.7213 61.0505 36.7821C61.1114 36.843 61.1596 36.9152 61.1926 36.9947C61.2255 37.0743 61.2425 37.1595 61.2425 37.2455V40.5255C61.2425 45.7346 59.1732 50.7303 55.4898 54.4137C51.8064 58.0971 46.8107 60.1664 41.6016 60.1664Z"
fill="#020350"
/>
<path
d="M51.0942 12.2496C53.2302 12.2496 55.3183 12.883 57.0944 14.0698C58.8704 15.2565 60.2547 16.9432 61.0721 18.9167C61.8895 20.8901 62.1034 23.0616 61.6867 25.1566C61.27 27.2516 60.2414 29.176 58.7309 30.6864C57.2205 32.1968 55.2962 33.2254 53.2012 33.6421C51.1062 34.0588 48.9347 33.845 46.9612 33.0275C44.9878 32.2101 43.301 30.8258 42.1143 29.0498C40.9276 27.2737 40.2942 25.1857 40.2942 23.0496C40.2942 20.1853 41.432 17.4383 43.4574 15.4129C45.4828 13.3875 48.2299 12.2496 51.0942 12.2496Z"
fill="#020350"
/>
</g>
</g>
<defs>
<clipPath id="clip0_8686_17776">
<rect width="80" height="80" fill="white" />
</clipPath>
<clipPath id="clip1_8686_17776">
<rect
width="44.2553"
height="80"
fill="white"
transform="translate(18 0.5)"
/>
</clipPath>
</defs>
</svg>
)

export default Logo
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* eslint-disable */
export default {
displayName: 'application-templates-parliamentary-list-creation',
preset: './jest.preset.js',
rootDir: '../../../../..',
roots: [__dirname],
transform: {
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/react/babel'] }],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory:
'<rootDir>/coverage/libs/application/templates/signature-collection/parliamentary-list-creation',
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "application-templates-parliamentary-list-creation",
"$schema": "../../../../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/application/templates/signature-collection/parliamentary-list-creation/src",
"projectType": "library",
"tags": ["scope:application-system", "lib:application-system"],
"targets": {
"lint": {
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": [
"libs/application/templates/signature-collection/parliamentary-list-creation/**/*.{ts,tsx,js,jsx}"
]
}
},
"test": {
"executor": "@nx/jest:jest",
"outputs": [
"{workspaceRoot}/coverage/libs/application/templates/signature-collection/parliamentary-list-creation"
],
"options": {
"jestConfig": "libs/application/templates/signature-collection/parliamentary-list-creation/jest.config.ts",
"passWithNoTests": true
}
},
"extract-strings": {
"executor": "nx:run-commands",
"options": {
"command": "yarn ts-node -P libs/localization/tsconfig.lib.json libs/localization/scripts/extract 'libs/application/templates/signature-collection/parliamentary-list-creation/src/**/*.{js,ts,tsx}'"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineTemplateApi } from '@island.is/application/types'

export const OwnerRequirementsApi = defineTemplateApi({
action: 'ownerRequirements',
})

export const CurrentCollectionApi = defineTemplateApi({
action: 'currentCollection',
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
import {
buildForm,
buildMultiField,
buildSection,
buildMessageWithLinkButtonField,
buildDescriptionField,
} from '@island.is/application/core'
import { Form, FormModes } from '@island.is/application/types'
import { m } from '../lib/messages'

export const Done: Form = buildForm({
id: 'done',
title: '',
mode: FormModes.COMPLETED,
children: [
/* Sections for the stepper */
buildSection({
id: 'screen1',
title: m.dataCollection,
children: [],
}),
buildSection({
id: 'screen2',
title: m.information,
children: [],
}),
buildSection({
id: 'screen3',
title: m.overview,
children: [],
}),
/* ------------------------ */
buildSection({
id: 'doneScreen',
title: m.listCreated,
children: [
buildMultiField({
id: 'doneScreen',
title: m.listCreated,
description: m.listCreatedDescription,
children: [
buildDescriptionField({
id: 'nextStepsTitle',
title: m.nextSteps,
titleVariant: 'h3',
marginBottom: 1,
}),
//Set up separately for even spacing
buildDescriptionField({
id: 'nextStepsDescription',
title: '',
description: m.nextStepsDescription,
titleVariant: 'h3',
marginBottom: 5,
}),
buildMessageWithLinkButtonField({
id: 'done.goToServicePortal',
title: '',
url: '/minarsidur/min-gogn/listar/medmaelasofnun',
buttonTitle: m.linkFieldButtonTitle,
message: m.linkFieldMessage,
}),
buildDescriptionField({
id: 'space',
title: '',
space: 'containerGutter',
}),
buildDescriptionField({
id: 'space1',
title: '',
space: 'containerGutter',
}),
],
}),
],
}),
],
})
Loading

0 comments on commit 8d22fae

Please sign in to comment.