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

[Fix] #7836 admin edit all types of order comments #3489

Merged
merged 9 commits into from
Dec 16, 2024

Conversation

yuliiakaras
Copy link
Collaborator

Issue: #7836
Summary of changes:

  • Added the ability to change all types of order comments on separate order page
  • Added popup for adding/editing different types of order comments

@@ -0,0 +1,56 @@
* {
font-family: var(--ubs-quaternary-font);
Copy link
Contributor

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;

Copy link
Collaborator Author

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;

Copy link
Contributor

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() {
Copy link
Contributor

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';
Copy link
Contributor

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) {
Copy link
Contributor

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';
Copy link
Contributor

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 {
Copy link
Contributor

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';
Copy link
Contributor

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

Copy link

sonarcloud bot commented Dec 16, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
52.7% Coverage on New Code (required ≥ 75%)

See analysis details on SonarQube Cloud

@hnativlyubomyr hnativlyubomyr merged commit fe5ad1d into dev Dec 16, 2024
1 of 2 checks passed
@hnativlyubomyr hnativlyubomyr deleted the fix/#7836-admin-edit-all-comments branch December 16, 2024 07:02
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