Skip to content

Commit

Permalink
Merge branch 'dev' into IS-67.00
Browse files Browse the repository at this point in the history
  • Loading branch information
FuriousLlama authored Nov 14, 2023
2 parents 9636cd3 + 926b0a0 commit bbcbca7
Show file tree
Hide file tree
Showing 24 changed files with 14,274 additions and 76 deletions.
29 changes: 2 additions & 27 deletions .github/workflows/retag-test-to-uat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,37 +84,12 @@ jobs:
- name: call scripts to upgrade database
shell: bash
run: |
oc process -f ./openshift/4.0/templates/jobs/db-deploy.yaml -p DB_SECRET_NAME=pims-database -p GIT_BRANCH=test -p SERVER_NAME=sqlprd.th.gov.bc.ca -p DB_NAME=PIMS_UAT -p NAMESPACE=3cd915-test | oc create -f - | grep -oP "(?<=job\.batch/)[^\s]*" | (read JOB_NAME; oc wait --for=condition=complete job/$JOB_NAME --timeout=120s)
sync-keycloak:
name: Sync Keycloak
needs: database-upgrade
runs-on: ubuntu-latest
steps:
- name: Checkout Source Code
uses: actions/checkout@v3

- name: Setup .NET 6
uses: actions/setup-dotnet@v2
with:
dotnet-version: "6.0.x"

- name: Install dependencies for keycloak sync
run: dotnet restore
working-directory: ${{env.sync-directory}}

- name: Build keycloak sync
run: dotnet build
working-directory: ${{env.sync-directory}}

