From be9971aaab1ad695f9c3daa67fa626d43fae8ea7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 31 May 2024 20:56:29 +0000 Subject: [PATCH 1/7] CI: Bump version to v5.3.0-81.24 --- source/backend/api/Pims.Api.csproj | 4 ++-- source/frontend/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/backend/api/Pims.Api.csproj b/source/backend/api/Pims.Api.csproj index eda1469bb4..7bfd4a576a 100644 --- a/source/backend/api/Pims.Api.csproj +++ b/source/backend/api/Pims.Api.csproj @@ -2,8 +2,8 @@ 0ef6255f-9ea0-49ec-8c65-c172304b4926 - 5.3.0-81.23 - 5.3.0-81.23 + 5.3.0-81.24 + 5.3.0-81.24 5.3.0.81 true 16BC0468-78F6-4C91-87DA-7403C919E646 diff --git a/source/frontend/package.json b/source/frontend/package.json index e18561c70d..aca0bcef61 100644 --- a/source/frontend/package.json +++ b/source/frontend/package.json @@ -1,6 +1,6 @@ { "name": "frontend", - "version": "5.3.0-81.23", + "version": "5.3.0-81.24", "private": true, "dependencies": { "@bcgov/bc-sans": "1.0.1", From 513f7bcf5272a27af143d9e8bde4cc3b60ea64b4 Mon Sep 17 00:00:00 2001 From: devinleighsmith <41091511+devinleighsmith@users.noreply.github.com> Date: Fri, 31 May 2024 14:13:50 -0700 Subject: [PATCH 2/7] modify tooltip render direction to avoid clipping. (#4069) * modify tooltip render direction to avoid clipping. * also correct remarks section. --------- Co-authored-by: Smith --- .../frontend/src/features/leases/add/LeaseDetailSubForm.tsx | 1 + .../detail/CompensationRequisitionDetailView.tsx | 2 +- .../CompensationRequisitionDetailView.test.tsx.snap | 6 +++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/source/frontend/src/features/leases/add/LeaseDetailSubForm.tsx b/source/frontend/src/features/leases/add/LeaseDetailSubForm.tsx index b452544858..c129ab96db 100644 --- a/source/frontend/src/features/leases/add/LeaseDetailSubForm.tsx +++ b/source/frontend/src/features/leases/add/LeaseDetailSubForm.tsx @@ -104,6 +104,7 @@ export const LeaseDetailSubForm: React.FunctionComponentArchived: File to be archived as per ARCS/ORCS. } + placement="right" > } required diff --git a/source/frontend/src/features/mapSideBar/acquisition/tabs/compensation/detail/CompensationRequisitionDetailView.tsx b/source/frontend/src/features/mapSideBar/acquisition/tabs/compensation/detail/CompensationRequisitionDetailView.tsx index 10a8c01859..80f9286c82 100644 --- a/source/frontend/src/features/mapSideBar/acquisition/tabs/compensation/detail/CompensationRequisitionDetailView.tsx +++ b/source/frontend/src/features/mapSideBar/acquisition/tabs/compensation/detail/CompensationRequisitionDetailView.tsx @@ -352,7 +352,7 @@ export const CompensationRequisitionDetailView: React.FunctionComponent<
- {compensation.detailedRemarks} +

{compensation.detailedRemarks}

diff --git a/source/frontend/src/features/mapSideBar/acquisition/tabs/compensation/detail/__snapshots__/CompensationRequisitionDetailView.test.tsx.snap b/source/frontend/src/features/mapSideBar/acquisition/tabs/compensation/detail/__snapshots__/CompensationRequisitionDetailView.test.tsx.snap index 01d6994561..080b8bc4e4 100644 --- a/source/frontend/src/features/mapSideBar/acquisition/tabs/compensation/detail/__snapshots__/CompensationRequisitionDetailView.test.tsx.snap +++ b/source/frontend/src/features/mapSideBar/acquisition/tabs/compensation/detail/__snapshots__/CompensationRequisitionDetailView.test.tsx.snap @@ -936,7 +936,11 @@ exports[`Compensation Detail View Component > renders as expected 1`] = `
+ > +

+

From 37170e96654c8ec917a0c55c4c652eed6c0050e0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 31 May 2024 21:14:15 +0000 Subject: [PATCH 3/7] CI: Bump version to v5.3.0-81.25 --- source/backend/api/Pims.Api.csproj | 4 ++-- source/frontend/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/backend/api/Pims.Api.csproj b/source/backend/api/Pims.Api.csproj index 7bfd4a576a..233786930d 100644 --- a/source/backend/api/Pims.Api.csproj +++ b/source/backend/api/Pims.Api.csproj @@ -2,8 +2,8 @@ 0ef6255f-9ea0-49ec-8c65-c172304b4926 - 5.3.0-81.24 - 5.3.0-81.24 + 5.3.0-81.25 + 5.3.0-81.25 5.3.0.81 true 16BC0468-78F6-4C91-87DA-7403C919E646 diff --git a/source/frontend/package.json b/source/frontend/package.json index aca0bcef61..941b6c6add 100644 --- a/source/frontend/package.json +++ b/source/frontend/package.json @@ -1,6 +1,6 @@ { "name": "frontend", - "version": "5.3.0-81.24", + "version": "5.3.0-81.25", "private": true, "dependencies": { "@bcgov/bc-sans": "1.0.1", From 3eb73a3c94da6f673bdea2cbe15b651a4dd41519 Mon Sep 17 00:00:00 2001 From: Manuel Rodriguez Date: Fri, 31 May 2024 15:06:46 -0700 Subject: [PATCH 4/7] psp-8499 | Updated historical number rendering for leases (#4050) * Updated historical number rendering for leases * Fixed tests * Updated placeholder and duplicate logic for Historical File # --- .../leases/list/LeaseFilter/LeaseFilter.tsx | 2 +- .../leases/list/LeaseListView.test.tsx | 6 +- .../LeaseSearchResults/LeaseSearchResults.tsx | 91 ++---------------- .../LeaseSearchResults.test.tsx.snap | 22 +---- .../__snapshots__/LeaseListView.test.tsx.snap | 2 +- .../acquisition/common/AcquisitionHeader.tsx | 8 +- .../disposition/common/DispositionHeader.tsx | 8 +- .../mapSideBar/lease/common/LeaseHeader.tsx | 5 +- .../property/MotiInventoryHeader.tsx | 5 +- .../research/common/ResearchHeader.tsx | 8 +- .../header/HistoricalNumberContainer.tsx | 4 +- .../header/HistoricalNumberFieldView.tsx | 87 +++++++++++++++++ .../header/HistoricalNumberSectionView.tsx | 96 +------------------ .../properties/filter/PropertyFilter.tsx | 5 +- .../properties/list/PropertyListView.test.tsx | 42 +++++--- .../src/features/properties/list/columns.tsx | 3 +- 16 files changed, 153 insertions(+), 241 deletions(-) create mode 100644 source/frontend/src/features/mapSideBar/shared/header/HistoricalNumberFieldView.tsx diff --git a/source/frontend/src/features/leases/list/LeaseFilter/LeaseFilter.tsx b/source/frontend/src/features/leases/list/LeaseFilter/LeaseFilter.tsx index f4d286efa9..787b609dd4 100644 --- a/source/frontend/src/features/leases/list/LeaseFilter/LeaseFilter.tsx +++ b/source/frontend/src/features/leases/list/LeaseFilter/LeaseFilter.tsx @@ -130,7 +130,7 @@ export const LeaseFilter: React.FunctionComponent { }), ); - expect(await findByText(/0309-001;/i)).toBeInTheDocument(); + expect(await findByText(/0309-001/i)).toBeInTheDocument(); }); it('searches historical file number for PS', async () => { @@ -253,7 +253,7 @@ describe('Lease and License List View', () => { 123, '0309-000', ApiGen_CodeTypes_HistoricalFileNumberTypes.PSNO.toString(), - 'PS #', + 'PS', ), ], }, @@ -275,7 +275,7 @@ describe('Lease and License List View', () => { }), ); - expect(await findByText(/0309-000;/i)).toBeInTheDocument(); + expect(await findByText(/0309-000/i)).toBeInTheDocument(); }); it('searches historical file number for OTHER', async () => { diff --git a/source/frontend/src/features/leases/list/LeaseSearchResults/LeaseSearchResults.tsx b/source/frontend/src/features/leases/list/LeaseSearchResults/LeaseSearchResults.tsx index 2047ff7ad7..1f556965c7 100644 --- a/source/frontend/src/features/leases/list/LeaseSearchResults/LeaseSearchResults.tsx +++ b/source/frontend/src/features/leases/list/LeaseSearchResults/LeaseSearchResults.tsx @@ -1,4 +1,3 @@ -import { groupBy } from 'lodash'; import moment from 'moment'; import { useCallback } from 'react'; import { Tooltip } from 'react-bootstrap'; @@ -10,8 +9,7 @@ import styled from 'styled-components'; import TooltipIcon from '@/components/common/TooltipIcon'; import { ColumnWithProps, renderTypeCode, Table } from '@/components/Table'; import { TableSort } from '@/components/Table/TableSort'; -import { ApiGen_CodeTypes_HistoricalFileNumberTypes } from '@/models/api/generated/ApiGen_CodeTypes_HistoricalFileNumberTypes'; -import { ApiGen_Concepts_HistoricalFileNumber } from '@/models/api/generated/ApiGen_Concepts_HistoricalFileNumber'; +import { HistoricalNumberFieldView } from '@/features/mapSideBar/shared/header/HistoricalNumberFieldView'; import { ApiGen_Concepts_Lease } from '@/models/api/generated/ApiGen_Concepts_Lease'; import { exists, prettyFormatDate } from '@/utils'; import { formatApiPersonNames } from '@/utils/personUtils'; @@ -117,79 +115,16 @@ const columns: ColumnWithProps[] = [ align: 'left', clickable: false, sortable: false, - width: 10, - maxWidth: 20, + width: 30, + maxWidth: 30, Cell: (props: CellProps) => { - // File numbers types to display - const numberTypes: string[] = [ - ApiGen_CodeTypes_HistoricalFileNumberTypes.LISNO.toString(), - ApiGen_CodeTypes_HistoricalFileNumberTypes.PSNO.toString(), - ApiGen_CodeTypes_HistoricalFileNumberTypes.OTHER.toString(), - ]; - // Get unique file numbers from lease properties - const fileNumbers: ApiGen_Concepts_HistoricalFileNumber[] = []; - props.row.original.fileProperties?.forEach(fl => { - fl.property.historicalFileNumbers?.forEach(number => { - if (numberTypes.includes(number.historicalFileNumberTypeCode.id)) { - if ( - !fileNumbers.find( - x => - x.historicalFileNumber === number.historicalFileNumber && - x.historicalFileNumberTypeCode.id === number.historicalFileNumberTypeCode.id, - ) - ) { - fileNumbers.push(number); - } - } - }); - }); - - const groupByType = groupBy(fileNumbers, x => x.historicalFileNumberTypeCode.id); - - let lisNumbers = ''; - let psNumbers = ''; - let otherNumbers = ''; - if (groupByType[ApiGen_CodeTypes_HistoricalFileNumberTypes.LISNO.toString()]?.length) { - lisNumbers = groupByType[ApiGen_CodeTypes_HistoricalFileNumberTypes.LISNO.toString()] - .map(x => x.historicalFileNumber) - .join(', '); - } - - if (groupByType[ApiGen_CodeTypes_HistoricalFileNumberTypes.PSNO.toString()]?.length) { - psNumbers = groupByType[ApiGen_CodeTypes_HistoricalFileNumberTypes.PSNO.toString()] - .map(x => x.historicalFileNumber) - .join(', '); - } + const fileNumbers = + props.row.original?.fileProperties + ?.flatMap(fl => fl?.property?.historicalFileNumbers) + .filter(exists) ?? []; - if (groupByType[ApiGen_CodeTypes_HistoricalFileNumberTypes.OTHER.toString()]?.length) { - otherNumbers = groupByType[ApiGen_CodeTypes_HistoricalFileNumberTypes.OTHER.toString()] - .map(x => x.historicalFileNumber) - .join(', '); - } - - return ( - - {lisNumbers ? ( - - ) : null} - {psNumbers ? ( - - ) : null} - {otherNumbers ? ( - - ) : null} - - ); + return ; }, }, { @@ -240,16 +175,6 @@ export function LeaseSearchResults(props: ILeaseSearchResultsProps) { ); } -const FileNumbersDiv = styled('div')` - label { - display: inline-block; - - span { - font-weight: bold; - } - } -`; - const ExpiredIcon = styled('span')` color: ${props => props.theme.bcTokens.surfaceColorPrimaryDangerButtonDefault}; `; diff --git a/source/frontend/src/features/leases/list/LeaseSearchResults/__snapshots__/LeaseSearchResults.test.tsx.snap b/source/frontend/src/features/leases/list/LeaseSearchResults/__snapshots__/LeaseSearchResults.test.tsx.snap index 7839e1badf..7dc540810a 100644 --- a/source/frontend/src/features/leases/list/LeaseSearchResults/__snapshots__/LeaseSearchResults.test.tsx.snap +++ b/source/frontend/src/features/leases/list/LeaseSearchResults/__snapshots__/LeaseSearchResults.test.tsx.snap @@ -39,14 +39,6 @@ exports[`Lease Search Results Table > matches snapshot 1`] = ` border-radius: 0.4rem; } -.c4 label { - display: inline-block; -} - -.c4 label span { - font-weight: bold; -} -
matches snapshot 1`] = ` class="th" colspan="1" role="columnheader" - style="box-sizing: border-box; flex: 20 0 auto; min-width: 30px; width: 20px; justify-content: left; text-align: left; flex-wrap: wrap; align-items: center; display: flex;" + style="box-sizing: border-box; flex: 30 0 auto; min-width: 30px; width: 30px; justify-content: left; text-align: left; flex-wrap: wrap; align-items: center; display: flex;" >
matches snapshot 1`] = `
-
+
matches snapshot 1`] = `
-
+
matches snapshot 1`] = ` class="th" colspan="1" role="columnheader" - style="box-sizing: border-box; flex: 20 0 auto; min-width: 30px; width: 20px; justify-content: left; text-align: left; flex-wrap: wrap; align-items: center; display: flex;" + style="box-sizing: border-box; flex: 30 0 auto; min-width: 30px; width: 30px; justify-content: left; text-align: left; flex-wrap: wrap; align-items: center; display: flex;" >
)} - + diff --git a/source/frontend/src/features/mapSideBar/disposition/common/DispositionHeader.tsx b/source/frontend/src/features/mapSideBar/disposition/common/DispositionHeader.tsx index 7becefde18..ae5dd14dc1 100644 --- a/source/frontend/src/features/mapSideBar/disposition/common/DispositionHeader.tsx +++ b/source/frontend/src/features/mapSideBar/disposition/common/DispositionHeader.tsx @@ -10,7 +10,7 @@ import { ApiGen_Concepts_DispositionFile } from '@/models/api/generated/ApiGen_C import { exists } from '@/utils'; import HistoricalNumbersContainer from '../../shared/header/HistoricalNumberContainer'; -import HistoricalNumberFieldView from '../../shared/header/HistoricalNumberSectionView'; +import { HistoricalNumberSectionView } from '../../shared/header/HistoricalNumberSectionView'; export interface IDispositionHeaderProps { dispositionFile?: ApiGen_Concepts_DispositionFile; @@ -32,11 +32,7 @@ export const DispositionHeader: React.FunctionComponent< D-{dispositionFile?.fileNumber} - + diff --git a/source/frontend/src/features/mapSideBar/lease/common/LeaseHeader.tsx b/source/frontend/src/features/mapSideBar/lease/common/LeaseHeader.tsx index b00010b9af..ee1b05ab81 100644 --- a/source/frontend/src/features/mapSideBar/lease/common/LeaseHeader.tsx +++ b/source/frontend/src/features/mapSideBar/lease/common/LeaseHeader.tsx @@ -19,7 +19,7 @@ import { ApiGen_Concepts_Lease } from '@/models/api/generated/ApiGen_Concepts_Le import { exists, prettyFormatDate } from '@/utils'; import HistoricalNumbersContainer from '../../shared/header/HistoricalNumberContainer'; -import HistoricalNumberFieldView from '../../shared/header/HistoricalNumberSectionView'; +import { HistoricalNumberSectionView } from '../../shared/header/HistoricalNumberSectionView'; import { LeaseHeaderTenants } from './LeaseHeaderTenants'; export interface ILeaseHeaderProps { @@ -74,8 +74,7 @@ export const LeaseHeader: React.FC = ({ lease, lastUpdatedBy diff --git a/source/frontend/src/features/mapSideBar/property/MotiInventoryHeader.tsx b/source/frontend/src/features/mapSideBar/property/MotiInventoryHeader.tsx index e5a2cce772..c42f541377 100644 --- a/source/frontend/src/features/mapSideBar/property/MotiInventoryHeader.tsx +++ b/source/frontend/src/features/mapSideBar/property/MotiInventoryHeader.tsx @@ -16,7 +16,7 @@ import { exists, formatApiAddress, pidFormatter } from '@/utils'; import { mapFeatureToProperty } from '@/utils/mapPropertyUtils'; import HistoricalNumbersContainer from '../shared/header/HistoricalNumberContainer'; -import HistoricalNumberFieldView from '../shared/header/HistoricalNumberSectionView'; +import { HistoricalNumberSectionView } from '../shared/header/HistoricalNumberSectionView'; export interface IMotiInventoryHeaderProps { isLoading: boolean; @@ -69,8 +69,7 @@ export const MotiInventoryHeader: React.FunctionComponent {exists(apiProperty) && ( )} diff --git a/source/frontend/src/features/mapSideBar/research/common/ResearchHeader.tsx b/source/frontend/src/features/mapSideBar/research/common/ResearchHeader.tsx index 494bdcf1e9..8b00abf10f 100644 --- a/source/frontend/src/features/mapSideBar/research/common/ResearchHeader.tsx +++ b/source/frontend/src/features/mapSideBar/research/common/ResearchHeader.tsx @@ -10,7 +10,7 @@ import { ApiGen_Concepts_ResearchFile } from '@/models/api/generated/ApiGen_Conc import { exists } from '@/utils'; import HistoricalNumbersContainer from '../../shared/header/HistoricalNumberContainer'; -import HistoricalNumberFieldView from '../../shared/header/HistoricalNumberSectionView'; +import { HistoricalNumberSectionView } from '../../shared/header/HistoricalNumberSectionView'; export interface IResearchHeaderProps { researchFile?: ApiGen_Concepts_ResearchFile; @@ -64,11 +64,7 @@ const ResearchHeader: React.FunctionComponent< {districts} - + diff --git a/source/frontend/src/features/mapSideBar/shared/header/HistoricalNumberContainer.tsx b/source/frontend/src/features/mapSideBar/shared/header/HistoricalNumberContainer.tsx index 33ea68bcfe..451f9e2830 100644 --- a/source/frontend/src/features/mapSideBar/shared/header/HistoricalNumberContainer.tsx +++ b/source/frontend/src/features/mapSideBar/shared/header/HistoricalNumberContainer.tsx @@ -7,12 +7,10 @@ import { IHistoricalNumbersViewProps } from './HistoricalNumberSectionView'; export interface IHistoricalNumbersContainerProps { propertyIds: number[]; - displayValuesOnly: boolean; View: React.FunctionComponent; } const HistoricalNumbersContainer: React.FC = ({ propertyIds, - displayValuesOnly, View, }) => { const [historicalNumbers, setHistoricalNumbers] = useState< @@ -36,6 +34,6 @@ const HistoricalNumbersContainer: React.FC = ( }); }, [propertyIds, getHistoricalExecute]); - return ; + return ; }; export default HistoricalNumbersContainer; diff --git a/source/frontend/src/features/mapSideBar/shared/header/HistoricalNumberFieldView.tsx b/source/frontend/src/features/mapSideBar/shared/header/HistoricalNumberFieldView.tsx new file mode 100644 index 0000000000..ecd7c648f8 --- /dev/null +++ b/source/frontend/src/features/mapSideBar/shared/header/HistoricalNumberFieldView.tsx @@ -0,0 +1,87 @@ +import { useMemo } from 'react'; +import styled from 'styled-components'; + +import ExpandableTextList from '@/components/common/ExpandableTextList'; +import { Dictionary } from '@/interfaces/Dictionary'; +import { ApiGen_Base_CodeType } from '@/models/api/generated/ApiGen_Base_CodeType'; +import { ApiGen_CodeTypes_HistoricalFileNumberTypes } from '@/models/api/generated/ApiGen_CodeTypes_HistoricalFileNumberTypes'; +import { ApiGen_Concepts_HistoricalFileNumber } from '@/models/api/generated/ApiGen_Concepts_HistoricalFileNumber'; +import { exists } from '@/utils'; + +export interface IHistoricalNumbersViewProps { + historicalNumbers: ApiGen_Concepts_HistoricalFileNumber[]; +} + +interface HistoricalGroup { + historicalType: ApiGen_Base_CodeType; + historicalValues: Dictionary; + otherDescription: string; + propertyKey: string; +} + +export const HistoricalNumberFieldView: React.FC = ({ + historicalNumbers, +}) => { + const uniqueNumbers = useMemo(() => { + const flatNumberDictionary: Dictionary = historicalNumbers + .filter(exists) + .reduce((accumulator, h) => { + const historicalTypeKey = `[${h.historicalFileNumberTypeCode.id}-${h.otherHistFileNumberTypeCode}]`; + if (!(historicalTypeKey in accumulator)) { + accumulator[historicalTypeKey] = { + historicalType: h.historicalFileNumberTypeCode, + historicalValues: {}, + otherDescription: h.otherHistFileNumberTypeCode, + key: '', + }; + } + + const historicalValueKey = `[${h.historicalFileNumber}][${h.historicalFileNumberTypeCode.id}][${h.otherHistFileNumberTypeCode}]`; + if (!(historicalValueKey in accumulator[historicalTypeKey])) { + accumulator[historicalTypeKey].historicalValues[historicalValueKey] = h; + accumulator[historicalTypeKey].key += h.propertyId; + } + return accumulator; + }, {}); + + const flatNumberArray = Object.values(flatNumberDictionary); + + return flatNumberArray.sort( + (a, b) => a.historicalType.displayOrder - b.historicalType.displayOrder, + ); + }, [historicalNumbers]); + + return ( + + items={uniqueNumbers} + keyFunction={(p, index: number) => + `historical-group-${p.historicalType.id}-${p.propertyKey}-${index}` + } + renderFunction={p => ( + <> + + {p.historicalType.id === ApiGen_CodeTypes_HistoricalFileNumberTypes.OTHER + ? p.otherDescription + : p.historicalType.description} + : + + + {Object.values(p.historicalValues).map((historicalValue, index) => { + return ( + + {historicalValue.historicalFileNumber} + {index + 1 < Object.values(p.historicalValues).length && , } + + ); + })} + + )} + delimiter={'; '} + maxCollapsedLength={2} + /> + ); +}; + +export const StyledLabel = styled.label` + font-weight: bold; +`; diff --git a/source/frontend/src/features/mapSideBar/shared/header/HistoricalNumberSectionView.tsx b/source/frontend/src/features/mapSideBar/shared/header/HistoricalNumberSectionView.tsx index b2adcd22f6..677b85591b 100644 --- a/source/frontend/src/features/mapSideBar/shared/header/HistoricalNumberSectionView.tsx +++ b/source/frontend/src/features/mapSideBar/shared/header/HistoricalNumberSectionView.tsx @@ -1,106 +1,18 @@ -import { useMemo } from 'react'; -import styled from 'styled-components'; - -import ExpandableTextList from '@/components/common/ExpandableTextList'; import { HeaderField } from '@/components/common/HeaderField/HeaderField'; -import { Dictionary } from '@/interfaces/Dictionary'; -import { ApiGen_Base_CodeType } from '@/models/api/generated/ApiGen_Base_CodeType'; import { ApiGen_Concepts_HistoricalFileNumber } from '@/models/api/generated/ApiGen_Concepts_HistoricalFileNumber'; -import { exists } from '@/utils'; + +import { HistoricalNumberFieldView } from './HistoricalNumberFieldView'; export interface IHistoricalNumbersViewProps { - valuesOnly: boolean; historicalNumbers: ApiGen_Concepts_HistoricalFileNumber[]; } -interface HistoricalGroup { - historicalType: ApiGen_Base_CodeType; - historicalValues: Dictionary; -} - -const HistoricalNumberFieldView: React.FC = ({ +export const HistoricalNumberSectionView: React.FC = ({ historicalNumbers, - valuesOnly, }) => { - const uniqueNumbers = useMemo(() => { - const flatNumberArray: Dictionary = historicalNumbers - .filter(exists) - .reduce((accumulator, h) => { - const historicalTypeKey = `[${h.historicalFileNumberTypeCode.description}]`; - if (!(historicalTypeKey in accumulator)) { - accumulator[historicalTypeKey] = { - historicalType: h.historicalFileNumberTypeCode, - historicalValues: {}, - }; - } - - const historicalValueKey = `[${h.historicalFileNumberTypeCode.description}][${h.historicalFileNumber}]`; - accumulator[historicalTypeKey].historicalValues[historicalValueKey] = h; - return accumulator; - }, {} as Dictionary); - - return Object.values(flatNumberArray).sort(p => p.historicalType.displayOrder); - }, [historicalNumbers]); - - if (valuesOnly) { - return ( - - items={uniqueNumbers} - keyFunction={(p, index: number) => `historical-number-${p.historicalType.id}-${index}`} - renderFunction={p => ( - <> - - {p.historicalType.description}: - - - {Object.values(p.historicalValues).map((historicalValue, index) => { - return ( - - {historicalValue.historicalFileNumber} - {index + 1 < Object.values(p.historicalValues).length && , } - - ); - })} - - )} - delimiter={'; '} - maxCollapsedLength={2} - /> - ); - } - return ( - <> - - items={uniqueNumbers} - keyFunction={(p, index: number) => `historical-number-${p.historicalType.id}-${index}`} - renderFunction={p => ( - <> - - {p.historicalType.description}: - - - {Object.values(p.historicalValues).map((historicalValue, index) => { - return ( - - {historicalValue.historicalFileNumber} - {index + 1 < Object.values(p.historicalValues).length && , } - - ); - })} - - )} - delimiter={'; '} - maxCollapsedLength={2} - /> - + ); }; - -export default HistoricalNumberFieldView; - -export const StyledLabel = styled.label` - font-weight: bold; -`; diff --git a/source/frontend/src/features/properties/filter/PropertyFilter.tsx b/source/frontend/src/features/properties/filter/PropertyFilter.tsx index 2c69e45ec5..1deb060204 100644 --- a/source/frontend/src/features/properties/filter/PropertyFilter.tsx +++ b/source/frontend/src/features/properties/filter/PropertyFilter.tsx @@ -155,7 +155,10 @@ export const PropertyFilter: React.FC )} {values.searchBy === 'historical' && ( - + )} diff --git a/source/frontend/src/features/properties/list/PropertyListView.test.tsx b/source/frontend/src/features/properties/list/PropertyListView.test.tsx index b12fb4cb0c..2492bede1b 100644 --- a/source/frontend/src/features/properties/list/PropertyListView.test.tsx +++ b/source/frontend/src/features/properties/list/PropertyListView.test.tsx @@ -29,6 +29,7 @@ import { ApiGen_Concepts_PropertyView } from '@/models/api/generated/ApiGen_Conc import { useApiHistoricalNumbers } from '@/hooks/pims-api/useApiHistoricalNumbers'; import { ApiGen_Concepts_HistoricalFileNumber } from '@/models/api/generated/ApiGen_Concepts_HistoricalFileNumber'; import { ApiGen_CodeTypes_HistoricalFileNumberTypes } from '@/models/api/generated/ApiGen_CodeTypes_HistoricalFileNumberTypes'; +import { useHistoricalNumberRepository } from '@/hooks/repositories/useHistoricalNumberRepository'; // Set all module functions to vi.fn @@ -50,12 +51,25 @@ vi.mocked(useApiGeocoder).mockReturnValue({ ) => Promise>, } as unknown as ReturnType); -const mockApiGetHistoricalFileNumbersApi = vi.fn(); -vi.mocked(useApiHistoricalNumbers).mockReturnValue({ - getByPropertyId: mockApiGetHistoricalFileNumbersApi as ( - propertyId: number, - ) => Promise>, -} as unknown as ReturnType); +const mockGetPropertyHistoricalNumbersExecute = vi.fn().mockResolvedValue([]); + +vi.mock('@/hooks/repositories/useHistoricalNumberRepository'); +vi.mocked(useHistoricalNumberRepository).mockReturnValue({ + getPropertyHistoricalNumbers: { + error: null, + response: [], + execute: mockGetPropertyHistoricalNumbersExecute, + loading: false, + status: 200, + }, + updatePropertyHistoricalNumbers: { + error: null, + response: [], + execute: vi.fn().mockResolvedValue([]), + loading: false, + status: 200, + }, +}); const mockAxios = new MockAdapter(axios); const history = createMemoryHistory(); @@ -97,15 +111,15 @@ const setupMockApi = (properties?: ApiGen_Concepts_PropertyView[]) => { }, } as any); - mockApiGetHistoricalFileNumbersApi.mockResolvedValue({ - data: [ + for (let i = 0; i < mockProperties.length; i++) { + mockGetPropertyHistoricalNumbersExecute.mockResolvedValueOnce([ { - id: 100, - propertyId: 1, + id: mockProperties[i].id * 100, + propertyId: mockProperties[i].id, property: null, historicalFileNumberTypeCode: { id: ApiGen_CodeTypes_HistoricalFileNumberTypes.LISNO.toString(), - description: 'LIS #', + description: 'LIS', isDisabled: false, displayOrder: 1, }, @@ -120,8 +134,8 @@ const setupMockApi = (properties?: ApiGen_Concepts_PropertyView[]) => { appCreateUserGuid: null, rowVersion: 1, }, - ], - }); + ]); + } }; describe('Property list view', () => { @@ -131,7 +145,7 @@ describe('Property list view', () => { mockAxios.onAny().reply(200, {}); mockApiGetPropertiesPagedApi.mockClear(); - mockApiGetHistoricalFileNumbersApi.mockClear(); + mockGetPropertyHistoricalNumbersExecute.mockClear(); }); afterEach(() => { diff --git a/source/frontend/src/features/properties/list/columns.tsx b/source/frontend/src/features/properties/list/columns.tsx index 059912da5a..6c61f349d3 100644 --- a/source/frontend/src/features/properties/list/columns.tsx +++ b/source/frontend/src/features/properties/list/columns.tsx @@ -11,7 +11,7 @@ import TooltipIcon from '@/components/common/TooltipIcon'; import { ColumnWithProps } from '@/components/Table'; import { AreaUnitTypes, Claims } from '@/constants/index'; import HistoricalNumbersContainer from '@/features/mapSideBar/shared/header/HistoricalNumberContainer'; -import HistoricalNumberFieldView from '@/features/mapSideBar/shared/header/HistoricalNumberSectionView'; +import { HistoricalNumberFieldView } from '@/features/mapSideBar/shared/header/HistoricalNumberFieldView'; import useKeycloakWrapper from '@/hooks/useKeycloakWrapper'; import { ApiGen_Concepts_PropertyView } from '@/models/api/generated/ApiGen_Concepts_PropertyView'; import { ILookupCode } from '@/store/slices/lookupCodes'; @@ -70,7 +70,6 @@ export const columns = ({ return ( ); From 48e7a8cbfaaf33f1decbcb256f009ffeb392c761 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 31 May 2024 22:07:09 +0000 Subject: [PATCH 5/7] CI: Bump version to v5.3.0-81.26 --- source/backend/api/Pims.Api.csproj | 4 ++-- source/frontend/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/backend/api/Pims.Api.csproj b/source/backend/api/Pims.Api.csproj index 233786930d..7b3c1694b4 100644 --- a/source/backend/api/Pims.Api.csproj +++ b/source/backend/api/Pims.Api.csproj @@ -2,8 +2,8 @@ 0ef6255f-9ea0-49ec-8c65-c172304b4926 - 5.3.0-81.25 - 5.3.0-81.25 + 5.3.0-81.26 + 5.3.0-81.26 5.3.0.81 true 16BC0468-78F6-4C91-87DA-7403C919E646 diff --git a/source/frontend/package.json b/source/frontend/package.json index 941b6c6add..96dbd8c248 100644 --- a/source/frontend/package.json +++ b/source/frontend/package.json @@ -1,6 +1,6 @@ { "name": "frontend", - "version": "5.3.0-81.25", + "version": "5.3.0-81.26", "private": true, "dependencies": { "@bcgov/bc-sans": "1.0.1", From 3a5937083beb6d305be45257f763ebf38be37871 Mon Sep 17 00:00:00 2001 From: devinleighsmith <41091511+devinleighsmith@users.noreply.github.com> Date: Fri, 31 May 2024 15:26:50 -0700 Subject: [PATCH 6/7] Features/psp 7494 (#4068) * Updated the deposts page * Fixed stylings for buttons and margin for collapsable section * updated snaps * PR comment updates. --------- Co-authored-by: FuriousLlama Co-authored-by: Smith Co-authored-by: Alejandro Sanchez --- .../src/assets/scss/_variables.module.scss | 3 +- .../src/components/common/Section/Section.tsx | 2 +- .../components/common/SectionListHeader.tsx | 3 +- .../frontend/src/components/common/styles.ts | 3 + .../CreateOrganizationForm.test.tsx.snap | 6 +- .../CreatePersonForm.test.tsx.snap | 6 +- .../CreateContactContainer.test.tsx.snap | 6 +- .../UpdateOrganizationForm.test.tsx.snap | 6 +- .../UpdatePersonForm.test.tsx.snap | 6 +- .../UpdateContactContainer.test.tsx.snap | 6 +- .../DocumentListView.test.tsx.snap | 2 +- .../AddLeaseContainer.test.tsx.snap | 2 +- .../DepositsContainer.test.tsx.snap | 179 +++-------------- .../components/DepositNotes/DepositNotes.tsx | 35 ++-- .../__snapshots__/DepositNotes.test.tsx.snap | 2 +- .../DepositsReceivedContainer.tsx | 28 +-- .../DepositsReceivedContainer.test.tsx.snap | 185 +++--------------- .../DepositsReceivedContainer/columns.tsx | 57 ++---- .../DepositsReturnedContainer/columns.tsx | 28 +-- .../DetailAdministration.test.tsx.snap | 4 +- .../DetailDocumentation.test.tsx.snap | 4 +- .../PropertiesInformation.test.tsx.snap | 2 +- .../__snapshots__/DocumentsPage.test.tsx.snap | 2 +- .../__snapshots__/AgreementView.test.tsx.snap | 4 +- ...nsationRequisitionDetailView.test.tsx.snap | 6 +- .../CompensationListView.test.tsx.snap | 2 +- ...eCompensationRequisitionForm.test.tsx.snap | 4 +- .../StakeHolderView.test.tsx.snap | 4 +- .../OffersAndSaleView.test.tsx.snap | 2 +- .../ProjectSummaryView.test.tsx.snap | 6 +- .../PropertyAssociationTabView.test.tsx.snap | 8 +- .../OperationSectionView.test.tsx.snap | 4 +- .../__snapshots__/OperationView.test.tsx.snap | 2 +- ...ManagementActivitiesListView.test.tsx.snap | 2 +- .../PropertyContactListView.test.tsx.snap | 2 +- ...PropertyManagementDetailView.test.tsx.snap | 2 +- .../TakeUpdateForm.test.tsx.snap | 2 +- .../__snapshots__/ChecklistView.test.tsx.snap | 12 +- .../__snapshots__/NoteListView.test.tsx.snap | 2 +- 39 files changed, 181 insertions(+), 460 deletions(-) diff --git a/source/frontend/src/assets/scss/_variables.module.scss b/source/frontend/src/assets/scss/_variables.module.scss index 339e97bca1..f87fcd61a0 100644 --- a/source/frontend/src/assets/scss/_variables.module.scss +++ b/source/frontend/src/assets/scss/_variables.module.scss @@ -10,8 +10,9 @@ highlightBackgroundColor: $highlight-background-color; // buttons borderOutlineColor: $border-outline-color; - + // Colors + pimsGreen80: $pims-green-80; warningBackgroundColor: $warning-background-color; numberBackgroundColor: $number-background-color; dangerBackgroundColor: $danger-background-color; diff --git a/source/frontend/src/components/common/Section/Section.tsx b/source/frontend/src/components/common/Section/Section.tsx index 1fd1889bad..899c11e570 100644 --- a/source/frontend/src/components/common/Section/Section.tsx +++ b/source/frontend/src/components/common/Section/Section.tsx @@ -42,7 +42,7 @@ export const Section: React.FC< {header} {isCollapsable && ( - + {isCollapsed && ( void; claims: Claims[]; + 'data-testId'?: string; } export const SectionListHeader: React.FunctionComponent< @@ -27,7 +28,7 @@ export const SectionListHeader: React.FunctionComponent< {hasClaim(props.claims) && ( - + {props.addButtonIcon}  {props.addButtonText ?? 'Add'} diff --git a/source/frontend/src/components/common/styles.ts b/source/frontend/src/components/common/styles.ts index ab2455ad8f..b35706e6c8 100644 --- a/source/frontend/src/components/common/styles.ts +++ b/source/frontend/src/components/common/styles.ts @@ -106,6 +106,9 @@ export const StyledAddButton = styled(Button)` &.btn.btn-primary:active { background-color: ${props => props.theme.bcTokens.iconsColorSuccess}; } + &.btn.btn-primary:hover { + background-color: ${props => props.theme.css.pimsGreen80}; + } `; export const StyledSectionAddButton = styled(StyledAddButton)` diff --git a/source/frontend/src/features/contacts/contact/create/Organization/__snapshots__/CreateOrganizationForm.test.tsx.snap b/source/frontend/src/features/contacts/contact/create/Organization/__snapshots__/CreateOrganizationForm.test.tsx.snap index 9364dbb9b7..7ef10a5c7c 100644 --- a/source/frontend/src/features/contacts/contact/create/Organization/__snapshots__/CreateOrganizationForm.test.tsx.snap +++ b/source/frontend/src/features/contacts/contact/create/Organization/__snapshots__/CreateOrganizationForm.test.tsx.snap @@ -688,7 +688,7 @@ exports[`CreateOrganizationForm > renders as expected 1`] = ` Mailing Address
renders as expected 1`] = ` Property Address
renders as expected 1`] = ` Billing Address
renders as expected 1`] = `
renders as expected 1`] = ` Property Address
renders as expected 1`] = ` Billing Address
should render as expected 1`] = `
should render as expected 1`] = ` Property Address
should render as expected 1`] = ` Billing Address
renders as expected 1`] = ` Mailing Address
renders as expected 1`] = ` Property Address
renders as expected 1`] = ` Billing Address
renders as expected 1`] = `
renders as expected 1`] = ` Property Address
renders as expected 1`] = ` Billing Address
renders as expected 1`] = `
renders as expected 1`] = ` Property Address
renders as expected 1`] = ` Billing Address
renders as expected 1`] = `
renders as expected 1`] = ` Consultation
renders as expected 1`] = ` class="Toastify" />
- .c3.btn { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; - padding: 0.4rem 1.2rem; - min-height: 3rem; - border: 0.2rem solid transparent; - border-radius: 0.4rem; - text-align: center; - -webkit-text-decoration: none; - text-decoration: none; - font-size: 1.8rem; - font-family: 'BCSans','Noto Sans',Verdana,Arial,sans-serif; - font-weight: 700; - -webkit-letter-spacing: 0.1rem; - -moz-letter-spacing: 0.1rem; - -ms-letter-spacing: 0.1rem; - letter-spacing: 0.1rem; - cursor: pointer; - height: 3.8rem; -} - -.c3.btn:hover { - -webkit-text-decoration: underline; - text-decoration: underline; - opacity: 0.8; -} - -.c3.btn:focus { - outline-width: 0.4rem; - outline-style: solid; - outline-offset: 1px; - box-shadow: none; -} - -.c3.btn.btn-primary { - border: none; -} - -.c3.btn.btn-secondary { - background: none; -} - -.c3.btn.btn-info { - border: none; - background: none; - padding-left: 0.6rem; - padding-right: 0.6rem; -} - -.c3.btn.btn-info:hover, -.c3.btn.btn-info:active, -.c3.btn.btn-info:focus { - background: none; -} - -.c3.btn.btn-light { - border: none; -} - -.c3.btn.btn-dark { - border: none; -} - -.c3.btn.btn-link { - font-size: 1.6rem; - font-weight: 400; - background: none; - border: none; - -webkit-text-decoration: none; - text-decoration: none; - min-height: 2.5rem; - line-height: 3rem; - -webkit-box-pack: left; - -webkit-justify-content: left; - -ms-flex-pack: left; - justify-content: left; - -webkit-letter-spacing: unset; - -moz-letter-spacing: unset; - -ms-letter-spacing: unset; - letter-spacing: unset; - text-align: left; - padding: 0; -} - -.c3.btn.btn-link:hover, -.c3.btn.btn-link:active, -.c3.btn.btn-link:focus { - -webkit-text-decoration: underline; - text-decoration: underline; - border: none; - background: none; - box-shadow: none; - outline: none; -} - -.c3.btn.btn-link:disabled, -.c3.btn.btn-link.disabled { - background: none; - pointer-events: none; -} - -.c3.btn:disabled, -.c3.btn:disabled:hover { - box-shadow: none; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - pointer-events: none; - cursor: not-allowed; - opacity: 0.65; -} - -.c3.Button .Button__icon { - margin-right: 1.6rem; -} - -.c3.Button--icon-only:focus { - outline: none; -} - -.c3.Button--icon-only .Button__icon { - margin-right: 0; -} - -.c4 { + .c4 { float: right; cursor: pointer; } @@ -160,6 +25,22 @@ exports[`DepositsContainer > renders as expected 1`] = ` border-radius: 0.5rem; } +.c3 { + -webkit-box-pack: justify; + -webkit-justify-content: space-between; + -ms-flex-pack: justify; + justify-content: space-between; + -webkit-align-items: end; + -webkit-box-align: end; + -ms-flex-align: end; + align-items: end; + min-height: 4.5rem; +} + +.c3 .btn { + margin: 0; +} + .c0 { display: -webkit-box; display: -webkit-flex; @@ -187,24 +68,24 @@ exports[`DepositsContainer > renders as expected 1`] = `
- Deposits Received +
+
+ Deposits Received +
+
+
-
renders as expected 1`] = `
+ hasClaim(Claims.LEASE_EDIT) && disabled ? ( + } + data-testId="edit-notes" + onAdd={() => { + onEdit(); + setCollapsed(false); + }} + /> + ) : ( Deposit Notes - {hasClaim(Claims.LEASE_EDIT) && disabled && ( - { - onEdit(); - setCollapsed(false); - }} - /> - )} - + ) } >