Merge branch 'develop' of ssh://ognproject.evlt.uma.es:21987/opengnsys/oggui into develop
commit
cf5f2754c6
|
@ -1,4 +1,4 @@
|
|||
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
|
||||
import { Component, OnInit, OnDestroy, ViewChild, QueryList, ViewChildren } from '@angular/core';
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import { Router } from '@angular/router';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
|
@ -24,8 +24,8 @@ import { ManageClientComponent } from "./shared/clients/manage-client/manage-cli
|
|||
import { debounceTime } from 'rxjs/operators';
|
||||
import { Subject } from 'rxjs';
|
||||
import { ConfigService } from '@services/config.service';
|
||||
import { GlobalStatusComponent } from '../global-status/global-status.component';
|
||||
import { BreakpointObserver } from '@angular/cdk/layout';
|
||||
import { MatMenuTrigger } from '@angular/material/menu';
|
||||
|
||||
enum NodeType {
|
||||
OrganizationalUnit = 'organizational-unit',
|
||||
|
@ -41,6 +41,7 @@ enum NodeType {
|
|||
styleUrls: ['./groups.component.css'],
|
||||
})
|
||||
export class GroupsComponent implements OnInit, OnDestroy {
|
||||
@ViewChildren(MatMenuTrigger) menuTriggers!: QueryList<MatMenuTrigger>;
|
||||
isSmallScreen: boolean = false;
|
||||
baseUrl: string;
|
||||
mercureUrl: string;
|
||||
|
@ -481,10 +482,11 @@ export class GroupsComponent implements OnInit, OnDestroy {
|
|||
? this.dialog.open(ManageOrganizationalUnitComponent, { data: { uuid }, width: '900px' })
|
||||
: this.dialog.open(ManageClientComponent, { data: { uuid }, width: '900px' });
|
||||
|
||||
dialogRef.afterClosed().subscribe(() => {
|
||||
if (node) {
|
||||
this.refreshData(node.id);
|
||||
dialogRef.afterClosed().subscribe((result) => {
|
||||
if (result?.success) {
|
||||
this.refreshData(node?.id);
|
||||
}
|
||||
this.menuTriggers.forEach(trigger => trigger.closeMenu());
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -548,8 +550,11 @@ export class GroupsComponent implements OnInit, OnDestroy {
|
|||
? this.dialog.open(ManageOrganizationalUnitComponent, { data: { uuid }, width: '900px' })
|
||||
: this.dialog.open(ManageClientComponent, { data: { uuid }, width: '900px' });
|
||||
|
||||
dialogRef.afterClosed().subscribe(() => {
|
||||
this.refreshData(this.selectedNode?.id, selectedClientsBeforeEdit);
|
||||
dialogRef.afterClosed().subscribe((result) => {
|
||||
if (result?.success) {
|
||||
this.refreshData(this.selectedNode?.id, selectedClientsBeforeEdit);
|
||||
}
|
||||
this.menuTriggers.forEach(trigger => trigger.closeMenu());
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -272,7 +272,7 @@ export class ManageClientComponent implements OnInit {
|
|||
|
||||
this.http.patch<any>(putUrl, formData, { headers }).subscribe(
|
||||
response => {
|
||||
this.dialogRef.close();
|
||||
this.dialogRef.close({ success: true });
|
||||
this.toastService.success('Cliente actualizado exitosamente', 'Éxito');
|
||||
},
|
||||
error => {
|
||||
|
@ -285,6 +285,7 @@ export class ManageClientComponent implements OnInit {
|
|||
(response) => {
|
||||
this.toastService.success('Cliente creado exitosamente', 'Éxito');
|
||||
this.dialogRef.close({
|
||||
success: true,
|
||||
client: response,
|
||||
organizationalUnit: formData.organizationalUnit,
|
||||
});
|
||||
|
@ -300,6 +301,6 @@ export class ManageClientComponent implements OnInit {
|
|||
}
|
||||
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
this.dialogRef.close({ success: false });
|
||||
}
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ export class ManageOrganizationalUnitComponent implements OnInit {
|
|||
});
|
||||
|
||||
this.networkSettingsFormGroup = this._formBuilder.group({
|
||||
ogLive: [ null],
|
||||
ogLive: [null],
|
||||
repository: [null],
|
||||
proxy: [null],
|
||||
dns: [null],
|
||||
|
@ -394,7 +394,7 @@ export class ManageOrganizationalUnitComponent implements OnInit {
|
|||
this.http.put<any>(putUrl, formData, { headers }).subscribe(
|
||||
response => {
|
||||
this.unitAdded.emit();
|
||||
this.dialogRef.close();
|
||||
this.dialogRef.close({ success: true });
|
||||
this.toastService.success('Editado exitosamente', 'Éxito');
|
||||
},
|
||||
error => {
|
||||
|
@ -413,7 +413,7 @@ export class ManageOrganizationalUnitComponent implements OnInit {
|
|||
this.http.post<any>(postUrl, formData, { headers }).subscribe(
|
||||
response => {
|
||||
this.unitAdded.emit(response);
|
||||
this.dialogRef.close(response);
|
||||
this.dialogRef.close({ success: true });
|
||||
this.toastService.success('Creado exitosamente', 'Éxito');
|
||||
},
|
||||
error => {
|
||||
|
@ -430,6 +430,6 @@ export class ManageOrganizationalUnitComponent implements OnInit {
|
|||
}
|
||||
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
this.dialogRef.close({ success: false });
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue