Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

psp-8851 | Fixed consultations update #4195

Merged
merged 3 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const AdministrationSubForm: React.FunctionComponent<
<InlineInput field="motiName" />
</SectionField>

<SectionField label="MOTI region" labelWidth="2" contentWidth="4" required>
<SectionField label="MOTI region" labelWidth="2" contentWidth="auto" required>
<UserRegionSelectContainer field="regionId" placeholder="Select region" required />
</SectionField>
<Row>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import useLookupCodeHelpers from '@/hooks/useLookupCodeHelpers';
import { ApiGen_Concepts_ConsultationLease } from '@/models/api/generated/ApiGen_Concepts_ConsultationLease';
import { ApiGen_Concepts_Lease } from '@/models/api/generated/ApiGen_Concepts_Lease';
import { getEmptyBaseAudit } from '@/models/defaultInitializers';
import { ILookupCode } from '@/store/slices/lookupCodes';

import { LeaseFormModel } from '../models';

Expand Down Expand Up @@ -56,7 +57,10 @@ const ConsultationSubForm: React.FunctionComponent<
);
};

export const getConsultations = (lease: ApiGen_Concepts_Lease, consultationTypes) => {
export const getConsultations = (
lease: ApiGen_Concepts_Lease,
consultationTypes: ILookupCode[],
) => {
if (lease.consultations?.length !== consultationTypes.length) {
const newConsultations: ApiGen_Concepts_ConsultationLease[] = [];

Expand Down Expand Up @@ -93,7 +97,7 @@ export const getConsultations = (lease: ApiGen_Concepts_Lease, consultationTypes
});
return newConsultations;
}
return [];
return lease.consultations;
};

export default ConsultationSubForm;
Original file line number Diff line number Diff line change
Expand Up @@ -1611,7 +1611,7 @@ exports[`AddLeaseContainer component > renders as expected 1`] = `
</label>
</div>
<div
class="c14 required text-left col-4"
class="c14 required text-left col-auto"
>
<div
class="required d-flex form-group"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ exports[`AdministrationSubForm component > renders as expected 1`] = `
</label>
</div>
<div
class="c3 required text-left col-4"
class="c3 required text-left col-auto"
>
<div
class="required d-flex form-group"
Expand Down
Loading