Skip to content

Commit

Permalink
Merge branch 'development' into forestgeo-app-development
Browse files Browse the repository at this point in the history
  • Loading branch information
siddheshraze committed Oct 21, 2024
2 parents 780ad20 + 4c7164d commit b631b3c
Show file tree
Hide file tree
Showing 10 changed files with 13,145 additions and 13,424 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/dev-forestgeo-livesite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,22 @@ jobs:
echo OWNER=${{ secrets.OWNER }} >> frontend/.env
echo REPO=${{ secrets.REPO }} >> frontend/.env
- name: Cache node modules
uses: actions/cache@v2
with:
path: frontend/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
# - name: Cache node modules
# uses: actions/cache@v2
# with:
# path: frontend/node_modules
# key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-node-

- name: Cache Next.js build
uses: actions/cache@v2
with:
path: frontend/build/cache
key: ${{ runner.os }}-next-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/.next/cache') }}
restore-keys: |
${{ runner.os }}-next-
${{ runner.os }}-next-${{ hashFiles('**/package-lock.json') }}
# - name: Cache Next.js build
# uses: actions/cache@v2
# with:
# path: frontend/build/cache
# key: ${{ runner.os }}-next-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/.next/cache') }}
# restore-keys: |
# ${{ runner.os }}-next-
# ${{ runner.os }}-next-${{ hashFiles('**/package-lock.json') }}

- name: move into frontend --> npm install, build, and test
run: |
Expand Down
233 changes: 0 additions & 233 deletions frontend/__tests__/config/utils.test.ts

This file was deleted.

8 changes: 0 additions & 8 deletions frontend/app/api/auth/[[...nextauth]]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,33 +21,26 @@ const handler = NextAuth({
},
callbacks: {
async signIn({ user, profile, email: signInEmail }) {
console.log('callback -- signin');
const azureProfile = profile as AzureADProfile;
const userEmail = user.email || signInEmail || azureProfile.preferred_username;
console.log('user email: ', userEmail);
if (typeof userEmail !== 'string') {
console.error('User email is not a string:', userEmail);
return false; // Email is not a valid string, abort sign-in
}
if (userEmail) {
console.log('getting connection');
let conn, emailVerified, userStatus;
try {
conn = await getConn();
console.log('obtained');
const query = `SELECT UserStatus FROM catalog.users WHERE Email = '${userEmail}' LIMIT 1`;
const results = await runQuery(conn, query);
console.log('results: ', results);

// emailVerified is true if there is at least one result
emailVerified = results.length > 0;
console.log('emailVerified: ', emailVerified);
if (!emailVerified) {
console.error('User email not found.');
return false;
}
userStatus = results[0].UserStatus;
console.log('userStatus: ', userStatus);
} catch (e: any) {
console.error('Error fetching user status:', e);
throw new Error('Failed to fetch user status.');
Expand All @@ -66,7 +59,6 @@ const handler = NextAuth({

user.sites = allowedSites;
user.allsites = allSites;
// console.log('all sites: ', user.allsites);
}
return true;
},
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/client/formcolumns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const getClosestAreaUnit = (input: string): string | null => {
return closestUnit;
};

const EditUnitsCell = (params: GridRenderEditCellParams & { fieldName: string; isArea: boolean }) => {
export const EditUnitsCell = (params: GridRenderEditCellParams & { fieldName: string; isArea: boolean }) => {
const apiRef = useGridApiContext();
const { id, fieldName, hasFocus, isArea } = params;
const [value, setValue] = useState<string>(params.row[fieldName]);
Expand Down
8 changes: 4 additions & 4 deletions frontend/components/client/githubfeedbackmodal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
Divider,
FormControl,
FormLabel,
Grid,
Input,
LinearProgress,
List,
Expand All @@ -36,6 +35,7 @@ import { usePathname } from 'next/navigation';
import { useSession } from 'next-auth/react';
import ReactMarkdown from 'react-markdown';
import remarkGfm from 'remark-gfm';
import Grid from '@mui/material/Grid2';

// this has been shelved -- it's a little too complicated for a first iteration.
// saving it for a later version.
Expand Down Expand Up @@ -185,7 +185,7 @@ ${pathname}
<DialogContent sx={{ display: 'flex', flex: 1, flexDirection: 'column', overflow: 'hidden' }}>
<Divider orientation="horizontal" sx={{ my: 1 }} />
<Grid container spacing={1}>
<Grid xs={4}>
<Grid size={4}>
{currentSite ? (
<Box sx={{ display: 'flex', flex: 1, flexDirection: 'column' }}>
<Typography level="body-sm" fontWeight={'xl'}>
Expand All @@ -197,7 +197,7 @@ ${pathname}
<Typography level="body-sm">No site selected.</Typography>
)}
</Grid>
<Grid xs={4}>
<Grid size={4}>
{currentPlot ? (
<Box sx={{ display: 'flex', flex: 1, flexDirection: 'column' }}>
<Typography level="body-sm">Selected Plot: {currentPlot.plotName}</Typography>
Expand All @@ -207,7 +207,7 @@ ${pathname}
<Typography level="body-sm">No plot selected.</Typography>
)}
</Grid>
<Grid xs={4}>
<Grid size={4}>
{currentCensus ? (
<Box sx={{ display: 'flex', flex: 1, flexDirection: 'column' }}>
<Typography level="body-sm">Selected Census: {currentCensus.plotCensusNumber}</Typography>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
import { Alert, Box, DialogActions, DialogContent, DialogTitle, List, ListItem, Modal, ModalDialog, Stack, Tooltip, Typography } from '@mui/joy';
import { UploadParseFilesProps } from '@/config/macros/uploadsystemmacros';
import { getTableHeaders } from '@/config/macros/formdetails';
import { Button, Grid } from '@mui/material';
import { Button } from '@mui/material';
import Grid from '@mui/material/Grid2';
import { DropzoneLogic } from '@/components/uploadsystemhelpers/dropzone';
import { FileList } from '@/components/uploadsystemhelpers/filelist';
import { LoadingButton } from '@mui/lab';
Expand Down Expand Up @@ -43,7 +44,7 @@ export default function UploadParseFiles(props: Readonly<UploadParseFilesProps>)
return (
<Box sx={{ display: 'flex', flex: 1, flexDirection: 'column' }}>
<Grid container spacing={2}>
<Grid item xs={6}>
<Grid size={6}>
<Box sx={{ display: 'flex', flexDirection: 'column', mb: 10, mr: 10 }}>
<DropzoneLogic onChange={handleFileChange} />
<Modal open={Boolean(fileToReplace)} onClose={() => setFileToReplace(null)}>
Expand All @@ -69,7 +70,7 @@ export default function UploadParseFiles(props: Readonly<UploadParseFilesProps>)
</Modal>
</Box>
</Grid>
<Grid item xs={6}>
<Grid size={6}>
<Stack direction={'column'} sx={{ display: 'flex', flexDirection: 'column', mb: 10 }}>
<Typography sx={{ mb: 2 }}>
You have selected {uploadForm}. Please ensure that your file has the following headers before continuing: <br />
Expand Down
Loading

0 comments on commit b631b3c

Please sign in to comment.