Skip to content
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

Add multi-permits needed statistic #140

Merged
merged 1 commit into from
Sep 5, 2024

Conversation

sanjaytkbabu
Copy link
Contributor

@sanjaytkbabu sanjaytkbabu commented Aug 28, 2024

Description

PADS-252
Multi-permits needed (Multi-Authorization Project) stats obtained (Projects with more than one permit with needed set to Yes)
rbac migration updated with statistics db function changes
list permits endpoint updated to make activityId optional
stats tab updated, submission data-table updated to show multi-auth column
multiPermitsNeeded property added to submission frontend type (this makes it easier for datatable to grab the value, also makes it sortable)

Types of changes

New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING doc
  • I have checked that unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

@sanjaytkbabu sanjaytkbabu changed the base branch from master to release/rbac August 28, 2024 15:34
@sanjaytkbabu sanjaytkbabu marked this pull request as draft August 28, 2024 15:42
@sanjaytkbabu sanjaytkbabu force-pushed the feature/multi-auth-projects branch from 89ff061 to c8effd5 Compare August 28, 2024 15:47
@sanjaytkbabu sanjaytkbabu marked this pull request as ready for review August 28, 2024 15:47
@sanjaytkbabu sanjaytkbabu force-pushed the feature/multi-auth-projects branch from c8effd5 to c98c1fc Compare August 28, 2024 15:52
Copy link

github-actions bot commented Aug 28, 2024

Coverage Report (Application)

Totals Coverage
Statements: 44.02% ( 1026 / 2331 )
Methods: 32.33% ( 140 / 433 )
Lines: 54.49% ( 661 / 1213 )
Branches: 32.85% ( 225 / 685 )

@sanjaytkbabu sanjaytkbabu force-pushed the feature/multi-auth-projects branch from c98c1fc to a9038af Compare August 28, 2024 16:05
Copy link

github-actions bot commented Aug 28, 2024

Coverage Report (Frontend)

Totals Coverage
Statements: 27.15% ( 1551 / 5713 )
Methods: 23.51% ( 260 / 1106 )
Lines: 31.32% ( 958 / 3059 )
Branches: 21.51% ( 333 / 1548 )

@sanjaytkbabu sanjaytkbabu force-pushed the feature/multi-auth-projects branch from a9038af to 9c98f41 Compare August 28, 2024 16:24
@sanjaytkbabu sanjaytkbabu changed the title Add Multi-authorization Projects Stats Add Multi-Permits Needed Stats Aug 28, 2024
@sanjaytkbabu sanjaytkbabu reopened this Aug 28, 2024
Copy link

github-actions bot commented Aug 28, 2024

@sanjaytkbabu sanjaytkbabu force-pushed the feature/multi-auth-projects branch from 9c98f41 to 2e33fc4 Compare August 28, 2024 17:30
Copy link
Collaborator

@wilwong89 wilwong89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have gone through the migration, but would like another dev to verify it as well.

@sanjaytkbabu sanjaytkbabu force-pushed the feature/multi-auth-projects branch from 2e33fc4 to 1bb5c2f Compare August 28, 2024 18:15
Comment on lines 171 to 178
let multiPermitsNeededCount = 0;
if (Array.isArray(permits.value)) {
permits.value.forEach((permit) => {
if (permit.activityId === sub.activityId && permit.needed?.toUpperCase() === BasicResponse.YES.toUpperCase()) {
multiPermitsNeededCount++;
}
});
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be condensed

const multiPermitsNeededCount = permits.value.filter(
      (x) => x.activityId === sub.activityId && x.needed?.toUpperCase() === BasicResponse.YES.toUpperCase()
    ).length;

@sanjaytkbabu sanjaytkbabu force-pushed the feature/multi-auth-projects branch from 1514d4a to d595f65 Compare September 4, 2024 18:11
@kyle1morel kyle1morel changed the title Add Multi-Permits Needed Stats Add multi-permits needed statistic Sep 5, 2024
@kyle1morel kyle1morel merged commit 124bd57 into release/rbac Sep 5, 2024
17 checks passed
@kyle1morel kyle1morel deleted the feature/multi-auth-projects branch September 5, 2024 02:24
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.

3 participants