- name: Start keycloak sync
run: dotnet run
working-directory: ${{env.sync-directory}}
oc process -f ./openshift/4.0/templates/jobs/db-deploy.yaml -p DB_SECRET_NAME=pims-database-uat -p GIT_BRANCH=test -p SERVER_NAME=sqlprd.th.gov.bc.ca -p DB_NAME=PIMS_UAT -p NAMESPACE=3cd915-test | oc create -f - | grep -oP "(?<=job\.batch/)[^\s]*" | (read JOB_NAME; oc wait --for=condition=complete job/$JOB_NAME --timeout=120s)
ci-cd-end-notification:
name: CI-CD End Notification to Teams Channel
runs-on: ubuntu-latest
needs: sync-keycloak
needs: database-upgrade
steps:
- name: check workflow status
uses: martialonline/workflow-status@v4
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
<UseWinAuth>false</UseWinAuth>
<WinAuthUserName />
<WinAuthDomain />
<ServerName>ssistst.th.gov.bc.ca</ServerName>
<PathOnServer>/SSISDB/PIMS_DEV/LISDB_PIMS_MANAGEMENT</PathOnServer>
<StartObjectID>LIS_DB_to_PIMS_ACTIVITY_PSP_6943.dtsx</StartObjectID>
<UserIDs />
<UserPasswords />
<OfflineMode>false</OfflineMode>
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
DTS:CreatorName="Xerces\Devin Smith"
DTS:DTSID="{6C914856-AF42-4D92-BBE1-AA6D6E2F0355}"
DTS:ExecutableType="Microsoft.Package"
DTS:LastModifiedProductVersion="16.0.948.0"
DTS:LastModifiedProductVersion="16.0.5270.0"
DTS:LocaleID="1033"
DTS:ObjectName="Package"
DTS:PackageType="5"
DTS:ProtectionLevel="0"
DTS:VersionBuild="6"
DTS:VersionGUID="{BCD0BF53-9147-4093-9AA0-82F4932373C5}">
DTS:VersionBuild="8"
DTS:VersionGUID="{9EEFEAE5-0A29-4CEB-9ECD-01034D41441C}">
<DTS:Property
DTS:Name="PackageFormatVersion">8</DTS:Property>
<DTS:ConnectionManagers>
Expand Down Expand Up @@ -1036,6 +1036,14 @@ where [refTable].[PID] = ?</property>
Size="172,42"
Id="Package\Summary\PIMS_PROPERTY"
TopLeft="358,270" />
<NodeLayout
Size="183,42"
Id="Package\Summary\CONCAT COLUMNS"
TopLeft="363,376" />
<NodeLayout
Size="211,42"
Id="Package\Summary\Update PIMS_PROPERTY"
TopLeft="334,481" />
<EdgeLayout
Id="Package\Summary.Paths[OLE DB Source Output]"
TopLeft="435.5,207">
Expand Down Expand Up @@ -1067,17 +1075,11 @@ where [refTable].[PID] = ?</property>
</mssgle:Curve>
</EdgeLayout.Curve>
<EdgeLayout.Labels>
<EdgeLabelCollection />
<mssgm:EdgeLabel
BoundingBox="0,0,0,0"
RelativePosition="Any" />
</EdgeLayout.Labels>
</EdgeLayout>
<NodeLayout
Size="211,42"
Id="Package\Summary\Update PIMS_PROPERTY"
TopLeft="334,481" />
<NodeLayout
Size="183,42"
Id="Package\Summary\CONCAT COLUMNS"
TopLeft="363,376" />
<EdgeLayout
Id="Package\Summary.Paths[Lookup Match Output]"
TopLeft="444,312">
Expand Down Expand Up @@ -1145,7 +1147,9 @@ where [refTable].[PID] = ?</property>
</mssgle:Curve>
</EdgeLayout.Curve>
<EdgeLayout.Labels>
<EdgeLabelCollection />
<mssgm:EdgeLabel
BoundingBox="0,0,0,0"
RelativePosition="Any" />
</EdgeLayout.Labels>
</EdgeLayout>
</GraphLayout>
Expand All @@ -1170,7 +1174,7 @@ where [refTable].[PID] = ?</property>
<Property>
<Name>OverwriteParamsSQLProp</Name>
<Value
type="q2:boolean">false</Value>
type="q2:string">false</Value>
</Property>
<Property>
<Name>UsedTableName</Name>
Expand All @@ -1180,7 +1184,7 @@ where [refTable].[PID] = ?</property>
<Property>
<Name>TableInfoObjectType</Name>
<Value
type="q4:int">0</Value>
type="q4:string">0</Value>
</Property>
<Property>
<Name>DataSourceViewID</Name>
Expand Down
4 changes: 2 additions & 2 deletions source/backend/api/Pims.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<UserSecretsId>0ef6255f-9ea0-49ec-8c65-c172304b4926</UserSecretsId>
<Version>4.0.0-67.1</Version>
<Version>4.0.0-67.1</Version>
<Version>4.0.0-67.6</Version>
<Version>4.0.0-67.6</Version>
<AssemblyVersion>4.0.0.67</AssemblyVersion>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<ProjectGuid>16BC0468-78F6-4C91-87DA-7403C919E646</ProjectGuid>
Expand Down
23 changes: 20 additions & 3 deletions source/backend/api/Services/AcquisitionFileService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ namespace Pims.Api.Services
{
public class AcquisitionFileService : IAcquisitionFileService
{
private static readonly string[] COREINVENTORYINTERESTCODES = { "Section 15", "Section 17", "NOI", "Section 66" };

private readonly ClaimsPrincipal _user;
private readonly ILogger _logger;
private readonly IAcquisitionFileRepository _acqFileRepository;
Expand Down Expand Up @@ -697,6 +699,8 @@ private void TransferPropertiesOfInterest(PimsAcquisitionFile acquisitionFile, b
// Get the current properties in the research file
var currentProperties = _acquisitionFilePropertyRepository.GetPropertiesByAcquisitionFileId(acquisitionFile.Internal_Id);
var propertiesOfInterest = currentProperties.Where(p => p.Property.IsPropertyOfInterest.HasValue && p.Property.IsPropertyOfInterest.Value);
var propertiesAccounted = currentProperties.Where(x => x.Property.IsPropertyOfInterest.HasValue && !x.Property.IsPropertyOfInterest.Value
&& x.Property.IsOwned.HasValue && !x.Property.IsOwned.Value);

// PSP-6111 Business rule: Transfer properties of interest to core inventory when acquisition file is completed
foreach (var acquisitionProperty in propertiesOfInterest)
Expand All @@ -707,16 +711,15 @@ private void TransferPropertiesOfInterest(PimsAcquisitionFile acquisitionFile, b
throw new UserOverrideException(UserOverrideCode.PoiToInventory, "The properties of interest will be added to the inventory as acquired properties.");
}
var takes = _takeRepository.GetAllByPropertyAcquisitionFileId(acquisitionProperty.Internal_Id);
var coreInventoryInterestCodes = new string[] { "Section 15", "Section 17", "NOI", "Section 66" };

var activeTakes = takes.Where(t =>
!(t.IsNewLandAct.HasValue && t.IsNewLandAct.Value && t.LandActEndDt.HasValue && t.LandActEndDt.Value.Date < DateTime.UtcNow.Date) &&
!(t.IsNewLicenseToConstruct.HasValue && t.IsNewLicenseToConstruct.Value && t.LtcEndDt.HasValue && t.LtcEndDt.Value.Date < DateTime.UtcNow.Date) &&
!(t.IsNewInterestInSrw.HasValue && t.IsNewInterestInSrw.Value && t.SrwEndDt.HasValue && t.SrwEndDt.Value.Date < DateTime.UtcNow.Date));

// see psp-6589 for business rules.
var isOwned = !(activeTakes.All(t => (t.IsNewLandAct.HasValue && t.IsNewLandAct.Value && coreInventoryInterestCodes.Contains(t.LandActTypeCode))
var isOwned = !(activeTakes.All(t => (t.IsNewLandAct.HasValue && t.IsNewLandAct.Value && COREINVENTORYINTERESTCODES.Contains(t.LandActTypeCode))
|| (t.IsNewInterestInSrw.HasValue && t.IsNewInterestInSrw.Value)
|| (t.IsThereSurplus.HasValue && t.IsThereSurplus.Value)
|| (t.IsNewLicenseToConstruct.HasValue && t.IsNewLicenseToConstruct.Value)) && activeTakes.Any());
var isPropertyOfInterest = false;

Expand All @@ -732,6 +735,20 @@ private void TransferPropertiesOfInterest(PimsAcquisitionFile acquisitionFile, b

_propertyRepository.TransferFileProperty(property, isOwned, isPropertyOfInterest);
}

foreach (var acqFileProperty in propertiesAccounted)
{
var property = acqFileProperty.Property;
if (!userOverride)
{
throw new UserOverrideException(UserOverrideCode.PoiToInventory, "The properties of interest will be added to the inventory as acquired properties.");
}

var takes = _takeRepository.GetAllByPropertyAcquisitionFileId(acqFileProperty.Internal_Id);
var isOwned = takes.Any(x => x.IsThereSurplus.HasValue && x.IsThereSurplus.Value);

_propertyRepository.TransferFileProperty(property, isOwned);
}
}

private void AddNoteIfStatusChanged(PimsAcquisitionFile updateAcquisitionFile)
Expand Down
1 change: 1 addition & 0 deletions source/backend/api/Services/DocumentService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public class DocumentService : BaseService, IDocumentService
"gml",
"kml",
"kmz",
"msg",
};

private readonly IDocumentRepository documentRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public interface IPropertyRepository : IRepository<PimsProperty>

void Delete(PimsProperty property);

PimsProperty TransferFileProperty(PimsProperty property, bool isOwned, bool isPropertyOfInterest);
PimsProperty TransferFileProperty(PimsProperty property, bool isOwned, bool isPropertyOfInterest = false);

HashSet<long> GetMatchingIds(PropertyFilterCriteria filter);
}
Expand Down
2 changes: 1 addition & 1 deletion source/backend/dal/Repositories/PropertyRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ public void Delete(PimsProperty property)
/// </summary>
/// <param name="property">The property to update.</param>
/// <returns>The updated property.</returns>
public PimsProperty TransferFileProperty(PimsProperty property, bool isOwned, bool isPropertyOfInterest)
public PimsProperty TransferFileProperty(PimsProperty property, bool isOwned, bool isPropertyOfInterest = false)
{
property.ThrowIfNull(nameof(property));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ public void Update_Success_PropertyOfInterest_UserOverride()
new object[] { new List<PimsTake>() { new PimsTake() { IsNewLandAct = true, LandActTypeCode = "Crown Grant (New)" } }, true, false },
new object[] { new List<PimsTake>() { new PimsTake() { IsNewInterestInSrw = true } }, false, false },
new object[] { new List<PimsTake>() { new PimsTake() { IsNewLicenseToConstruct = true } }, false, false },
new object[] { new List<PimsTake>() { new PimsTake() { IsThereSurplus = true } }, false, false },
new object[] { new List<PimsTake>() { new PimsTake() { IsThereSurplus = true } }, true, false },
new object[] { new List<PimsTake>() { new PimsTake() { IsNewHighwayDedication = true } }, true, false },
new object[] { new List<PimsTake>() { new PimsTake() { IsNewHighwayDedication = true, IsAcquiredForInventory = false } }, false, true },
new object[] { new List<PimsTake>() { new PimsTake() { IsNewHighwayDedication = false, IsAcquiredForInventory = true } }, true, false },
Expand Down
2 changes: 1 addition & 1 deletion source/frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "frontend",
"version": "4.0.0-67.1",
"version": "4.0.0-67.6",
"private": true,
"dependencies": {
"@bcgov/bc-sans": "1.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const LeaseAndLicenses = ({ onLinkClick }: ISideTrayPageProps) => {
return (
<>
<HalfHeightDiv>
<Styled.TrayHeader>Management</Styled.TrayHeader>
<Styled.TrayHeader>Leases & Licenses</Styled.TrayHeader>
{hasClaim(Claims.LEASE_VIEW) && (
<Link onClick={onLinkClick} to="/lease/list">
Manage Lease/License Files
Expand All @@ -38,7 +38,7 @@ export const LeaseAndLicenses = ({ onLinkClick }: ISideTrayPageProps) => {
</ExportH3>
<p>Aggregated Lease & License Payments</p>
<ExportAggregatedLeasesContainer />
<p>Lease and License Payments by Fiscal Year</p>
<p>Lease & License Payments by Fiscal Year</p>
<ExportLeasePaymentsContainer />
</HalfHeightDiv>
)}
Expand Down
5 changes: 4 additions & 1 deletion source/frontend/src/components/layout/SideNavBar/NavIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ export const NavIcon = ({ icon, text, showText, onClick, roles, claims }: INavIc
_.find(claims, (claim: Claims) => hasClaim(claim));

return (!roles?.length && !claims?.length) || displayIcon ? (
<StyledNav onClick={onClick} data-testid={`nav-tooltip-${text.replace(' ', '').toLowerCase()}`}>
<StyledNav
onClick={onClick}
data-testid={`nav-tooltip-${text.replaceAll(' ', '').toLowerCase()}`}
>
<StyledLink>
<TooltipWrapper toolTipId={`nav-tooltip-${text}`} toolTip={text}>
{icon}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ describe('SideNavbar display and logic', () => {
const { getByTitle, queryByText, getByTestId } = renderComponent();
await waitFor(async () => {
expect(getByTitle('expand')).toBeInTheDocument();
expect(queryByText('Management')?.clientWidth).toBe(0);
expect(getByTestId('nav-tooltip-management')).toContainHTML('svg');
expect(queryByText('Leases & Licenses')?.clientWidth).toBe(0);
expect(getByTestId('nav-tooltip-leases&licenses')).toContainHTML('svg');
});
});

Expand All @@ -73,8 +73,8 @@ describe('SideNavbar display and logic', () => {
userEvent.click(expandButton);
});
await waitFor(async () => {
expect(getByTestId('nav-tooltip-management')).toContainHTML('svg');
expect(getByText('Management')).toBeInTheDocument();
expect(getByTestId('nav-tooltip-leases&licenses')).toContainHTML('svg');
expect(getByText('Leases & Licenses')).toBeInTheDocument();
});
});

Expand Down Expand Up @@ -118,7 +118,7 @@ describe('SideNavbar display and logic', () => {
const { getByText, getByTestId } = renderComponent({
roles: [Roles.SYSTEM_ADMINISTRATOR],
});
const managementButton = getByTestId('nav-tooltip-management');
const managementButton = getByTestId('nav-tooltip-leases&licenses');
await act(async () => {
userEvent.click(managementButton);
});
Expand All @@ -131,7 +131,7 @@ describe('SideNavbar display and logic', () => {
const { getByTestId, getByTitle } = renderComponent({
roles: [Roles.SYSTEM_ADMINISTRATOR],
});
const managementButton = getByTestId('nav-tooltip-management');
const managementButton = getByTestId('nav-tooltip-leases&licenses');
await act(async () => {
userEvent.click(managementButton);
});
Expand All @@ -148,7 +148,7 @@ describe('SideNavbar display and logic', () => {
const { getByTestId, getByTitle } = renderComponent({
roles: [Roles.SYSTEM_ADMINISTRATOR],
});
const managementButton = getByTestId('nav-tooltip-management');
const managementButton = getByTestId('nav-tooltip-leases&licenses');
await act(async () => {
userEvent.click(managementButton);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const SideNavBar = () => {
<NavIcon
onClick={() => setTrayPage(SidebarContextType.LEASE)}
icon={<Fence />}
text="Management"
text="Leases & Licenses"
showText={expanded}
/>
<NavIcon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ exports[`SideNavbar display and logic renders 1`] = `
</div>
<div
class="c2 nav-item"
data-testid="nav-tooltip-management"
data-testid="nav-tooltip-leases&licenses"
>
<a
class="c3 nav-link"
Expand All @@ -277,7 +277,7 @@ exports[`SideNavbar display and logic renders 1`] = `
<label
class="c4"
>
Management
Leases & Licenses
</label>
</a>
</div>
Expand Down
1 change: 1 addition & 0 deletions source/frontend/src/constants/ValidDocumentExtensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const ValidDocumentExtensions: string[] = [
'gml',
'kml',
'kmz',
'msg',
];

export default ValidDocumentExtensions;
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ exports[`DocumentUploadView component renders as expected 1`] = `
class="pt-2"
>
<input
accept=".txt,.pdf,.docx,.doc,.xlsx,.xls,.html,.odt,.png,.jpg,.bmp,.tif,.tiff,.jpeg,.gif,.shp,.gml,.kml,.kmz"
accept=".txt,.pdf,.docx,.doc,.xlsx,.xls,.html,.odt,.png,.jpg,.bmp,.tif,.tiff,.jpeg,.gif,.shp,.gml,.kml,.kmz,.msg"
data-testid="upload-input"
id="uploadInput"
name="documentFile"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ exports[`PropertyManagementDetailView component renders as expected when provide
<div
class="c5 text-left col"
>
No active Lease/License
No
</div>
</div>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ exports[`PropertyManagementUpdateForm component renders as expected 1`] = `
<div
class="c5 text-left col"
>
No active Lease/License
No
</div>
</div>
<div
Expand Down
Loading

0 comments on commit bbcbca7

Please sign in to comment.