Skip to content

Add crud for election rounds#857

Merged
idormenco merged 38 commits intomainfrom
feature/election-round-crud
Feb 17, 2025
Merged

Add crud for election rounds#857
idormenco merged 38 commits intomainfrom
feature/election-round-crud

Conversation

@idormenco
Copy link
Copy Markdown
Contributor

No description provided.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 22, 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 Feb 17, 2025 2:24pm

Comment thread web/src/features/election-rounds/components/Dashboard/Dashboard.tsx Fixed
Comment thread web/src/features/election-rounds/components/Dashboard/Dashboard.tsx Fixed
Comment thread web/src/features/election-rounds/components/Dashboard/Dashboard.tsx Fixed
Comment thread web/src/common/types.ts Fixed
Comment thread web/src/components/CoalitionDescription/CoalitionDescription.tsx Fixed
Comment on lines +237 to +245
foreach (var iso in languages)
{
if (!Languages.Contains(iso))
{
throw new ValidationException([
new ValidationFailure(nameof(languages) + $".{iso}", "Language is not supported.")
]);
}
}

Check notice

Code scanning / CodeQL

Missed opportunity to use Where

This foreach loop [implicitly filters its target sequence](1) - consider filtering the sequence explicitly using '.Where(...)'.
Comment thread web/src/components/FormEditor/FormEditor.tsx Fixed
Comment thread web/src/components/FormStatusBadge/ElectionRoundStatusBadge.tsx Fixed
import { EditFormType } from '../EditForm/EditForm';
import { useElectionRoundDetails } from '@/features/election-event/hooks/election-event-hooks';
import { EditFormType } from '../FormEditor/FormEditor';
import { FormFull } from '@/features/forms/models';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class

Unused import FormFull.

Copilot Autofix

AI about 1 year ago

To fix the problem, we need to remove the unused import statement for FormFull. This will clean up the code and improve readability and maintainability. The change should be made in the file web/src/components/FormTranslationEditor/FormDetailsTranslationEditor.tsx.

Suggested changeset 1
web/src/components/FormTranslationEditor/FormDetailsTranslationEditor.tsx

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/src/components/FormTranslationEditor/FormDetailsTranslationEditor.tsx b/web/src/components/FormTranslationEditor/FormDetailsTranslationEditor.tsx
--- a/web/src/components/FormTranslationEditor/FormDetailsTranslationEditor.tsx
+++ b/web/src/components/FormTranslationEditor/FormDetailsTranslationEditor.tsx
@@ -13,3 +13,3 @@
 import { EditFormType } from '../FormEditor/FormEditor';
-import { FormFull } from '@/features/forms/models';
+
 import { FormTemplateFull } from '@/features/form-templates/models';
EOF
@@ -13,3 +13,3 @@
import { EditFormType } from '../FormEditor/FormEditor';
import { FormFull } from '@/features/forms/models';

import { FormTemplateFull } from '@/features/form-templates/models';
Copilot is powered by AI and may make mistakes. Always verify output.
import { useElectionRoundDetails } from '@/features/election-event/hooks/election-event-hooks';
import { EditFormType } from '../FormEditor/FormEditor';
import { FormFull } from '@/features/forms/models';
import { FormTemplateFull } from '@/features/form-templates/models';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class

Unused import FormTemplateFull.

Copilot Autofix

AI about 1 year ago

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

  • Locate the import statement for FormTemplateFull in the file web/src/components/FormTranslationEditor/FormDetailsTranslationEditor.tsx.
  • Remove the line containing the import statement.
  • Ensure that the removal does not affect any other parts of the code.
Suggested changeset 1
web/src/components/FormTranslationEditor/FormDetailsTranslationEditor.tsx

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/src/components/FormTranslationEditor/FormDetailsTranslationEditor.tsx b/web/src/components/FormTranslationEditor/FormDetailsTranslationEditor.tsx
--- a/web/src/components/FormTranslationEditor/FormDetailsTranslationEditor.tsx
+++ b/web/src/components/FormTranslationEditor/FormDetailsTranslationEditor.tsx
@@ -14,3 +14,3 @@
 import { FormFull } from '@/features/forms/models';
-import { FormTemplateFull } from '@/features/form-templates/models';
+
 
EOF
@@ -14,3 +14,3 @@
import { FormFull } from '@/features/forms/models';
import { FormTemplateFull } from '@/features/form-templates/models';


