Skip to content

Commit

Permalink
leasing summary: add internal_order field
Browse files Browse the repository at this point in the history
  • Loading branch information
NC-jsAhonen committed Jan 8, 2024
1 parent a68394b commit 17cf456
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/leases/components/leaseSections/summary/Summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,16 @@ class Summary extends PureComponent<Props, State> {
}
</Column>
</Row>
<Row>
<Column small={12} medium={6} large={8}>
<Authorization allow={isFieldAllowedToRead(attributes, LeaseFieldPaths.INTERNAL_ORDER)}>
<FormTextTitle uiDataKey={getUiDataLeaseKey(LeaseFieldPaths.INTERNAL_ORDER)}>
{LeaseFieldTitles.INTERNAL_ORDER}
</FormTextTitle>
<ShowMore text={summary.internal_order || '-'} />
</Authorization>
</Column>
</Row>

<SummaryLeaseInfo />
</Collapse>
Expand Down
10 changes: 10 additions & 0 deletions src/leases/components/leaseSections/summary/SummaryEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,16 @@ class SummaryEdit extends PureComponent<Props, State> {
}
</Column>
</Row>
<Row>
<Column small={12} medium={6} large={4}>
<Authorization allow={isFieldAllowedToRead(attributes, LeaseFieldPaths.INTERNAL_ORDER)}>
<FormTextTitle uiDataKey={getUiDataLeaseKey(LeaseFieldPaths.INTERNAL_ORDER)}>
{LeaseFieldTitles.INTERNAL_ORDER}
</FormTextTitle>
<FormText>{summary.internal_order || '-'}</FormText>
</Authorization>
</Column>
</Row>

<SummaryLeaseInfo />
</Collapse>
Expand Down
2 changes: 2 additions & 0 deletions src/leases/enums.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ export const LeaseFieldPaths = {
INFILL_DEVELOPMENT_COMPENSATIONS: 'infill_development_compensations',
INTENDED_USE: 'intended_use',
INTENDED_USE_NOTE: 'intended_use_note',
INTERNAL_ORDER: 'internal_order',
IS_SUBJECT_TO_VAT: 'is_subject_to_vat',
LESSOR: 'lessor',
MANAGEMENT: 'management',
Expand Down Expand Up @@ -394,6 +395,7 @@ export const LeaseFieldTitles = {
INFILL_DEVELOPMENT_COMPENSATIONS: 'Täydennysrakentamiskorvaus',
INTENDED_USE: 'Vuokrauksen käyttötarkoitus',
INTENDED_USE_NOTE: 'Käyttötarkoituksen huomautus',
INTERNAL_ORDER: 'Sisäinen tilaus',
IS_SUBJECT_TO_VAT: 'Arvonlisävelvollinen',
LESSOR: 'Vuokranantaja',
MANAGEMENT: 'Hallintamuoto',
Expand Down
2 changes: 2 additions & 0 deletions src/leases/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ export const getContentLeaseSummary = (lease: Object): Object => {
infill_development_compensations: getContentLeaseInfillDevelopmentCompensations(lease),
intended_use: lease.intended_use,
intended_use_note: lease.intended_use_note,
internal_order: lease.internal_order,
is_subject_to_vat: lease.is_subject_to_vat,
lease_areas: getContentLeaseAreas(lease).filter((area) => !area.archived_at),
lessor: getContentLessor(lease.lessor),
Expand Down Expand Up @@ -2180,6 +2181,7 @@ export const addSummaryFormValuesToPayload = (payload: Object, formValues: Objec
hitas: formValues.hitas,
intended_use: formValues.intended_use,
intended_use_note: formValues.intended_use_note,
internal_order: formValues.internal_order,
is_subject_to_vat: formValues.is_subject_to_vat,
lessor: get(formValues, 'lessor.value'),
notice_note: formValues.notice_note,
Expand Down

0 comments on commit 17cf456

Please sign in to comment.