Skip to content

Commit

Permalink
Refactor SelectableOtherGuardianAgreementStatus to lib-common
Browse files Browse the repository at this point in the history
  • Loading branch information
patari committed Jan 22, 2025
1 parent 70851bc commit 586fe7e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

import React from 'react'

import { ContactInfoFormData } from 'lib-common/api-types/application/ApplicationFormData'
import { UpdateStateFn } from 'lib-common/form-state'
import {
ApplicationType,
OtherGuardianAgreementStatus
} from 'lib-common/generated/api-types/application'
ContactInfoFormData,
SelectableOtherGuardianAgreementStatus
} from 'lib-common/api-types/application/ApplicationFormData'
import { UpdateStateFn } from 'lib-common/form-state'
import { ApplicationType } from 'lib-common/generated/api-types/application'
import InputField from 'lib-components/atoms/form/InputField'
import Radio from 'lib-components/atoms/form/Radio'
import AdaptiveFlex from 'lib-components/layout/AdaptiveFlex'
Expand All @@ -31,11 +31,6 @@ type SecondGuardianSubSectionProps = {
otherGuardianStatus: 'NO' | 'SAME_ADDRESS' | 'DIFFERENT_ADDRESS'
}

export type SelectableOtherGuardianAgreementStatus = Exclude<
OtherGuardianAgreementStatus,
'AUTOMATED'
>

export default React.memo(function SecondGuardianSubSection({
type,
formData,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import { Link } from 'react-router'
import styled from 'styled-components'

import { Result, wrapResult } from 'lib-common/api'
import { SelectableOtherGuardianAgreementStatus } from 'lib-common/api-types/application/ApplicationFormData'
import { swapElements } from 'lib-common/array'
import DateRange from 'lib-common/date-range'
import {
Address,
ApplicationDetails,
FutureAddress,
OtherGuardianAgreementStatus,
PersonBasics
} from 'lib-common/generated/api-types/application'
import { AttachmentType } from 'lib-common/generated/api-types/attachment'
Expand Down Expand Up @@ -94,12 +94,7 @@ const PreferredUnitGridContainer = styled.div`
grid-template-columns: 1fr auto auto auto auto;
`

export type SelectableOtherGuardianAgreementStatus = Exclude<
OtherGuardianAgreementStatus,
'AUTOMATED'
> | null

const selectableOtherGuardianAgreementStatuses: SelectableOtherGuardianAgreementStatus[] =
const selectableOtherGuardianAgreementStatuses: (SelectableOtherGuardianAgreementStatus | null)[] =
['AGREED', 'NOT_AGREED', 'RIGHT_TO_GET_NOTIFIED', null]

export default React.memo(function ApplicationEditView({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ export type UnitPreferenceFormData = {
preferredUnits: { id: DaycareId; name: string }[]
}

export type SelectableOtherGuardianAgreementStatus = Exclude<
OtherGuardianAgreementStatus,
'AUTOMATED'
>

export type ContactInfoFormData = {
childFirstName: string
childLastName: string
Expand Down

0 comments on commit 586fe7e

Please sign in to comment.