From 9ecad6cadc75948491627d0bf4ac78fd99f3427f Mon Sep 17 00:00:00 2001 From: James Holcombe Date: Sun, 27 Oct 2024 11:03:18 +0000 Subject: [PATCH 1/3] fix add row bug, add tooltip --- .../validator/GridView/GridView.tsx | 1 + .../components/validator/validator.tsx | 39 +++++++++++++++---- ags-validator-app/lib/redux/ags.ts | 11 +++--- 3 files changed, 37 insertions(+), 14 deletions(-) diff --git a/ags-validator-app/components/validator/GridView/GridView.tsx b/ags-validator-app/components/validator/GridView/GridView.tsx index 830e95a..f5c6fa1 100644 --- a/ags-validator-app/components/validator/GridView/GridView.tsx +++ b/ags-validator-app/components/validator/GridView/GridView.tsx @@ -258,6 +258,7 @@ const GridView: React.FC = ({ const onRowAppended = useCallback(() => { dispatch(addRow({ group: group.name })); + dispatch(applySetRowDataEffect()); }, [dispatch, group.name]); useEffect(() => { diff --git a/ags-validator-app/components/validator/validator.tsx b/ags-validator-app/components/validator/validator.tsx index 936cb31..59bc75c 100644 --- a/ags-validator-app/components/validator/validator.tsx +++ b/ags-validator-app/components/validator/validator.tsx @@ -18,6 +18,12 @@ import ViewToolbar from "./ViewToolbar"; import { track } from "@vercel/analytics"; import { useAppDispatch } from "@/lib/redux/hooks"; import { applySetRowDataEffect, setDictionaryVersion } from "@/lib/redux/ags"; +import { + Tooltip, + TooltipContent, + TooltipProvider, + TooltipTrigger, +} from "../ui/tooltip"; const agsDictOptions = [ { value: "v4_0_3", label: "4.0.3" }, @@ -119,14 +125,31 @@ export default function Validator() { Text - - - Tables - + + + + + {/* wrapping in div so can have tooltip on hover when disabled */} +
+ + + Tables + +
+
+ + {agsData !== "" && parsedAgs === undefined && ( + + Current errors must be resolved before viewing as + tables + + )} +
+
diff --git a/ags-validator-app/lib/redux/ags.ts b/ags-validator-app/lib/redux/ags.ts index c027cf6..34ef938 100644 --- a/ags-validator-app/lib/redux/ags.ts +++ b/ags-validator-app/lib/redux/ags.ts @@ -252,12 +252,11 @@ export const agsSlice = createSlice({ state.future = []; } - const lineNumberLast = - Math.max( - ...Object.keys( - state.parsedAgsNormalized[action.payload.group].rows - ).map((lineNumber) => parseInt(lineNumber)) - ) + 1; + const lineNumberLast = Math.max( + ...Object.keys( + state.parsedAgsNormalized[action.payload.group].rows + ).map((lineNumber) => parseInt(lineNumber)) + ); const newRow = { data: Object.fromEntries(headings.map((heading) => [heading, ""])), From 4310f4d6df27c8afc9c45fb810d8d1e50515fcbc Mon Sep 17 00:00:00 2001 From: James Holcombe Date: Sun, 27 Oct 2024 11:55:40 +0000 Subject: [PATCH 2/3] fix re-upload file bug --- .../validator/AGSUpload/AGSUpload.tsx | 7 ++++- .../components/validator/validator.tsx | 27 ++++++++++--------- ags-validator-app/lib/redux/ags.ts | 2 ++ 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/ags-validator-app/components/validator/AGSUpload/AGSUpload.tsx b/ags-validator-app/components/validator/AGSUpload/AGSUpload.tsx index 6861991..016cdc2 100644 --- a/ags-validator-app/components/validator/AGSUpload/AGSUpload.tsx +++ b/ags-validator-app/components/validator/AGSUpload/AGSUpload.tsx @@ -7,7 +7,11 @@ import { useAppDispatch } from "@/lib/redux/hooks"; import { applySetRawDataEffect, setRawData } from "@/lib/redux/ags"; import { track } from "@vercel/analytics"; -export default function AGSUpload() { +interface Props { + setTabsViewValue: React.Dispatch>; +} + +export default function AGSUpload({ setTabsViewValue }: Props) { const dispatch = useAppDispatch(); // Handle file input change @@ -17,6 +21,7 @@ export default function AGSUpload() { if (selectedFile) { const reader = new FileReader(); reader.onload = (e) => { + setTabsViewValue("text"); const content = e.target?.result; // get size of file diff --git a/ags-validator-app/components/validator/validator.tsx b/ags-validator-app/components/validator/validator.tsx index 59bc75c..bbcdc0f 100644 --- a/ags-validator-app/components/validator/validator.tsx +++ b/ags-validator-app/components/validator/validator.tsx @@ -74,7 +74,7 @@ export default function Validator() { setSelectedGroup(firstKey); } } - }, [parsedAgs, selectedGroup, setSelectedGroup]); + }, [parsedAgs, selectedGroup, setSelectedGroup, setTabsViewValue]); return (
@@ -82,7 +82,7 @@ export default function Validator() { AGS Options - + Text @@ -130,11 +130,11 @@ export default function Validator() { {/* wrapping in div so can have tooltip on hover when disabled */} -
+
Tables @@ -166,13 +166,16 @@ export default function Validator() { selectedGroup={selectedGroup} setSelection={setSelection} /> - + + {parsedAgs && ( + + )}
diff --git a/ags-validator-app/lib/redux/ags.ts b/ags-validator-app/lib/redux/ags.ts index 34ef938..ee62b5b 100644 --- a/ags-validator-app/lib/redux/ags.ts +++ b/ags-validator-app/lib/redux/ags.ts @@ -181,6 +181,8 @@ export const agsSlice = createSlice({ setRawData: (state, action: PayloadAction) => { state.rawData = action.payload; + // clear the parsed data when the raw data changes + state.parsedAgsNormalized = undefined; }, deleteRows: ( From 24d6d396c608b8833459606b57e2b98f389b4707 Mon Sep 17 00:00:00 2001 From: James Holcombe Date: Sun, 27 Oct 2024 12:02:17 +0000 Subject: [PATCH 3/3] tweak privacy ui --- ags-validator-app/app/page.tsx | 2 +- ags-validator-app/app/privacy/page.tsx | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ags-validator-app/app/page.tsx b/ags-validator-app/app/page.tsx index 70f199b..a795eeb 100644 --- a/ags-validator-app/app/page.tsx +++ b/ags-validator-app/app/page.tsx @@ -163,7 +163,7 @@ export default function Page() {

- + Privacy Policy
diff --git a/ags-validator-app/app/privacy/page.tsx b/ags-validator-app/app/privacy/page.tsx index e517f89..d976a10 100644 --- a/ags-validator-app/app/privacy/page.tsx +++ b/ags-validator-app/app/privacy/page.tsx @@ -1,8 +1,10 @@ export default function Page() { return ( -
+

Privacy Policy

-

Last updated October 25, 2024

+

+ Last updated October 25, 2024 +

@@ -17,7 +19,7 @@ export default function Page() { Visit our website at{" "} www.validator.groundup.cloud @@ -33,7 +35,7 @@ export default function Page() { understand your privacy rights and choices. If you do not agree with our policies and practices, please do not use our Services. If you still have any questions or concerns, please contact us at{" "} - + james@groundup.cloud . @@ -81,7 +83,7 @@ export default function Page() {

  • How do you exercise your rights? Contact us at{" "} - + james@groundup.cloud .