Skip to content

Commit

Permalink
Merge pull request #2220 from bcgov/1.10.6
Browse files Browse the repository at this point in the history
1.10.6
  • Loading branch information
bcgov-brwang authored Sep 20, 2022
2 parents a0ebf31 + 093910d commit 5e7b5c1
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 23 deletions.
13 changes: 7 additions & 6 deletions Server/HetsApi/Controllers/DistrictEquipmentTypeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,18 +104,19 @@ public virtual ActionResult<DistrictEquipmentTypeAgreementSummary> DistrictEquip
{
// get user's district
int? districtId = UserAccountHelper.GetUsersDistrictId(_context);

var summary = _context.HetRentalAgreements.AsNoTracking()
.Include(x => x.Equipment.DistrictEquipmentType)
.Where(x => x.DistrictId == districtId &&
!x.Number.StartsWith("BCBid"))
.ToList()
.GroupBy(x => x.Equipment.DistrictEquipmentType, (t, agreements) => new DistrictEquipmentTypeAgreementSummary
.Include(x => x.Equipment.DistrictEquipmentType)
.Where(x => x.DistrictId == districtId &&
!x.Number.StartsWith("BCBid"))
.ToList()
.OrderByDescending(x => x.DatedOn).GroupBy(x => x.Equipment.DistrictEquipmentTypeId).Select(x => x.FirstOrDefault()).ToList()
.GroupBy(x => x.Equipment.DistrictEquipmentType, (t, agreements) => new DistrictEquipmentTypeAgreementSummary
{
Id = t.DistrictEquipmentTypeId,
Name = t.DistrictEquipmentName,
AgreementIds = agreements.Select(y => y.RentalAgreementId).Distinct().ToList(),
ProjectIds = agreements.Select(y => y.ProjectId).Distinct().ToList(),

})
.ToList();

Expand Down
2 changes: 1 addition & 1 deletion Server/HetsApi/HetsApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<PropertyGroup>
<VersionPrefix>1.0.0.0</VersionPrefix>
<VersionSuffix>sprint1</VersionSuffix>
<Version>1.10.5.0</Version>
<Version>1.10.6.0</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down
4 changes: 2 additions & 2 deletions Server/HetsApi/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"LogoffUrl-Training": "https://logontest.gov.bc.ca/clp-cgi/logoff.cgi?returl=https://trn-hets.th.gov.bc.ca&retnow=1",
"LogoffUrl-UAT": "https://logontest.gov.bc.ca/clp-cgi/logoff.cgi?returl=https://uat-hets.th.gov.bc.ca&retnow=1",
"LogoffUrl-Production": "https://logon.gov.bc.ca/clp-cgi/logoff.cgi?returl=https://hets.th.gov.bc.ca&retnow=1",
"Version-Application": "Release 1.10.4.0",
"Version-Database": "Release 1.10.4.0",
"Version-Application": "Release 1.10.6.0",
"Version-Database": "Release 1.10.6.0",
"Maximum-Blank-Agreements": "3",
"ExceptionDescriptions": {
"HETS-01": "Record not found",
Expand Down
7 changes: 7 additions & 0 deletions client/src/js/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -1451,9 +1451,11 @@ export function getProjectsAgreementSummary() {
type: Action.UPDATE_PROJECTS_AGREEMENT_SUMMARY_LOOKUP,
projects: projects,
});

});
}


