Skip to content

Commit

Permalink
Merge branch 'main' into NDT-498-Email-notification-for-Project-Descr…
Browse files Browse the repository at this point in the history
…iption-when-SOW-uploaded
  • Loading branch information
RRanath authored Sep 27, 2024
2 parents e81d132 + 49c5b05 commit 6602b66
Show file tree
Hide file tree
Showing 24 changed files with 403 additions and 180 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/release-process.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,13 @@ jobs:
yarn
git checkout "${GITHUB_HEAD_REF}"
yarn run release-it --ci --branch="${GITHUB_HEAD_REF}" --git.commitArgs=-n
- name: Enable Auto-Merge
if: steps.checkbox.outputs.result == 'true' && steps.up_to_date.outputs.result == 'true' && steps.pr_approval.outputs.result == 'true' && !github.event.pull_request.draft
run: |
PR_URL="${{ github.event.pull_request.html_url }}"
gh pr merge --auto --merge "$PR_URL"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Uncheck the checkbox
if: steps.checkbox.outputs.result == 'true' && steps.up_to_date.outputs.result == 'true' && steps.pr_approval.outputs.result == 'true' && !github.event.pull_request.draft
uses: actions/github-script@v7
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-containers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Self-hosted Renovate
uses: renovatebot/github-action@v40.2.9
uses: renovatebot/github-action@v40.2.10
with:
configurationFile: ./.github/renovate.json
token: ${{ secrets.RENOVATE_GITHUB_TOKEN }}
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
## [1.193.6](https://github.com/bcgov/CONN-CCBC-portal/compare/v1.193.5...v1.193.6) (2024-09-26)

### Bug Fixes

