Skip to content

Commit cb9e77a

Browse files
committed
fix comments: avoid explicit type casting, sonar issues
1 parent 6f370dc commit cb9e77a

File tree

3 files changed

+29
-22
lines changed

3 files changed

+29
-22
lines changed

src/app/store/effects/bigOrderTable.effects.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export class BigOrderTableEffects {
142142
map((response) => {
143143
if (response.body) {
144144
this.snackBar.openSnackBar('changesSaved');
145-
return UpdateOrderInfoSuccess({ updatedOrder: response.body as IBigOrderTableOrderInfo });
145+
return UpdateOrderInfoSuccess({ updatedOrder: response.body });
146146
} else {
147147
this.snackBar.openSnackBar('error');
148148
return ReceivedFailure({ error: 'Failed to update order' });

src/app/ubs/ubs-admin/components/ubs-admin-order/ubs-admin-order.component.ts

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, OnInit, OnDestroy, AfterContentChecked, ChangeDetectorRef, ViewChild, HostListener } from '@angular/core';
1+
import { Component, OnInit, OnDestroy, AfterContentChecked, ChangeDetectorRef, HostListener } from '@angular/core';
22
import { FormArray, FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
33
import { ActivatedRoute, Params, Router } from '@angular/router';
44
import { formatDate } from '@angular/common';
@@ -11,14 +11,12 @@ import { UbsAdminCancelModalComponent } from '../ubs-admin-cancel-modal/ubs-admi
1111
import { OrderService } from '../../services/order.service';
1212
import { LocalStorageService } from '@global-service/localstorage/local-storage.service';
1313
import {
14-
IAddressExportDetails,
1514
IEmployee,
1615
IExportDetails,
1716
IGeneralOrderInfo,
1817
IOrderDetails,
1918
IOrderInfo,
2019
IOrderStatusInfo,
21-
IPaymentInfo,
2220
IResponsiblePersons,
2321
IUpdateResponsibleEmployee,
2422
IUserInfo,
@@ -50,7 +48,6 @@ export class UbsAdminOrderComponent implements OnInit, OnDestroy, AfterContentCh
5048
private destroy$: Subject<boolean> = new Subject<boolean>();
5149
isOrderCancelledAfterFormed: boolean;
5250
orderForm: FormGroup;
53-
isDataLoaded = false;
5451
orderId: number;
5552
orderInfo: IOrderInfo;
5653
generalInfo: IGeneralOrderInfo;
@@ -94,17 +91,17 @@ export class UbsAdminOrderComponent implements OnInit, OnDestroy, AfterContentCh
9491
return this.orderForm.controls.addressExportDetailsDto as FormControl;
9592
}
9693
constructor(
97-
private translate: TranslateService,
98-
private localStorageService: LocalStorageService,
99-
private adminTableService: AdminTableService,
100-
private fb: FormBuilder,
101-
private dialog: MatDialog,
102-
private route: ActivatedRoute,
103-
private router: Router,
104-
private changeDetector: ChangeDetectorRef,
105-
private store: Store<IAppState>,
106-
private actions$: Actions,
107-
private orderService: OrderService,
94+
private readonly translate: TranslateService,
95+
private readonly localStorageService: LocalStorageService,
96+
private readonly adminTableService: AdminTableService,
97+
private readonly fb: FormBuilder,
98+
private readonly dialog: MatDialog,
99+
private readonly route: ActivatedRoute,
100+
private readonly router: Router,
101+
private readonly changeDetector: ChangeDetectorRef,
102+
private readonly store: Store<IAppState>,
103+
private readonly actions$: Actions,
104+
private readonly orderService: OrderService,
108105
public ubsAdminEmployeeService: UbsAdminEmployeeService,
109106
public unsavedChangesGuard: UnsavedChangesGuard
110107
) {}

src/app/ubs/ubs-admin/services/order.service.ts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { HttpClient } from '@angular/common/http';
1+
import { HttpClient, HttpResponse } from '@angular/common/http';
22
import { Injectable } from '@angular/core';
33
import { Observable } from 'rxjs';
44
import {
@@ -10,7 +10,8 @@ import {
1010
ResponsibleEmployee,
1111
INotTakenOutReason,
1212
NotTakenOutReasonImages,
13-
IOrderInfo
13+
IOrderInfo,
14+
IBigOrderTableOrderInfo
1415
} from '../models/ubs-admin.interface';
1516
import { environment } from '@environment/environment';
1617
import { IViolation } from '../models/violation.model';
@@ -97,7 +98,12 @@ export class OrderService {
9798
return this.http.get<IOrderInfo>(`${this.backend}/management/get-data-for-order/${orderId}`);
9899
}
99100

100-
updateOrderInfo(orderId: number, lang: string, data: object, images?: NotTakenOutReasonImages[]) {
101+
updateOrderInfo(
102+
orderId: number,
103+
lang: string,
104+
data: object,
105+
images?: NotTakenOutReasonImages[]
106+
): Observable<HttpResponse<IBigOrderTableOrderInfo>> {
101107
const formData: FormData = new FormData();
102108
formData.append('updateOrderPageAdminDto', JSON.stringify(data));
103109

@@ -107,9 +113,13 @@ export class OrderService {
107113
});
108114
}
109115

110-
return this.http.patch(`${this.backend}/management/update-order-page-admin-info/${orderId}?language=${lang}`, formData, {
111-
observe: 'response'
112-
});
116+
return this.http.patch<IBigOrderTableOrderInfo>(
117+
`${this.backend}/management/update-order-page-admin-info/${orderId}?language=${lang}`,
118+
formData,
119+
{
120+
observe: 'response'
121+
}
122+
);
113123
}
114124

115125
getIsOrderCancelledAfterFormed(orderId: number): Observable<boolean> {

0 commit comments

Comments
 (0)