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

chore(SILVA-403): code refactor #444

Merged
merged 76 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
09f5a41
chore(deps): code refactor
paulushcgcj Oct 28, 2024
5ceb7e6
chore(deps): removing swagger
paulushcgcj Oct 28, 2024
4d36f7c
chore: changing annoying checkstyle config
paulushcgcj Oct 28, 2024
aa4746a
chore: fixing test
paulushcgcj Oct 28, 2024
3cb574a
chore(test): updating test related config and data
paulushcgcj Oct 28, 2024
acca0f9
ci: updating sonar and jacoco exclusions
paulushcgcj Oct 28, 2024
22f1105
test: adding jwt mock
paulushcgcj Oct 28, 2024
7e9c1c8
chore: updating timestamp util and test
paulushcgcj Oct 28, 2024
3b93d13
chore: simplified code and updated tests
paulushcgcj Oct 28, 2024
f2ffa55
chore: renamed test and added display name
paulushcgcj Oct 28, 2024
ea70089
chore: package and class rename
paulushcgcj Oct 28, 2024
6dba48e
chore: simplifying database connection
paulushcgcj Oct 28, 2024
c4da7a6
chore: simplifying database connection
paulushcgcj Oct 28, 2024
7f1f93d
Merge branch 'main' into feat/SILVA-514
paulushcgcj Oct 28, 2024
3ec7991
feat(SILVA-514): adding backend api for favorites
paulushcgcj Oct 28, 2024
dcea8aa
Merge branch 'main' into feat/SILVA-514
paulushcgcj Oct 29, 2024
037aed9
Merge branch 'main' into feat/SILVA-514
paulushcgcj Oct 29, 2024
8dd24a2
chore: fixing entity by adding the schemas
paulushcgcj Oct 29, 2024
2e18902
Merge branch 'main' into feat/SILVA-514
paulushcgcj Oct 30, 2024
209529f
Merge branch 'main' into feat/SILVA-514
paulushcgcj Oct 30, 2024
8b50df3
Merge branch 'main' into feat/SILVA-514
paulushcgcj Nov 4, 2024
ce66764
test: fixing backend tests
paulushcgcj Nov 4, 2024
3f5bd9d
chore: changing backend imports and logs
paulushcgcj Nov 4, 2024
dd20681
feat: added fav/trends request to backend
paulushcgcj Nov 4, 2024
fe8585e
chore: extracted types from service
paulushcgcj Nov 4, 2024
53fbaaa
test: added test to OpeningService
paulushcgcj Nov 4, 2024
5e7e182
chore: changing type location
paulushcgcj Nov 4, 2024
05c8ddc
test: added test to OpeningHistory
paulushcgcj Nov 4, 2024
6fc8de7
test: updating tests due to code change
paulushcgcj Nov 4, 2024
7b4bd74
chore: changed log message
paulushcgcj Nov 4, 2024
eac2b6d
feat(SILVA-514): updated fav button to include callback
paulushcgcj Nov 4, 2024
bd27a18
chore: function renamed
paulushcgcj Nov 4, 2024
cd69169
feat(SILVA-514): updated OpeningHistory
paulushcgcj Nov 5, 2024
c062fdd
feat(SILVA-514): added the function to add to fav
paulushcgcj Nov 5, 2024
4a1bbae
chore: addressing sonar issues
paulushcgcj Nov 5, 2024
03deefa
fix: fixing opening id value
paulushcgcj Nov 5, 2024
22ed6cb
fix: fixing an issue with request timeout
paulushcgcj Nov 5, 2024
b984e1a
chore: removing duplicated import
paulushcgcj Nov 5, 2024
ab22c75
chore: fixing sonar issues
paulushcgcj Nov 6, 2024
b9da88d
test: adding more tests to Opening screen
paulushcgcj Nov 6, 2024
1327314
Merge branch 'main' into feat/SILVA-514
paulushcgcj Nov 6, 2024
b85a826
test: adding OpeningMetricsTab test
paulushcgcj Nov 6, 2024
61afaa3
test: fixing tests
paulushcgcj Nov 6, 2024
ee15006
chore: removing only
paulushcgcj Nov 6, 2024
b154780
chore(SILVA-403): making toast notification more useful
paulushcgcj Nov 6, 2024
74be87f
Merge branch 'main' into fix/SILVA-403
paulushcgcj Nov 6, 2024
dedb36f
Merge branch 'main' into fix/SILVA-403
paulushcgcj Nov 6, 2024
34ef5f4
chore: code fix
paulushcgcj Nov 6, 2024
7f93a44
Merge branch 'main' into fix/SILVA-403
paulushcgcj Nov 7, 2024
895f039
fix: fixed missing load when removing favorites
paulushcgcj Nov 7, 2024
069b3b0
test: fixing OpeningHistoryTest
paulushcgcj Nov 7, 2024
5202413
chore: fixing sonar issues
paulushcgcj Nov 7, 2024
ea31752
chore: fixing sonar issues
paulushcgcj Nov 7, 2024
9947704
chore: fixing sonar issues
paulushcgcj Nov 7, 2024
bcfc6de
chore: removing reducer
paulushcgcj Nov 7, 2024
d433346
chore: removing redux dependencies
paulushcgcj Nov 7, 2024
62aefea
chore: removing redux spillouts
paulushcgcj Nov 7, 2024
4ad00e0
chore: removing unused file
paulushcgcj Nov 7, 2024
33db56f
chore: fixing sonar isues
paulushcgcj Nov 7, 2024
784d370
chore: removing actions
paulushcgcj Nov 7, 2024
5817fec
chore: removing help screen
paulushcgcj Nov 7, 2024
0a72bfd
chore: route cleanup
paulushcgcj Nov 7, 2024
85a7a5b
chore: sonar cleanup
paulushcgcj Nov 7, 2024
af59cff
chore: removing test for deleted files
paulushcgcj Nov 7, 2024
9a7fda0
chore: fixing sonar issues
paulushcgcj Nov 7, 2024
6e1bce6
chore: disabling unused tabs
paulushcgcj Nov 7, 2024
58a1a6a
chore: fixing sonar issues
paulushcgcj Nov 7, 2024
b7eb156
chore(ci): configuring sonar exclusion
paulushcgcj Nov 7, 2024
6f19481
chore: removing useles prop param
paulushcgcj Nov 7, 2024
9e846ed
chore: sonar fixes
paulushcgcj Nov 7, 2024
4815d57
chore: fixing sonar and build issues
paulushcgcj Nov 7, 2024
65f545d
chore: initial OpeningTabs test
paulushcgcj Nov 7, 2024
635db81
test: added ThemeToggle test
paulushcgcj Nov 7, 2024
e563ad5
chore: removing unused component
paulushcgcj Nov 7, 2024
7462014
chore: sonar issues fixed
paulushcgcj Nov 7, 2024
1704b83
Merge branch 'main' into fix/SILVA-403
paulushcgcj Nov 7, 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
2 changes: 1 addition & 1 deletion .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
-Dsonar.javascript.lcov.reportPaths=coverage/lcov.info
-Dsonar.typescript.tsconfigPaths=tsconfig.json
-Dsonar.sources=src/
-Dsonar.exclusions=src/__test__/**
-Dsonar.exclusions=src/__test__/**,src/amplifyconfiguration.*,src/**/*.scss,src/**/*.css,src/**/*.d.*,src/setupTests.*
-Dsonar.tests=src/__test__/
-Dsonar.project.monorepo.enabled=true
sonar_token: ${{ secrets.SONAR_TOKEN_FRONTEND }}
Expand Down
76 changes: 3 additions & 73 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@
"@carbon/icons-react": "^11.50.1",
"@carbon/pictograms-react": "^11.49.0",
"@carbon/react": "^1.27.0",
"@redux-devtools/extension": "^3.3.0",
"@tanstack/react-query": "^5.50.1",
"@types/node": "^22.0.0",
"@vitejs/plugin-react": "^4.0.4",
"@vitejs/plugin-react-swc": "^3.3.2",
"@vitejs/plugin-react-swc": "^3.3.2",
"aws-amplify": "^6.7.0",
"axios": "^1.6.8",
"jspdf": "^2.5.2",
Expand All @@ -26,10 +25,7 @@
"react-esri-leaflet": "^2.0.1",
"react-hash-string": "^1.0.0",
"react-leaflet": "^4.2.1",
"react-redux": "^9.0.0",
"react-router-dom": "^6.10.0",
"redux": "^5.0.0",
"redux-thunk": "^3.0.0",
"vite": "^5.0.0",
"vite-plugin-svgr": "^4.0.0",
"vite-tsconfig-paths": "^5.0.0",
Expand Down
10 changes: 0 additions & 10 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { createBrowserRouter, RouterProvider } from 'react-router-dom';
import './custom.scss';
import Landing from "./screens/Landing";
import Help from "./screens/Help";
import Reports from './screens/Reports';
import SideLayout from './layouts/SideLayout';
import ProtectedRoute from './routes/ProtectedRoute';
import Opening from './screens/Opening';
Expand Down Expand Up @@ -34,14 +32,6 @@ const router = createBrowserRouter([
{
path: "/silviculture-search",
element: <SideLayout pageContent={<SilvicultureSearch />} />
},
{
path: "/opening/reports",
element: <SideLayout pageContent={<Reports />} />
},
{
path: "/help",
element: <SideLayout pageContent={<Help />} />
}
]
},
Expand Down
86 changes: 0 additions & 86 deletions frontend/src/__test__/actions/userAction.test.ts

This file was deleted.

22 changes: 4 additions & 18 deletions frontend/src/__test__/components/BCHeaderwSide.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ import { BrowserRouter } from 'react-router-dom';
import BCHeaderwSide from '../../components/BCHeaderwSide';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import {leftMenu } from '../../components/BCHeaderwSide/constants';
import * as redux from 'react-redux';
import { Provider } from 'react-redux';
import store from '../../store';
import { UserClientRolesType } from '../../types/UserRoleType';
import '@testing-library/jest-dom';
import { AuthProvider } from '../../contexts/AuthProvider';
Expand All @@ -31,12 +28,10 @@ const renderComponent = () => {

render(
<AuthProvider>
<QueryClientProvider client={qc}>
<Provider store={store}>
<BrowserRouter>
<BCHeaderwSide />
</BrowserRouter>
</Provider>
<QueryClientProvider client={qc}>
<BrowserRouter>
<BCHeaderwSide />
</BrowserRouter>
</QueryClientProvider>
</AuthProvider>
);
Expand Down Expand Up @@ -65,9 +60,6 @@ const state = {
},
};

vi.spyOn(redux, 'useSelector')
.mockImplementation((callback) => callback(state));

describe('BCHeaderwSide', () => {
it('should renders the component', () => {
renderComponent();
Expand All @@ -88,12 +80,6 @@ describe('BCHeaderwSide', () => {
// expect(screen.queryByText('My Profile')).not.toBeVisible();
});

// it('renders the correct number of top-level menu items', () => {
// renderComponent();
// const menuItems = screen.getAllByRole('button', { name: /.*Category.*/ });
// expect(menuItems).toHaveLength(leftMenu.length);
// });

it('renders the correct menu item names', () => {
renderComponent();
leftMenu.forEach(item => {
Expand Down
Loading
Loading