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

NERT-314 auth project new view UI part 1, other minor changes #81

Merged
merged 3 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion app/.pipeline/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const phases = {
suffix: `-dev-${deployChangeId}`,
instance: `${name}-dev-${deployChangeId}`,
version: `${deployChangeId}-${changeId}`,
tag: `dev-${version}-${deployChangeId}`,
tag: `dev-${version}`,
host: (isStaticDeployment && staticUrls.dev) || `${name}-${changeId}-d83219-dev.apps.silver.devops.gov.bc.ca`,
apiHost:
(isStaticDeployment && staticUrlsAPI.dev) || `${apiName}-${changeId}-d83219-dev.apps.silver.devops.gov.bc.ca`,
Expand Down
8 changes: 2 additions & 6 deletions app/src/components/layout/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,9 @@ const pageStyles = {

const Header: React.FC = () => {
const config = useContext(ConfigContext);
console.log(config);

const mmm = config?.VERSION ? config.VERSION.split('-')[1] : '0.0.0';
const nert_version = config?.CHANGE_VERSION
? mmm
? `${mmm}.${config.CHANGE_VERSION}`
: `0.0.0.${config.CHANGE_VERSION}`
: '0.0.0.NA';
const nert_version = mmm ?? '0.0.0.NA';
const nert_environment = config?.REACT_APP_NODE_ENV || 'undefined';

const { keycloakWrapper } = useContext(AuthStateContext);
Expand Down
2 changes: 1 addition & 1 deletion app/src/components/map/MapContainer.test.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { cleanup, render } from '@testing-library/react';
import bbox from '@turf/bbox';
import React from 'react';
import MapContainer from './MapContainer';
import { IMarker } from './components/MarkerCluster';
import { IStaticLayer } from './components/StaticLayers';
import MapContainer from './MapContainer';

describe('MapContainer', () => {
afterEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion app/src/components/map/MapContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Feature } from 'geojson';
import L, { LeafletEventHandlerFnMap } from 'leaflet';
import 'leaflet-draw/dist/leaflet.draw.css';
import 'leaflet-fullscreen/dist/Leaflet.fullscreen.js';
import 'leaflet-fullscreen/dist/leaflet.fullscreen.css';
import 'leaflet-fullscreen/dist/Leaflet.fullscreen.js';
import iconRetina from 'leaflet/dist/images/marker-icon-2x.png';
import icon from 'leaflet/dist/images/marker-icon.png';
import iconShadow from 'leaflet/dist/images/marker-shadow.png';
Expand Down
4 changes: 2 additions & 2 deletions app/src/components/map/MapContainer2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@

/* Add popup for the points */
map.on('click', 'markerProjects.points', (e: any) => {
const prop = e.features![0].properties;

Check warning on line 597 in app/src/components/map/MapContainer2.tsx

View workflow job for this annotation

GitHub Actions / Running Linter

Forbidden non-null assertion

const html = makePopup(prop.name, prop.id, true);

Expand All @@ -610,7 +610,7 @@

/* Add popup for the points */
map.on('click', 'markerPlans.points', (e: any) => {
const prop = e.features![0].properties;

Check warning on line 613 in app/src/components/map/MapContainer2.tsx

View workflow job for this annotation

GitHub Actions / Running Linter

Forbidden non-null assertion

// TBD: Currently the /plans route is not available
// const html = makePopup(prop.name, prop.id, false);
Expand Down Expand Up @@ -849,8 +849,8 @@
return plansVisible && !feature.properties.is_project
? feature
: projectsVisible && feature.properties.is_project
? feature
: null;
? feature

Check warning on line 852 in app/src/components/map/MapContainer2.tsx

View workflow job for this annotation

GitHub Actions / Running Linter

Insert `··`
: null;

Check warning on line 853 in app/src/components/map/MapContainer2.tsx

View workflow job for this annotation

GitHub Actions / Running Linter

Insert `··`
});
if (map.getSource('markers')) {
// @ts-ignore
Expand Down
2 changes: 1 addition & 1 deletion app/src/components/security/Guards.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { PROJECT_ROLE, SYSTEM_ROLE } from 'constants/roles';
import { AuthStateContext } from 'contexts/authStateContext';
import React, { PropsWithChildren, ReactElement, isValidElement, useContext } from 'react';
import React, { isValidElement, PropsWithChildren, ReactElement, useContext } from 'react';
import { useParams } from 'react-router-dom';
import { isAuthenticated } from 'utils/authUtils';

Expand Down
2 changes: 1 addition & 1 deletion app/src/contexts/dialogContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import IconButton from '@mui/material/IconButton';
import Snackbar from '@mui/material/Snackbar';
import { ErrorDialog, IErrorDialogProps } from 'components/dialog/ErrorDialog';
import YesNoDialog, { IYesNoDialogProps } from 'components/dialog/YesNoDialog';
import React, { ReactNode, createContext, useState } from 'react';
import React, { createContext, ReactNode, useState } from 'react';

export interface IDialogContext {
/**
Expand Down
2 changes: 1 addition & 1 deletion app/src/features/projects/Plans.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import PlanFilter, {
IPlanAdvancedFilters,
PlanAdvancedFiltersInitialValues
} from 'components/search-plan-filter/PlanFilter';
import { ICONS, focusOptions, planStatusOptions } from 'constants/misc';
import { focusOptions, ICONS, planStatusOptions } from 'constants/misc';
import { DialogContext } from 'contexts/dialogContext';
import { Formik, FormikProps } from 'formik';
import { APIError } from 'hooks/api/useAxios';
Expand Down
2 changes: 1 addition & 1 deletion app/src/features/projects/Projects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import ProjectFilter, {
IProjectAdvancedFilters,
ProjectAdvancedFiltersInitialValues
} from 'components/search-project-filter/ProjectFilter';
import { ICONS, focusOptions, projectStatusOptions } from 'constants/misc';
import { focusOptions, ICONS, projectStatusOptions } from 'constants/misc';
import { DialogContext } from 'contexts/dialogContext';
import { Formik, FormikProps } from 'formik';
import { APIError } from 'hooks/api/useAxios';
Expand Down
4 changes: 2 additions & 2 deletions app/src/features/projects/ProjectsRouter.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { RoleGuard, SystemRoleGuard } from 'components/security/Guards';
import { PROJECT_ROLE, SYSTEM_ROLE } from 'constants/roles';
import EditProjectPage from 'features/edit/EditProjectPage';
import ProjectsLayout from 'features/projects/ProjectsLayout';
import CreateProjectPage from 'features/projects/create/CreateProjectPage';
import ProjectsLayout from 'features/projects/ProjectsLayout';
import ViewProjectPage from 'features/projects/view/ViewProjectPage';
import React from 'react';
import { Navigate, Route, Routes } from 'react-router-dom';
import { RedirectURL } from 'utils/AppRoutesUtils';
import ProjectsPlansListPage from './ProjectsPlansListPage';
import ProjectParticipantsPage from './participants/ProjectParticipantsPage';
import ProjectsPlansListPage from './ProjectsPlansListPage';

/**
* Router for all `/admin/project/*` pages.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
cleanup,
fireEvent,
findByText as rawFindByText,
fireEvent,
getByText as rawGetByText,
render,
waitFor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@
};

const getProject = useCallback(async () => {
const projectWithDetailsResponse =
await restorationTrackerApi.project.getProjectById(projectId);
const projectWithDetailsResponse = await restorationTrackerApi.project.getProjectById(

Check warning on line 97 in app/src/features/projects/participants/ProjectParticipantsPage.tsx

View workflow job for this annotation

GitHub Actions / Running Linter

Replace `·await·restorationTrackerApi.project.getProjectById(⏎······projectId⏎····` with `⏎······await·restorationTrackerApi.project.getProjectById(projectId`
projectId
);

if (!projectWithDetailsResponse) {
return;
Expand Down
Loading
Loading