Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed School Safety Campaign Strategy from rules #1752

Merged
merged 1 commit into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions client/src/components/ProjectWizard/TdmCalculationContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,16 +169,18 @@ export function TdmCalculationContainer({ contentContainerRef }) {
const strategyBike4 = rules.find(r => r.code === "STRATEGY_BIKE_4");
const strategyHov4 = rules.find(r => r.code === "STRATEGY_HOV_4");
const strategyInfo3 = rules.find(r => r.code === "STRATEGY_INFO_3");
const strategyInfo5 = rules.find(r => r.code === "STRATEGY_INFO_5");
const strategyMobilityInvestment2 = rules.find(
r => r.code === "STRATEGY_MOBILITY_INVESTMENT_2"
);
return (
strategyBike4 &&
!!strategyBike4.value &&
strategyHov4 &&
!!strategyHov4.value &&
strategyInfo3 &&
strategyInfo3.value >= 2 &&
strategyInfo5 &&
!!strategyInfo5.value
strategyMobilityInvestment2 &&
strategyMobilityInvestment2.value >= 2
);
};

Expand Down Expand Up @@ -211,7 +213,7 @@ export function TdmCalculationContainer({ contentContainerRef }) {
if (rules.find(r => r.code === "STRATEGY_INFO_3").value <= 1) {
modifiedInputs["STRATEGY_INFO_3"] = 2;
}
modifiedInputs["STRATEGY_INFO_5"] = true;
modifiedInputs["STRATEGY_MOBILITY_INVESTMENT_2"] = 2;
modifiedInputs["STRATEGY_HOV_4"] = true;

// De-select Trip-Reduction Program
Expand All @@ -225,7 +227,7 @@ export function TdmCalculationContainer({ contentContainerRef }) {
} else {
modifiedInputs["STRATEGY_INFO_3"] = 1;
}
modifiedInputs["STRATEGY_INFO_5"] = false;
modifiedInputs["STRATEGY_MOBILITY_INVESTMENT_2"] = 0;
modifiedInputs["STRATEGY_HOV_4"] = false;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
if exists (SELECT * from calculationrule where calculationid = 1 and code = 'STRATEGY_INFO_5')
begin
delete calculationrule where calculationid = 1 and code = 'STRATEGY_INFO_5';
end

if exists (SELECT * from calculationrule where calculationid = 1 and code = 'PTS_INFO_5')

begin
delete calculationrule where calculationid = 1 and code = 'PTS_INFO_5';
end

update calculationrule set
functionBody = ' return (<<PROJECT_LEVEL>> === 1 && !!<<STRATEGY_BIKE_4>> && <<STRATEGY_HOV_4>> && (<<STRATEGY_MOBILITY_INVESTMENT_2>> >= 2) && !!(<<STRATEGY_INFO_3>> >= 2)) ? 1 : 0; '
where calculationid = 1 and code = 'PTS_PKG_SCHOOL'

update calculationrule set
functionBody = 'return <<PTS_INFO_1>> + <<PTS_INFO_2>> + <<PTS_INFO_3>>;'
where calculationid = 1 and code = 'PTS_INFO'
Loading