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

[PM-12403] - Implement Remove Send policy on Add/edit screen #11178

Merged
merged 9 commits into from
Sep 25, 2024
Merged

Conversation

jaasen-livefront
Copy link
Collaborator

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-12410

📔 Objective

This PR adds logic to disable all of the send forms if the policy requires. I also merged the base send details and send details components as it is not necessary or helpful to keep them separate.

📸 Screenshots

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

Copy link
Contributor

github-actions bot commented Sep 20, 2024

Logo
Checkmarx One – Scan Summary & Details1d7fc9ac-6b38-4927-8b51-b76d3b40ded6

No New Or Fixed Issues Found

Copy link

codecov bot commented Sep 20, 2024

Codecov Report

Attention: Patch coverage is 0% with 45 lines in your changes missing coverage. Please review.

Project coverage is 35.17%. Comparing base (992964f) to head (ad1a53f).
Report is 41 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
.../components/send-details/send-details.component.ts 0.00% 39 Missing ⚠️
...-form/components/options/send-options.component.ts 0.00% 2 Missing ⚠️
...onents/send-details/send-file-details.component.ts 0.00% 2 Missing ⚠️
...onents/send-details/send-text-details.component.ts 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11178      +/-   ##
==========================================
+ Coverage   35.05%   35.17%   +0.12%     
==========================================
  Files        2711     2718       +7     
  Lines       84576    84911     +335     
  Branches    16069    16161      +92     
==========================================
+ Hits        29649    29870     +221     
- Misses      53956    54063     +107     
- Partials      971      978       +7     

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

@jaasen-livefront jaasen-livefront changed the title [PM-12410] - disable edit send if policy requires [PM-12403] - disable edit send if policy requires Sep 20, 2024
@jaasen-livefront jaasen-livefront changed the title [PM-12403] - disable edit send if policy requires [PM-12403] - Implement Remove Send policy on Add/edit screen Sep 20, 2024
@djsmith85 djsmith85 removed request for a team and r-tome September 23, 2024 11:01
Copy link
Contributor

@djsmith85 djsmith85 left a comment

Choose a reason for hiding this comment

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

Instead of pulling in the policyService and checking if DisableSend is active, you can grab that information from the SendFormConfig(areSendsAllowed), which is required and passed in from the hosting component. This should simplify the component and the pattern applies to all components modified in this PR.

@jaasen-livefront
Copy link
Collaborator Author

Instead of pulling in the policyService and checking if DisableSend is active, you can grab that information from the SendFormConfig(areSendsAllowed), which is required and passed in from the hosting component. This should simplify the component and the pattern applies to all components modified in this PR.

🤦 Not sure how I missed that one! That definitely simplifies things.

Comment on lines 41 to 42
export class SendOptionsComponent implements OnInit, OnDestroy {
private destroy$ = new Subject<void>();
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ OnDestroy and destroy$ aren't used anywhere and can be removed. This was previously introduced for subscribing to policy changes, but could have also been done with takeUntilDestroyed()

@@ -27,6 +29,8 @@ import { SendFormContainer } from "../../send-form-container";
],
})
export class SendFileDetailsComponent implements OnInit {
private destroy$ = new Subject<void>();
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Not needed anymore

@@ -40,6 +44,7 @@ export class SendFileDetailsComponent implements OnInit {
constructor(
private formBuilder: FormBuilder,
protected sendFormContainer: SendFormContainer,
private policyService: PolicyService,
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Requiring policyService is no longer necessary

Comment on lines 68 to 69
export class SendDetailsComponent implements OnInit, OnDestroy {
private destroy$ = new Subject<void>();
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ OnDestroy and destroy$ aren't used anywhere and can be removed. This was previously introduced for subscribing to policy changes, but could have also been done with takeUntilDestroyed()


constructor(
protected sendFormContainer: SendFormContainer,
protected formBuilder: FormBuilder,
protected i18nService: I18nService,
protected datePipe: DatePipe,
protected environmentService: EnvironmentService,
private policyService: PolicyService,
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Requiring policyService is no longer necessary

Comment on lines 28 to 29
export class SendTextDetailsComponent implements OnInit, OnDestroy {
private destroy$ = new Subject<void>();
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ OnDestroy and destroy$ aren't used anywhere and can be removed. This was previously introduced for subscribing to policy changes, but could have also been done with takeUntilDestroyed()

@@ -35,6 +39,7 @@ export class SendTextDetailsComponent implements OnInit {
constructor(
private formBuilder: FormBuilder,
protected sendFormContainer: SendFormContainer,
private policyService: PolicyService,
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Requiring policyService is no longer necessary

@djsmith85 djsmith85 enabled auto-merge (squash) September 25, 2024 11:06
@djsmith85 djsmith85 merged commit d587be1 into main Sep 25, 2024
43 checks passed
@djsmith85 djsmith85 deleted the PM-12410 branch September 25, 2024 11:07
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