- cbc edit input focus issue ([df5a5eb](https://github.com/bcgov/CONN-CCBC-portal/commit/df5a5ebb8677cf167036632e0dcec93ef0c88db2))

## [1.193.5](https://github.com/bcgov/CONN-CCBC-portal/compare/v1.193.4...v1.193.5) (2024-09-26)

## [1.193.4](https://github.com/bcgov/CONN-CCBC-portal/compare/v1.193.3...v1.193.4) (2024-09-26)

## [1.193.3](https://github.com/bcgov/CONN-CCBC-portal/compare/v1.193.2...v1.193.3) (2024-09-26)

### Bug Fixes

- format for Federal requested for history ([5ec38ba](https://github.com/bcgov/CONN-CCBC-portal/commit/5ec38ba9b7c308b22fbf1a24e6c26561e0c64902))
- update PR to enable automerge after realease setup ([f16a726](https://github.com/bcgov/CONN-CCBC-portal/commit/f16a726bc967a192e13394ac227afee9f4304ea5))

## [1.193.2](https://github.com/bcgov/CONN-CCBC-portal/compare/v1.193.1...v1.193.2) (2024-09-26)

## [1.193.1](https://github.com/bcgov/CONN-CCBC-portal/compare/v1.193.0...v1.193.1) (2024-09-18)

### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM registry.access.redhat.com/ubi9/s2i-base@sha256:3655df7d8496fe199de5fc0b37d22f2cc12f06ad82559a61e5c97196063cf580
FROM registry.access.redhat.com/ubi9/s2i-base@sha256:b360ce593f2bf0008e066b51ce6b7a257473d056ca646451b27fc42833a33831

ENV SUMMARY="An image for the CONN-CCBC-portal app" \
DESCRIPTION="This image contains the compiled CONN-CCBC-portal node app"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const notifyApplicationSubmission: EmailTemplateProvider = (
url: string
): EmailTemplate => {
return {
emailTo: [71, 34, 70, 1, 3, 72],
emailTo: [71, 34, 70, 1, 3, 72, 111, 112, 10, 11, 146],
emailCC: [],
tag: 'application-submitted',
subject: `CCBC Application received`,
Expand Down
36 changes: 35 additions & 1 deletion app/backend/lib/sow_import/tab_7.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const readBudget = async (sow_id, wb, sheet_name) => {
fundingFromAllOtherSources: '',
amountRequestedFromProvince: '',
totalInfrastructureBankFunding: '',
totalFNHAFunding: '',
totalFundingRequestedCCBC: '',
},
detailedBudget: {
Expand Down Expand Up @@ -126,6 +127,13 @@ const readBudget = async (sow_id, wb, sheet_name) => {
2627: '',
total: '',
},
fnhaFunding: {
2324: '',
2425: '',
2526: '',
2627: '',
total: '',
},
otherFundingPartners: [],
totalFinancialContribution: {
2324: '',
Expand Down Expand Up @@ -472,6 +480,7 @@ const readBudget = async (sow_id, wb, sheet_name) => {
budget[row]['K'];
row++;
// next 7 are possible other
let fnhaFundingRow = {};
for (let otherRow = row; otherRow < row + 7; otherRow++) {
const otherSuspect = budget[otherRow]['B'];
let otherValue;
Expand All @@ -483,8 +492,14 @@ const readBudget = async (sow_id, wb, sheet_name) => {
}
// if we don't have the predefined phrase, we have a custom other
if (
otherValue.indexOf('Identify other source of funding by name') === -1
otherValue.indexOf('Identify other source of funding by name') > -1
) {
continue;
} else if (
otherValue.indexOf('First Nations Health Authority (FNHA)') > -1
) {
fnhaFundingRow = budget[otherRow];
} else {
detailedBudget.summaryOfEstimatedProjectFunding.otherFundingPartners.push(
{
fundingPartnersName: budget[otherRow]['B'],
Expand All @@ -497,6 +512,19 @@ const readBudget = async (sow_id, wb, sheet_name) => {
);
}
}

// FNHA Funding
detailedBudget.summaryOfEstimatedProjectFunding.fnhaFunding[2324] =
fnhaFundingRow['G'] ?? 0;
detailedBudget.summaryOfEstimatedProjectFunding.fnhaFunding[2425] =
fnhaFundingRow['H'] ?? 0;
detailedBudget.summaryOfEstimatedProjectFunding.fnhaFunding[2526] =
fnhaFundingRow['I'] ?? 0;
detailedBudget.summaryOfEstimatedProjectFunding.fnhaFunding[2627] =
fnhaFundingRow['J'] ?? 0;
detailedBudget.summaryOfEstimatedProjectFunding.fnhaFunding.total =
fnhaFundingRow['K'] ?? 0;
detailedBudget.summaryTable.totalFNHAFunding = fnhaFundingRow['K'] ?? 0;
}
// get totals
if (value.indexOf('Total Financial Contributions') > -1) {
Expand Down Expand Up @@ -632,6 +660,12 @@ const ValidateData = (data) => {
error: 'Invalid data: Amount CIB will contribute',
});
}
if (typeof data.totalFNHAFunding !== 'number') {
errors.push({
level: 'cell',
error: 'Invalid data: First Nations Health Authority (FNHA)',
});
}
if (typeof data.fundingFromAllOtherSources !== 'number') {
errors.push({
level: 'cell',
Expand Down
54 changes: 31 additions & 23 deletions app/components/Analyst/Project/fields/ProjectFieldTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,33 @@ const StyledContainer = styled.div`
}
`;

const ErrorWrapper = styled.div<{ errorColor?: string }>`
position: relative;
background-color: ${(props) => props.errorColor};
padding: 8px;
margin-bottom: 8px;
max-width: calc(100% - 8px) !important;
interface StyledInputWrapperProps {
errorColor?: string;
hasError?: boolean;
}

.pg-select-wrapper,
.datepicker-widget,
.url-widget-wrapper,
.ccbcid-widget-wrapper {
background-color: white !important;
max-width: calc(340px - 8px) !important;
}
const StyledInputWrapper = styled.div<StyledInputWrapperProps>`
${(props) =>
props.hasError &&
`
position: relative;
background-color: ${props.errorColor};
padding: 8px;
margin-bottom: 8px;
max-width: calc(100% - 8px) !important;
[class*='StyledMessage']:empty {
display: none;
}
.pg-select-wrapper,
.datepicker-widget,
.url-widget-wrapper,
.ccbcid-widget-wrapper {
background-color: white !important;
max-width: calc(340px - 8px) !important;
}
[class*='StyledMessage']:empty {
display: none;
}
`}
`;

const StyledHelp = styled(Help)`
Expand Down Expand Up @@ -80,22 +89,21 @@ const ProjectFieldTemplate: React.FC<FieldTemplateProps> = ({
const { errorColor, __errors: formContextErrors } =
formContext?.errors?.[fieldName] || {};
const hasFormContextError = formContextErrors?.length > 0;
const showError = hasFormContextError && showErrorHint;

return (
<>
{!hidden && (
<StyledContainer>
{uiTitle && <StyledH4>{uiTitle}</StyledH4>}
{showErrorHint && hasFormContextError ? (
<ErrorWrapper errorColor={errorColor}>
<div>{children}</div>
<StyledInputWrapper errorColor={errorColor} hasError={showError}>
<div>{children}</div>
{showError && (
<Tooltip title={formContextErrors?.join()}>
<StyledHelp />
</Tooltip>
</ErrorWrapper>
) : (
children
)}
)}
</StyledInputWrapper>
</StyledContainer>
)}
</>
Expand Down
18 changes: 9 additions & 9 deletions app/components/Review/Components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,22 @@ export const StyledColLeft = styled('th')`
vertical-align: top;
`;

export const StyledColRight = styled('td')`
interface StyledColRightProps {
errorColor?: string;
hasError?: boolean;
}

export const StyledColRight = styled('td')<StyledColRightProps>`
width: 50%;
padding: 16px !important;
border: 1px solid rgba(0, 0, 0, 0.16);
border-right: 0;
font-weight: 400;
white-space: pre-line;
`;

interface StyledColErrorProps {
errorColor?: string;
}

export const StyledColError = styled(StyledColRight)<StyledColErrorProps>`
background-color: ${(props) =>
props?.errorColor ? props.errorColor : props.theme.color.errorBackground};
props.hasError &&
(props?.errorColor ? props.errorColor : props.theme.color.errorBackground)};
.pg-select-wrapper {
background-color: white !important;
}
Expand Down
4 changes: 2 additions & 2 deletions app/components/Review/fields/ArrayBooleanField.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FieldProps, RJSFSchema } from '@rjsf/utils';
import React from 'react';
import { StyledColLeft, StyledColRight, StyledColError } from '../Components';
import { StyledColLeft, StyledColRight } from '../Components';

/**
Field to display a list of yes/no values instead of the enum for array type fields
Expand All @@ -23,7 +23,7 @@ const ArrayBooleanField: React.FC<FieldProps> = ({
<tr key={item}>
<StyledColLeft id={id}>{item}</StyledColLeft>
{isError ? (
<StyledColError id={`${id}-error`} />
<StyledColRight id={`${id}-error`} hasError />
) : (
<StyledColRight id={`${id}-value`}>
{isValueTrue ? 'Yes' : 'No'}
Expand Down
8 changes: 2 additions & 6 deletions app/components/Review/fields/ReviewCheckboxField.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import React from 'react';
import { FieldProps } from '@rjsf/utils';
import {
StyledColLeft,
StyledColRight,
StyledColError,
} from 'components/Review/Components';
import { StyledColLeft, StyledColRight } from 'components/Review/Components';

const ReviewCheckboxField: React.FC<FieldProps> = ({
id,
Expand All @@ -22,7 +18,7 @@ const ReviewCheckboxField: React.FC<FieldProps> = ({
{isChecked ? (
<StyledColRight id={`${id}-value`}>Yes</StyledColRight>
) : (
<StyledColError id={`${id}-error`} />
<StyledColRight id={`${id}-error`} hasError />
)}
</>
) : (
Expand Down
47 changes: 21 additions & 26 deletions app/components/Review/fields/ReviewFieldTemplate.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { FieldTemplateProps } from '@rjsf/utils';
import React from 'react';
import {
StyledColLeft,
StyledColRight,
StyledColError,
} from 'components/Review/Components';
import { StyledColLeft, StyledColRight } from 'components/Review/Components';
import { Help } from '@mui/icons-material';
import styled from 'styled-components';
import { Tooltip } from '@mui/material';
Expand Down Expand Up @@ -58,33 +54,32 @@ const ReviewFieldTemplate: React.FC<FieldTemplateProps> = ({
const isFieldInRfi = formContext?.rfiList?.some((rfi) =>
Object.keys(rfi?.jsonData?.rfiAdditionalFiles || []).includes(fieldName)
);
const hasError = isErrors && !isFieldInRfi;

return (
<>
{before}
<tr>
<StyledColLeft id={`${id}_title`}>{title}</StyledColLeft>
{isErrors && !isFieldInRfi ? (
<StyledColError data-testid={`${id}-value`} errorColor={errorColor}>
{children}
{showErrorHint && hasFormContextError && (
<Tooltip
title={
<span style={{ whiteSpace: 'pre-line' }}>
{formContextErrors.join('\n')}
</span>
}
placement="top"
>
<StyledHelp />
</Tooltip>
)}
</StyledColError>
) : (
<StyledColRight data-testid={`${id}-value`}>
{children}
</StyledColRight>
)}
<StyledColRight
data-testid={`${id}-value`}
hasError={hasError}
errorColor={errorColor}
>
{children}
{hasError && showErrorHint && hasFormContextError && (
<Tooltip
title={
<span style={{ whiteSpace: 'pre-line' }}>
{formContextErrors.join('\n')}
</span>
}
placement="top"
>
<StyledHelp />
</Tooltip>
)}
</StyledColRight>
</tr>
{after}
</>
Expand Down
Loading

0 comments on commit 6602b66

Please sign in to comment.