Skip to content

Commit

Permalink
Merge branch 'main' into NDT-472-Freeze-Dashboard-Column-names-to-top…
Browse files Browse the repository at this point in the history
…-of-page
  • Loading branch information
RRanath authored Aug 29, 2024
2 parents 5f1631b + 6c320df commit d1202e6
Show file tree
Hide file tree
Showing 75 changed files with 4,074 additions and 284 deletions.
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.6
uses: renovatebot/github-action@v40.2.7
with:
configurationFile: ./.github/renovate.json
token: ${{ secrets.RENOVATE_GITHUB_TOKEN }}
63 changes: 63 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,66 @@
## [1.186.3](https://github.com/bcgov/CONN-CCBC-portal/compare/v1.186.2...v1.186.3) (2024-08-28)

### Bug Fixes

- sa permission for communities source data ([cc1d2e3](https://github.com/bcgov/CONN-CCBC-portal/commit/cc1d2e3e17e82d7807d078d1895cbfdb36958f7c))

## [1.186.2](https://github.com/bcgov/CONN-CCBC-portal/compare/v1.186.1...v1.186.2) (2024-08-28)

### Bug Fixes

- cbc household count validation ([9c203db](https://github.com/bcgov/CONN-CCBC-portal/commit/9c203db6d2a4e6f2a40d3d785137f2c62a0abc98))

## [1.186.1](https://github.com/bcgov/CONN-CCBC-portal/compare/v1.186.0...v1.186.1) (2024-08-27)

### Bug Fixes

- analyst status to show in report correctly ([657bf9f](https://github.com/bcgov/CONN-CCBC-portal/commit/657bf9fc1818644ec2c8d409d8283bfa86b8aa2a))
- filtering for ccbc gcpe report ([dcd2b52](https://github.com/bcgov/CONN-CCBC-portal/commit/dcd2b52ea8f43a82a259cdbfa76cd7e87d05e03e))

# [1.186.0](https://github.com/bcgov/CONN-CCBC-portal/compare/v1.185.0...v1.186.0) (2024-08-27)

### Bug Fixes

- 500 error when visiting non-locations page ([b3a101c](https://github.com/bcgov/CONN-CCBC-portal/commit/b3a101c68f6ee5351f335e872b8583a8391dbce8))
- add permissions for executing function ([6defd8f](https://github.com/bcgov/CONN-CCBC-portal/commit/6defd8f09689bdf6f9cfc320294c2953ca70e182))
- cleanup of [section] to remove dataBySection ([35a85ee](https://github.com/bcgov/CONN-CCBC-portal/commit/35a85ee778573f92f526c8bff124c79abd40b43c))
- clear button and inputs show correct values at all times ([abd9f20](https://github.com/bcgov/CONN-CCBC-portal/commit/abd9f20a15b2d15564a114f13f18ac4faa8b8542))
- empty communities are not saved ([9c0c906](https://github.com/bcgov/CONN-CCBC-portal/commit/9c0c906e4b17c9e6e5105903bcfee4a74a7c0dc1))
- geographic name options are by economic region and regional district ([a1c6927](https://github.com/bcgov/CONN-CCBC-portal/commit/a1c6927b67f89e81683716e0de8a39a4b0fd080d))
- geographic name options are populated with only economic region ([40b9438](https://github.com/bcgov/CONN-CCBC-portal/commit/40b9438ef9793d5b83c178d9901e0eb587c8771d))
- update on save instead of after refresh ([56b42f2](https://github.com/bcgov/CONN-CCBC-portal/commit/56b42f246d06b423ad279333199115fcccec035a))
- user correct rowId ([378dcfc](https://github.com/bcgov/CONN-CCBC-portal/commit/378dcfcebef4b01a48e8da34ae92b03f3c2d3269))

### Features

- add and remove community source behaves as expected ([ce70b29](https://github.com/bcgov/CONN-CCBC-portal/commit/ce70b29e6f100032f9c92b6f8d7023d18d0e10a3))
- added community sources are read only ([39e3834](https://github.com/bcgov/CONN-CCBC-portal/commit/39e3834d2b75707dd0cdf0ebcc1379b3ede77869))
- community source data is now displayed properly ([b8e811e](https://github.com/bcgov/CONN-CCBC-portal/commit/b8e811e456700752e0d18c9ca18ea835915c790c))
- disable previously selected options ([7c810e3](https://github.com/bcgov/CONN-CCBC-portal/commit/7c810e3ace1a19e3da2217f28b9dd2a5dd3c0236))
- section community source data behaves similar to quick edit ([b9d8e7c](https://github.com/bcgov/CONN-CCBC-portal/commit/b9d8e7c96d348515f99a3b3b8644a3dad618fa6b))
- style buttons for add, remove, and clear ([35698ff](https://github.com/bcgov/CONN-CCBC-portal/commit/35698ff6ee1164d2a9e90828ce3d1a79193ecf24))

# [1.185.0](https://github.com/bcgov/CONN-CCBC-portal/compare/v1.184.2...v1.185.0) (2024-08-26)

### Features

- add indication to Template upload ([d880cec](https://github.com/bcgov/CONN-CCBC-portal/commit/d880cecf266e7881f2c37de471a2afbd5816421b))

## [1.184.2](https://github.com/bcgov/CONN-CCBC-portal/compare/v1.184.1...v1.184.2) (2024-08-26)

### Bug Fixes

- refine communities validation cbc ([33c40d5](https://github.com/bcgov/CONN-CCBC-portal/commit/33c40d575abfa58ca7bd77d7ff7fcc324a6b960b))

## [1.184.1](https://github.com/bcgov/CONN-CCBC-portal/compare/v1.184.0...v1.184.1) (2024-08-26)

# [1.184.0](https://github.com/bcgov/CONN-CCBC-portal/compare/v1.183.0...v1.184.0) (2024-08-26)

### Features

- ccbc summary page ([15b83b8](https://github.com/bcgov/CONN-CCBC-portal/commit/15b83b80048b07052e7697011e66fc22491ba7a6))
- summary highlight communities counts not matching in sow ([450d8b1](https://github.com/bcgov/CONN-CCBC-portal/commit/450d8b1a36d5a6c26be89f2a5f1361d1f1eda951))

# [1.183.0](https://github.com/bcgov/CONN-CCBC-portal/compare/v1.182.2...v1.183.0) (2024-08-22)

### Features
Expand Down
5 changes: 3 additions & 2 deletions app/backend/lib/reporting/gcpe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const getCbcDataQuery = `
const getCcbcQuery = `
query getCcbc {
allApplications(
filter: {status: {in: ["conditionally_approved", "approved", "on_hold", "closed", "recommendation", "complete"]}}
filter: {analystStatus: {in: ["conditionally_approved", "approved", "on_hold", "closed", "recommendation", "complete"]}}
) {
edges {
node {
Expand Down Expand Up @@ -119,6 +119,7 @@ const getCcbcQuery = `
package
projectName
status
analystStatus
intakeNumber
organizationName
}
Expand Down Expand Up @@ -337,7 +338,7 @@ const generateExcelData = async (
// federal funding source
{ value: 'ISED-UBF Core' },
// status
{ value: convertStatus(node?.status) },
{ value: convertStatus(node?.analystStatus) },
// project milestone complete percent
{
value:
Expand Down
6 changes: 4 additions & 2 deletions app/components/Analyst/CBC/CbcTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ import {
TextWidget,
DatePickerWidget,
} from 'lib/theme/widgets';
import ArrayLocationFieldTemplate from 'lib/theme/fields/ArrayLocationDataField';
import CommunitySourceWidget from 'lib/theme/widgets/custom/CommunitySourceWidget';
import ArrayBooleanField from '../../Review/fields/ArrayBooleanField';
import ReviewCheckboxField from '../../Review/fields/ReviewCheckboxField';
import ReviewInlineArrayField from '../../Review/fields/ReviewInlineArrayField';
import ReviewObjectFieldTemplate from '../../Review/ReviewObjectFieldTemplate';
import ReviewSectionField from '../../Review/ReviewSectionField';
import ReviewArrayFieldTemplate from '../../Review/fields/ReviewArrayFieldTemplate';
import ReviewFieldTemplate from '../../Review/fields/ReviewFieldTemplate';
import DefaultWidget from '../../Review/widgets/DefaultWidget';
import BooleanWidget from '../../Review/widgets/BooleanWidget';
Expand Down Expand Up @@ -47,12 +48,13 @@ const CbcTheme: ThemeProps = {
NumberWidget,
NumericStringWidget,
ReadOnlyWidget: DefaultWidget,
CommunitySourceWidget,
},
templates: {
...templates,
ObjectFieldTemplate: ReviewObjectFieldTemplate,
FieldTemplate: ReviewFieldTemplate,
ArrayFieldTemplate: ReviewArrayFieldTemplate,
ArrayFieldTemplate: ArrayLocationFieldTemplate,
},
};

Expand Down
7 changes: 7 additions & 0 deletions app/components/Analyst/NavigationSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
faClipboardList,
faClockRotateLeft,
faEnvelope,
faNoteSticky,
} from '@fortawesome/free-solid-svg-icons';
import NavItem from './NavItem';

Expand Down Expand Up @@ -47,6 +48,12 @@ const NavigationSidebar = () => {
/>
</StyledUpperSection>
<section>
<NavItem
currentPath={asPath}
href={`/analyst/application/${applicationId}/summary`}
icon={faNoteSticky}
label="Summary"
/>
<NavItem
currentPath={asPath}
href={`/analyst/application/${applicationId}`}
Expand Down
2 changes: 2 additions & 0 deletions app/components/Analyst/Project/ProjectTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import ArrayFieldTemplate from 'lib/theme/fields/ArrayFieldTemplate';
import * as widgets from 'lib/theme/widgets';
import ReadOnlyWidget from 'components/Analyst/Project/ConditionalApproval/widgets/ReadOnlyWidget';
import ExcelImportFileWidget from 'components/Analyst/Project/ProjectInformation/widgets/ExcelImportFileWidget';
import CommunitySourceWidget from 'lib/theme/widgets/custom/CommunitySourceWidget';
import { StatusSelectWidget } from './ConditionalApproval/widgets';
import ProjectFieldTemplate from './fields/ProjectFieldTemplate';
import ProjectObjectFieldTemplate from './fields/ProjectObjectFieldTemplate';
Expand Down Expand Up @@ -30,6 +31,7 @@ const ProjectTheme: ThemeProps = {
CcbcIdWidget,
HiddenWidget,
ContextErrorWidget,
CommunitySourceWidget,
},
templates: {
...templates,
Expand Down
52 changes: 51 additions & 1 deletion app/components/Analyst/Project/fields/ProjectFieldTemplate.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import React from 'react';
import { Help } from '@mui/icons-material';
import { Tooltip } from '@mui/material';
import { FieldTemplateProps } from '@rjsf/utils';
import styled from 'styled-components';

Expand Down Expand Up @@ -31,21 +34,68 @@ 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;
.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)`
color: ${(props) => props.theme.color.primaryBlue};
cursor: pointer;
position: absolute;
right: 8px;
top: 50%;
transform: translateY(-50%);
`;

const ProjectFieldTemplate: React.FC<FieldTemplateProps> = ({
children,
uiSchema,
formContext,
id,
}) => {
const uiTitle =
uiSchema?.['ui:label'] || uiSchema?.['ui:title']
? `${uiSchema?.['ui:label'] ?? uiSchema?.['ui:title']}`
: null;
const fieldName = id?.split('_')?.[1];
const hidden = uiSchema?.['ui:widget'] === 'HiddenWidget' || false;

const showErrorHint = formContext?.showErrorHint ?? false;
const { errorColor, __errors: formContextErrors } =
formContext?.errors?.[fieldName] || {};
const hasFormContextError = formContextErrors?.length > 0;

return (
<>
{!hidden && (
<StyledContainer>
{uiTitle && <StyledH4>{uiTitle}</StyledH4>}
{children}
{showErrorHint && hasFormContextError ? (
<ErrorWrapper errorColor={errorColor}>
<div>{children}</div>
<Tooltip title={formContextErrors?.join()}>
<StyledHelp />
</Tooltip>
</ErrorWrapper>
) : (
children
)}
</StyledContainer>
)}
</>
Expand Down
5 changes: 5 additions & 0 deletions app/components/Analyst/RFI/ListFilesWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import styled from 'styled-components';
import { useRouter } from 'next/router';
import { useFeature } from '@growthbook/growthbook-react';
import { AddButton } from '../Project';
import TemplateDescription from './TemplateDescription';

const StyledContainer = styled.div`
margin-bottom: 24px;
Expand Down Expand Up @@ -40,10 +41,13 @@ const ListFilesWidget: React.FC<WidgetProps> = ({
formContext,
label,
value,
uiSchema,
}) => {
const showRfiUpload = useFeature('show_analyst_rfi_upload').value;
const router = useRouter();
const isFiles = value?.length > 0;
const templateNumber =
(uiSchema['ui:options']?.templateNumber as number) ?? null;

const handleDownload = async (uuid: string, fileName: string) => {
const url = `/api/s3/download/${uuid}/${fileName}`;
Expand Down Expand Up @@ -86,6 +90,7 @@ const ListFilesWidget: React.FC<WidgetProps> = ({
}}
/>
)}
<TemplateDescription templateNumber={templateNumber} />
</StyledContainer>
);
};
Expand Down
49 changes: 49 additions & 0 deletions app/components/Analyst/RFI/TemplateDescription.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { Link } from '@button-inc/bcgov-theme';
import { useRouter } from 'next/router';
import styled from 'styled-components';

const HintText = styled.p`
color: ${(props) => props.theme.color.darkGrey};
font-style: italic;
font-size: 13px;
a {
color: ${(props) => props.theme.color.links};
font-size: 13px;
&:hover {
text-decoration: underline;
}
}
`;

interface Props {
templateNumber: number;
}

const TemplateDescription: React.FC<Props> = ({ templateNumber }) => {
const applicationId = useRouter().query.applicationId as string;
if (!templateNumber) return null;
const link = (
<Link
href={`/analyst/application/${applicationId}?section=${templateNumber === 1 ? 'benefits' : 'budgetDetails'}`}
passHref
>
{templateNumber === 1 ? 'Benefits' : 'Budget Details'}
</Link>
);

return (
(templateNumber === 1 || templateNumber === 2) && (
<HintText>
* RFI upload for Template {templateNumber} automatically updates the
data for{' '}
{templateNumber === 1
? 'Final Eligible Households and Indigenous'
: 'Total Eligible Costs and Total Project Costs'}{' '}
in the {link} section. Please verify the changes on the application
page.*
</HintText>
)
);
};

export default TemplateDescription;
2 changes: 1 addition & 1 deletion app/components/AnalystDashboard/AllDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const CcbcIdCell = ({ cell }) => {
<>
{linkCbc ? (
<StyledLink
href={`/analyst/${isCbcProject ? 'cbc' : 'application'}/${applicationId}`}
href={`/analyst/${isCbcProject ? 'cbc' : 'application'}/${applicationId}${isCbcProject ? '' : '/summary'}`}
>
{cell.getValue()}
</StyledLink>
Expand Down
19 changes: 17 additions & 2 deletions app/components/Review/Accordion.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useEffect, useState } from 'react';
import { useEffect, useState, useRef } from 'react';
import { useRouter } from 'next/router';
import { BaseAccordion } from '@button-inc/bcgov-theme/Accordion';
import styled from 'styled-components';
Expand Down Expand Up @@ -76,13 +76,16 @@ const Accordion = ({
toggled,
title,
recordLocked,
focused,
...rest
}: any) => {
const [isToggled, setIsToggled] = useState(
getToggledState(toggled, defaultToggled)
);
const router = useRouter();
const applicationId = router.query.applicationId as string;
const accordionRef = useRef(null);

const handleToggle = (event) => {
setIsToggled((toggle) => !toggle);
if (onToggle) onToggle(event);
Expand All @@ -96,9 +99,21 @@ const Accordion = ({
setIsToggled(getToggledState(toggled, defaultToggled));
}, [toggled, defaultToggled]);

useEffect(() => {
if (focused && accordionRef.current) {
window.scrollTo({
top:
accordionRef.current.getBoundingClientRect().top +
window.scrollY -
100, // Adjust offset to account for header
behavior: 'smooth',
});
}
}, [focused]);

return (
<StyledBaseAccordion {...rest} onToggle={handleToggle}>
<header>
<header ref={accordionRef}>
<h2>{title}</h2>
<StyledToggleRight>
{allowAnalystEdit &&
Expand Down
3 changes: 3 additions & 0 deletions app/components/Review/Components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,7 @@ interface StyledColErrorProps {
export const StyledColError = styled(StyledColRight)<StyledColErrorProps>`
background-color: ${(props) =>
props?.errorColor ? props.errorColor : props.theme.color.errorBackground};
.pg-select-wrapper {
background-color: white !important;
}
`;
Loading

0 comments on commit d1202e6

Please sign in to comment.