Skip to content

Commit

Permalink
Merge branch 'main' into feat/adding-pdf-endpoint-to-api
Browse files Browse the repository at this point in the history
  • Loading branch information
MargretFinnboga authored Oct 22, 2024
2 parents f5a15c4 + 5411331 commit 481dbc5
Show file tree
Hide file tree
Showing 28 changed files with 232 additions and 96 deletions.
39 changes: 16 additions & 23 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1,31 +1,24 @@
#!/bin/bash
declare -A TIME_KEEP
# t <target> - get elapsed time in milliseconds since first invocation (with nanosecond precision)
t() {
if [[ -v TIME_KEEP[$1] ]]; then
D="$(date +%N)"
echo "$(((${D##0} - ${TIME_KEEP[$1]##0}) / 1000000))"
else
TIME_KEEP[$1]=$(date +%N)
fi
}
set -euo pipefail
t root

source_env .env.secret

# global

export NODE_OPTIONS="--max-old-space-size=8192"

# MacOS specific

export REDIS_CLUSTER_IP=0.0.0.0

# Developer custom direnv config
for envrc in .envrc.* $(if [[ "${IS_DEVCONTAINER:-}" == true ]]; then echo .devcontainer/.envrc.private; fi); do
t "${envrc}"
source_env_if_exists "$envrc"
T_TOTAL=$(t "${envrc}")
if ((T_TOTAL > 100)); then
echo -e "\033[93mSetting '$envrc' took ${T_TOTAL}ms\033[0m"
fi
done

echo "Loading .envrc took $(t root)ms"
# developer custom direnv config

source_env_if_exists .envrc.private
if [[ "${IS_DEVCONTAINER:-}" == true ]]; then
source_env_if_exists .devcontainer/.envrc.private
fi

# Podman compatibility
# NOTE: Exits direnv if user is using docker.
source_env_if_exists .envrc.podman

source_env_if_exists .envrc.kube
17 changes: 14 additions & 3 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,6 @@ codemagic.yaml
/libs/application/templates/university/ @island-is/origo
/libs/application/template-api-modules/src/lib/modules/templates/university/ @island-is/origo

# Temporary assignment while the QA bootstrap project is in progress
/apps/system-e2e/ @island-is/qa

# DevOps
/.github/ @island-is/devops
/.githooks/ @island-is/devops
Expand All @@ -386,3 +383,17 @@ codemagic.yaml
/scripts/postinstall.js @island-is/devops @island-is/core
/scripts/codegen.js @island-is/devops @island-is/core
/charts/ @island-is/devops