Copilot is powered by AI and may make mistakes. Always verify output.
@@ -0,0 +1,233 @@
import Layout from '@/components/layout/Layout';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class

Unused import Layout.

Copilot Autofix

AI about 1 year ago

To fix the problem, we need to remove the unused import statement for Layout from the file web/src/components/PreviewFormPage/PreviewFormPage.tsx. This will clean up the code and eliminate any potential confusion caused by the presence of an unused import.

  • Remove the import statement for Layout on line 1.
  • Ensure that no other parts of the code rely on this import.
Suggested changeset 1
web/src/components/PreviewFormPage/PreviewFormPage.tsx

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/src/components/PreviewFormPage/PreviewFormPage.tsx b/web/src/components/PreviewFormPage/PreviewFormPage.tsx
--- a/web/src/components/PreviewFormPage/PreviewFormPage.tsx
+++ b/web/src/components/PreviewFormPage/PreviewFormPage.tsx
@@ -1,2 +1 @@
-import Layout from '@/components/layout/Layout';
 import { Badge } from '@/components/ui/badge';
EOF
@@ -1,2 +1 @@
import Layout from '@/components/layout/Layout';
import { Badge } from '@/components/ui/badge';
Copilot is powered by AI and may make mistakes. Always verify output.
@@ -0,0 +1,233 @@
import Layout from '@/components/layout/Layout';
import { Badge } from '@/components/ui/badge';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class

Unused import Badge.

Copilot Autofix

AI about 1 year ago

To fix the problem, we need to remove the unused import statement for Badge from the file web/src/components/PreviewFormPage/PreviewFormPage.tsx. This will improve code readability and maintainability without changing any existing functionality.

Suggested changeset 1
web/src/components/PreviewFormPage/PreviewFormPage.tsx

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/src/components/PreviewFormPage/PreviewFormPage.tsx b/web/src/components/PreviewFormPage/PreviewFormPage.tsx
--- a/web/src/components/PreviewFormPage/PreviewFormPage.tsx
+++ b/web/src/components/PreviewFormPage/PreviewFormPage.tsx
@@ -1,3 +1,3 @@
 import Layout from '@/components/layout/Layout';
-import { Badge } from '@/components/ui/badge';
+
 import { Button } from '@/components/ui/button';
EOF
@@ -1,3 +1,3 @@
import Layout from '@/components/layout/Layout';
import { Badge } from '@/components/ui/badge';

import { Button } from '@/components/ui/button';
Copilot is powered by AI and may make mistakes. Always verify output.
@@ -0,0 +1,40 @@
import { BaseQuestion, FormBase, FormType, LanguagesTranslationStatus, TranslatedString } from "@/common/types";

Check notice

Code scanning / CodeQL

Unused variable, import, function or class

Unused import LanguagesTranslationStatus.

Copilot Autofix

AI about 1 year ago

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

  • In general terms, the problem can be fixed by identifying and removing any unused imports.
  • Specifically, we will remove LanguagesTranslationStatus from the import statement on line 1.
  • The change will be made in the file web/src/features/forms/models.ts.
Suggested changeset 1
web/src/features/forms/models.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/src/features/forms/models.ts b/web/src/features/forms/models.ts
--- a/web/src/features/forms/models.ts
+++ b/web/src/features/forms/models.ts
@@ -1,2 +1,2 @@
-import { BaseQuestion, FormBase, FormType, LanguagesTranslationStatus, TranslatedString } from "@/common/types";
+import { BaseQuestion, FormBase, FormType, TranslatedString } from "@/common/types";
 
EOF
@@ -1,2 +1,2 @@
import { BaseQuestion, FormBase, FormType, LanguagesTranslationStatus, TranslatedString } from "@/common/types";
import { BaseQuestion, FormBase, FormType, TranslatedString } from "@/common/types";

Copilot is powered by AI and may make mistakes. Always verify output.
Comment thread web/src/routes/form-templates/$formTemplateId.tsx Fixed
Comment thread web/src/routes/forms/$formId_.edit.tsx Fixed
@@ -1,14 +1,12 @@
import { FormBuilderScreenScratch } from '@/features/forms/components/FormBuilder/components/FormBuilderScreenScratch';
import FormEdit from '@/features/forms/components/FormEdit/FormEdit';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class

Unused import FormEdit.

Copilot Autofix

AI about 1 year ago

