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

Feat/opening search #365

Merged
merged 61 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
95271bf
added the SilviculturePage and the Openings blank tab
jazzgrewal Aug 13, 2024
6fbf88e
added the search filter bar
jazzgrewal Aug 20, 2024
e704aff
added the table toolbar for search table
jazzgrewal Aug 22, 2024
9d7499b
added the toggle feature to OpenignsSearchtab
jazzgrewal Aug 23, 2024
70b15dd
keeping the Advanced Filters persistent after show/shide
jazzgrewal Aug 28, 2024
07a7c8f
integrated the filtersCount pill
jazzgrewal Aug 28, 2024
297bc89
SearchFilter Bar integration
jazzgrewal Aug 29, 2024
453b71c
troubleshooting the duplicate row behaviour in table
jazzgrewal Sep 4, 2024
a7608b2
added map option and removed datatable from the searchScreen data
jazzgrewal Sep 4, 2024
1bda4fe
removed console logs
jazzgrewal Sep 5, 2024
76fea2b
Merge branch 'main' of github.com:bcgov/nr-silva into feat/openingSearch
jazzgrewal Sep 5, 2024
772fccd
Merge branch 'main' into feat/openingSearch
jazzgrewal Sep 5, 2024
d1a4117
Merge branch 'feat/openingSearch' of github.com:bcgov/nr-silva into f…
jazzgrewal Sep 5, 2024
595652d
installed leaflet
jazzgrewal Sep 5, 2024
c127425
fixed the dark mode for the Advanced Search
jazzgrewal Sep 5, 2024
58a0f8f
added the searchProvider to handle filters state
jazzgrewal Sep 6, 2024
72a6376
added the individually clearing filters logic
jazzgrewal Sep 6, 2024
e4e9b22
made the pagination work fro mthe frontend and call the database
jazzgrewal Sep 11, 2024
94a60c5
organised the Openings Search related components into one folder
jazzgrewal Sep 11, 2024
0c64fa5
changed URL for search screen
jazzgrewal Sep 12, 2024
f730719
Merge branch 'main' of github.com:bcgov/nr-silva into feat/openingSearch
jazzgrewal Sep 12, 2024
42e352b
made the OpeningsSearchTab more Mobile responsive
jazzgrewal Sep 13, 2024
4baaa9d
fixed the fileId . to forestFileId, and the Org selecetor clint codes
jazzgrewal Sep 13, 2024
e75e733
tweaked the clientStatusCode for fetching the Org List properly
jazzgrewal Sep 16, 2024
9bf92e0
changed the rogUnit and the status values in the table and commited c…
jazzgrewal Sep 16, 2024
fa418d4
fixed the more options by autoAlign
jazzgrewal Sep 16, 2024
f1f72a4
completed changes proposed by Ricardo
jazzgrewal Sep 16, 2024
9eb433c
fixed the width of the Overflowmenu in thee search table
jazzgrewal Sep 17, 2024
07ac015
completed adding the Edit Column feature
jazzgrewal Sep 18, 2024
e18a8db
Merge branch 'main' of github.com:bcgov/nr-silva into feat/openingSearch
jazzgrewal Sep 18, 2024
7159805
added the download CSV,XLS and pdf option without success prompts
jazzgrewal Sep 18, 2024
ef9177d
corrected the selected key issue in previous build
jazzgrewal Sep 18, 2024
4af64e7
donwload individual openings
jazzgrewal Sep 19, 2024
f1e114b
Merge branch 'main' of github.com:bcgov/nr-silva into feat/openingSearch
jazzgrewal Sep 24, 2024
e9b4781
removed the actions column from the downloads
jazzgrewal Sep 24, 2024
959ded1
added the checkbox feature for selecting rows
jazzgrewal Sep 24, 2024
90950f5
added the favourite opening feature
jazzgrewal Sep 25, 2024
e588b35
added the build failure fix
jazzgrewal Sep 25, 2024
467dd9e
added the build failure fix
jazzgrewal Sep 25, 2024
64a43e2
added the search stabaling feature
jazzgrewal Sep 25, 2024
1b2ed4a
updating the per page limits
jazzgrewal Sep 27, 2024
14e67ac
updating the saved search changes when navigate to different screen
jazzgrewal Sep 27, 2024
868b9d1
set the backend url to locahost
jazzgrewal Sep 27, 2024
93d3454
synced the package files
jazzgrewal Sep 27, 2024
fdea311
Merge branch 'main' into feat/openingSearch
jazzgrewal Oct 1, 2024
30a5331
added the Date Type field
jazzgrewal Oct 1, 2024
ee63e15
fixed the dateInput issue
jazzgrewal Oct 1, 2024
8b8a077
fixed the dark mode for the org selection
jazzgrewal Oct 1, 2024
36ab18c
added the dateType mock
jazzgrewal Oct 1, 2024
c0c8643
Merge branch 'main' of github.com:bcgov/nr-silva into feat/openingSearch
jazzgrewal Oct 2, 2024
0e2b260
updated the broken link to Silviculture search screen
jazzgrewal Oct 2, 2024
355653f
corrected the status filters
jazzgrewal Oct 7, 2024
48e5867
Merge branch 'main' into feat/openingSearch
jazzgrewal Oct 7, 2024
199bb43
arranged the filters according to the new design
jazzgrewal Oct 8, 2024
e17ffbc
Merge branch 'main' into feat/openingSearch
jazzgrewal Oct 8, 2024
abf7303
multiple status filter working
jazzgrewal Oct 8, 2024
2b15c31
added al filters to work
jazzgrewal Oct 8, 2024
bd09ec7
removed the excel for vulnerability issues
jazzgrewal Oct 8, 2024
a29c1bd
made the download xlsx same as csv
jazzgrewal Oct 8, 2024
2c5df01
did some basic liniting and docker compose fix
jazzgrewal Oct 8, 2024
7dbf2ca
Merge branch 'main' into feat/openingSearch
jazzgrewal Oct 8, 2024
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
249 changes: 233 additions & 16 deletions frontend/package-lock.json

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@
"amazon-cognito-identity-js": "^6.3.13",
"aws-amplify": "^6.5.0",
"axios": "^1.6.8",
"jspdf": "^2.5.2",
"jspdf-autotable": "^3.8.3",
"leaflet": "^1.9.4",
"lottie-react": "^2.4.0",
"qs": "^6.13.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-esri-leaflet": "^2.0.1",
Expand All @@ -31,6 +34,7 @@
"vite": "^5.0.0",
"vite-plugin-svgr": "^4.0.0",
"vite-tsconfig-paths": "^5.0.0",
"web-vitals": "^4.0.0",
"yaml": "^2.3.2"
},
"scripts": {
Expand Down Expand Up @@ -60,7 +64,9 @@
"@testing-library/react": "^16.0.0",
"@testing-library/user-event": "^14.5.2",
"@types/jest": "^29.5.12",
"@types/jspdf": "^2.0.0",
"@types/leaflet": "^1.9.12",
"@types/qs": "^6.9.16",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^6.5.0",
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import PostLoginRoute from './routes/PostLoginRoute';
import ProtectedRoute from './routes/ProtectedRoute';
import Opening from './screens/Opening';
import DashboardRedirect from './screens/DashboardRedirect';
import SilvicultureSearch from './screens/SilvicultureSearch';

Amplify.configure(amplifyconfig);

Expand All @@ -32,6 +33,11 @@ const App: React.FC = () => {
<SideLayout pageContent={<Opening/>} />
</ProtectedRoute>
} />
<Route path="/silviculture-search" element={
<ProtectedRoute>
<SideLayout pageContent={<SilvicultureSearch/>} />
</ProtectedRoute>
} />
<Route path="/opening/reports" element={
<ProtectedRoute>
<SideLayout pageContent={<Reports/>} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const rows: RecentOpening[] = [{
}];

const headers = [{ key: 'openingId', header: 'Opening Id', },
{ key: 'fileId', header: 'File Id', },
{ key: 'forestFileId', header: 'File Id', },
{ key: 'cuttingPermit', header: 'Cutting permit', },
{ key: 'timberMark', header: 'Timber mark', },
{ key: 'cutBlock', header: 'Cut block', },
Expand All @@ -42,6 +42,8 @@ const paginationValueMock = {
handlePageChange: vi.fn(),
handleItemsPerPageChange: vi.fn(),
itemsPerPage: 5,
totalResultItems:100,
setTotalResultItems:vi.fn(),
setPageData: vi.fn(),
setInitialItemsPerPage: vi.fn(),
};
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/BCHeaderwSide/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const mainActivitiesItems: LeftMenu[] = [
},
{
name: 'Silviculture search',
link: '/opening/silviculture',
link: '/silviculture-search',
disabled: false
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
padding: 0rem;
}

.bx--list-box__label {
.#{vars.$bcgov-prefix}--list-box__label {
jazzgrewal marked this conversation as resolved.
Show resolved Hide resolved
color: var(--#{vars.$bcgov-prefix}-text-secondary);
}
1 change: 1 addition & 0 deletions frontend/src/components/EmptySection/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
font-family: 'BC Sans', 'IBM Plex Sans', sans-serif;
font-style: normal;
padding-bottom: 0.5rem;
max-width: 368px;
jazzgrewal marked this conversation as resolved.
Show resolved Hide resolved
}

.empty-section-title {
Expand Down
13 changes: 9 additions & 4 deletions frontend/src/components/MyRecentActions/filesData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,23 @@ export const rows: RecentAction[] = [
export const headers: ITableHeader[] = [
{
key: 'activityType',
header: 'Activity Type'
header: 'Activity Type',
selected: true
},
{
key: 'fileFormat',
header: 'File Format'
header: 'File Format',
selected: true
},
{
key: 'statusCode',
header: 'Status'
header: 'Status',
selected: true
},
{
key: 'lastUpdatedLabel',
header: 'Last Updated'
header: 'Last Updated',
selected: true
}
];

4 changes: 4 additions & 0 deletions frontend/src/components/MyRecentActions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,22 @@ const MyRecentActions: React.FC = () => {
{
key: 'activityType',
header: 'Activity Type',
selected: true
},
{
key: 'openingId',
header: 'Opening ID',
selected: true
},
{
key: 'statusCode',
header: 'Status',
selected: true
},
{
key: 'lastUpdatedLabel',
header: 'Last Updated',
selected: true
}
];

Expand Down
95 changes: 54 additions & 41 deletions frontend/src/components/OpeningMetricsTab/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react";
import React, { useRef, useEffect } from "react";
import './styles.scss';
import SectionTitle from "../SectionTitle";
import BarChartGrouped from "../BarChartGrouped";
Expand All @@ -8,48 +8,61 @@ import OpeningHistory from "../OpeningHistory";
import OpeningHistoryItems from "../../mock-data/OpeningHistoryItems";
import MyRecentActions from "../MyRecentActions";

const OpeningMetricsTab: React.FC = () => (
<>
<div className="container-fluid tab-padding">
<div className="title-container pb-32">
<SectionTitle title="Dashboard" subtitle="Manage and track silvicultural information about openings" />
</div>
<div className="row gy-4">
<div className="col-xxl-6">
<ChartContainer
title="Openings submission trends"
description="Check quantity and evolution of openings"
>
<BarChartGrouped />
</ChartContainer>
</div>
<div className="col-xxl-6">
<ChartContainer title="Track Openings" description="Follow your favourite openings">
<OpeningHistory
histories={OpeningHistoryItems}
/>
</ChartContainer>
</div>
<div className="col-xxl-6">
<ChartContainer
title="Free growing milestone declarations"
description="Check opening standards unit for inspections purposes"
>
<DoughnutChartView />
</ChartContainer>
const OpeningMetricsTab: React.FC = () => {
const trackOpeningRef = useRef<HTMLDivElement>(null);

// Optional: Scroll to "Track Openings" when this component mounts
useEffect(() => {
const params = new URLSearchParams(window.location.search);
const scrollToSection = params.get('scrollTo');

if (scrollToSection === 'trackOpenings' && trackOpeningRef.current) {
trackOpeningRef.current.scrollIntoView({ behavior: "smooth" });
}
}, []);

return (
<>
<div className="container-fluid tab-padding">
<div className="title-container pb-32">
<SectionTitle title="Dashboard" subtitle="Manage and track silvicultural information about openings" />
</div>
<div className="col-xxl-6">
<ChartContainer
title="My recent actions"
description="Check your recent requests and files"
>
<MyRecentActions />
</ChartContainer>
<div className="row gy-4">
<div className="col-xxl-6">
<ChartContainer
title="Openings submission trends"
description="Check quantity and evolution of openings"
>
<BarChartGrouped />
</ChartContainer>
</div>
<div className="col-xxl-6" ref={trackOpeningRef}> {/* Add ref here to scroll */}
<ChartContainer title="Track Openings" description="Follow your favourite openings">
<OpeningHistory
histories={OpeningHistoryItems}
/>
</ChartContainer>
</div>
<div className="col-xxl-6">
<ChartContainer
title="Free growing milestone declarations"
description="Check opening standards unit for inspections purposes"
>
<DoughnutChartView />
</ChartContainer>
</div>
<div className="col-xxl-6">
<ChartContainer
title="My recent actions"
description="Check your recent requests and files"
>
<MyRecentActions />
</ChartContainer>
</div>
</div>

</div>
</div>
</>
);
</>
);
};

export default OpeningMetricsTab;
3 changes: 3 additions & 0 deletions frontend/src/components/OpeningMetricsTab/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
.pb-32{
padding-bottom: 32px;
}
.p-32{
padding: 32px;
jazzgrewal marked this conversation as resolved.
Show resolved Hide resolved
}

@media only screen and (max-width: 671px) {
.favourite-activities {
Expand Down
33 changes: 22 additions & 11 deletions frontend/src/components/OpeningScreenDataTable/testData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,53 @@ import { ITableHeader } from "../../types/TableHeader";
export const headers: ITableHeader[] = [
{
key: 'openingId',
header: 'Opening Id'
header: 'Opening Id',
selected: false
},
{
key: 'fileId',
header: 'File Id'
key: 'forestFileId',
header: 'File Id',
selected: false
},
{
key: 'cuttingPermit',
header: 'Cutting permit'
header: 'Cutting permit',
selected: false
},
{
key: 'timberMark',
header: 'Timber mark'
header: 'Timber mark',
selected: false
},
{
key: 'cutBlock',
header: 'Cut block'
header: 'Cut block',
selected: false
},
{
key: 'grossAreaHa',
header: 'Gross area (ha)'
header: 'Gross area (ha)',
selected: false
},
{
key: 'status',
header: 'Status'
header: 'Status',
selected: false
},
{
key: 'category',
header: 'Category'
header: 'Category',
selected: false
},
{
key: 'disturbanceStart',
header: 'Disturbance start'
header: 'Disturbance start',
selected: false
},
{
key: 'actions',
header: 'Actions'
header: 'Actions',
selected: false
}
];

Loading
Loading