Skip to content

Commit

Permalink
Merge pull request #474 from bcgov/1.2.2
Browse files Browse the repository at this point in the history
Version 1.2.2
  • Loading branch information
ychung-mot authored May 20, 2020
2 parents 3e180fc + f3178dc commit 80e825a
Show file tree
Hide file tree
Showing 8 changed files with 356 additions and 7 deletions.
2 changes: 1 addition & 1 deletion api/Hmcr.Api/Extensions/IServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public static void AddHmcrControllers(this IServiceCollection services)

public static void AddHmcrDbContext(this IServiceCollection services, string connectionString)
{
services.AddDbContext<AppDbContext>(options => options.UseSqlServer(connectionString, x => x.UseNetTopologySuite()));
services.AddDbContext<AppDbContext>(options => options.UseSqlServer(connectionString, x => x.UseNetTopologySuite().CommandTimeout(1800)));
}

public static void AddHmcrAutoMapper(this IServiceCollection services)
Expand Down
2 changes: 1 addition & 1 deletion api/Hmcr.Api/appsettings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"AllowedHosts": "*",
"Constants": {
"Version": "1.2.1.0",
"Version": "1.2.2.0",
"SwaggerApiUrl": "/swagger/v1/swagger.json"
},
"Serilog": {
Expand Down
2 changes: 1 addition & 1 deletion api/Hmcr.Hangfire/appsettings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"AllowedHosts": "*",
"Constants": {
"Version": "1.2.0.0",
"Version": "1.2.2.0",
"SwaggerApiUrl": "/swagger/v1/swagger.json"
},
"Serilog": {
Expand Down
8 changes: 5 additions & 3 deletions client/src/js/components/fragments/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,11 @@ const Header = ({ currentUser }) => {
Quick Links
</DropdownToggle>
<DropdownMenu>
<DropdownItem tag={Link} to={Constants.PATHS.API_ACCESS}>
API Access
</DropdownItem>
{currentUser.userType === Constants.USER_TYPE.INTERNAL && (
<DropdownItem tag={Link} to={Constants.PATHS.API_ACCESS}>
API Access
</DropdownItem>
)}
<DropdownItem tag={Link} to={Constants.PATHS.VERSION}>
Version
</DropdownItem>
Expand Down
23 changes: 23 additions & 0 deletions database/V21.1/1_HMR_PDM-dml_CODE_LOOKUP_CHANGE-V20_S1.21.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/* ---------------------------------------------------------------------- */
/* Target DBMS: MS SQL Server 2017 */
/* Project name: Highway Maintenance Reporting */
/* Author: Ayodeji Kuponiyi */
/* Script type: DML */
/* Created on: 2020-05-11 */
/* ---------------------------------------------------------------------- */

USE HMR_DEV;

/* Updates
JIRA Ticket: https://jira.th.gov.bc.ca/browse/HMCR-633
i) Remove major event type as an option from HMR_CODE_LOOKUP.
*/


IF EXISTS
(SELECT * FROM [dbo].[HMR_CODE_LOOKUP] WHERE CODE_SET = 'WRK_RPT_MAINT_TYPE' AND CODE_NAME = 'Major Event')
DELETE [dbo].[HMR_CODE_LOOKUP] WHERE CODE_SET = 'WRK_RPT_MAINT_TYPE' AND CODE_NAME = 'Major Event';

GO
160 changes: 160 additions & 0 deletions database/V21.1/2_HMR_PDM-dml_DELETE_PRD_SUBMISSION_OBJ-V22_S1.22.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
-- =============================================
-- Author: Ayodeji Kuponiyi
-- Create date: 2020-05-13



-- Updates:
-- Deleting submission entries in all relevant tables on or before May 06 2020.
-- =============================================

USE HMR_DEV; -- uncomment appropriate instance
--USE HMR_TST;
--USE HMR_UAT;
--USE HMR_PRD;
GO


DELETE HMR_WORK_REPORT

WHERE EXISTS

(
SELECT *

FROM [dbo].[HMR_SUBMISSION_OBJECT] so

WHERE so.SUBMISSION_OBJECT_ID = HMR_WORK_REPORT.SUBMISSION_OBJECT_ID

AND so.SERVICE_AREA_NUMBER = 19
AND FORMAT(so.APP_CREATE_TIMESTAMP, 'dd-MM-yyyy') <= '06-MAY-2020'
)

DELETE HMR_WORK_REPORT_HIST

WHERE EXISTS

(
SELECT *

FROM [dbo].[HMR_SUBMISSION_OBJECT] so

WHERE so.SUBMISSION_OBJECT_ID = HMR_WORK_REPORT_HIST.SUBMISSION_OBJECT_ID

AND so.SERVICE_AREA_NUMBER = 19
AND FORMAT(so.APP_CREATE_TIMESTAMP, 'dd-MM-yyyy') <= '06-MAY-2020'
)


DELETE HMR_ROCKFALL_REPORT

WHERE EXISTS

(
SELECT *

FROM [dbo].[HMR_SUBMISSION_OBJECT] so

WHERE so.SUBMISSION_OBJECT_ID = HMR_ROCKFALL_REPORT.SUBMISSION_OBJECT_ID

AND so.SERVICE_AREA_NUMBER = 19
AND FORMAT(so.APP_CREATE_TIMESTAMP, 'dd-MM-yyyy') <= '06-MAY-2020'
)

DELETE HMR_ROCKFALL_REPORT_HIST

WHERE EXISTS

(
SELECT *

FROM [dbo].[HMR_SUBMISSION_OBJECT] so

WHERE so.SUBMISSION_OBJECT_ID = HMR_ROCKFALL_REPORT_HIST.SUBMISSION_OBJECT_ID

AND so.SERVICE_AREA_NUMBER = 19
AND FORMAT(so.APP_CREATE_TIMESTAMP, 'dd-MM-yyyy') <= '06-MAY-2020'
)


DELETE HMR_WILDLIFE_REPORT

WHERE EXISTS

(
SELECT *

FROM [dbo].[HMR_SUBMISSION_OBJECT] so

WHERE so.SUBMISSION_OBJECT_ID = HMR_WILDLIFE_REPORT.SUBMISSION_OBJECT_ID

AND so.SERVICE_AREA_NUMBER = 19
AND FORMAT(so.APP_CREATE_TIMESTAMP, 'dd-MM-yyyy') <= '06-MAY-2020'
)

DELETE HMR_WILDLIFE_REPORT_HIST

WHERE EXISTS

(
SELECT *

FROM [dbo].[HMR_SUBMISSION_OBJECT] so

WHERE so.SUBMISSION_OBJECT_ID = HMR_WILDLIFE_REPORT_HIST.SUBMISSION_OBJECT_ID

AND so.SERVICE_AREA_NUMBER = 19
AND FORMAT(so.APP_CREATE_TIMESTAMP, 'dd-MM-yyyy') <= '06-MAY-2020'
)

DELETE HMR_FEEDBACK_MESSAGE

WHERE EXISTS

(
SELECT *

FROM [dbo].[HMR_SUBMISSION_OBJECT] so

WHERE so.SUBMISSION_OBJECT_ID = HMR_FEEDBACK_MESSAGE.SUBMISSION_OBJECT_ID

AND so.SERVICE_AREA_NUMBER = 19
AND FORMAT(so.APP_CREATE_TIMESTAMP, 'dd-MM-yyyy') <= '06-MAY-2020'
)


DELETE HMR_SUBMISSION_ROW

WHERE EXISTS

(
SELECT *

FROM [dbo].[HMR_SUBMISSION_OBJECT] so

WHERE so.SUBMISSION_OBJECT_ID = HMR_SUBMISSION_ROW.SUBMISSION_OBJECT_ID

AND so.SERVICE_AREA_NUMBER = 19
AND FORMAT(so.APP_CREATE_TIMESTAMP, 'dd-MM-yyyy') <= '06-MAY-2020'
)

DELETE HMR_SUBMISSION_ROW_HIST

WHERE EXISTS

(
SELECT *

FROM [dbo].[HMR_SUBMISSION_OBJECT] so

WHERE so.SUBMISSION_OBJECT_ID = HMR_SUBMISSION_ROW_HIST.SUBMISSION_OBJECT_ID

AND so.SERVICE_AREA_NUMBER = 19
AND FORMAT(so.APP_CREATE_TIMESTAMP, 'dd-MM-yyyy') <= '06-MAY-2020'
)

DELETE HMR_SUBMISSION_OBJECT

WHERE
SERVICE_AREA_NUMBER = 19
AND FORMAT(APP_CREATE_TIMESTAMP, 'dd-MM-yyyy') <= '06-MAY-2020'
164 changes: 164 additions & 0 deletions database/V21.2/1_HMR_PDM-dml_DELETE_PRD_SUBMISSION_OBJ-V22_S1.22-2.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
-- =============================================
-- Author: Ayodeji Kuponiyi
-- Create date: 2020-05-13
-- Update date: 2020-05-20



-- Comments:
-- Original:
--Deleting submission entries in all relevant tables on or before May 06 2020 for SA 19
-- Updates 2020-05-20:
--Included May 07 and SA 14
-- =============================================

USE HMR_DEV; -- uncomment appropriate instance
--USE HMR_TST;
--USE HMR_UAT;
--USE HMR_PRD;
GO


DELETE HMR_WORK_REPORT

WHERE EXISTS

(
SELECT *

FROM [dbo].[HMR_SUBMISSION_OBJECT] so

WHERE so.SUBMISSION_OBJECT_ID = HMR_WORK_REPORT.SUBMISSION_OBJECT_ID

AND so.SERVICE_AREA_NUMBER IN (14,19)
AND FORMAT(so.APP_CREATE_TIMESTAMP, 'dd-MM-yyyy') <= '07-MAY-2020'
)

DELETE HMR_WORK_REPORT_HIST

WHERE EXISTS

(
SELECT *

FROM [dbo].[HMR_SUBMISSION_OBJECT] so

WHERE so.SUBMISSION_OBJECT_ID = HMR_WORK_REPORT_HIST.SUBMISSION_OBJECT_ID

AND so.SERVICE_AREA_NUMBER IN (14,19)
AND FORMAT(so.APP_CREATE_TIMESTAMP, 'dd-MM-yyyy') <= '07-MAY-2020'
)


DELETE HMR_ROCKFALL_REPORT

WHERE EXISTS

(
SELECT *

FROM [dbo].[HMR_SUBMISSION_OBJECT] so

WHERE so.SUBMISSION_OBJECT_ID = HMR_ROCKFALL_REPORT.SUBMISSION_OBJECT_ID

AND so.SERVICE_AREA_NUMBER IN (14,19)
AND FORMAT(so.APP_CREATE_TIMESTAMP, 'dd-MM-yyyy') <= '07-MAY-2020'
)

DELETE HMR_ROCKFALL_REPORT_HIST

WHERE EXISTS

(
SELECT *

FROM [dbo].[HMR_SUBMISSION_OBJECT] so

WHERE so.SUBMISSION_OBJECT_ID = HMR_ROCKFALL_REPORT_HIST.SUBMISSION_OBJECT_ID

AND so.SERVICE_AREA_NUMBER IN (14,19)
AND FORMAT(so.APP_CREATE_TIMESTAMP, 'dd-MM-yyyy') <= '07-MAY-2020'
)


DELETE HMR_WILDLIFE_REPORT

WHERE EXISTS

(
SELECT *

FROM [dbo].[HMR_SUBMISSION_OBJECT] so

WHERE so.SUBMISSION_OBJECT_ID = HMR_WILDLIFE_REPORT.SUBMISSION_OBJECT_ID

AND so.SERVICE_AREA_NUMBER IN (14,19)
AND FORMAT(so.APP_CREATE_TIMESTAMP, 'dd-MM-yyyy') <= '07-MAY-2020'
)

DELETE HMR_WILDLIFE_REPORT_HIST

WHERE EXISTS

(
SELECT *

FROM [dbo].[HMR_SUBMISSION_OBJECT] so

WHERE so.SUBMISSION_OBJECT_ID = HMR_WILDLIFE_REPORT_HIST.SUBMISSION_OBJECT_ID

AND so.SERVICE_AREA_NUMBER IN (14,19)
AND FORMAT(so.APP_CREATE_TIMESTAMP, 'dd-MM-yyyy') <= '07-MAY-2020'
)

DELETE HMR_FEEDBACK_MESSAGE

WHERE EXISTS

(
SELECT *

FROM [dbo].[HMR_SUBMISSION_OBJECT] so

WHERE so.SUBMISSION_OBJECT_ID = HMR_FEEDBACK_MESSAGE.SUBMISSION_OBJECT_ID

AND so.SERVICE_AREA_NUMBER IN (14,19)
AND FORMAT(so.APP_CREATE_TIMESTAMP, 'dd-MM-yyyy') <= '07-MAY-2020'
)


DELETE HMR_SUBMISSION_ROW

WHERE EXISTS

(
SELECT *

FROM [dbo].[HMR_SUBMISSION_OBJECT] so

WHERE so.SUBMISSION_OBJECT_ID = HMR_SUBMISSION_ROW.SUBMISSION_OBJECT_ID

AND so.SERVICE_AREA_NUMBER IN (14,19)
AND FORMAT(so.APP_CREATE_TIMESTAMP, 'dd-MM-yyyy') <= '07-MAY-2020'
)

DELETE HMR_SUBMISSION_ROW_HIST

WHERE EXISTS

(
SELECT *

FROM [dbo].[HMR_SUBMISSION_OBJECT] so

WHERE so.SUBMISSION_OBJECT_ID = HMR_SUBMISSION_ROW_HIST.SUBMISSION_OBJECT_ID

AND so.SERVICE_AREA_NUMBER IN (14,19)
AND FORMAT(so.APP_CREATE_TIMESTAMP, 'dd-MM-yyyy') <= '07-MAY-2020'
)

DELETE HMR_SUBMISSION_OBJECT

WHERE
SERVICE_AREA_NUMBER IN (14,19)
AND FORMAT(APP_CREATE_TIMESTAMP, 'dd-MM-yyyy') <= '07-MAY-2020'
Loading

0 comments on commit 80e825a

Please sign in to comment.