export function getProjectsCurrentFiscal() {
const silent = store.getState().lookups.projectsCurrentFiscal.loaded;
return new ApiRequest('/projects', { silent }).get({ currentFiscal: true }).then((response) => {
Expand Down Expand Up @@ -2781,13 +2783,18 @@ export function getDistrictEquipmentTypes() {

export function getDistrictEquipmentTypesAgreementSummary() {
const silent = store.getState().lookups.districtEquipmentTypesAgreementSummary.loaded;


return new ApiRequest('/districtequipmenttypes/agreementSummary', { silent }).get().then((response) => {
var districtEquipmentTypes = normalize(response.data);

store.dispatch({
type: Action.UPDATE_DISTRICT_EQUIPMENT_TYPES_AGREEMENT_SUMMARY_LOOKUP,
districtEquipmentTypes,
});



});
}

Expand Down
28 changes: 20 additions & 8 deletions client/src/js/views/AitReport.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class AitReport extends React.Component {
constructor(props) {
super(props);


var today = Moment();

this.state = {
Expand All @@ -69,7 +70,9 @@ class AitReport extends React.Component {
sortField: props.ui.sortField || 'rentalAgreementNumber',
sortDesc: props.ui.sortDesc === true,
},

};

}

buildSearchParams = () => {
Expand Down Expand Up @@ -108,6 +111,8 @@ class AitReport extends React.Component {
Api.getDistrictEquipmentTypesAgreementSummary();
Api.getEquipmentAgreementSummary();



// If this is the first load, then look for a default favourite
if (_.isEmpty(this.props.search)) {
var defaultFavourite = _.find(this.props.favourites, (f) => f.isDefault);
Expand Down Expand Up @@ -148,6 +153,8 @@ class AitReport extends React.Component {
});
};



updateSearchState = (state, callback) => {
this.setState({ search: { ...this.state.search, ...state, ...{ loaded: true } } }, () => {
store.dispatch({
Expand Down Expand Up @@ -267,7 +274,6 @@ class AitReport extends React.Component {
var today = Moment();
var startDate;
var endDate;

switch (state.dateRange) {
case THIS_FISCAL:
// Fiscal Year: Apr 1 - March 31
Expand Down Expand Up @@ -338,10 +344,12 @@ class AitReport extends React.Component {
};

getFilteredDistrictEquipmentType = () => {
return _.chain(this.props.districtEquipmentTypes.data)
.filter((x) => this.matchesDateFilter(x.agreementIds) && this.matchesProjectFilter(x.projectIds))
.sortBy('name')
.value();
var result = _.chain(this.props.districtEquipmentTypes.data)
.filter((x) => this.matchesDateFilter(x.agreementIds) && this.matchesProjectFilter(x.projectIds))
.sortBy('name')
.value();
return result;

};

getFilteredEquipment = () => {
Expand All @@ -365,7 +373,7 @@ class AitReport extends React.Component {
var projects = this.getFilteredProjects();
var districtEquipmentTypes = this.getFilteredDistrictEquipmentType();
var equipment = this.getFilteredEquipment();

return (
<div id="rental-agreement-summary">
<PageHeader>
Expand Down Expand Up @@ -489,7 +497,9 @@ class AitReport extends React.Component {
}

function mapStateToProps(state) {
return {


var result = {
currentUser: state.user,
agreementSummaryLite: state.lookups.agreementSummaryLite,
projects: state.lookups.projectsAgreementSummary,
Expand All @@ -500,6 +510,8 @@ function mapStateToProps(state) {
search: state.search.aitResponses,
ui: state.ui.aitResponses,
};

return result;
}

export default connect(mapStateToProps)(AitReport);
export default connect(mapStateToProps)(AitReport);
2 changes: 1 addition & 1 deletion openshift/api-build-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kind: Template
apiVersion: v1
apiVersion: template.openshift.io/v1
metadata:
name: ${PROJECT_NAME}
creationTimestamp:
Expand Down
2 changes: 1 addition & 1 deletion openshift/api-deploy-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kind: Template
apiVersion: v1
apiVersion: template.openshift.io/v1
metadata:
name: ${PROJECT_NAME}
creationTimestamp:
Expand Down
2 changes: 1 addition & 1 deletion openshift/backup-deploy-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kind: Template
apiVersion: v1
apiVersion: template.openshift.io/v1
metadata:
name: "${NAME}-deployment-template"
objects:
Expand Down
2 changes: 1 addition & 1 deletion openshift/client-build-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: v1
apiVersion: template.openshift.io/v1
kind: Template
metadata:
creationTimestamp: null
Expand Down
2 changes: 1 addition & 1 deletion openshift/client-deploy-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kind: Template
apiVersion: v1
apiVersion: template.openshift.io/v1
metadata:
name: ${PROJECT_NAME}
creationTimestamp:
Expand Down
2 changes: 1 addition & 1 deletion openshift/postgresql-deploy-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kind: Template
apiVersion: v1
apiVersion: template.openshift.io/v1
metadata:
name: ${PROJECT_NAME}
objects:
Expand Down

0 comments on commit 5e7b5c1

Please sign in to comment.