Skip to content

Add citizen reporting web client template #926

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

Open
wants to merge 27 commits into
base: main
Choose a base branch
from

Conversation

idormenco
Copy link
Contributor

No description provided.

Copy link

vercel bot commented Mar 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
votemonitor ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 27, 2025 11:00am

* created card for every form in form page

* deleted span with lastModifiedOn data
* hide footer on thank you page

* add notifications

* fixes
* updating className properties for each of typographyClasses

* removed redundant {" "} from text

* renamed typographyClasses to just typography
@@ -0,0 +1,37 @@
import { API } from "@/api/api";

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused import API.

Copilot Autofix

AI 2 months ago

To fix the problem, we need to remove the unused API import from the file. This will clean up the code and eliminate any confusion or potential maintenance issues related to unused imports.

  • Remove the import { API } from "@/api/api"; line from the file.
  • Ensure that no other parts of the code rely on this import (based on the provided snippet, this is already the case).
Suggested changeset 1
web-citizen-reporting/web-citizen-reporting-template/src/hooks/use-upload-file.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/web-citizen-reporting/web-citizen-reporting-template/src/hooks/use-upload-file.ts b/web-citizen-reporting/web-citizen-reporting-template/src/hooks/use-upload-file.ts
--- a/web-citizen-reporting/web-citizen-reporting-template/src/hooks/use-upload-file.ts
+++ b/web-citizen-reporting/web-citizen-reporting-template/src/hooks/use-upload-file.ts
@@ -1,2 +1 @@
-import { API } from "@/api/api";
 import * as React from "react";
EOF
@@ -1,2 +1 @@
import { API } from "@/api/api";
import * as React from "react";
Copilot is powered by AI and may make mistakes. Always verify output.
}

export function useUploadFile({ defaultUploadedFiles }: UseUploadFileOptions) {
const [uploadedFiles, setUploadedFiles] = React.useState<File[]>(

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused variable setUploadedFiles.

Copilot Autofix

AI 2 months ago

To fix the problem, we need to remove the unused setUploadedFiles function. This involves removing the definition of setUploadedFiles and any related commented-out code that references it. This will clean up the code and eliminate the unused variable.

  • Remove the setUploadedFiles function definition from the useUploadFile function.
  • Remove the commented-out code that references setUploadedFiles.
Suggested changeset 1
web-citizen-reporting/web-citizen-reporting-template/src/hooks/use-upload-file.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/web-citizen-reporting/web-citizen-reporting-template/src/hooks/use-upload-file.ts b/web-citizen-reporting/web-citizen-reporting-template/src/hooks/use-upload-file.ts
--- a/web-citizen-reporting/web-citizen-reporting-template/src/hooks/use-upload-file.ts
+++ b/web-citizen-reporting/web-citizen-reporting-template/src/hooks/use-upload-file.ts
@@ -9,3 +9,3 @@
 export function useUploadFile({ defaultUploadedFiles }: UseUploadFileOptions) {
-  const [uploadedFiles, setUploadedFiles] = React.useState<File[]>(
+  const [uploadedFiles] = React.useState<File[]>(
     defaultUploadedFiles ?? []
@@ -20,4 +20,4 @@
     try {
-      //   const res = await API.postForm();
-      //   setUploadedFiles((prev) => (prev ? [...prev, ...res] : res));
+      // const res = await API.postForm();
+      // setUploadedFiles((prev) => (prev ? [...prev, ...res] : res));
     } catch (err) {
EOF
@@ -9,3 +9,3 @@
export function useUploadFile({ defaultUploadedFiles }: UseUploadFileOptions) {
const [uploadedFiles, setUploadedFiles] = React.useState<File[]>(
const [uploadedFiles] = React.useState<File[]>(
defaultUploadedFiles ?? []
@@ -20,4 +20,4 @@
try {
// const res = await API.postForm();
// setUploadedFiles((prev) => (prev ? [...prev, ...res] : res));
// const res = await API.postForm();
// setUploadedFiles((prev) => (prev ? [...prev, ...res] : res));
} catch (err) {
Copilot is powered by AI and may make mistakes. Always verify output.
* added guide details component for text guideType

* finished guide details page

* Update NotificationDetails.tsx

---------

Co-authored-by: Ion Dormenco <[email protected]>
…orm component (#960)

* WIP: fix number inputs not validating and text, number and selection input losing the value when going back

* fix form validation

* add number input component

* fetch formData inside route

* call useLoaderData from the Route obj

* WIP: add display logic for form questions

* Wip/refactor inputs (#17)

* start refactoring inputs

* fix multiselect and add free text responses

* refactor display logic check

* refactor and set required only if field is displayed

* refactor logic

* add freeform text to single select input

* add rating input
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants