From bbffcd5aed13d2b7390dd2bc4f9823d61fb099c5 Mon Sep 17 00:00:00 2001 From: phil Date: Sat, 28 Jun 2025 03:58:17 +0200 Subject: [PATCH] Cleanup --- .../access/role-dialog.component.css | 0 .../access/role-dialog.component.ts | 37 +++--- .../maintenance/maintenance.component.css | 0 .../maintenance/maintenance.component.ts | 39 +++--- .../info/info-home/info-home.component.css | 0 src/app/info/info-home/info-home.component.ts | 7 +- .../info/info-tags/tag-action.component.css | 0 .../info/info-tags/tag-action.component.ts | 119 +++++++++--------- .../info/info-tools/downloader.component.css | 0 .../info/info-tools/downloader.component.ts | 33 +++-- 10 files changed, 116 insertions(+), 119 deletions(-) delete mode 100644 src/app/admin/admin-manage/access/role-dialog.component.css delete mode 100644 src/app/admin/admin-manage/maintenance/maintenance.component.css delete mode 100644 src/app/info/info-home/info-home.component.css delete mode 100644 src/app/info/info-tags/tag-action.component.css delete mode 100644 src/app/info/info-tools/downloader.component.css diff --git a/src/app/admin/admin-manage/access/role-dialog.component.css b/src/app/admin/admin-manage/access/role-dialog.component.css deleted file mode 100644 index e69de29..0000000 diff --git a/src/app/admin/admin-manage/access/role-dialog.component.ts b/src/app/admin/admin-manage/access/role-dialog.component.ts index 635f1d5..c0444a3 100644 --- a/src/app/admin/admin-manage/access/role-dialog.component.ts +++ b/src/app/admin/admin-manage/access/role-dialog.component.ts @@ -6,29 +6,28 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog' import { Role } from './models' export interface DialogData { - role: Role + role: Role } @Component({ - selector: 'gisaf-admin-access-role-dialog', - templateUrl: 'role-dialog.component.html', - styleUrls: ['role-dialog.component.css'], + selector: 'gisaf-admin-access-role-dialog', + templateUrl: 'role-dialog.component.html', }) export class GisafAdminAccessRoleDialogComponent implements OnInit { - formGroup: UntypedFormGroup = new UntypedFormGroup({}) - constructor( - public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: DialogData - ) {} + formGroup: UntypedFormGroup = new UntypedFormGroup({}) + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: DialogData + ) { } - ngOnInit() { - let role: Role = this.data['role'] || new Role(undefined, '', '') - this.formGroup.addControl('id', new UntypedFormControl(role.id)) - this.formGroup.addControl('name', new UntypedFormControl(role.name, [Validators.required])) - this.formGroup.addControl('description', new UntypedFormControl(role.description, [Validators.required])) - } + ngOnInit() { + let role: Role = this.data['role'] || new Role(undefined, '', '') + this.formGroup.addControl('id', new UntypedFormControl(role.id)) + this.formGroup.addControl('name', new UntypedFormControl(role.name, [Validators.required])) + this.formGroup.addControl('description', new UntypedFormControl(role.description, [Validators.required])) + } - save() { - this.dialogRef.close(this.formGroup.value); - } -} \ No newline at end of file + save() { + this.dialogRef.close(this.formGroup.value); + } +} diff --git a/src/app/admin/admin-manage/maintenance/maintenance.component.css b/src/app/admin/admin-manage/maintenance/maintenance.component.css deleted file mode 100644 index e69de29..0000000 diff --git a/src/app/admin/admin-manage/maintenance/maintenance.component.ts b/src/app/admin/admin-manage/maintenance/maintenance.component.ts index 5f907dc..2a3cbd1 100644 --- a/src/app/admin/admin-manage/maintenance/maintenance.component.ts +++ b/src/app/admin/admin-manage/maintenance/maintenance.component.ts @@ -5,28 +5,27 @@ import { MatSnackBar } from '@angular/material/snack-bar' import { AdminManageDataService } from '../data.service' @Component({ - selector: 'gisaf-admin-maintenance', - templateUrl: './maintenance.component.html', - styleUrls: ['./maintenance.component.css'], - changeDetection: ChangeDetectionStrategy.OnPush, + selector: 'gisaf-admin-maintenance', + templateUrl: './maintenance.component.html', + changeDetection: ChangeDetectionStrategy.OnPush, }) export class AdminMaintenanceComponent implements OnInit { - constructor( - private adminManageDataService: AdminManageDataService, - private snackBar: MatSnackBar, - private cdr: ChangeDetectorRef, - ) { } + constructor( + private adminManageDataService: AdminManageDataService, + private snackBar: MatSnackBar, + private cdr: ChangeDetectorRef, + ) { } - ngOnInit(): void { - } + ngOnInit(): void { + } - vacuumDb() { - this.adminManageDataService.vacuumDb().subscribe( - resp => this.snackBar.open( - 'Database vacuum OK', - 'Close', - ) - ) - } -} \ No newline at end of file + vacuumDb() { + this.adminManageDataService.vacuumDb().subscribe( + resp => this.snackBar.open( + 'Database vacuum OK', + 'Close', + ) + ) + } +} diff --git a/src/app/info/info-home/info-home.component.css b/src/app/info/info-home/info-home.component.css deleted file mode 100644 index e69de29..0000000 diff --git a/src/app/info/info-home/info-home.component.ts b/src/app/info/info-home/info-home.component.ts index 27de6aa..fe1c8c8 100644 --- a/src/app/info/info-home/info-home.component.ts +++ b/src/app/info/info-home/info-home.component.ts @@ -2,8 +2,7 @@ import { Component } from '@angular/core' @Component({ - selector: 'gisaf-info-home', - templateUrl: './info-home.component.html', - styleUrls: ['./info-home.component.css'] + selector: 'gisaf-info-home', + templateUrl: './info-home.component.html', }) -export class InfoHomeComponent {} +export class InfoHomeComponent { } diff --git a/src/app/info/info-tags/tag-action.component.css b/src/app/info/info-tags/tag-action.component.css deleted file mode 100644 index e69de29..0000000 diff --git a/src/app/info/info-tags/tag-action.component.ts b/src/app/info/info-tags/tag-action.component.ts index e2fd2fb..66970f2 100644 --- a/src/app/info/info-tags/tag-action.component.ts +++ b/src/app/info/info-tags/tag-action.component.ts @@ -1,5 +1,7 @@ -import { Component, Input, - ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core' +import { + Component, Input, + ChangeDetectionStrategy, ChangeDetectorRef +} from '@angular/core' import { Tag } from './tags.service' import { FullInfo, InfoDataService, FormField } from '../info-data.service' @@ -10,64 +12,63 @@ import { AuthenticationService } from '../../_services/authentication.service' import { MapControlService } from '../../map/map-control.service' @Component({ - selector: 'gisaf-tag-action', - templateUrl: './tag-action.component.html', - styleUrls: ['./tag-action.component.css'], - changeDetection: ChangeDetectionStrategy.OnPush, + selector: 'gisaf-tag-action', + templateUrl: './tag-action.component.html', + changeDetection: ChangeDetectionStrategy.OnPush, }) export class TagActionComponent { - @Input() source: FullInfo - @Input() action: Action - constructor( - private actionsService: ActionsService, - private infoDataService: InfoDataService, - private snackBar: MatSnackBar, - public authenticationService: AuthenticationService, - protected mapControlService: MapControlService, - private cdr: ChangeDetectorRef, - ) {} + @Input() source: FullInfo + @Input() action: Action + constructor( + private actionsService: ActionsService, + private infoDataService: InfoDataService, + private snackBar: MatSnackBar, + public authenticationService: AuthenticationService, + protected mapControlService: MapControlService, + private cdr: ChangeDetectorRef, + ) { } - execute() { - this.actionsService.execute( - [this.source.modelInfo.store], - [[this.source.featureInfo.id.toString()]], - [this.action.name], - this.action.params, - ).subscribe( - results => { - // Update the tags in the info source - let result = results[0].actionResults[0] - if (result.message) { - this.snackBar.open(result.message, 'Close', {duration: 3000}) - } - if (!result.actionResults || result.actionResults.length == 0) { - return - } - let layer = result.actionResults[0].taggedLayers.find( - tl => tl.store == this.source.modelInfo.store - ) - let feature = layer.features.find(f=>f.id == this.source.featureInfo.id) - if (feature) { - feature.tags.forEach( - tag => { - let existingTag = this.source.featureInfo.tags.find(t => t.key == tag.key) - if (existingTag) { - console.log("Tag update: test me!") - existingTag.value = tag.value - this.infoDataService.dataProviderService.next(this.source) - } - else { - this.source.featureInfo.tags.push({key: tag.key, value: tag.value}) - } - } - ) - this.infoDataService.dataProviderService.next(this.source) - } - // Trick to refresh the tags on the map - if (this.mapControlService.hasTags.value) { - this.mapControlService.hasTags.next(true) - } - } + execute() { + this.actionsService.execute( + [this.source.modelInfo.store], + [[this.source.featureInfo.id.toString()]], + [this.action.name], + this.action.params, + ).subscribe( + results => { + // Update the tags in the info source + let result = results[0].actionResults[0] + if (result.message) { + this.snackBar.open(result.message, 'Close', { duration: 3000 }) + } + if (!result.actionResults || result.actionResults.length == 0) { + return + } + let layer = result.actionResults[0].taggedLayers.find( + tl => tl.store == this.source.modelInfo.store ) - } -} \ No newline at end of file + let feature = layer.features.find(f => f.id == this.source.featureInfo.id) + if (feature) { + feature.tags.forEach( + tag => { + let existingTag = this.source.featureInfo.tags.find(t => t.key == tag.key) + if (existingTag) { + console.log("Tag update: test me!") + existingTag.value = tag.value + this.infoDataService.dataProviderService.next(this.source) + } + else { + this.source.featureInfo.tags.push({ key: tag.key, value: tag.value }) + } + } + ) + this.infoDataService.dataProviderService.next(this.source) + } + // Trick to refresh the tags on the map + if (this.mapControlService.hasTags.value) { + this.mapControlService.hasTags.next(true) + } + } + ) + } +} diff --git a/src/app/info/info-tools/downloader.component.css b/src/app/info/info-tools/downloader.component.css deleted file mode 100644 index e69de29..0000000 diff --git a/src/app/info/info-tools/downloader.component.ts b/src/app/info/info-tools/downloader.component.ts index 695fdd9..e9e6cd1 100644 --- a/src/app/info/info-tools/downloader.component.ts +++ b/src/app/info/info-tools/downloader.component.ts @@ -6,25 +6,24 @@ import { FullInfo } from '../info-data.service' import { Downloader } from '../../openapi' @Component({ - selector: 'gisaf-downloader', - templateUrl: './downloader.component.html', - styleUrls: ['./downloader.component.css'] + selector: 'gisaf-downloader', + templateUrl: './downloader.component.html', }) export class DownloaderComponent implements OnInit { - @Input() source: FullInfo - @Input() downloader: Downloader + @Input() source: FullInfo + @Input() downloader: Downloader - constructor( - private snackBar: MatSnackBar, - ) {} + constructor( + private snackBar: MatSnackBar, + ) { } - ngOnInit() { - } + ngOnInit() { + } - execute() { - window.open('/api/download/plugin/' - + '/' + this.downloader.name - + '/' + this.source.modelInfo.store - + '/' + this.source.featureInfo.id) - } -} \ No newline at end of file + execute() { + window.open('/api/download/plugin/' + + '/' + this.downloader.name + + '/' + this.source.modelInfo.store + + '/' + this.source.featureInfo.id) + } +}