Skip to content

Commit 8003e78

Browse files
committed
Bumped [email protected], [email protected], fixed code smells
1 parent f099b83 commit 8003e78

File tree

54 files changed

+1500
-1644
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1500
-1644
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ RUN npm ci && \
1515
npm prune --omit=dev
1616

1717
# ---------- Release ----------
18-
FROM nginx:1.29.1-alpine-slim
18+
FROM nginx:1.29.2-alpine-slim
1919

2020
# Copy nginx config file
2121
RUN rm -rf /usr/share/nginx/html/* && rm -rf /etc/nginx/nginx.conf

npm-shrinkwrap.json

Lines changed: 454 additions & 890 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -24,40 +24,40 @@
2424
"license": "MIT",
2525
"private": true,
2626
"dependencies": {
27-
"@angular/animations": "~20.3.2",
28-
"@angular/cdk": "~20.2.5",
29-
"@angular/common": "~20.3.2",
30-
"@angular/compiler": "~20.3.2",
31-
"@angular/core": "~20.3.2",
32-
"@angular/forms": "~20.3.2",
33-
"@angular/material": "~20.2.5",
34-
"@angular/platform-browser": "~20.3.2",
35-
"@angular/platform-browser-dynamic": "~20.3.2",
36-
"@angular/router": "~20.3.2",
37-
"@angular/service-worker": "~20.3.2",
38-
"@apollo/client": "^3.14.0",
27+
"@angular/animations": "~20.3.7",
28+
"@angular/cdk": "~20.2.10",
29+
"@angular/common": "~20.3.7",
30+
"@angular/compiler": "~20.3.7",
31+
"@angular/core": "~20.3.7",
32+
"@angular/forms": "~20.3.7",
33+
"@angular/material": "~20.2.10",
34+
"@angular/platform-browser": "~20.3.7",
35+
"@angular/platform-browser-dynamic": "~20.3.7",
36+
"@angular/router": "~20.3.7",
37+
"@angular/service-worker": "~20.3.7",
38+
"@apollo/client": "^4.0.7",
3939
"@ng-bootstrap/ng-bootstrap": "~19.0.1",
4040
"@types/grecaptcha": "^3.0.9",
41-
"apollo-angular": "^11.0.0",
42-
"chart.js": "^4.5.0",
43-
"core-js": "^3.45.1",
41+
"apollo-angular": "^12.1.0",
42+
"chart.js": "^4.5.1",
43+
"core-js": "^3.46.0",
4444
"graphql": "^16.11.0",
4545
"graphql-tag": "^2.12.6",
4646
"ngx-markdown": "^20.1.0",
4747
"rxjs": "^7.8.2",
4848
"tslib": "^2.8.1"
4949
},
5050
"devDependencies": {
51-
"@angular/build": "^20.3.3",
52-
"@angular/cli": "^20.3.3",
53-
"@angular/compiler-cli": "~20.3.2",
54-
"@types/node": "^24.5.2",
55-
"@types/react": "^19.1.15",
56-
"angular-eslint": "20.3.0",
57-
"eslint": "^9.36.0",
51+
"@angular/build": "^20.3.7",
52+
"@angular/cli": "^20.3.7",
53+
"@angular/compiler-cli": "~20.3.7",
54+
"@types/node": "^24.9.1",
55+
"@types/react": "^19.2.2",
56+
"angular-eslint": "20.4.0",
57+
"eslint": "^9.38.0",
5858
"ts-node": "^10.9.2",
59-
"typescript": "^5.9.2",
60-
"typescript-eslint": "8.44.1"
59+
"typescript": "^5.9.3",
60+
"typescript-eslint": "8.46.2"
6161
},
6262
"repository": {
6363
"type": "git",

src/app/app.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export class AppComponent implements OnInit, OnDestroy {
7272
this.authService.currentUser.subscribe(() => {
7373
this.loggedUserName = this.authService.getUserInfo("name");
7474
const avatar = this.authService.getUserInfo("avatar");
75-
this.profileAvatar = avatar || "assets\\switcherapi_mark_white.png";
75+
this.profileAvatar = avatar || String.raw`assets\switcherapi_mark_white.png`;
7676
});
7777

7878
this.reloadTheme();

src/app/dashboard-module/domain-list/domain-list.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export class DomainListComponent implements OnInit, OnDestroy {
5858
createDomain(): void {
5959
const dialogRef = this.dialog.open(DomainCreateComponent, {
6060
width: '400px',
61-
minWidth: window.innerWidth < 450 ? '95vw' : '',
61+
minWidth: globalThis.innerWidth < 450 ? '95vw' : '',
6262
data: { name: '', description: '' }
6363
});
6464

src/app/dashboard-module/domain-module/changelog/changelog.component.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export class ChangelogComponent implements OnInit, OnDestroy {
9898
});
9999

100100
this.activatedRoute.paramMap
101-
.pipe(map(() => window.history.state))
101+
.pipe(map(() => globalThis.history.state))
102102
.pipe(takeUntil(this.unsubscribe))
103103
.subscribe(data => this.fetch = data.navigationId === 1);
104104
}
@@ -140,11 +140,11 @@ export class ChangelogComponent implements OnInit, OnDestroy {
140140
.pipe(takeUntil(this.unsubscribe))
141141
.subscribe(data => {
142142
if (data.length) {
143-
data.forEach(element => {
143+
for (const element of data) {
144144
if (element.action === 'DELETE') {
145145
this.removable = element.result === 'ok';
146146
}
147-
});
147+
}
148148
}
149149
});
150150
}
@@ -308,17 +308,17 @@ export class ChangelogComponent implements OnInit, OnDestroy {
308308
}
309309

310310
private customFilterPredicate(data: History, filter: string): boolean {
311-
if (data.updatedBy.indexOf(filter) >= 0) {
311+
if (data.updatedBy.includes(filter)) {
312312
return true;
313313
}
314314

315-
if (data.date.toString().indexOf(filter) >= 0) {
315+
if (data.date.toString().includes(filter)) {
316316
return true;
317317
}
318318

319-
return Object.keys(data.newValue).filter(key => key.indexOf(filter) >= 0).length > 0 ||
320-
Object.values(data.newValue).filter(value => value.indexOf(filter) >= 0).length > 0 ||
321-
Object.values(data.oldValue).filter(value => value.indexOf(filter) >= 0).length > 0;
319+
return Object.keys(data.newValue).some(key => key.includes(filter)) ||
320+
Object.values(data.newValue).some(value => String(value).includes(filter)) ||
321+
Object.values(data.oldValue).some(value => String(value).includes(filter));
322322
}
323323

324324
private compare(a: number | string, b: number | string, isAsc: boolean) {
@@ -346,7 +346,7 @@ export class ChangelogComponent implements OnInit, OnDestroy {
346346
}
347347

348348
getColumnLabel(dataColumn: string): string {
349-
return this.columnsToDisplay.filter(column => column.data === dataColumn)[0].display;
349+
return this.columnsToDisplay.find(column => column.data === dataColumn)?.display ?? '';
350350
}
351351

352352
getElementKeys(element: any): string[] {
@@ -367,13 +367,13 @@ export class ChangelogComponent implements OnInit, OnDestroy {
367367

368368
formatExpandedData(element: any): string {
369369
if (element instanceof Object) {
370-
return element != undefined ? JSON.stringify(element) : '';
370+
return JSON.stringify(element);
371371
}
372372
return element;
373373
}
374374

375375
formatDateContent(value: string): string {
376-
if (window.screen.width < 380) {
376+
if (globalThis.screen.width < 380) {
377377
return this.datepipe.transform(value, 'yy/MM/dd HH:mm');
378378
}
379379
return value;

src/app/dashboard-module/domain-module/common/element-autocomplete/element-autocomplete.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { ConsoleLogger } from 'src/app/_helpers/console-logger';
55
import { FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
66
import { DomainService } from 'src/app/services/domain.service';
77
import { Group } from 'src/app/model/group';
8-
import { ApolloQueryResult } from '@apollo/client';
8+
import { Apollo } from 'apollo-angular/apollo';
99
import { MatFormField, MatLabel, MatInput } from '@angular/material/input';
1010
import { MatAutocompleteTrigger, MatAutocomplete, MatOption } from '@angular/material/autocomplete';
1111
import { MatTooltip } from '@angular/material/tooltip';
@@ -33,7 +33,7 @@ export class ElementAutocompleteComponent implements OnInit, OnDestroy {
3333
smartSearchFormControl = new FormControl('');
3434
searchListItems: any[] = [];
3535
searchedValues: Observable<any[]>;
36-
private query: Observable<ApolloQueryResult<any>>;
36+
private query: Observable<Apollo.QueryResult<any>>;
3737

3838
ngOnInit() {
3939
this.searchedValues = this.smartSearchFormControl.valueChanges.pipe(

src/app/dashboard-module/domain-module/components/components.component.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export class ComponentsComponent extends BasicComponent implements OnInit, OnDes
7676
});
7777

7878
this.activatedRoute.paramMap
79-
.pipe(map(() => window.history.state))
79+
.pipe(map(() => globalThis.history.state))
8080
.pipe(takeUntil(this.unsubscribe))
8181
.subscribe(data => this.fetch = data.navigationId === 1);
8282
}
@@ -119,15 +119,15 @@ export class ComponentsComponent extends BasicComponent implements OnInit, OnDes
119119
.pipe(takeUntil(this.unsubscribe))
120120
.subscribe(data => {
121121
if (data.length) {
122-
data.forEach(element => {
122+
for (const element of data) {
123123
if (element.action === 'UPDATE') {
124124
this.updatable = element.result === 'ok';
125125
} else if (element.action === 'DELETE') {
126126
this.removable = element.result === 'ok';
127127
} else if (element.action === 'CREATE') {
128128
this.creatable = element.result === 'ok';
129129
}
130-
});
130+
}
131131
}
132132
});
133133
}
@@ -169,14 +169,14 @@ export class ComponentsComponent extends BasicComponent implements OnInit, OnDes
169169
modalConfirmation.componentInstance.question = `Are you sure you want to remove ${selectedEnvironment.name}?`;
170170
modalConfirmation.result.then((result) => {
171171
if (result) {
172-
const component = this.components.filter(env => env.id === selectedEnvironment.id);
172+
const component = this.components.find(env => env.id === selectedEnvironment.id);
173173

174174
this.compService.deleteComponent(selectedEnvironment.id)
175175
.pipe(takeUntil(this.unsubscribe))
176176
.subscribe({
177177
next: env => {
178-
if (env) {
179-
this.components.splice(this.components.indexOf(component[0]), 1);
178+
if (env && component) {
179+
this.components.splice(this.components.indexOf(component), 1);
180180
this.toastService.showSuccess('Component removed with success');
181181
}
182182
},

src/app/dashboard-module/domain-module/config/config-detail/config-detail.component.ts

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -154,38 +154,38 @@ export class ConfigDetailComponent extends DetailComponent implements OnInit, On
154154
if (!this.editing) {
155155
this.classStatus = 'header editing';
156156
this.editing = true;
157-
} else {
158-
const { valid } = this.keyFormControl;
159-
160-
if (valid) {
161-
this.setBlockUI(true, 'Saving changes...');
162-
this.classStatus = this.currentStatus ? 'header activated' : 'header deactivated';
163-
164-
const body = {
165-
key: this.keyElement.nativeElement.value,
166-
description: this.descElement.nativeElement.value
167-
};
168-
169-
if (super.validateEdition({
170-
key: this.config.key,
171-
description: this.config.description,
172-
components: String(this.config.components.map(component => component.name)),
173-
disable_metrics: this.config.disable_metrics != undefined ?
174-
this.config.disable_metrics[this.currentEnvironment] : false
175-
},
176-
{
177-
key: body.key,
178-
description: body.description,
179-
components: String(this.components),
180-
disable_metrics: this.disableMetrics
181-
})) {
182-
this.setBlockUI(false);
183-
this.editing = false;
184-
return;
185-
}
157+
return;
158+
}
186159

187-
this.editConfig(body);
160+
const { valid } = this.keyFormControl;
161+
162+
if (valid) {
163+
this.setBlockUI(true, 'Saving changes...');
164+
this.classStatus = this.currentStatus ? 'header activated' : 'header deactivated';
165+
166+
const body = {
167+
key: this.keyElement.nativeElement.value,
168+
description: this.descElement.nativeElement.value
169+
};
170+
171+
if (super.validateEdition({
172+
key: this.config.key,
173+
description: this.config.description,
174+
components: String(this.config.components.map(component => component.name)),
175+
disable_metrics: this.config.disable_metrics === undefined ?
176+
false : this.config.disable_metrics[this.currentEnvironment]
177+
}, {
178+
key: body.key,
179+
description: body.description,
180+
components: String(this.components),
181+
disable_metrics: this.disableMetrics
182+
})) {
183+
this.setBlockUI(false);
184+
this.editing = false;
185+
return;
188186
}
187+
188+
this.editConfig(body);
189189
}
190190
}
191191

@@ -217,7 +217,7 @@ export class ConfigDetailComponent extends DetailComponent implements OnInit, On
217217
addStrategy() {
218218
const dialogRef = this.dialog.open(StrategyCreateComponent, {
219219
width: '700px',
220-
minWidth: window.innerWidth < 450 ? '95vw' : '',
220+
minWidth: globalThis.innerWidth < 450 ? '95vw' : '',
221221
data: {
222222
currentStrategies: this.strategies.getValue()
223223
}
@@ -486,8 +486,8 @@ export class ConfigDetailComponent extends DetailComponent implements OnInit, On
486486
private editConfig(body: { key: string; description: string; }): void {
487487
const updateDisableMetrics = this.getDisableMetricsChange();
488488
this.configService.updateConfig(this.config.id,
489-
body.key != this.config.key ? body.key : undefined,
490-
body.description != this.config.description ? body.description : undefined, updateDisableMetrics)
489+
body.key === this.config.key ? undefined : body.key,
490+
body.description === this.config.description ? undefined : body.description, updateDisableMetrics)
491491
.pipe(takeUntil(this.unsubscribe))
492492
.subscribe({
493493
next: data => {

src/app/dashboard-module/domain-module/config/config-list/config-list.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export class ConfigListComponent extends ListComponent implements OnInit, OnDest
8484
createConfig(): void {
8585
const dialogRef = this.dialog.open(ConfigCreateComponent, {
8686
width: '400px',
87-
minWidth: window.innerWidth < 450 ? '95vw' : '',
87+
minWidth: globalThis.innerWidth < 450 ? '95vw' : '',
8888
data: { key: '', description: '' }
8989
});
9090

0 commit comments

Comments
 (0)