|
1 | 1 | import {ChangeDetectorRef, Component, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges} from '@angular/core'; |
2 | 2 | import {Subject} from 'rxjs'; |
3 | | -import {debounceTime, distinctUntilChanged, finalize, map, takeUntil, tap} from 'rxjs/operators'; |
| 3 | +import {debounceTime, finalize, map, takeUntil, tap} from 'rxjs/operators'; |
4 | 4 | import {ModalService} from '../../../core/modal/modal.service'; |
5 | 5 | import {UtmToastService} from '../../../shared/alert/utm-toast.service'; |
6 | 6 | import { |
7 | 7 | ModalConfirmationComponent |
8 | 8 | } from '../../../shared/components/utm/util/modal-confirmation/modal-confirmation.component'; |
9 | | -import {EncryptService} from '../../../shared/services/util/encrypt.service'; |
10 | 9 | import {ModuleChangeStatusBehavior} from '../../shared/behavior/module-change-status.behavior'; |
11 | 10 | import {IntCreateGroupComponent} from '../../shared/components/int-create-group/int-create-group.component'; |
12 | 11 | import {GroupTypeEnum} from '../../shared/enum/group-type.enum'; |
@@ -46,10 +45,10 @@ export class IntGenericGroupConfigComponent implements OnInit, OnChanges, OnDest |
46 | 45 | destroy$ = new Subject<void>(); |
47 | 46 | uniqueConfigNameConstrain = false; |
48 | 47 | invalidDomainOrIp = false; |
| 48 | + savingConfigs = new Map<number, boolean>(); |
49 | 49 |
|
50 | 50 | constructor(private utmModuleGroupService: UtmModuleGroupService, |
51 | 51 | private toast: UtmToastService, |
52 | | - private encryptService: EncryptService, |
53 | 52 | private utmModuleGroupConfService: UtmModuleGroupConfService, |
54 | 53 | private modalService: ModalService, |
55 | 54 | private moduleChangeStatusBehavior: ModuleChangeStatusBehavior, |
@@ -189,15 +188,15 @@ export class IntGenericGroupConfigComponent implements OnInit, OnChanges, OnDest |
189 | 188 | } |
190 | 189 |
|
191 | 190 | saveConfig(group: UtmModuleGroupType) { |
192 | | - this.savingConfig = true; |
| 191 | + this.savingConfigs.set(group.id, true); |
193 | 192 | const configs = this.changes.keys.filter(change => change.groupId === group.id); |
194 | 193 |
|
195 | 194 | this.utmModuleGroupConfService.update({ |
196 | 195 | moduleId: group.moduleId, |
197 | 196 | keys: configs |
198 | 197 | }).pipe( |
199 | 198 | finalize(() => { |
200 | | - this.savingConfig = false; |
| 199 | + this.savingConfigs.set(group.id, false); |
201 | 200 | this.cdr.detectChanges(); |
202 | 201 | }) |
203 | 202 | ).subscribe({ |
@@ -440,6 +439,7 @@ export class IntGenericGroupConfigComponent implements OnInit, OnChanges, OnDest |
440 | 439 | this.addChange(integrationConfig); |
441 | 440 | } |
442 | 441 |
|
| 442 | + |
443 | 443 | ngOnDestroy() { |
444 | 444 | this.destroy$.next(); |
445 | 445 | this.destroy$.complete(); |
|
0 commit comments