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-12732] - fix new send button #11266

Merged
merged 2 commits into from
Oct 1, 2024
Merged

[PM-12732] - fix new send button #11266

merged 2 commits into from
Oct 1, 2024

Conversation

jaasen-livefront
Copy link
Collaborator

🎟️ Tracking

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

📔 Objective

This PR fixes the create send button shown in the main window when no sends are active.

📸 Screenshots

Screenshot 2024-09-26 at 3 17 21 PM

⏰ 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 26, 2024

Codecov Report

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

Project coverage is 33.22%. Comparing base (46f62b6) to head (e5a73da).
Report is 35 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...c/new-send-dropdown/new-send-dropdown.component.ts 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11266      +/-   ##
==========================================
+ Coverage   33.20%   33.22%   +0.02%     
==========================================
  Files        2727     2730       +3     
  Lines       85175    85257      +82     
  Branches    16204    16221      +17     
==========================================
+ Hits        28279    28326      +47     
- Misses      54643    54675      +32     
- Partials     2253     2256       +3     

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

Copy link
Contributor

github-actions bot commented Sep 26, 2024

Logo
Checkmarx One – Scan Summary & Detailsa8c6a57b-822d-4e1a-9771-94621ce0f7e1

Fixed Issues

Severity Issue Source File / Package
MEDIUM Client_Privacy_Violation /libs/tools/generator/components/src/username-generator.component.html: 3

Comment on lines 35 to 38
get iconClass() {
return this.showIcon ? "bwi bwi-plus-f" : null;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

❓ Why have this getter if the *ngIf within the mark up can already hide show the icon?

@@ -1,7 +1,7 @@
<popup-page>
<popup-header slot="header" [pageTitle]="'send' | i18n">
<ng-container slot="end">
<tools-new-send-dropdown *ngIf="!sendsDisabled"></tools-new-send-dropdown>
<tools-new-send-dropdown [showIcon]="true" *ngIf="!sendsDisabled"></tools-new-send-dropdown>
Copy link
Contributor

Choose a reason for hiding this comment

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

I think I'd prefer an optional hideIcon as the more common usage is the + New instead of New Send. Considering the future usage within web and potentially desktop

Which would mean instead of changing line 4, you'd need to modify line 26

@@ -1,6 +1,6 @@
<button bitButton [bitMenuTriggerFor]="itemOptions" buttonType="primary" type="button">
<i class="bwi bwi-plus-f" aria-hidden="true"></i>
{{ "new" | i18n }}
<i *ngIf="iconClass" class="{{ iconClass }}" aria-hidden="true"></i>
Copy link
Contributor

Choose a reason for hiding this comment

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

The class being filled by the getter iconClass is unnecessary as it can always be bwi bwi-plus-f

<i class="bwi bwi-plus-f" aria-hidden="true"></i>
{{ "new" | i18n }}
<i *ngIf="iconClass" class="{{ iconClass }}" aria-hidden="true"></i>
{{ (iconClass ? "new" : "createSend") | i18n }}
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 then also be achieved via the hideIcon input. Modifying the text, using the same input/getter for the icon is not ideal and my suggestion doesn't improve that. I'm open to ideas, but also fine with keeping it as suggested

@jaasen-livefront
Copy link
Collaborator Author

@djsmith85 Agree 💯% with your remarks. This was overly complicated for such a simple implementation.

@djsmith85 djsmith85 merged commit 5a1583c into main Oct 1, 2024
64 of 66 checks passed
@djsmith85 djsmith85 deleted the PM-12732 branch October 1, 2024 09:36
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