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

SIMSBIOHUB-428: Apply Security to Different Features #227

Merged
merged 32 commits into from
Jan 16, 2024
Merged

Conversation

curtisupshall
Copy link
Contributor

@curtisupshall curtisupshall commented Jan 5, 2024

Overview

Apply security rules to selected features.

Links to Jira tickets

Testing

You should be able to apply and remove multiple security rules to any number of selected features.

Description of relevant changes

  • Updated endpoints and service and repo methods to support applying security to selected features.
  • Refactored the frontend to support selecting features, applying security rules, and to see already applied security rules.

Removed endpoints

Endpoint Purpose
.../security/apply.ts Was used to apply and override security rules to features. This has been replaced.
.../security/category/fetch.ts Was used to fetch all security rule rules with their associated. This has been replaced.
.../security/remove.ts Was used to remove security rules from a set of features. Has been superseded by .../security/rules.
.../security/index Was originally used to get all security rules. Because we don't currently have a use for getting rules without their categories, this endpoint has been removed in favor of .../security/rules.

Moved endpoints

Endpoint Purpose
...security/category/index.../security/categories.ts Used to list all active security categories

New endpoints

Endpoint Purpose
.../security/rules Used to fetch all security rule rules with their associated
.../security/submission/{submissionId}.ts Used to list already-applied security rules, and to apply/remove security for any number of features belonging to the given submission

@curtisupshall curtisupshall added the Not Ready For Review Addressing feedback and/or refactoring label Jan 5, 2024
Copy link

codecov bot commented Jan 5, 2024

Codecov Report

Attention: 154 lines in your changes are missing coverage. Please review.

Comparison is base (4573d87) 0.00% compared to head (d8798c3) 62.44%.

Files Patch % Lines
app/src/components/security/SecurityRuleForm.tsx 0.00% 53 Missing ⚠️
...ministrative/security/submission/{submissionId}.ts 0.00% 35 Missing ⚠️
...p/src/features/submissions/AdminSubmissionPage.tsx 0.00% 16 Missing ⚠️
...ures/submissions/components/SubmissionDataGrid.tsx 0.00% 15 Missing ⚠️
api/src/repositories/security-repository.ts 64.70% 6 Missing ⚠️
...submissions/components/SubmissionHeaderToolbar.tsx 0.00% 5 Missing ⚠️
app/src/hooks/api/useSecurityApi.ts 37.50% 5 Missing ⚠️
app/src/components/security/SecuritiesDialog.tsx 0.00% 4 Missing ⚠️
...src/components/security/SecurityRuleActionCard.tsx 0.00% 4 Missing ⚠️
api/src/services/security-service.ts 81.25% 2 Missing and 1 partial ⚠️
... and 4 more
Additional details and impacted files
@@           Coverage Diff            @@
##           dev     #227       +/-   ##
========================================
+ Coverage     0   62.44%   +62.44%     
========================================
  Files        0      263      +263     
  Lines        0     7294     +7294     
  Branches     0     1029     +1029     
========================================
+ Hits         0     4555     +4555     
- Misses       0     2494     +2494     
- Partials     0      245      +245     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@curtisupshall curtisupshall added Early Feedback Welcome PR is not finished, but early review feedback is welcomed and removed Not Ready For Review Addressing feedback and/or refactoring labels Jan 11, 2024
@curtisupshall curtisupshall marked this pull request as ready for review January 11, 2024 18:02
@curtisupshall curtisupshall added Ready For Review PR is ready for review and removed Early Feedback Welcome PR is not finished, but early review feedback is welcomed labels Jan 12, 2024
@NickPhura

This comment was marked as resolved.

Copy link
Contributor

@al-rosenthal al-rosenthal left a comment

Choose a reason for hiding this comment

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

Ran this locally and it works great. Couple of nit picks but overall solid

app/src/components/security/SecurityRuleForm.tsx Outdated Show resolved Hide resolved
api/src/repositories/security-repository.ts Show resolved Hide resolved
api/src/services/security-service.ts Outdated Show resolved Hide resolved
api/src/services/security-service.ts Show resolved Hide resolved
app/src/constants/i18n.ts Outdated Show resolved Hide resolved
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions

7.8% Duplication on New Code (required ≤ 3%)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

idea Catch issues before they fail your Quality Gate with our IDE extension SonarLint SonarLint

Copy link
Contributor

@al-rosenthal al-rosenthal left a comment

Choose a reason for hiding this comment

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

😎

Copy link
Contributor

@KjartanE KjartanE left a comment

Choose a reason for hiding this comment

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

Tested locally, works great. Just couple questions about service functions. 🐈

@curtisupshall curtisupshall merged commit a305328 into dev Jan 16, 2024
20 of 21 checks passed
@curtisupshall curtisupshall deleted the SIMSBIOHUB-428 branch January 16, 2024 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready For Review PR is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants