Skip to content

Commit

Permalink
Merge pull request #469 from bcgov/5.4-db-release-update
Browse files Browse the repository at this point in the history
5.4 db release update
  • Loading branch information
mgtennant authored Oct 10, 2024
2 parents c2ef0b2 + 1c14468 commit 7ea8bb4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect } from "react";
import { useSelector, useDispatch } from "react-redux";
import { Row, Col, Form, Button } from "react-bootstrap";
import { Row, Col, Button } from "react-bootstrap";

import DocGenDownloadBar from "../../components/DocGenDownloadBar";

Expand Down
4 changes: 4 additions & 0 deletions app/client/src/features/licences/LicenceTrailers.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import ErrorMessageRow from "../../components/ErrorMessageRow";

import { selectCurrentUser } from "../../app/appSlice";
import GenerateDairyTrailerInspection from "./GenerateDairyTrailerInspection";
import { clearReportsJob } from "../reports/reportsSlice";

function formatResultRow(result) {
const url = `${TRAILERS_PATHNAME}/${result.dairyFarmTrailerId}`;
Expand Down Expand Up @@ -81,6 +82,9 @@ export default function LicenceTrailers({ licence }) {
setTrailerParameters({ licenceNumber: licence.data.licenceNumber })
);
dispatch(fetchTrailerResults());
return () => {
dispatch(clearReportsJob());
};
}, [dispatch]);

const handleFilterTextChange = (e) => {
Expand Down
9 changes: 5 additions & 4 deletions spilo-db/db-scripts/releases/release_5.4_ddl.sql
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ GRANT SELECT ON TABLE mals_app.mal_dairy_farm_trailer_inspection_vw TO mals_app_
-- VIEW: MAL_PRINT_DAIRY_FARM_TRAILER_INSPECTION_VW
--

CREATE VIEW mals_app.mal_print_dairy_farm_trailer_inspection_vw
CREATE OR REPLACE VIEW mals_app.mal_print_dairy_farm_trailer_inspection_vw
AS
SELECT lictyp.licence_type,
to_char(insp.inspection_date, 'yyyy') inspection_year,
Expand All @@ -265,6 +265,7 @@ AS
lic.irma_number,
json_build_object(
'CurrentDate', to_char(CURRENT_DATE::timestamp with time zone, 'fmMonth dd, yyyy'::text),
'LicenceNumber', lic.licence_number,
'IRMA_Num', lic.irma_number,
'LicenceStatus', licstat.code_name,
'LicenceHolderCompany', lic.company_name,
Expand Down Expand Up @@ -478,8 +479,8 @@ GRANT SELECT ON TABLE mals_app.mal_print_certificate_vw TO mals_app_role;
-- PROCEDURE: PR_GENERATE_PRINT_JSON_DAIRY_FARM_TRAILER_INSPECTION
--

CREATE OR REPLACE PROCEDURE mals_app.pr_generate_print_json_dairy_farm_trailer_inspection(
IN ip_irma_number character varying,
CREATE PROCEDURE mals_app.pr_generate_print_json_dairy_farm_trailer_inspection(
IN ip_licence_number integer,
INOUT iop_print_job_id integer)
LANGUAGE plpgsql
AS $procedure$
Expand Down Expand Up @@ -514,7 +515,7 @@ AS $procedure$
'InspectorName', inspector_id,
'InspectionComments', inspection_comments)) AS trailer_json
FROM mal_dairy_farm_trailer_inspection_vw
WHERE irma_number = ip_irma_number
WHERE licence_number = ip_licence_number
GROUP BY irma_number,
licence_number,
company_name)
Expand Down

0 comments on commit 7ea8bb4

Please sign in to comment.