-
Notifications
You must be signed in to change notification settings - Fork 46
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
[Fix] #7836 admin edit all types of order comments #3489
Conversation
@@ -0,0 +1,56 @@ | |||
* { | |||
font-family: var(--ubs-quaternary-font); |
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.
Font property font-family does not have generic default:
font-family: var(--ubs-quaternary-font), sans-serif;
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.
It`s defined in the variable declaration:
--ubs-quaternary-font: 'Lato', sans-serif;
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.
For some reason `var' doesn't work correctly for font-family,
okay, leave it as it is
@@ -57,10 +58,13 @@ export class UbsAdminOrderDetailsFormComponent implements OnInit, OnChanges { | |||
|
|||
constructor(private readonly orderService: OrderService) {} | |||
|
|||
get customerComment() { |
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.
For better type safety return FormControl
get customerComment(): FormControl
@@ -0,0 +1,92 @@ | |||
import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing'; |
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.
Unused imports specifier fakeAsync, tick
.blockOrders(this.typeOfChange) | ||
.pipe(take(1)) | ||
.subscribe((res: IAlertInfo[]) => { | ||
if (res[0] === undefined) { |
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.
We can flip condition:
if (res && res[0])
in both this.isBlocked = false;
Handle any errors that might occur during the request
@@ -6,6 +6,7 @@ import { TableCellReadonlyComponent } from './table-cell-readonly.component'; | |||
import { Language } from 'src/app/main/i18n/Language'; | |||
import { TableKeys } from '../../../services/table-keys.enum'; | |||
import { PaymnetStatus } from '../../../../ubs/order-status.enum'; |
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.
Import can be shortened:
'@ubs/ubs/order-status.enum'
@@ -354,6 +355,27 @@ export class AdminTableService { | |||
this.filters = this.filters.filter((filteredElem) => !filteredElem[colName]); | |||
} | |||
|
|||
showTooltip(event: any, tooltip: any, font: string, maxLength = 50): void { |
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.
Use a more precise type (MouseEvent) instead of any for better type safety
and ensure event.target is a valid HTMLElement and check the text length
const target = event.target as HTMLElement;
const lengthStr = target?.innerText.length;
isBlocked: boolean; | ||
|
||
private typeOfChange: number[]; | ||
private font = '12px Lato, sans-serif'; |
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.
Member 'font' is never reassigned; mark it as readonly.
also pay attentions on sonar issues
Quality Gate failedFailed conditions |
Issue: #7836
Summary of changes: