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
NAS-128451 / 24.10 / Port WidgetSysInfoComponent to new dashboard #10047
Conversation
# Conflicts: # src/app/pages/dashboard/dashboard.module.ts # src/app/pages/dashboard/services/dashboard.store.ts # src/app/pages/dashboard/services/widget-resources.service.ts # src/app/pages/dashboard/types/widget-category.enum.ts # src/app/pages/dashboard/widgets/all-widgets.constant.ts # src/assets/i18n/nl.json # src/assets/i18n/zh-hans.json
@RehanY147 you're lucky :) |
src/app/pages/dashboard/widgets/system/common/product-image/product-image.component.html
Outdated
Show resolved
Hide resolved
src/app/pages/dashboard/widgets/system/common/product-image/product-image.component.spec.ts
Outdated
Show resolved
Hide resolved
src/app/pages/dashboard/widgets/system/common/product-image/product-image.component.ts
Outdated
Show resolved
Hide resolved
.../pages/dashboard/widgets/system/widget-sys-info-passive/widget-sys-info-passive.component.ts
Outdated
Show resolved
Hide resolved
...pp/pages/dashboard/widgets/system/widget-sys-info-active/widget-sys-info-active.component.ts
Outdated
Show resolved
Hide resolved
.../pages/dashboard/widgets/system/widget-sys-info-active/widget-sys-info-active.component.html
Outdated
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #10047 +/- ##
===========================================
+ Coverage 4.84% 73.95% +69.10%
===========================================
Files 1526 1537 +11
Lines 53446 53675 +229
Branches 6387 6410 +23
===========================================
+ Hits 2592 39696 +37104
+ Misses 50854 13979 -36875 ☔ View full report in Codecov by Sentry. |
@RehanY147 okay I made bunch of adjustments and ready for another review. |
isHaLicensed = input.required<boolean>(); | ||
isIxHardware = input.required<boolean>(); | ||
|
||
isUnsupportedHardware = computed(() => this.isEnterprise() && !this.isIxHardware() && !this.isHaLicensed()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer writing this like the following
isUnsupportedHardware = computed(() => {
const isEnterprise = this.isEnterprise();
const isIxHardware = this.isIxHardware();
const isHaLicensed = this.isHaLicensed();
return isEnterprise && !isIxHardware && !isHaLicensed;
});
Because of the way JavaScript handles comparison operators, it can ignore a signal dependency in a computed signal if during the initial execution, the signal was never fetched. For example, computed(() => this.isEnterprise() || this.isHa())
will ignore this.isHa()
every time if this.isEnterprise()
is always true. So, this.isHa()
is never considered a dependency for the computed signal.
This applies to all computed signals. As a best practice, any dependency signals should be fetched at the start of the compute callback function into variables so it's clear that they are all dependencies.
This PR has been merged and conversations have been locked. |
There are some TODOs to resolve but it is ready for review and testing.
The widget has some changes:
Show scale image placeholder even if it is Unsupported Hardware.
When a system has HA but HA is disabled the triangle exclamation icon and tooltip was moved into the button:
When a system has running update
UPDATE IN PROGRESS
string was moved into the button:The system reports icon was added on widget for active node that brings user to
/reportsdashboard/system