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-12505] - add delete send button to footer #11187

Merged
merged 4 commits into from
Sep 24, 2024
Merged

[PM-12505] - add delete send button to footer #11187

merged 4 commits into from
Sep 24, 2024

Conversation

jaasen-livefront
Copy link
Collaborator

🎟️ Tracking

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

📔 Objective

This PR adds the delete button to the footer of the edit send page.

📸 Screenshots

Screen.Recording.2024-09-20.at.4.38.21.PM.mov

⏰ 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

codecov bot commented Sep 20, 2024

Codecov Report

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

Project coverage is 35.08%. Comparing base (9a89ef9) to head (fe16ede).
Report is 14 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
.../popup/send-v2/add-edit/send-add-edit.component.ts 0.00% 15 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11187      +/-   ##
==========================================
+ Coverage   34.98%   35.08%   +0.09%     
==========================================
  Files        2712     2718       +6     
  Lines       84577    84738     +161     
  Branches    16069    16110      +41     
==========================================
+ Hits        29587    29728     +141     
- Misses      54019    54038      +19     
- Partials      971      972       +1     

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

Copy link
Contributor

github-actions bot commented Sep 20, 2024

Logo
Checkmarx One – Scan Summary & Detailsf6f69596-aaaf-4660-a1e4-d911ff11c358

No New Or Fixed Issues Found

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.

As a quick win (approaching deadline), we can include the delete within the send-add-edit.component.

Thinking forward though about re-using the send-form.component on other clients, it should take care of the deletion (via SendFormConfigService) and prompt like it already does for the submit action.

I envision a onSendDeleted-event which would then take care of the navigation and success toast, which are client-specific. On browser I'd navigate back (this.location.back) but on web I'd close a dialog and on desktop I might remove/hide the tools-send-form 🤷

async deleteSend() {
const confirmed = await this.dialogService.openSimpleDialog({
title: { key: "deleteSend" },
content: { key: "deleteSendConfirmation" },
Copy link
Contributor

Choose a reason for hiding this comment

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

The message needs to be changed according to the design into:
"Are you sure you want to permanently delete this Send?"

While this is being changed, it should also be used within the send-list-items-container.component

*ngIf="config?.mode !== 'add'"
type="button"
buttonType="danger"
class="tw-border-0 tw-ml-auto bwi-lg"
Copy link
Contributor

Choose a reason for hiding this comment

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

The classes shouldn't be need

Copy link
Collaborator Author

@jaasen-livefront jaasen-livefront Sep 23, 2024

Choose a reason for hiding this comment

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

@djsmith85 Without the classes the icon gets a border, doesn't align right, and is too small. I'm open to suggestion on how you'd prefer to implement these requirements.

Copy link
Contributor

@djsmith85 djsmith85 Sep 23, 2024

Choose a reason for hiding this comment

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

@danielleflinn As mentioned on another comment I was looking at vault's view2 component for how the delete button was implemented there

Copy link
Member

Choose a reason for hiding this comment

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

This component should use https://components.bitwarden.com/?path=/story/component-library-icon-button--danger, in the current styles it has a border which will be removed in the Design System feature branch.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok I'll remove the tw-border-0 class. According to @danielleflinn's feedback everything else should remain unless I'm missing something.

buttonType="danger"
class="tw-border-0 tw-ml-auto bwi-lg"
bitIconButton="bwi-trash"
(click)="deleteSend()"
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use bitAction instead. Example for the delete button can be found on the vault's view2 component

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.

Approving for the changes I requested, leaving it to @danielleflinn to comment/approve on the usage of the classes.

@@ -92,6 +104,37 @@ export class SendAddEditComponent {
this.location.back();
}

async deleteSend() {
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Approved to quickly, for the bitAction to work, the method needs to be an arrow function delete = async (): Promise<boolean> => {

@djsmith85 djsmith85 merged commit 6d9223f into main Sep 24, 2024
66 checks passed
@djsmith85 djsmith85 deleted the PM-12505 branch September 24, 2024 07:26
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