fix rest, add initialization param

This commit is contained in:
FrancescoMolinaro
2023-12-14 16:46:02 +01:00
parent 8e4408f118
commit 6a202bd685
2 changed files with 181 additions and 176 deletions

View File

@@ -80,7 +80,7 @@
</div>
<!-- In the Inbound Patterns Labels section -->
<div class="row mb-1 mt-5">
<div class="row mb-1 mt-5" *ngIf="areControlsInitialized">
<div class="col">
<label class="font-weight-bold">{{ 'ldn-new-service.form.label.inboundPattern' | translate }} </label>
</div>
@@ -97,6 +97,7 @@
</div>
<!-- In the Inbound Patterns section -->
<div *ngIf="areControlsInitialized">
<div *ngFor="let patternGroup of formModel.get('notifyServiceInboundPatterns')['controls']; let i = index"
[class.marked-for-deletion]="markedForDeletionInboundPattern.includes(i)"
formGroupName="notifyServiceInboundPatterns">
@@ -214,13 +215,13 @@
</div>
</ng-container>
</div>
</div>
<span (click)="addInboundPattern()"
class="add-pattern-link mb-2">{{ 'ldn-new-service.form.label.addPattern' | translate }}</span>
<!-- In the Outbound Patterns Labels section -->
<div class="row mb-1 mt-5">
<div class="row mb-1 mt-5" *ngIf="areControlsInitialized">
<div class="col">
<label class="font-weight-bold">{{ 'ldn-new-service.form.label.outboundPattern' | translate }} </label>
</div>
@@ -239,6 +240,7 @@
</div>
<!-- In the Outbound Patterns section -->
<div *ngIf="areControlsInitialized">
<div *ngFor="let patternGroup of formModel.get('notifyServiceOutboundPatterns')['controls']; let i = index"
[class.marked-for-deletion]="markedForDeletionOutboundPattern.includes(i)"
formGroupName="notifyServiceOutboundPatterns">
@@ -348,6 +350,8 @@
</div>
</ng-container>
</div>
</div>
<div
(click)="addOutboundPattern()"

View File

@@ -54,6 +54,7 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
public inboundPatterns: string[] = notifyPatterns;
public outboundPatterns: string[] = notifyPatterns;
public isNewForm: boolean;
public areControlsInitialized: boolean;
itemfiltersRD$: Observable<RemoteData<PaginatedList<Itemfilter>>>;
config: FindListOptions = Object.assign(new FindListOptions(), {
elementsPerPage: 20
@@ -120,7 +121,7 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
this.isNewForm = segment[0].path === 'new';
this.formModel.addControl('notifyServiceInboundPatterns', this.formBuilder.array([this.createInboundPatternFormGroup()]));
this.formModel.addControl('notifyServiceOutboundPatterns', this.formBuilder.array([this.createOutboundPatternFormGroup()]));
this.areControlsInitialized = true;
if (this.serviceId && !this.isNewForm) {
this.fetchServiceData(this.serviceId);
}