Skip to content

Commit

Permalink
fix(driving-license): hotfix/jurisdictionid back in dl (#15940)
Browse files Browse the repository at this point in the history
* fix(driving-license): digital license, no pickup (#15881)

* fix(driving-license): digital license, no pickup

* chore: nx format:write update dirty files

---------

Co-authored-by: andes-it <builders@andes.is>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>

* fix(driving-license): adding back JurisdictionApi check (#15938)

* fix(driving-license): adding back JurisdictionApi check

* chore: nx format:write update dirty files

---------

Co-authored-by: andes-it <builders@andes.is>

---------

Co-authored-by: andes-it <builders@andes.is>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Sep 10, 2024
1 parent 690fb3e commit 38154ed
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export {
UserProfileApi,
CurrentLicenseApi,
DrivingAssessmentApi,
JurisdictionApi,
QualityPhotoApi,
ExistingApplicationApi,
} from '@island.is/application/types'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { subSectionTempInfo } from './subSectionTempInfo'
import { subSectionOtherCountry } from './subSectionOtherCountry'
import { subSectionOtherCountryDirections } from './subSectionOtherCountryDirections'
import { subSectionQualityPhoto } from './subSectionQualityPhoto'
import { subSectionDelivery } from './subSectionDelivery'
import { subSectionHealthDeclaration } from './subSectionHealthDeclaration'
import { subSectionSummary } from './subSectionSummary'
import { subSectionPhone } from './subSectionPhone'
Expand All @@ -32,6 +33,7 @@ export const draft: Form = buildForm({
subSectionOtherCountry,
subSectionOtherCountryDirections,
subSectionQualityPhoto,
subSectionDelivery,
subSectionHealthDeclaration,
subSectionSummary,
],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import {
buildDescriptionField,
buildMultiField,
buildSelectField,
buildSubSection,
} from '@island.is/application/core'
import { m } from '../../lib/messages'
import {
chooseDistrictCommissionerDescription,
hasNoDrivingLicenseInOtherCountry,
} from '../../lib/utils'

import { Jurisdiction } from '@island.is/clients/driving-license'

export const subSectionDelivery = buildSubSection({
id: 'user',
title: m.informationSectionTitle,
condition: hasNoDrivingLicenseInOtherCountry,
children: [
buildMultiField({
id: 'info',
title: m.pickupLocationTitle,
space: 1,
children: [
buildDescriptionField({
id: 'afhending',
title: m.districtCommisionerTitle,
titleVariant: 'h4',
description: chooseDistrictCommissionerDescription,
}),
buildSelectField({
id: 'jurisdiction',
title: m.districtCommisionerPickup,
disabled: false,
required: true,
options: ({
externalData: {
jurisdictions: { data },
},
}) => {
return (data as Jurisdiction[]).map(({ id, name, zip }) => ({
value: `${id}`,
label: name,
tooltip: `Póstnúmer ${zip}`,
}))
},
}),
],
}),
],
})
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
UserProfileApi,
CurrentLicenseApi,
DrivingAssessmentApi,
JurisdictionApi,
QualityPhotoApi,
ExistingApplicationApi,
} from '@island.is/application/types'
Expand Down Expand Up @@ -56,6 +57,10 @@ export const sectionExternalData = buildSubSection({
provider: DrivingAssessmentApi,
title: '',
}),
buildDataProviderItem({
provider: JurisdictionApi,
title: '',
}),
buildDataProviderItem({
provider: SyslumadurPaymentCatalogApi,
title: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
ApplicationStateSchema,
DefaultEvents,
defineTemplateApi,
JurisdictionApi,
CurrentLicenseApi,
DrivingAssessmentApi,
NationalRegistryUserApi,
Expand Down Expand Up @@ -126,6 +127,7 @@ const template: ApplicationTemplate<
UserProfileApi,
SyslumadurPaymentCatalogApi,
GlassesCheckApi,
JurisdictionApi,
CurrentLicenseApi.configure({
params: {
useLegacyVersion: true,
Expand Down
10 changes: 10 additions & 0 deletions libs/application/templates/driving-license/src/lib/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ export const m = defineMessages({
defaultMessage: 'Sýslumannsembætti',
description: 'Information',
},
pickupLocationTitle: {
id: 'dl.application:pickuplocation',
defaultMessage: 'Afhendingarstaður',
description: 'location for pickup',
},
informationApplicant: {
id: 'dl.application:information.applicant',
defaultMessage: 'Umsækjandi',
Expand Down Expand Up @@ -581,6 +586,11 @@ export const m = defineMessages({
defaultMessage: 'Sýslumannsembætti',
description: 'Title for district commissioner',
},
districtCommisionerPickup: {
id: 'dl.application:districtCommisionerPickup',
defaultMessage: 'Afhending',
description: 'Pickup for district commissioner',
},
chooseDistrictCommisionerForFullLicense: {
id: 'dl.application:chooseDistrictCommisionerForFullLicense',
defaultMessage:
Expand Down

0 comments on commit 38154ed

Please sign in to comment.