To fix the problem, we need to remove the unused import statement for FormEdit. This will clean up the code and eliminate any potential confusion or minor performance issues associated with the unused import.

  • Remove the import statement for FormEdit from the file web/src/routes/forms/new_.scratch.tsx.
  • Ensure that no other parts of the code are affected by this removal.
Suggested changeset 1
web/src/routes/forms/new_.scratch.tsx

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/src/routes/forms/new_.scratch.tsx b/web/src/routes/forms/new_.scratch.tsx
--- a/web/src/routes/forms/new_.scratch.tsx
+++ b/web/src/routes/forms/new_.scratch.tsx
@@ -1,2 +1 @@
-import FormEdit from '@/features/forms/components/FormEdit/FormEdit';
 import FormNew from '@/features/forms/components/FormNew/FormNew';
EOF
@@ -1,2 +1 @@
import FormEdit from '@/features/forms/components/FormEdit/FormEdit';
import FormNew from '@/features/forms/components/FormNew/FormNew';
Copilot is powered by AI and may make mistakes. Always verify output.
idormenco and others added 2 commits February 17, 2025 16:22
…rt, function or class

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…rt, function or class

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@idormenco idormenco merged commit 7d34ece into main Feb 17, 2025
@idormenco idormenco deleted the feature/election-round-crud branch February 17, 2025 14:27
var hasher = new PasswordHasher<ApplicationUser>();
PasswordHash = hasher.HashPassword(this, password.Trim());
Status = UserStatus.Active;
EmailConfirmed = true;

Check warning

Code scanning / CodeQL

Virtual call in constructor or destructor

Avoid virtual calls in a constructor or destructor.
imdeaconu added a commit to imdeaconu/votemonitor that referenced this pull request Feb 17, 2025
* Fix guide access for observers (commitglobal#868)

* Realease v0.2.48 (commitglobal#869)

* [NGO Admin] Fix monitoring observers bugs (commitglobal#872)

* fix: make dropdown menus scrollable

* fix: truncate overflowing table columns

* Squashed commit of the following:

commit 742f250
Author: imdeaconu <imdeaconu@gmail.com>
Date:   Wed Sep 11 19:54:55 2024 +0300

    add read notification checkmark

commit ea11fa0
Author: imdeaconu <imdeaconu@gmail.com>
Date:   Wed Sep 11 19:54:30 2024 +0300

    add read notification column

* Squashed commit of the following:

commit d8833dc
Author: imdeaconu <imdeaconu@gmail.com>
Date:   Fri Sep 13 13:29:31 2024 +0300

    WIP: add selector functionality

commit 3608c0e
Author: imdeaconu <imdeaconu@gmail.com>
Date:   Fri Sep 13 10:00:05 2024 +0300

    WIP: create new tags input

* chore: remove unused import

* chore: delete duplicated / unused classes

* feature: add searching to MonitoringObserversTagFilter

* chore: update config files

* Revert "[NGO Admin] Rewrite the tag selector component  (commitglobal#675)"

This reverts commit 2ad0e90.

* Merge branch 'main' of https://github.com/commitglobal/votemonitor into commitglobal-main

* WIP: rename prop for alternative filter key in Observer Tags and add it to the Push Message form

* WIP: fix push messages receipients query not invalidating after edits

* invalidate targeted observers query after a morning observer is added

* Add crud for election rounds (commitglobal#857)

* Add crud for election rounds

* Update Validator.cs

* Improve endpoints for election rounds

* make phone number not mandatory

* rework validation of phone number

* Implement edit ps /location

* undo delete

* fix dashboard search

* fix filtering

* Refactor form builders

* Rework form templates fix form builder

* Refactor forms

* Rebuild migrations

* fix observers tab queries

* more fixez and improvements

* Update packages

* Fix monitoring observers view/edit

* Fix .net build, fix navigations

* Fix new form

* use navigate without void

* fix file name casing

* fix linting issues

* Cleanup and fix add translations

* Add election rounds filtering

* Update form-submissions-queries.ts

* Update ElectionRoundForm.tsx

* Delete hooks.ts

* Update queries.ts

* Update PreviewDialogs.tsx

* better errors

* Update observer.ts

* Cleanup

* Potential fix for code scanning alert no. 1118: Unused variable, import, function or class

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* Potential fix for code scanning alert no. 1098: Unused variable, import, function or class

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* Release v0.2.49 (commitglobal#874)

---------

Co-authored-by: Ion Dormenco <idormenco@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
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.

2 participants