-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(driving-license): adding back JurisdictionApi check
- Loading branch information
Showing
6 changed files
with
71 additions
and
0 deletions.
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
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
51 changes: 51 additions & 0 deletions
51
libs/application/templates/driving-license/src/forms/draft/subSectionDelivery.ts
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,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}`, | ||
})) | ||
}, | ||
}), | ||
], | ||
}), | ||
], | ||
}) |
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
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