variable rename

This commit is contained in:
FrancescoMolinaro
2023-12-15 09:46:53 +01:00
parent 3177a8c581
commit e280666dc3
2 changed files with 14 additions and 14 deletions

View File

@@ -1,10 +1,10 @@
<div class="container"> <div class="container">
<form (ngSubmit)="onSubmit()" [formGroup]="formModel"> <form (ngSubmit)="onSubmit()" [formGroup]="formModel">
<div class="d-flex"> <div class="d-flex">
<h2 class="flex-grow-1">{{ isNewForm ? ('ldn-create-service.title' | translate) : ('ldn-edit-registered-service.title' | translate) }}</h2> <h2 class="flex-grow-1">{{ isNewService ? ('ldn-create-service.title' | translate) : ('ldn-edit-registered-service.title' | translate) }}</h2>
</div> </div>
<!-- In the toggle section --> <!-- In the toggle section -->
<div class="toggle-switch-container" *ngIf="!isNewForm"> <div class="toggle-switch-container" *ngIf="!isNewService">
<label class="status-label font-weight-bold" for="enabled">{{ 'ldn-service-status' | translate }}</label> <label class="status-label font-weight-bold" for="enabled">{{ 'ldn-service-status' | translate }}</label>
<div> <div>
<input formControlName="enabled" hidden id="enabled" name="enabled" type="checkbox"> <input formControlName="enabled" hidden id="enabled" name="enabled" type="checkbox">
@@ -371,8 +371,8 @@
</div> </div>
<ng-template #confirmModal> <ng-template #confirmModal>
<div class="modal-header"> <div class="modal-header">
<h4 *ngIf="!isNewForm">{{'service.overview.edit.modal' | translate }}</h4> <h4 *ngIf="!isNewService">{{'service.overview.edit.modal' | translate }}</h4>
<h4 *ngIf="isNewForm">{{'service.overview.create.modal' | translate }}</h4> <h4 *ngIf="isNewService">{{'service.overview.create.modal' | translate }}</h4>
<button (click)="closeModal()" aria-label="Close" <button (click)="closeModal()" aria-label="Close"
class="close" type="button"> class="close" type="button">
<span aria-hidden="true">×</span> <span aria-hidden="true">×</span>
@@ -380,23 +380,23 @@
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div *ngIf="!isNewForm"> <div *ngIf="!isNewService">
{{ 'service.overview.edit.body' | translate }} {{ 'service.overview.edit.body' | translate }}
</div> </div>
<span *ngIf="isNewForm"> <span *ngIf="isNewService">
{{ 'service.overview.create.body' | translate }} {{ 'service.overview.create.body' | translate }}
</span> </span>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<div *ngIf="!isNewForm"> <div *ngIf="!isNewService">
<button (click)="closeModal()" class="btn btn-danger mr-2" <button (click)="closeModal()" class="btn btn-danger mr-2"
id="delete-confirm-edit">{{ 'service.detail.return' | translate }} id="delete-confirm-edit">{{ 'service.detail.return' | translate }}
</button> </button>
<button *ngIf="!isNewForm" (click)="patchService()" <button *ngIf="!isNewService" (click)="patchService()"
class="btn btn-primary">{{ 'service.detail.update' | translate }} class="btn btn-primary">{{ 'service.detail.update' | translate }}
</button> </button>
</div> </div>
<div *ngIf="isNewForm"> <div *ngIf="isNewService">
<button (click)="closeModal()" class="btn btn-danger mr-2 " <button (click)="closeModal()" class="btn btn-danger mr-2 "
id="delete-confirm-new">{{ 'service.refuse.create' | translate }} id="delete-confirm-new">{{ 'service.refuse.create' | translate }}
</button> </button>

View File

@@ -53,7 +53,7 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
public inboundPatterns: string[] = notifyPatterns; public inboundPatterns: string[] = notifyPatterns;
public outboundPatterns: string[] = notifyPatterns; public outboundPatterns: string[] = notifyPatterns;
public isNewForm: boolean; public isNewService: boolean;
public areControlsInitialized: boolean; public areControlsInitialized: boolean;
itemfiltersRD$: Observable<RemoteData<PaginatedList<Itemfilter>>>; itemfiltersRD$: Observable<RemoteData<PaginatedList<Itemfilter>>>;
config: FindListOptions = Object.assign(new FindListOptions(), { config: FindListOptions = Object.assign(new FindListOptions(), {
@@ -118,11 +118,11 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
combineLatestWith(this.route.url) combineLatestWith(this.route.url)
).subscribe(([params, segment]) => { ).subscribe(([params, segment]) => {
this.serviceId = params.serviceId; this.serviceId = params.serviceId;
this.isNewForm = segment[0].path === 'new'; this.isNewService = segment[0].path === 'new';
this.formModel.addControl('notifyServiceInboundPatterns', this.formBuilder.array([this.createInboundPatternFormGroup()])); this.formModel.addControl('notifyServiceInboundPatterns', this.formBuilder.array([this.createInboundPatternFormGroup()]));
this.formModel.addControl('notifyServiceOutboundPatterns', this.formBuilder.array([this.createOutboundPatternFormGroup()])); this.formModel.addControl('notifyServiceOutboundPatterns', this.formBuilder.array([this.createOutboundPatternFormGroup()]));
this.areControlsInitialized = true; this.areControlsInitialized = true;
if (this.serviceId && !this.isNewForm) { if (this.serviceId && !this.isNewService) {
this.fetchServiceData(this.serviceId); this.fetchServiceData(this.serviceId);
} }
}); });
@@ -657,7 +657,7 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
isNew: true isNew: true
}; };
if (this.isNewForm) { if (this.isNewService) {
delete outBoundFormGroup.isNew; delete outBoundFormGroup.isNew;
} }
@@ -677,7 +677,7 @@ export class LdnServiceFormComponent implements OnInit, OnDestroy {
isNew: true isNew: true
}; };
if (this.isNewForm) { if (this.isNewService) {
delete inBoundFormGroup.isNew; delete inBoundFormGroup.isNew;
} }