Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ RUN npm ci && \
npm prune --omit=dev

# ---------- Release ----------
FROM nginx:1.29.1-alpine-slim
FROM nginx:1.29.2-alpine-slim

# Copy nginx config file
RUN rm -rf /usr/share/nginx/html/* && rm -rf /etc/nginx/nginx.conf
Expand Down
1,344 changes: 454 additions & 890 deletions npm-shrinkwrap.json

Large diffs are not rendered by default.

48 changes: 24 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,40 +24,40 @@
"license": "MIT",
"private": true,
"dependencies": {
"@angular/animations": "~20.3.2",
"@angular/cdk": "~20.2.5",
"@angular/common": "~20.3.2",
"@angular/compiler": "~20.3.2",
"@angular/core": "~20.3.2",
"@angular/forms": "~20.3.2",
"@angular/material": "~20.2.5",
"@angular/platform-browser": "~20.3.2",
"@angular/platform-browser-dynamic": "~20.3.2",
"@angular/router": "~20.3.2",
"@angular/service-worker": "~20.3.2",
"@apollo/client": "^3.14.0",
"@angular/animations": "~20.3.7",
"@angular/cdk": "~20.2.10",
"@angular/common": "~20.3.7",
"@angular/compiler": "~20.3.7",
"@angular/core": "~20.3.7",
"@angular/forms": "~20.3.7",
"@angular/material": "~20.2.10",
"@angular/platform-browser": "~20.3.7",
"@angular/platform-browser-dynamic": "~20.3.7",
"@angular/router": "~20.3.7",
"@angular/service-worker": "~20.3.7",
"@apollo/client": "^4.0.7",
"@ng-bootstrap/ng-bootstrap": "~19.0.1",
"@types/grecaptcha": "^3.0.9",
"apollo-angular": "^11.0.0",
"chart.js": "^4.5.0",
"core-js": "^3.45.1",
"apollo-angular": "^12.1.0",
"chart.js": "^4.5.1",
"core-js": "^3.46.0",
"graphql": "^16.11.0",
"graphql-tag": "^2.12.6",
"ngx-markdown": "^20.1.0",
"rxjs": "^7.8.2",
"tslib": "^2.8.1"
},
"devDependencies": {
"@angular/build": "^20.3.3",
"@angular/cli": "^20.3.3",
"@angular/compiler-cli": "~20.3.2",
"@types/node": "^24.5.2",
"@types/react": "^19.1.15",
"angular-eslint": "20.3.0",
"eslint": "^9.36.0",
"@angular/build": "^20.3.7",
"@angular/cli": "^20.3.7",
"@angular/compiler-cli": "~20.3.7",
"@types/node": "^24.9.1",
"@types/react": "^19.2.2",
"angular-eslint": "20.4.0",
"eslint": "^9.38.0",
"ts-node": "^10.9.2",
"typescript": "^5.9.2",
"typescript-eslint": "8.44.1"
"typescript": "^5.9.3",
"typescript-eslint": "8.46.2"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class AppComponent implements OnInit, OnDestroy {
this.authService.currentUser.subscribe(() => {
this.loggedUserName = this.authService.getUserInfo("name");
const avatar = this.authService.getUserInfo("avatar");
this.profileAvatar = avatar || "assets\\switcherapi_mark_white.png";
this.profileAvatar = avatar || String.raw`assets\switcherapi_mark_white.png`;
});

this.reloadTheme();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class DomainListComponent implements OnInit, OnDestroy {
createDomain(): void {
const dialogRef = this.dialog.open(DomainCreateComponent, {
width: '400px',
minWidth: window.innerWidth < 450 ? '95vw' : '',
minWidth: globalThis.innerWidth < 450 ? '95vw' : '',
data: { name: '', description: '' }
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export class ChangelogComponent implements OnInit, OnDestroy {
});

this.activatedRoute.paramMap
.pipe(map(() => window.history.state))
.pipe(map(() => globalThis.history.state))
.pipe(takeUntil(this.unsubscribe))
.subscribe(data => this.fetch = data.navigationId === 1);
}
Expand Down Expand Up @@ -140,11 +140,11 @@ export class ChangelogComponent implements OnInit, OnDestroy {
.pipe(takeUntil(this.unsubscribe))
.subscribe(data => {
if (data.length) {
data.forEach(element => {
for (const element of data) {
if (element.action === 'DELETE') {
this.removable = element.result === 'ok';
}
});
}
}
});
}
Expand Down Expand Up @@ -308,17 +308,17 @@ export class ChangelogComponent implements OnInit, OnDestroy {
}

private customFilterPredicate(data: History, filter: string): boolean {
if (data.updatedBy.indexOf(filter) >= 0) {
if (data.updatedBy.includes(filter)) {
return true;
}

if (data.date.toString().indexOf(filter) >= 0) {
if (data.date.toString().includes(filter)) {
return true;
}

return Object.keys(data.newValue).filter(key => key.indexOf(filter) >= 0).length > 0 ||
Object.values(data.newValue).filter(value => value.indexOf(filter) >= 0).length > 0 ||
Object.values(data.oldValue).filter(value => value.indexOf(filter) >= 0).length > 0;
return Object.keys(data.newValue).some(key => key.includes(filter)) ||
Object.values(data.newValue).some(value => String(value).includes(filter)) ||
Object.values(data.oldValue).some(value => String(value).includes(filter));
}

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

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

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

formatExpandedData(element: any): string {
if (element instanceof Object) {
return element != undefined ? JSON.stringify(element) : '';
return JSON.stringify(element);
}
return element;
}

formatDateContent(value: string): string {
if (window.screen.width < 380) {
if (globalThis.screen.width < 380) {
return this.datepipe.transform(value, 'yy/MM/dd HH:mm');
}
return value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ConsoleLogger } from 'src/app/_helpers/console-logger';
import { FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
import { DomainService } from 'src/app/services/domain.service';
import { Group } from 'src/app/model/group';
import { ApolloQueryResult } from '@apollo/client';
import { Apollo } from 'apollo-angular/apollo';
import { MatFormField, MatLabel, MatInput } from '@angular/material/input';
import { MatAutocompleteTrigger, MatAutocomplete, MatOption } from '@angular/material/autocomplete';
import { MatTooltip } from '@angular/material/tooltip';
Expand Down Expand Up @@ -33,7 +33,7 @@ export class ElementAutocompleteComponent implements OnInit, OnDestroy {
smartSearchFormControl = new FormControl('');
searchListItems: any[] = [];
searchedValues: Observable<any[]>;
private query: Observable<ApolloQueryResult<any>>;
private query: Observable<Apollo.QueryResult<any>>;

ngOnInit() {
this.searchedValues = this.smartSearchFormControl.valueChanges.pipe(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class ComponentsComponent extends BasicComponent implements OnInit, OnDes
});

this.activatedRoute.paramMap
.pipe(map(() => window.history.state))
.pipe(map(() => globalThis.history.state))
.pipe(takeUntil(this.unsubscribe))
.subscribe(data => this.fetch = data.navigationId === 1);
}
Expand Down Expand Up @@ -119,15 +119,15 @@ export class ComponentsComponent extends BasicComponent implements OnInit, OnDes
.pipe(takeUntil(this.unsubscribe))
.subscribe(data => {
if (data.length) {
data.forEach(element => {
for (const element of data) {
if (element.action === 'UPDATE') {
this.updatable = element.result === 'ok';
} else if (element.action === 'DELETE') {
this.removable = element.result === 'ok';
} else if (element.action === 'CREATE') {
this.creatable = element.result === 'ok';
}
});
}
}
});
}
Expand Down Expand Up @@ -169,14 +169,14 @@ export class ComponentsComponent extends BasicComponent implements OnInit, OnDes
modalConfirmation.componentInstance.question = `Are you sure you want to remove ${selectedEnvironment.name}?`;
modalConfirmation.result.then((result) => {
if (result) {
const component = this.components.filter(env => env.id === selectedEnvironment.id);
const component = this.components.find(env => env.id === selectedEnvironment.id);

this.compService.deleteComponent(selectedEnvironment.id)
.pipe(takeUntil(this.unsubscribe))
.subscribe({
next: env => {
if (env) {
this.components.splice(this.components.indexOf(component[0]), 1);
if (env && component) {
this.components.splice(this.components.indexOf(component), 1);
this.toastService.showSuccess('Component removed with success');
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,38 +154,38 @@ export class ConfigDetailComponent extends DetailComponent implements OnInit, On
if (!this.editing) {
this.classStatus = 'header editing';
this.editing = true;
} else {
const { valid } = this.keyFormControl;

if (valid) {
this.setBlockUI(true, 'Saving changes...');
this.classStatus = this.currentStatus ? 'header activated' : 'header deactivated';

const body = {
key: this.keyElement.nativeElement.value,
description: this.descElement.nativeElement.value
};

if (super.validateEdition({
key: this.config.key,
description: this.config.description,
components: String(this.config.components.map(component => component.name)),
disable_metrics: this.config.disable_metrics != undefined ?
this.config.disable_metrics[this.currentEnvironment] : false
},
{
key: body.key,
description: body.description,
components: String(this.components),
disable_metrics: this.disableMetrics
})) {
this.setBlockUI(false);
this.editing = false;
return;
}
return;
}

this.editConfig(body);
const { valid } = this.keyFormControl;

if (valid) {
this.setBlockUI(true, 'Saving changes...');
this.classStatus = this.currentStatus ? 'header activated' : 'header deactivated';

const body = {
key: this.keyElement.nativeElement.value,
description: this.descElement.nativeElement.value
};

if (super.validateEdition({
key: this.config.key,
description: this.config.description,
components: String(this.config.components.map(component => component.name)),
disable_metrics: this.config.disable_metrics === undefined ?
false : this.config.disable_metrics[this.currentEnvironment]
}, {
key: body.key,
description: body.description,
components: String(this.components),
disable_metrics: this.disableMetrics
})) {
this.setBlockUI(false);
this.editing = false;
return;
}

this.editConfig(body);
}
}

Expand Down Expand Up @@ -217,7 +217,7 @@ export class ConfigDetailComponent extends DetailComponent implements OnInit, On
addStrategy() {
const dialogRef = this.dialog.open(StrategyCreateComponent, {
width: '700px',
minWidth: window.innerWidth < 450 ? '95vw' : '',
minWidth: globalThis.innerWidth < 450 ? '95vw' : '',
data: {
currentStrategies: this.strategies.getValue()
}
Expand Down Expand Up @@ -486,8 +486,8 @@ export class ConfigDetailComponent extends DetailComponent implements OnInit, On
private editConfig(body: { key: string; description: string; }): void {
const updateDisableMetrics = this.getDisableMetricsChange();
this.configService.updateConfig(this.config.id,
body.key != this.config.key ? body.key : undefined,
body.description != this.config.description ? body.description : undefined, updateDisableMetrics)
body.key === this.config.key ? undefined : body.key,
body.description === this.config.description ? undefined : body.description, updateDisableMetrics)
.pipe(takeUntil(this.unsubscribe))
.subscribe({
next: data => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class ConfigListComponent extends ListComponent implements OnInit, OnDest
createConfig(): void {
const dialogRef = this.dialog.open(ConfigCreateComponent, {
width: '400px',
minWidth: window.innerWidth < 450 ? '95vw' : '',
minWidth: globalThis.innerWidth < 450 ? '95vw' : '',
data: { key: '', description: '' }
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export class ConfigPreviewComponent extends BasicComponent implements OnInit, On
private readPermissionToObject(): void {
this.loadOperationSelectionComponent();

const element = this.permissions.filter(p => p.id === this.config.id)[0];
const element = this.permissions.find(p => p.id === this.config.id);
this.updatable = element.permissions.find(p => p.action === 'UPDATE').result === 'ok';
this.removable = element.permissions.find(p => p.action === 'DELETE').result === 'ok';

Expand Down
Loading