Skip to content

NGO coalitions#823

Merged
idormenco merged 23 commits intomainfrom
feature/ngo-coalitions
Nov 21, 2024
Merged

NGO coalitions#823
idormenco merged 23 commits intomainfrom
feature/ngo-coalitions

Conversation

@idormenco
Copy link
Copy Markdown
Contributor

No description provided.

@vercel
Copy link
Copy Markdown

vercel Bot commented Nov 21, 2024

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 Nov 21, 2024 11:26pm

Comment on lines +46 to +51
foreach (var ngo in ngosToAddAsMonitoringNgos)
{
var monitoringNgo = electionRound.AddMonitoringNgo(ngo);
monitoringNgos.Add(monitoringNgo);
context.MonitoringNgos.Add(monitoringNgo);
}

Check notice

Code scanning / CodeQL

Missed opportunity to use Select

This foreach loop immediately [maps its iteration variable to another variable](1) - consider mapping the sequence explicitly using '.Select(...)'.
Comment on lines +45 to +50
foreach (var ngo in ngosToAddAsMonitoringNgos)
{
var monitoringNgo = coalition.ElectionRound.AddMonitoringNgo(ngo);
coalitionMembers.Add(monitoringNgo);
context.MonitoringNgos.Add(monitoringNgo);
}

Check notice

Code scanning / CodeQL

Missed opportunity to use Select

This foreach loop immediately [maps its iteration variable to another variable](1) - consider mapping the sequence explicitly using '.Select(...)'.
&& x.MonitoringNgo.NgoId == req.NgoId
&& x.Id == req.FormId)
.FromSqlInterpolated($"""
select f.* from "GetAvailableForms"({req.ElectionRoundId}, {req.NgoId}, {req.DataSource.ToString()}) af

Check notice

Code scanning / CodeQL

Redundant ToString() call

Redundant call to 'ToString' on a String object.
""";

var queryArgs = new { electionRoundId = req.ElectionRoundId, ngoId = req.NgoId };
IEnumerable<MonitoringObserverExportModel> monitoringObservers = [];

Check warning

Code scanning / CodeQL

Useless assignment to local variable

This assignment to [monitoringObservers](1) is useless, since its value is never read.
PresignedUrl = result!.Url,
MimeType = attachment.MimeType,
UrlValidityInSeconds = result.UrlValidityInSeconds,
UrlValidityInSeconds = result.UrlValidityInSeconds

Check warning

Code scanning / CodeQL

Dereferenced variable may be null

Variable [result](1) may be null at this access because of [this](2) assignment.

public CoalitionScenarioBuilder WithQuickReport(ScenarioObserver observer, ScenarioPollingStation pollingStation)
{
var observerClient = ParentBuilder.WithQuickReport(observer, pollingStation);

Check warning

Code scanning / CodeQL

Useless assignment to local variable

This assignment to [observerClient](1) is useless, since its value is never read.
@@ -24,6 +24,6 @@
new List<object[]>
{
new object[] { Guid.Empty },
new object[] { null as Guid? },
new object[] { null as Guid? }

Check warning

Code scanning / CodeQL

Useless upcast

There is no need to upcast from [null](1) to [Nullable<Guid>](2) - the conversion can be done implicitly.
Comment thread web/src/components/layout/Header/Header.tsx Fixed
Comment thread web/src/features/monitoring-observers/models/monitoring-observer.ts Fixed

{isFiltering && (
{filtersExpanded && (

Check warning

Code scanning / CodeQL

Useless conditional

This use of variable 'filtersExpanded' always evaluates to true.
@idormenco idormenco merged commit 0c94629 into main Nov 21, 2024
@idormenco idormenco deleted the feature/ngo-coalitions branch November 21, 2024 23:30
const { data: statistics } = useElectionRoundStatistics(currentElectionRoundId);

const { data: statistics } = useElectionRoundStatistics(currentElectionRoundId, dataSource);
console.log(statistics)

Check notice

Code scanning / CodeQL

Semicolon insertion

Avoid automated semicolon insertion (95% of all statements in [the enclosing function](1) have an explicit semicolon).
idormenco added a commit that referenced this pull request Nov 27, 2024
* Rename column in form templates (#809)

* Reset pageNumber param on filtering (#819)

* 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  (#675)"

This reverts commit 2ad0e90.

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

* reset page numbr to 1 on filtering

* Update Endpoint.cs (#820)

* Update Endpoint.cs (#821)

* Release v0.2.33 (#822)

* NGO coalitions (#823)

* Add coalitions

* Fix form template name, fix get form by id and form submissions

* fix selects

* Add form access ui

* Remove unused columns

* Fix get filters

* Add data source filters for submissions

* Fix list submissions

* fix queries

* fixes and tests

* cleanup, fix list by observer endpoint add tests

* refactor fix tests

* fix tests and selects

* fix queries for get by id and get aggregated

* Fix quick reports

* implement coalition data

* add is own observer and filters on qr

* Fix failing tests

* fix ui build

* fix statistics

* fix issues

* fix tests

* Release v0.2.34 (#824)

* Improve UX for election round selector (#825)

* Fix export data as coalition member (#826)

* Update locals.tf (#827)

* Fix sendind notifications (#828)

* Release v0.2.36 (#829)

* Fix sending of notifications (#830)

* Release v0.2.37 (#831)

* Feature/rework header (#833)

* Rework header

* Fix bug with invitations

* Fix stuff

* Release v0.2.38 (#834)

* add readonly view (#835)

* Release v0.2.39 (#836)

* Fix number of targeted observers (#837)

* Release v0.2.40 (#838)

* Feature/cleanup (#839)

* Cleanup and improvements

* move form submissions to /responses/form-submissions

* add before load for all auth routes

* Rework and cleanup observers import

* cleanup

---------

Co-authored-by: Iulian Deaconu <imdeaconu@gmail.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