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-11926] - send created redirect #11140

Merged
merged 9 commits into from
Oct 1, 2024
Merged

[PM-11926] - send created redirect #11140

merged 9 commits into from
Oct 1, 2024

Conversation

jaasen-livefront
Copy link
Collaborator

@jaasen-livefront jaasen-livefront commented Sep 18, 2024

🎟️ Tracking

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

📔 Objective

This PR adds a redirect to the send created page after successfully creating a send as part of the extension refresh.

📸 Screenshots

Note: in the video the icon in the send-created page isn't rendering properly because of the new tw art prefix classes that will be added along with the extension refresh.

Screen.Recording.2024-09-18.at.3.09.30.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
Contributor

github-actions bot commented Sep 18, 2024

Logo
Checkmarx One – Scan Summary & Detailsc13fd470-ab73-4bec-8662-0d610f7e1201

New Issues

Severity Issue Source File / Package Checkmarx Insight
MEDIUM Client_Privacy_Violation /apps/browser/src/vault/popup/components/vault/password-history.component.html: 18 Attack Vector
MEDIUM Unpinned Actions Full Length Commit SHA /build-desktop.yml: 1328 Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...
MEDIUM Unpinned Actions Full Length Commit SHA /build-desktop.yml: 884 Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...
MEDIUM Unpinned Actions Full Length Commit SHA /build-desktop.yml: 1282 Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps...

Fixed Issues

Severity Issue Source File / Package
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/password-history.component.html: 11
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/password-history.component.html: 11
MEDIUM Client_Privacy_Violation /libs/tools/generator/components/src/username-generator.component.html: 3
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/password-history.component.ts: 112
MEDIUM Client_Privacy_Violation /apps/web/src/app/vault/individual-vault/password-history.component.ts: 112
MEDIUM Unpinned Actions Full Length Commit SHA /build-desktop.yml: 1293
MEDIUM Unpinned Actions Full Length Commit SHA /build-desktop.yml: 288
MEDIUM Unpinned Actions Full Length Commit SHA /build-desktop.yml: 891
MEDIUM Unpinned Actions Full Length Commit SHA /build-desktop.yml: 1339

Copy link

codecov bot commented Sep 18, 2024

Codecov Report

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

Project coverage is 33.27%. Comparing base (3646214) to head (6ecdcf9).
Report is 64 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...ui/src/send-form/components/send-form.component.ts 0.00% 7 Missing ⚠️
.../popup/send-v2/add-edit/send-add-edit.component.ts 0.00% 4 Missing ⚠️
...rc/send-form/services/default-send-form.service.ts 0.00% 2 Missing ⚠️
...pup/send-v2/send-created/send-created.component.ts 75.00% 0 Missing and 1 partial ⚠️
...common/src/tools/send/services/send-api.service.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11140      +/-   ##
==========================================
- Coverage   35.16%   33.27%   -1.90%     
==========================================
  Files        2719     2727       +8     
  Lines       84928    85182     +254     
  Branches    16160    16222      +62     
==========================================
- Hits        29868    28341    -1527     
- Misses      54082    54586     +504     
- Partials      978     2255    +1277     

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

Comment on lines 204 to 206
await this.addEditFormService.saveSend(this.updatedSendView, this.file, this.config);

const sendView = await this.addEditFormService.saveSend(
Copy link
Contributor

Choose a reason for hiding this comment

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

This is likely due to a resolved merge conflict. We don't want to save the send twice. I think the const sendView = needs to be moved up and this saveSend-call can be removed.

slot="header"
[pageTitle]="'createdSend' | i18n"
showBackButton
[backAction]="close.bind(this)"
Copy link
Contributor

Choose a reason for hiding this comment

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

⛏️ This can just be close

Suggested change
[backAction]="close.bind(this)"
[backAction]="close"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@djsmith85 Binding to the current context is required here, otherwise the popup header component will attempt to call this.close which doesn't exist in PopupHeaderComponent. There's a similar implementation here.

@@ -135,11 +135,12 @@ export class SendApiService implements SendApiServiceAbstraction {
return this.apiService.send("DELETE", "/sends/" + id, null, true, false);
}

async save(sendData: [Send, EncArrayBuffer]): Promise<any> {
async save(sendData: [Send, EncArrayBuffer]): Promise<SendData> {
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Please also update the send-api.service.abstraction

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.

I've updated the model being used to bubble up after calling save.

I have split the save and navigation part and use events to differ between create and update. The navigation (back or to the send-created-page) has been moved out of the shared component into the client-specific send-add-edit.component. The idea being that we later implement this component on web and desktop. The only thing I haven't found a great solution for is the back-navigation of the send-created page. This will need to be refactored at a later point.

Either find a way to wire up a send-create-close event and use the send-add-edit.component to take care of the navigation
or
The send-created page is slimmed down to it's body and the send-add-edit.component.html includes it under a conditional. That would mean though that it would also need to change the header and take care of the new buttons shown in the footer 🤷

Merging this, to continue testing, but will need more work to make it a fully shareable component across all clients.

@djsmith85 djsmith85 merged commit dab60db into main Oct 1, 2024
64 checks passed
@djsmith85 djsmith85 deleted the PM-11926 branch October 1, 2024 19:58
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