# System tests
# Catch-all
/apps/system-e2e/ @island-is/qa
# Islandis
/apps/system-e2e/src/tests/islandis/admin-portal/ @island-is/aranja
/apps/system-e2e/src/tests/islandis/application-system/ @island-is/norda-applications
/apps/system-e2e/src/tests/islandis/application-system/acceptance/parental-leave.spec.ts @island-is/deloitte
/apps/system-e2e/src/tests/islandis/consultation-portal/ @island-is/advania
/apps/system-e2e/src/tests/islandis/service-portal/ @island-is/hugsmidjan @island-is/juni @island-is/norda-applications
/apps/system-e2e/src/tests/islandis/web/ @island-is/hugsmidjan @island-is/juni @island-is/stefna
# Judicial system
/apps/system-e2e/src/tests/judicial-system/ @island-is/kolibri-justice-league
4 changes: 4 additions & 0 deletions apps/application-system/api/infra/application-system-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ export const serviceSetup = (services: {
skilavottordWs: ServiceBuilder<'skilavottord-ws'>
// The user profile service is named service-portal-api in infra setup
servicePortalApi: ServiceBuilder<'service-portal-api'>
userNotificationService: ServiceBuilder<'services-user-notification'>
}): ServiceBuilder<'application-system-api'> =>
service('application-system-api')
.namespace(namespace)
Expand Down Expand Up @@ -256,6 +257,9 @@ export const serviceSetup = (services: {
SERVICE_USER_PROFILE_URL: ref(
(h) => `http://${h.svc(services.servicePortalApi)}`,
),
USER_NOTIFICATION_API_URL: ref(
(h) => `http://${h.svc(services.userNotificationService)}`,
),
})
.xroad(
Base,
Expand Down
7 changes: 5 additions & 2 deletions apps/web/components/Stepper/Stepper/Stepper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ const getInitialStateAndAnswersByQueryParams = (
)

const stepQuestion = getStepQuestion(step)
if (stepQuestion) {
if (stepQuestion && stepType !== STEP_TYPES.INFORMATION) {
questionsAndAnswers.push({
question: stepQuestion,
answer: selectedOption.label,
Expand Down Expand Up @@ -305,7 +305,10 @@ const Stepper = ({
<Box marginTop={3}>
<Button
onClick={() => {
if (selectedOption === null) {
if (
selectedOption === null &&
currentStepType !== STEP_TYPES.INFORMATION
) {
setHasClickedContinueWithoutSelecting(true)
return
}
Expand Down
27 changes: 23 additions & 4 deletions apps/web/screens/Manual/ManualChapter.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useEffect, useMemo, useRef } from 'react'
import { useEffect, useMemo, useRef, useState } from 'react'
import { useQueryState } from 'next-usequerystate'
import { BLOCKS } from '@contentful/rich-text-types'

Expand Down Expand Up @@ -75,6 +75,9 @@ const ManualChapter: ManualScreen = ({ manual, manualChapter, namespace }) => {
const { activeLocale } = useI18n()

const [selectedItemId, setSelectedItemId] = useQueryState('selectedItemId')
const [expandedItemIds, setExpandedItemIds] = useState(
selectedItemId ? [selectedItemId] : [],
)
const initialScrollHasHappened = useRef(false)

useLocalLinkTypeResolver()
Expand Down Expand Up @@ -174,13 +177,29 @@ const ManualChapter: ManualScreen = ({ manual, manualChapter, namespace }) => {
key={item.id}
id={item.id}
label={item.title}
expanded={item.id === selectedItemId}
expanded={
expandedItemIds.includes(item.id) ||
item.id === selectedItemId
}
onToggle={(expanded) => {
initialScrollHasHappened.current = true
if (expanded) {
setExpandedItemIds((prev) => prev.concat(item.id))
setSelectedItemId(item.id)
} else if (selectedItemId === item.id) {
setSelectedItemId(null)
} else {
setExpandedItemIds((prev) => {
const updatedExpandedItemIds = prev.filter(
(id) => id !== item.id,
)
if (selectedItemId === item.id) {
setSelectedItemId(
updatedExpandedItemIds[
updatedExpandedItemIds.length - 1
] ?? null,
)
}
return updatedExpandedItemIds
})
}
}}
>
Expand Down
1 change: 1 addition & 0 deletions charts/islandis/values.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,7 @@ application-system-api:
SERVICE_DOCUMENTS_BASEPATH: 'http://web-services-documents.services-documents.svc.cluster.local'
SERVICE_USER_PROFILE_URL: 'http://web-service-portal-api.service-portal.svc.cluster.local'
UNIVERSITY_GATEWAY_API_URL: 'http://web-services-university-gateway.services-university-gateway.svc.cluster.local'
USER_NOTIFICATION_API_URL: 'http://web-user-notification.user-notification.svc.cluster.local'
WORKPOINT_ARBORG_SERVICE_PATH: 'IS-DEV/MUN/10036/Arborg-Protected/tengill-application-v1'
XROAD_AGRICULTURAL_UNIVERSITY_OF_ICELAND_PATH: 'IS-DEV/EDU/10056/LBHI-Protected/brautskraning-v1'
XROAD_ALTHINGI_OMBUDSMAN_SERVICE_PATH: 'IS-DEV/GOV/10047/UA-Protected/kvortun-v1/'
Expand Down
1 change: 1 addition & 0 deletions charts/islandis/values.prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,7 @@ application-system-api:
SERVICE_DOCUMENTS_BASEPATH: 'http://web-services-documents.services-documents.svc.cluster.local'
SERVICE_USER_PROFILE_URL: 'http://web-service-portal-api.service-portal.svc.cluster.local'
UNIVERSITY_GATEWAY_API_URL: 'http://web-services-university-gateway.services-university-gateway.svc.cluster.local'
USER_NOTIFICATION_API_URL: 'http://web-user-notification.user-notification.svc.cluster.local'
WORKPOINT_ARBORG_SERVICE_PATH: 'IS/MUN/10036/Arborg-Protected/tengill-application-v1'
XROAD_AGRICULTURAL_UNIVERSITY_OF_ICELAND_PATH: 'IS/EDU/4112043590/LBHI-Protected/brautskraning-v1'
XROAD_ALTHINGI_OMBUDSMAN_SERVICE_PATH: 'IS/GOV/5605882089/UA-Protected/kvortun-v1'
Expand Down
1 change: 1 addition & 0 deletions charts/islandis/values.staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,7 @@ application-system-api:
SERVICE_DOCUMENTS_BASEPATH: 'http://web-services-documents.services-documents.svc.cluster.local'
SERVICE_USER_PROFILE_URL: 'http://web-service-portal-api.service-portal.svc.cluster.local'
UNIVERSITY_GATEWAY_API_URL: 'http://web-services-university-gateway.services-university-gateway.svc.cluster.local'
USER_NOTIFICATION_API_URL: 'http://web-user-notification.user-notification.svc.cluster.local'
WORKPOINT_ARBORG_SERVICE_PATH: 'IS-TEST/MUN/10036/Arborg-Protected/tengill-application-v1'
XROAD_AGRICULTURAL_UNIVERSITY_OF_ICELAND_PATH: 'IS-TEST/EDU/10056/LBHI-Protected/brautskraning-v1'
XROAD_ALTHINGI_OMBUDSMAN_SERVICE_PATH: 'IS-TEST/GOV/10047/UA-Protected/kvortun-v1/'
Expand Down
9 changes: 5 additions & 4 deletions infra/src/uber-charts/islandis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,16 @@ const skilavottordWeb = skilavottordWebSetup({ api: skilavottordWs })
const documentsService = serviceDocumentsSetup()
const servicePortalApi = servicePortalApiSetup()

const userNotificationService = userNotificationServiceSetup({
userProfileApi: servicePortalApi,
})

const appSystemApi = appSystemApiSetup({
documentsService,
servicesEndorsementApi: endorsement,
skilavottordWs,
servicePortalApi,
userNotificationService,
})
const appSystemApiWorker = appSystemApiWorkerSetup()

Expand All @@ -94,10 +99,6 @@ const authAdminApi = authAdminApiSetup()
const universityGatewayService = universityGatewaySetup()
const universityGatewayWorker = universityGatewayWorkerSetup()

const userNotificationService = userNotificationServiceSetup({
userProfileApi: servicePortalApi,
})

const api = apiSetup({
appSystemApi,
servicePortalApi,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ export class Name {

@Field(() => String, { nullable: true })
fullName?: string | null

@Field(() => String, { nullable: true })
displayName?: string | null
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ export class PersonBase {
@Field(() => ID)
nationalId!: string

@Field(() => String, { nullable: true })
@Field(() => String, {
nullable: true,
deprecationReason:
'This might return the display name instead of true full name. Use name object instead.',
})
fullName!: string | null

@Field(() => String, {
Expand Down
7 changes: 7 additions & 0 deletions libs/api/domains/national-registry/src/lib/v3/mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ export const formatPerson = async (
individual.kennitala && {
baseId: maskedNationalId,
}),
name: {
firstName: individual.fulltNafn?.eiginNafn ?? null,
middleName: individual.fulltNafn?.milliNafn ?? null,
lastName: individual.fulltNafn?.kenniNafn ?? null,
fullName: individual.fulltNafn?.fulltNafn ?? individual.nafn,
displayName: individual.nafn,
},

//DEPRECATION LINE -- below shall be removed
legalResidence: formatLegalResidence(individual.heimilisfang),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ export const useEligibility = (
isEligible: loading
? undefined
: (data.drivingLicenseApplicationEligibility?.isEligible ?? false) &&
hasQualityPhoto &&
!hasExtendedLicense &&
!hasAnyInvalidRemarks,
requirements,
Expand Down
21 changes: 21 additions & 0 deletions libs/portals/admin/signature-collection/src/lib/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,27 @@ export const m = defineMessages({
defaultMessage: 'Opna fyrir úrvinnslu',
description: '',
},
collectionReviewedTitle: {
id: 'admin-portal.signature-collection:collectionReviewedTitle',
defaultMessage: 'Meðmælasöfnun vegna framboðs til Alþingis lokið',
description: '',
},
collectionReviewedMessage: {
id: 'admin-portal.signature-collection:collectionReviewedMessage',
defaultMessage:
'Nú hefur úrvinnslu verið lokið á öllum listum í öllum kjördæmum.',
description: '',
},
collectionProcessedTitle: {
id: 'admin-portal.signature-collection:collectionProcessedTitle',
defaultMessage: 'Úrvinnsla meðmælasöfnunar lokið',
description: '',
},
collectionProcessedMessage: {
id: 'admin-portal.signature-collection:collectionReviewedTitle',
defaultMessage: 'Nú er hægt að framlengja stökum listum.',
description: '',
},
listReviewedModalDescription: {
id: 'admin-portal.signature-collection:listReviewedModalDescription#markdown',
defaultMessage:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ import electionsCommitteeLogo from '../../../assets/electionsCommittee.svg'
import nationalRegistryLogo from '../../../assets/nationalRegistry.svg'
import { useSignatureCollectionAdminRemoveListMutation } from './removeList.generated'
import { useSignatureCollectionAdminRemoveCandidateMutation } from './removeCandidate.generated'
import { SignatureCollectionList } from '@island.is/api/schema'
import {
CollectionStatus,
SignatureCollectionList,
} from '@island.is/api/schema'

export const Constituency = ({
allowedToProcess,
Expand All @@ -41,7 +44,8 @@ export const Constituency = ({
const navigate = useNavigate()
const { revalidate } = useRevalidator()

const { collection, allLists } = useLoaderData() as ListsLoaderReturn
const { collection, collectionStatus, allLists } =
useLoaderData() as ListsLoaderReturn
const { constituencyName } = useParams() as { constituencyName: string }

const constituencyLists = allLists.filter(
Expand Down Expand Up @@ -127,12 +131,13 @@ export const Constituency = ({
': ' +
constituencyLists.length}
</Text>
{allowedToProcess && constituencyLists?.length > 0 && (
<CreateCollection
collectionId={collection?.id}
areaId={areaId}
/>
)}
{allowedToProcess &&
collectionStatus === CollectionStatus.Processed && (
<CreateCollection
collectionId={collection?.id}
areaId={areaId}
/>
)}
</Box>
<Stack space={3}>
{constituencyLists.map((list) => (
Expand All @@ -158,7 +163,9 @@ export const Constituency = ({
},
}}
tag={
allowedToProcess && list.active
allowedToProcess &&
list.active &&
collectionStatus === CollectionStatus.InitialActive
? {
label: 'Cancel collection',
renderTag: () => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,12 @@ const List = ({ allowedToProcess }: { allowedToProcess: boolean }) => {
? formatMessage(m.listStatusReviewedStatusAlert)
: formatMessage(m.listStatusActiveAlert)
}
type={listStatus === ListStatus.Reviewed ? 'success' : undefined}
type={
listStatus === ListStatus.Reviewed ||
listStatus === ListStatus.Inactive
? 'success'
: undefined
}
/>
<ActionExtendDeadline
listId={list.id}
Expand All @@ -101,7 +106,9 @@ const List = ({ allowedToProcess }: { allowedToProcess: boolean }) => {
)}
{allowedToProcess && (
<Box>
{!list.active && <PaperSignees listId={list.id} />}
{!list.active && !list.reviewed && (
<PaperSignees listId={list.id} />
)}
<ActionReviewComplete listId={list.id} listStatus={listStatus} />
</Box>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ import {
useIdentityQuery,
} from './identityAndCanSignLookup.generated'
import { useSignatureCollectionAdminUploadPaperSignatureMutation } from './uploadPaperSignee.generated'
import { useRevalidator } from 'react-router-dom'

export const PaperSignees = ({ listId }: { listId: string }) => {
useNamespaces('sp.signatureCollection')
const { formatMessage } = useLocale()
const { revalidate } = useRevalidator()
const { control, reset } = useForm()

const [nationalIdInput, setNationalIdInput] = useState('')
Expand Down Expand Up @@ -76,6 +78,7 @@ export const PaperSignees = ({ listId }: { listId: string }) => {
toast.error(formatMessage(m.paperSigneeError))
}
reset()
revalidate()
setNationalIdTypo(false)
setName('')
},
Expand Down
Loading

0 comments on commit 481dbc5

Please sign in to comment.