From ae1aa1120d7f654cc0cb8c794b3c56462060d791 Mon Sep 17 00:00:00 2001 From: Yi-Jacob Date: Fri, 7 Jun 2024 12:37:35 -0700 Subject: [PATCH] Small UI updates --- .../df-role-details.component.html | 2 +- .../df-roles-access.component.html | 2 +- .../df-service-details.component.html | 2 +- .../df-service-details.component.ts | 33 ++++++++++++++----- .../df-side-nav/df-side-nav.component.html | 4 ++- src/app/shared/constants/services.ts | 16 ++++----- 6 files changed, 39 insertions(+), 20 deletions(-) diff --git a/src/app/adf-roles/df-role-details/df-role-details.component.html b/src/app/adf-roles/df-role-details/df-role-details.component.html index e2e3f3e6..14b231dc 100644 --- a/src/app/adf-roles/df-role-details/df-role-details.component.html +++ b/src/app/adf-roles/df-role-details/df-role-details.component.html @@ -30,7 +30,7 @@ -
+
+
diff --git a/src/app/adf-services/df-service-details/df-service-details.component.html b/src/app/adf-services/df-service-details/df-service-details.component.html index 114c940d..97bccf26 100644 --- a/src/app/adf-services/df-service-details/df-service-details.component.html +++ b/src/app/adf-services/df-service-details/df-service-details.component.html @@ -2,7 +2,7 @@ [formGroup]="serviceForm" class="details-section" [class]="(isDarkMode | async) ? 'dark-theme' : ''" - (ngSubmit)="save()"> + (ngSubmit)="save(false)"> diff --git a/src/app/adf-services/df-service-details/df-service-details.component.ts b/src/app/adf-services/df-service-details/df-service-details.component.ts index 069eb384..4c530b35 100644 --- a/src/app/adf-services/df-service-details/df-service-details.component.ts +++ b/src/app/adf-services/df-service-details/df-service-details.component.ts @@ -36,7 +36,10 @@ import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; import { MatTooltipModule } from '@angular/material/tooltip'; import { MatButtonModule } from '@angular/material/button'; import { UntilDestroy } from '@ngneat/until-destroy'; -import { SERVICES_SERVICE_TOKEN } from 'src/app/shared/constants/tokens'; +import { + CACHE_SERVICE_TOKEN, + SERVICES_SERVICE_TOKEN, +} from 'src/app/shared/constants/tokens'; import { DfBaseCrudService } from 'src/app/shared/services/df-base-crud.service'; import { Service } from 'src/app/shared/types/files'; import { AceEditorMode } from 'src/app/shared/types/scripts'; @@ -103,14 +106,13 @@ export class DfServiceDetailsComponent implements OnInit { search = ''; serviceDefinition: string; serviceDefinitionType: string; - systemEvents: Array<{ label: string; value: string }>; constructor( private activatedRoute: ActivatedRoute, private fb: FormBuilder, - @Inject(SERVICES_SERVICE_TOKEN) - private servicesService: DfBaseCrudService, + @Inject(SERVICES_SERVICE_TOKEN) private servicesService: DfBaseCrudService, + @Inject(CACHE_SERVICE_TOKEN) private cacheService: DfBaseCrudService, private router: Router, private systemConfigDataService: DfSystemConfigDataService, private http: HttpClient, @@ -158,7 +160,9 @@ export class DfServiceDetailsComponent implements OnInit { } const { data, serviceTypes, groups } = route; const licenseType = env.platform?.license; - this.serviceTypes = serviceTypes; + this.serviceTypes = serviceTypes.filter( + (s: { name: string }) => s.name.toLowerCase() !== 'python' + ); this.notIncludedServices = []; if (this.isDatabase) { if (licenseType === 'SILVER') { @@ -318,7 +322,7 @@ export class DfServiceDetailsComponent implements OnInit { return this.serviceForm.controls[name] as FormControl; } - save() { + save(clearCache: boolean) { if (this.serviceForm.invalid) { return; } @@ -434,7 +438,21 @@ export class DfServiceDetailsComponent implements OnInit { snackbarSuccess: 'services.updateSuccessMsg', }) .subscribe(() => { - this.router.navigate(['../'], { relativeTo: this.activatedRoute }); + if (clearCache) { + this.cacheService + .delete(payload.name, { + snackbarSuccess: 'cache.serviceCacheFlushed', + }) + .subscribe({ + next: () => { + console.log('Cache flushed'); + this.router.navigate(['../'], { + relativeTo: this.activatedRoute, + }); + }, + error: (err: any) => console.error('Error flushing cache', err), + }); + } }); } else { this.servicesService @@ -446,7 +464,6 @@ export class DfServiceDetailsComponent implements OnInit { ) .subscribe(() => { this.router.navigate(['../'], { relativeTo: this.activatedRoute }); - // this.router.navigate([`/api-connections/api-docs/${data.name}`]); }); } } diff --git a/src/app/shared/components/df-side-nav/df-side-nav.component.html b/src/app/shared/components/df-side-nav/df-side-nav.component.html index 6dcc6016..eedb30b6 100644 --- a/src/app/shared/components/df-side-nav/df-side-nav.component.html +++ b/src/app/shared/components/df-side-nav/df-side-nav.component.html @@ -13,7 +13,9 @@ class="toggle-icon"> - +