mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Merged coar-notify-7 into CST-11045
This commit is contained in:
@@ -2,35 +2,33 @@ import { NgModule } from '@angular/core';
|
|||||||
import { RouterModule } from '@angular/router';
|
import { RouterModule } from '@angular/router';
|
||||||
import { I18nBreadcrumbResolver } from 'src/app/core/breadcrumbs/i18n-breadcrumb.resolver';
|
import { I18nBreadcrumbResolver } from 'src/app/core/breadcrumbs/i18n-breadcrumb.resolver';
|
||||||
import { LdnServicesOverviewComponent } from './ldn-services-directory/ldn-services-directory.component';
|
import { LdnServicesOverviewComponent } from './ldn-services-directory/ldn-services-directory.component';
|
||||||
import { LdnServicesGuard } from './ldn-services-guard/ldn-services-guard.service';
|
|
||||||
import { LdnServiceNewComponent } from './ldn-service-new/ldn-service-new.component';
|
import { LdnServiceNewComponent } from './ldn-service-new/ldn-service-new.component';
|
||||||
import { LdnServiceFormEditComponent } from './ldn-service-form-edit/ldn-service-form-edit.component';
|
import { LdnServiceFormEditComponent } from './ldn-service-form-edit/ldn-service-form-edit.component';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
RouterModule.forChild([
|
RouterModule.forChild([
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
pathMatch: 'full',
|
pathMatch: 'full',
|
||||||
component: LdnServicesOverviewComponent,
|
component: LdnServicesOverviewComponent,
|
||||||
resolve: { breadcrumb: I18nBreadcrumbResolver },
|
resolve: {breadcrumb: I18nBreadcrumbResolver},
|
||||||
data: { title: 'ldn-registered-services.title', breadcrumbKey: 'ldn-registered-services.new' },
|
data: {title: 'ldn-registered-services.title', breadcrumbKey: 'ldn-registered-services.new'},
|
||||||
canActivate: [LdnServicesGuard]
|
},
|
||||||
},
|
{
|
||||||
{
|
path: 'new',
|
||||||
path: 'new',
|
resolve: {breadcrumb: I18nBreadcrumbResolver},
|
||||||
resolve: { breadcrumb: I18nBreadcrumbResolver },
|
component: LdnServiceNewComponent,
|
||||||
component: LdnServiceNewComponent,
|
data: {title: 'ldn-register-new-service.title', breadcrumbKey: 'ldn-register-new-service'}
|
||||||
data: { title: 'ldn-register-new-service.title', breadcrumbKey: 'ldn-register-new-service' }
|
},
|
||||||
},
|
{
|
||||||
{
|
path: 'edit/:serviceId',
|
||||||
path: 'edit/:serviceId',
|
resolve: {breadcrumb: I18nBreadcrumbResolver},
|
||||||
resolve: { breadcrumb: I18nBreadcrumbResolver },
|
component: LdnServiceFormEditComponent,
|
||||||
component: LdnServiceFormEditComponent,
|
data: {title: 'ldn-edit-service.title', breadcrumbKey: 'ldn-edit-service'}
|
||||||
data: { title: 'ldn-edit-service.title', breadcrumbKey: 'ldn-edit-service' }
|
},
|
||||||
},
|
]),
|
||||||
]),
|
]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
export class AdminLdnServicesRoutingModule {
|
export class AdminLdnServicesRoutingModule {
|
||||||
|
|
||||||
|
@@ -6,20 +6,24 @@ import { SharedModule } from '../../shared/shared.module';
|
|||||||
import { LdnServiceNewComponent } from './ldn-service-new/ldn-service-new.component';
|
import { LdnServiceNewComponent } from './ldn-service-new/ldn-service-new.component';
|
||||||
import { LdnServiceFormComponent } from './ldn-service-form/ldn-service-form.component';
|
import { LdnServiceFormComponent } from './ldn-service-form/ldn-service-form.component';
|
||||||
import { LdnServiceFormEditComponent } from './ldn-service-form-edit/ldn-service-form-edit.component';
|
import { LdnServiceFormEditComponent } from './ldn-service-form-edit/ldn-service-form-edit.component';
|
||||||
|
import { FormsModule } from '@angular/forms';
|
||||||
|
import { LdnItemfiltersService } from './ldn-services-data/ldn-itemfilters-data.service';
|
||||||
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
SharedModule,
|
SharedModule,
|
||||||
AdminLdnServicesRoutingModule,
|
AdminLdnServicesRoutingModule,
|
||||||
],
|
FormsModule
|
||||||
declarations: [
|
],
|
||||||
LdnServicesOverviewComponent,
|
declarations: [
|
||||||
LdnServiceNewComponent,
|
LdnServicesOverviewComponent,
|
||||||
LdnServiceFormComponent,
|
LdnServiceNewComponent,
|
||||||
LdnServiceFormEditComponent,
|
LdnServiceFormComponent,
|
||||||
]
|
LdnServiceFormEditComponent,
|
||||||
|
],
|
||||||
|
providers: [LdnItemfiltersService]
|
||||||
})
|
})
|
||||||
export class AdminLdnServicesModule { }
|
export class AdminLdnServicesModule {
|
||||||
|
}
|
||||||
|
@@ -1,155 +1,281 @@
|
|||||||
|
<div class="container">
|
||||||
<form (ngSubmit)="submitForm()" [formGroup]="formModel">
|
<form (ngSubmit)="onSubmit()" [formGroup]="formModel">
|
||||||
|
<div class="d-flex">
|
||||||
<div class="toggle-switch-container">
|
<h2 class="flex-grow-1">{{ 'ldn-edit-registered-service.title' | translate }}</h2>
|
||||||
<label for="enabled" class="status-label">{{ 'ldn-service-status' | translate }}</label>
|
|
||||||
<div>
|
|
||||||
<input formControlName="enabled" id="enabled" name="enabled" type="checkbox" hidden>
|
|
||||||
<div class="toggle-switch" [class.checked]="formModel.get('enabled').value" (click)="toggleEnabled()">
|
|
||||||
<div class="slider"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="mb-2">
|
|
||||||
<label for="name">{{ 'ldn-new-service.form.label.name' | translate }}</label>
|
|
||||||
<input [placeholder]="'ldn-new-service.form.placeholder.name' | translate"
|
|
||||||
formControlName="name" id="name" name="name"
|
|
||||||
[class.invalid-field]="formModel.get('name').invalid && formModel.get('name').touched"
|
|
||||||
type="text">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="mb-4">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="mb-2 d-flex flex-column">
|
|
||||||
<label for="description">{{ 'ldn-new-service.form.label.description' | translate }}</label>
|
|
||||||
<textarea [placeholder]="'ldn-new-service.form.placeholder.description' | translate"
|
|
||||||
formControlName="description" id="description" name="description"></textarea>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="mb-4">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="mb-2">
|
|
||||||
<label for="url">{{ 'ldn-new-service.form.label.url' | translate }}</label>
|
|
||||||
<input [placeholder]="'ldn-new-service.form.placeholder.url' | translate"
|
|
||||||
formControlName="url" id="url" name="url"
|
|
||||||
[class.invalid-field]="formModel.get('url').invalid && formModel.get('url').touched"
|
|
||||||
type="text">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="mb-4">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="mb-2">
|
|
||||||
<label for="ldnUrl">{{ 'ldn-new-service.form.label.ldnUrl' | translate }}</label>
|
|
||||||
<input [placeholder]="'ldn-new-service.form.placeholder.ldnUrl' | translate"
|
|
||||||
formControlName="ldnUrl" id="ldnUrl" name="ldnUrl"
|
|
||||||
[class.invalid-field]="formModel.get('ldnUrl').invalid && formModel.get('ldnUrl').touched"
|
|
||||||
type="text">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="mb-4">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div *ngFor="let patternGroup of formModel.get('notifyServiceInboundPatterns')['controls']; let i = index"
|
|
||||||
class="mb-2 d-flex align-content-center" formGroupName="notifyServiceInboundPatterns">
|
|
||||||
|
|
||||||
<ng-container [formGroupName]="i">
|
|
||||||
|
|
||||||
<div class="flex-grow-1">
|
|
||||||
<label *ngIf="i === 0" for="additionalInboundPattern{{i}}">{{ 'ldn-new-service.form.label.inboundPattern' | translate }} </label>
|
|
||||||
<select #inboundPattern formControlName="pattern" id="additionalInboundPattern{{i}}"
|
|
||||||
name="additionalInboundPattern{{i}}" required>
|
|
||||||
<option value="">{{ 'ldn-new-service.form.label.placeholder.inboundPattern' | translate }}</option>
|
|
||||||
<option *ngFor="let pattern of inboundPatterns" [ngValue]="pattern.name">{{ pattern.name }}</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<ng-container *ngIf="inboundPattern.value">
|
|
||||||
|
|
||||||
<div class="ml-2 flex-grow-1">
|
|
||||||
<label *ngIf="i === 0" for="constraint{{i}}">{{ 'ldn-new-service.form.label.ItemFilter' | translate }}</label>
|
|
||||||
<select formControlName="constraint" id="constraint{{i}}" name="constraint{{i}}">
|
|
||||||
<option value="">{{ 'ldn-new-service.form.label.placeholder.selectedItemFilter' | translate }}</option>
|
|
||||||
<option *ngFor="let itemFilter of itemFilterList" [value]="itemFilter.name">{{ itemFilter.name }}</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
</div>
|
||||||
|
<!-- In the toggle section -->
|
||||||
<div class="ml-2 d-flex flex-column align-content-center">
|
<div class="toggle-switch-container">
|
||||||
<label *ngIf="i === 0" for="automatic{{i}}">{{ 'ldn-new-service.form.label.automatic' | translate }}</label>
|
<label class="status-label" for="enabled">{{ 'ldn-service-status' | translate }}</label>
|
||||||
<div class="d-flex flex-grow-1 align-content-center justify-content-center">
|
<div>
|
||||||
<input formControlName="automatic" id="automatic{{i}}" name="automatic{{i}}" type="checkbox" hidden>
|
<input formControlName="enabled" hidden id="enabled" name="enabled" type="checkbox">
|
||||||
<div class="toggle-switch" [class.checked]="formModel.get('notifyServiceInboundPatterns.' + i + '.automatic').value" (click)="toggleAutomatic(i)">
|
<div (click)="toggleEnabled()" [class.checked]="formModel.get('enabled').value" class="toggle-switch">
|
||||||
<div class="slider"></div>
|
<div class="slider"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</ng-container>
|
<div class="mb-2">
|
||||||
|
<label for="name">{{ 'ldn-new-service.form.label.name' | translate }}</label>
|
||||||
|
<input [class.invalid-field]="formModel.get('name').invalid && formModel.get('name').touched"
|
||||||
|
[placeholder]="'ldn-new-service.form.placeholder.name' | translate" formControlName="name" id="name"
|
||||||
|
name="name"
|
||||||
|
type="text">
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="d-flex align-items-end justify-content-center">
|
<div class="mb-4">
|
||||||
<button (click)="removeInboundPattern(i)" class="btn btn-outline-dark trash-button ml-2">
|
|
||||||
<i class="fas fa-trash"></i>
|
</div>
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</ng-container>
|
<!-- In the description section -->
|
||||||
|
<div class="mb-2 d-flex flex-column">
|
||||||
|
<label for="description">{{ 'ldn-new-service.form.label.description' | translate }}</label>
|
||||||
|
<textarea [placeholder]="'ldn-new-service.form.placeholder.description' | translate"
|
||||||
|
formControlName="description" id="description" name="description"></textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
<div class="mb-4">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
<span (click)="addInboundPattern()" class="add-pattern-link mb-2">{{ 'ldn-new-service.form.label.addPattern' | translate }}</span>
|
<!-- In the url section -->
|
||||||
|
<div class="mb-2">
|
||||||
|
<label for="url">{{ 'ldn-new-service.form.label.url' | translate }}</label>
|
||||||
|
<input [class.invalid-field]="formModel.get('url').invalid && formModel.get('url').touched"
|
||||||
|
[placeholder]="'ldn-new-service.form.placeholder.url' | translate" formControlName="url" id="url"
|
||||||
|
name="url"
|
||||||
|
type="text">
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="mb-4">
|
<div class="mb-4">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngFor="let patternGroup of formModel.get('notifyServiceOutboundPatterns')['controls']; let i = index"
|
<!-- In the ldnUrl section -->
|
||||||
class="mb-2 d-flex align-content-center" formGroupName="notifyServiceOutboundPatterns">
|
<div class="mb-2">
|
||||||
|
<label for="ldnUrl">{{ 'ldn-new-service.form.label.ldnUrl' | translate }}</label>
|
||||||
|
<input [class.invalid-field]="formModel.get('ldnUrl').invalid && formModel.get('ldnUrl').touched"
|
||||||
|
[placeholder]="'ldn-new-service.form.placeholder.ldnUrl' | translate" formControlName="ldnUrl"
|
||||||
|
id="ldnUrl"
|
||||||
|
name="ldnUrl"
|
||||||
|
type="text">
|
||||||
|
</div>
|
||||||
|
|
||||||
<ng-container [formGroupName]="i">
|
<div class="mb-4">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="flex-grow-1">
|
<div class="row">
|
||||||
<label *ngIf="i === 0" for="additionalOutboundPattern{{i}}">{{ 'ldn-new-service.form.label.outboundPattern' | translate }}</label>
|
<div class="col">
|
||||||
<select #outboundPattern formControlName="pattern" id="additionalOutboundPattern{{i}}"
|
<label>{{ 'ldn-new-service.form.label.inboundPattern' | translate }} </label>
|
||||||
name="additionalOutboundPattern{{i}}"
|
</div>
|
||||||
required>
|
<div class="col">
|
||||||
<option value="">{{ 'ldn-new-service.form.label.placeholder.outboundPattern' | translate }}</option>
|
<label class="label-box">{{ 'ldn-new-service.form.label.ItemFilter' | translate }}</label>
|
||||||
<option *ngFor="let pattern of outboundPatterns" [ngValue]="pattern.name">{{ pattern.name }}</option>
|
</div>
|
||||||
</select>
|
<div class="col-sm1 ">
|
||||||
</div>
|
<label class="label-box-2">{{ 'ldn-new-service.form.label.automatic' | translate }}</label>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-1">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div *ngIf="outboundPattern.value" class="ml-2 flex-grow-1">
|
<div *ngFor="let patternGroup of formModel.get('notifyServiceInboundPatterns')['controls']; let i = index"
|
||||||
<label *ngIf="i === 0" for="constraint{{i}}">{{ 'ldn-new-service.form.label.ItemFilter' | translate }}</label>
|
formGroupName="notifyServiceInboundPatterns">
|
||||||
<select formControlName="constraint" id="constraint{{i}}" name="constraint{{i}}">
|
|
||||||
<option value="">{{ 'ldn-new-service.form.label.placeholder.selectedItemFilter' | translate }}</option>
|
|
||||||
<option *ngFor="let itemFilter of itemFilterList" [value]="itemFilter.name">{{ itemFilter.name }}</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="d-flex align-items-end justify-content-center">
|
<ng-container [formGroupName]="i">
|
||||||
<button (click)="removeOutboundPattern(i)" class="btn btn-outline-dark trash-button ml-2">
|
|
||||||
<i class="fas fa-trash"></i>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</ng-container>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<span
|
<div [class.marked-for-deletion]="markedForDeletionInboundPattern.includes(i)" class="row mb-1">
|
||||||
(click)="addOutboundPattern()" class="add-pattern-link mb-2">{{ 'ldn-new-service.form.label.addPattern' | translate }}
|
<div class="col">
|
||||||
</span>
|
<select #inboundPattern formControlName="pattern" id="additionalInboundPattern{{i}}"
|
||||||
|
name="additionalInboundPattern{{i}}" required>
|
||||||
|
<option value="">{{ 'ldn-new-service.form.label.placeholder.inboundPattern' | translate }}</option>
|
||||||
|
<option *ngFor="let pattern of inboundPatterns"
|
||||||
|
[ngValue]="pattern.name">{{ pattern.name }}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="mb-2">
|
<div class="col">
|
||||||
|
<ng-container *ngIf="inboundPattern.value">
|
||||||
</div>
|
<select formControlName="constraint" id="constraint{{i}}" name="constraint{{i}}">
|
||||||
|
<option value="">{{ 'ldn-new-service.form.label.placeholder.selectedItemFilter' | translate }}</option>
|
||||||
|
<option *ngFor="let itemFilter of (itemfiltersRD$ | async)?.payload?.page"
|
||||||
|
[value]="itemFilter.id">{{ itemFilter.id }}</option>
|
||||||
|
</select>
|
||||||
|
</ng-container>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div [style.visibility]="inboundPattern.value ? 'visible' : 'hidden'" class="col-sm1">
|
||||||
|
<input formControlName="automatic" hidden id="automatic{{i}}" name="automatic{{i}}"
|
||||||
|
type="checkbox">
|
||||||
|
<div (click)="toggleAutomatic(i)"
|
||||||
|
[class.checked]="formModel.get('notifyServiceInboundPatterns.' + i + '.automatic').value"
|
||||||
|
class="toggle-switch">
|
||||||
|
<div class="slider"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-sm-1 btn-group">
|
||||||
|
<button (click)="markForInboundPatternDeletion(i)" class="btn btn-outline-dark trash-button" type="button">
|
||||||
|
<i class="fas fa-trash"></i>
|
||||||
|
</button>
|
||||||
|
<button (click)="unmarkForInboundPatternDeletion(i)" *ngIf="markedForDeletionInboundPattern.includes(i)" class="btn btn-outline-dark undo-button"
|
||||||
|
type="button">
|
||||||
|
<i class="fas fa-undo"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</ng-container>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<span (click)="addInboundPattern()"
|
||||||
|
class="add-pattern-link mb-2">{{ 'ldn-new-service.form.label.addPattern' | translate }}</span>
|
||||||
|
|
||||||
|
<div class="mb-4">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col">
|
||||||
|
<label>{{ 'ldn-new-service.form.label.outboundPattern' | translate }}</label>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<label class="label-box-3">{{ 'ldn-new-service.form.label.ItemFilter' | translate }}</label>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-1 ">
|
||||||
|
<label class="label-box-2"></label>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-1 ">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div *ngFor="let patternGroup of formModel.get('notifyServiceOutboundPatterns')['controls']; let i = index"
|
||||||
|
formGroupName="notifyServiceOutboundPatterns">
|
||||||
|
|
||||||
|
<ng-container [formGroupName]="i">
|
||||||
|
|
||||||
|
<!-- Input elements in a separate row -->
|
||||||
|
<div [class.marked-for-deletion]="markedForDeletionOutboundPattern.includes(i)" class="row mb-1">
|
||||||
|
<div class="col">
|
||||||
|
<select #outboundPattern formControlName="pattern" id="additionalOutboundPattern{{i}}"
|
||||||
|
name="additionalOutboundPattern{{i}}"
|
||||||
|
required>
|
||||||
|
<option value="">{{ 'ldn-new-service.form.label.placeholder.outboundPattern' | translate }}</option>
|
||||||
|
<option *ngFor="let pattern of outboundPatterns"
|
||||||
|
[ngValue]="pattern.name">{{ pattern.name }}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<ng-container *ngIf="outboundPattern.value">
|
||||||
|
<select formControlName="constraint" id="constraint{{i}}" name="constraint{{i}}">
|
||||||
|
<option value="">{{ 'ldn-new-service.form.label.placeholder.selectedItemFilter' | translate }}</option>
|
||||||
|
<option *ngFor="let itemFilter of (itemfiltersRD$ | async)?.payload?.page"
|
||||||
|
[value]="itemFilter.id">{{ itemFilter.id }}</option>
|
||||||
|
</select>
|
||||||
|
</ng-container>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div [style.visibility]="'hidden'" class="col-sm1">
|
||||||
|
<input hidden id="automatic{{i}}" name="automatic{{i}}" type="checkbox">
|
||||||
|
<div
|
||||||
|
class="toggle-switch">
|
||||||
|
<div class="slider"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-sm-1 btn-group">
|
||||||
|
<button (click)="markForOutboundPatternDeletion(i)" class="btn btn-outline-dark trash-button" type="button">
|
||||||
|
<i class="fas fa-trash"></i>
|
||||||
|
</button>
|
||||||
|
<button (click)="unmarkForOutboundPatternDeletion(i)" *ngIf="markedForDeletionOutboundPattern.includes(i)" class="btn btn-outline-dark undo-button"
|
||||||
|
type="button">
|
||||||
|
<i class="fas fa-undo"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<span
|
||||||
|
(click)="addOutboundPattern()"
|
||||||
|
class="add-pattern-link mb-2">{{ 'ldn-new-service.form.label.addPattern' | translate }}
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<div class="mb-5">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div aria-label="Basic example" class="submission-form-footer mt-1 mb-1 position-sticky" role="group">
|
||||||
|
<button class="btn btn-primary" type="submit">
|
||||||
|
<span><i class="fas fa-save"></i> {{ 'ldn-new-service.form.label.submit' | translate }}</span>
|
||||||
|
</button>
|
||||||
|
<div class="d-flex">
|
||||||
|
<button (click)="this.openResetFormModal(this.resetFormModal)" class="btn btn-danger" type="button">
|
||||||
|
<span><i class="fas fa-trash"></i> {{ 'submission.general.discard.submit' | translate }}</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<ng-template #confirmModal>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
|
||||||
|
<div class="modal-header">
|
||||||
|
<div>
|
||||||
|
<h4>{{'service.overview.edit.modal' | translate }}</h4>
|
||||||
|
</div>
|
||||||
|
<button (click)="closeModal()" aria-label="Close"
|
||||||
|
class="close" type="button">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal-body">
|
||||||
|
<div>
|
||||||
|
{{ 'service.overview.edit.body' | translate }}
|
||||||
|
</div>
|
||||||
|
<div class="mt-4">
|
||||||
|
<button (click)="closeModal()" class="btn btn-danger mr-2"
|
||||||
|
id="delete-confirm">{{ 'service.detail.return' | translate }}
|
||||||
|
</button>
|
||||||
|
<button (click)="this.patchService()"
|
||||||
|
class="btn btn-primary custom-btn">{{ 'service.detail.update' | translate }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ng-template>
|
||||||
|
|
||||||
|
<ng-template #resetFormModal>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
|
||||||
|
<div class="modal-header">
|
||||||
|
<div>
|
||||||
|
<h4>{{'service.overview.reset-form.modal' | translate }}</h4>
|
||||||
|
</div>
|
||||||
|
<button (click)="closeModal()" aria-label="Close"
|
||||||
|
class="close" type="button">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal-body">
|
||||||
|
<div>
|
||||||
|
{{ 'service.overview.reset-form.body' | translate }}
|
||||||
|
</div>
|
||||||
|
<div class="mt-4">
|
||||||
|
<button (click)="closeModal()" class="mr-2 btn btn-danger"
|
||||||
|
id="reset-delete">{{ 'service.overview.reset-form.reset-confirm' | translate }}
|
||||||
|
</button>
|
||||||
|
<button (click)="resetFormAndLeave()"
|
||||||
|
class="btn btn-primary custom-btn"
|
||||||
|
id="reset-confirm">{{ 'service.overview.reset-form.reset-return' | translate }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ng-template>
|
||||||
|
|
||||||
<button class="btn btn-primary" type="submit">{{ 'ldn-new-service.form.label.submit' | translate }}</button>
|
|
||||||
</form>
|
|
||||||
|
@@ -1,14 +1,8 @@
|
|||||||
form {
|
form {
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: flex-start;
|
|
||||||
max-width: 800px;
|
max-width: 800px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
margin-left: 300px;
|
position: relative;
|
||||||
|
|
||||||
& > * {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type="text"],
|
input[type="text"],
|
||||||
@@ -33,12 +27,13 @@ textarea {
|
|||||||
resize: none;
|
resize: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.add-pattern-link{
|
.add-pattern-link {
|
||||||
color: #0048ff;
|
color: #0048ff;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
.remove-pattern-link{
|
|
||||||
|
.remove-pattern-link {
|
||||||
color: #e34949;
|
color: #e34949;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
@@ -81,7 +76,6 @@ textarea {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.toggle-switch .slider {
|
.toggle-switch .slider {
|
||||||
width: 22px;
|
width: 22px;
|
||||||
height: 22px;
|
height: 22px;
|
||||||
@@ -103,12 +97,39 @@ textarea {
|
|||||||
|
|
||||||
.toggle-switch {
|
.toggle-switch {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
margin-top: 3px;
|
||||||
|
margin-right: 3px
|
||||||
|
}
|
||||||
|
|
||||||
|
.label-box {
|
||||||
|
margin-left: 11px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.label-box-2 {
|
||||||
|
margin-left: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.label-box-3 {
|
||||||
|
margin-left: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
form button.btn.btn-primary[type="submit"] {
|
||||||
|
position: absolute;
|
||||||
|
right: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.submission-form-footer {
|
||||||
|
border-radius: var(--bs-card-border-radius);
|
||||||
|
bottom: 0;
|
||||||
|
background-color: var(--bs-gray-400);
|
||||||
|
padding: calc(var(--bs-spacer) / 2);
|
||||||
|
z-index: var(--ds-submission-footer-z-index);
|
||||||
|
}
|
||||||
|
|
||||||
|
.marked-for-deletion {
|
||||||
|
background-color: #ffcccc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -3,21 +3,21 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|||||||
import { LdnServiceFormEditComponent } from './ldn-service-form-edit.component';
|
import { LdnServiceFormEditComponent } from './ldn-service-form-edit.component';
|
||||||
|
|
||||||
describe('LdnServiceFormEditComponent', () => {
|
describe('LdnServiceFormEditComponent', () => {
|
||||||
let component: LdnServiceFormEditComponent;
|
let component: LdnServiceFormEditComponent;
|
||||||
let fixture: ComponentFixture<LdnServiceFormEditComponent>;
|
let fixture: ComponentFixture<LdnServiceFormEditComponent>;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
declarations: [ LdnServiceFormEditComponent ]
|
declarations: [LdnServiceFormEditComponent]
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
||||||
fixture = TestBed.createComponent(LdnServiceFormEditComponent);
|
fixture = TestBed.createComponent(LdnServiceFormEditComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create', () => {
|
it('should create', () => {
|
||||||
expect(component).toBeTruthy();
|
expect(component).toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -1,14 +1,24 @@
|
|||||||
import { ChangeDetectorRef, Component, Input } from '@angular/core';
|
import { ChangeDetectorRef, Component, Input, OnInit, TemplateRef, ViewChild } from '@angular/core';
|
||||||
import { FormArray, FormBuilder, FormGroup, Validators } from '@angular/forms';
|
import { FormArray, FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||||
import { LDN_SERVICE } from '../ldn-services-model/ldn-service.resource-type';
|
import { LDN_SERVICE } from '../ldn-services-model/ldn-service.resource-type';
|
||||||
import { Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { HttpClient } from '@angular/common/http';
|
|
||||||
import { LdnDirectoryService } from '../ldn-services-services/ldn-directory.service';
|
|
||||||
import { LdnServicesService } from '../ldn-services-data/ldn-services-data.service';
|
import { LdnServicesService } from '../ldn-services-data/ldn-services-data.service';
|
||||||
import { LdnServiceConstraint } from '../ldn-services-model/ldn-service-constraint.model';
|
|
||||||
import { notifyPatterns } from '../ldn-services-patterns/ldn-service-coar-patterns';
|
import { notifyPatterns } from '../ldn-services-patterns/ldn-service-coar-patterns';
|
||||||
import { ActivatedRoute } from '@angular/router';
|
|
||||||
import { animate, state, style, transition, trigger } from '@angular/animations';
|
import { animate, state, style, transition, trigger } from '@angular/animations';
|
||||||
|
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||||
|
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||||
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
|
import { LdnService } from '../ldn-services-model/ldn-services.model';
|
||||||
|
import { RemoteData } from 'src/app/core/data/remote-data';
|
||||||
|
import { Operation } from 'fast-json-patch';
|
||||||
|
import { getFirstCompletedRemoteData } from '../../../core/shared/operators';
|
||||||
|
import { LdnItemfiltersService } from '../ldn-services-data/ldn-itemfilters-data.service';
|
||||||
|
import { Itemfilter } from '../ldn-services-model/ldn-service-itemfilters';
|
||||||
|
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { PaginationService } from '../../../core/pagination/pagination.service';
|
||||||
|
import { FindListOptions } from '../../../core/data/find-list-options.model';
|
||||||
|
import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-ldn-service-form-edit',
|
selector: 'ds-ldn-service-form-edit',
|
||||||
@@ -22,17 +32,21 @@ import { animate, state, style, transition, trigger } from '@angular/animations'
|
|||||||
]),
|
]),
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class LdnServiceFormEditComponent {
|
export class LdnServiceFormEditComponent implements OnInit {
|
||||||
formModel: FormGroup;
|
formModel: FormGroup;
|
||||||
|
@ViewChild('confirmModal', {static: true}) confirmModal: TemplateRef<any>;
|
||||||
|
@ViewChild('resetFormModal', {static: true}) resetFormModal: TemplateRef<any>;
|
||||||
|
|
||||||
showItemFilterDropdown = false;
|
|
||||||
|
|
||||||
private originalInboundPatterns: any[] = [];
|
|
||||||
private originalOutboundPatterns: any[] = [];
|
|
||||||
public inboundPatterns: object[] = notifyPatterns;
|
public inboundPatterns: object[] = notifyPatterns;
|
||||||
public outboundPatterns: object[] = notifyPatterns;
|
public outboundPatterns: object[] = notifyPatterns;
|
||||||
public itemFilterList: LdnServiceConstraint[];
|
itemfiltersRD$: Observable<RemoteData<PaginatedList<Itemfilter>>>;
|
||||||
|
config: FindListOptions = Object.assign(new FindListOptions(), {
|
||||||
|
elementsPerPage: 20
|
||||||
|
});
|
||||||
|
pageConfig: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), {
|
||||||
|
id: 'po',
|
||||||
|
pageSize: 20
|
||||||
|
});
|
||||||
@Input() public name: string;
|
@Input() public name: string;
|
||||||
@Input() public description: string;
|
@Input() public description: string;
|
||||||
@Input() public url: string;
|
@Input() public url: string;
|
||||||
@@ -41,18 +55,28 @@ export class LdnServiceFormEditComponent {
|
|||||||
@Input() public outboundPattern: string;
|
@Input() public outboundPattern: string;
|
||||||
@Input() public constraint: string;
|
@Input() public constraint: string;
|
||||||
@Input() public automatic: boolean;
|
@Input() public automatic: boolean;
|
||||||
|
|
||||||
@Input() public headerKey: string;
|
@Input() public headerKey: string;
|
||||||
private serviceId: string;
|
markedForDeletionInboundPattern: number[] = [];
|
||||||
|
markedForDeletionOutboundPattern: number[] = [];
|
||||||
|
protected serviceId: string;
|
||||||
|
private originalInboundPatterns: any[] = [];
|
||||||
|
private originalOutboundPatterns: any[] = [];
|
||||||
|
private deletedInboundPatterns: number[] = [];
|
||||||
|
private deletedOutboundPatterns: number[] = [];
|
||||||
|
private modalRef: any;
|
||||||
|
private service: LdnService;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private ldnServicesService: LdnServicesService,
|
protected ldnServicesService: LdnServicesService,
|
||||||
private ldnDirectoryService: LdnDirectoryService,
|
private ldnItemfiltersService: LdnItemfiltersService,
|
||||||
private formBuilder: FormBuilder,
|
private formBuilder: FormBuilder,
|
||||||
private http: HttpClient,
|
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private cdRef: ChangeDetectorRef
|
private cdRef: ChangeDetectorRef,
|
||||||
|
protected modalService: NgbModal,
|
||||||
|
private notificationService: NotificationsService,
|
||||||
|
private translateService: TranslateService,
|
||||||
|
protected paginationService: PaginationService
|
||||||
) {
|
) {
|
||||||
|
|
||||||
this.formModel = this.formBuilder.group({
|
this.formModel = this.formBuilder.group({
|
||||||
@@ -78,101 +102,238 @@ export class LdnServiceFormEditComponent {
|
|||||||
this.fetchServiceData(this.serviceId);
|
this.fetchServiceData(this.serviceId);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.ldnDirectoryService.getItemFilters().subscribe((itemFilters) => {
|
this.setItemfilters();
|
||||||
this.itemFilterList = itemFilters._embedded.itemfilters.map((filter: { id: string; }) => ({
|
|
||||||
name: filter.id
|
|
||||||
}));
|
|
||||||
this.cdRef.detectChanges();
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private getOriginalPattern(formArrayName: string, patternId: number): any {
|
setItemfilters() {
|
||||||
let originalPatterns: any[] = [];
|
this.itemfiltersRD$ = this.ldnItemfiltersService.findAll().pipe(
|
||||||
|
getFirstCompletedRemoteData());
|
||||||
if (formArrayName === 'notifyServiceInboundPatterns') {
|
|
||||||
originalPatterns = this.originalInboundPatterns;
|
|
||||||
} else if (formArrayName === 'notifyServiceOutboundPatterns') {
|
|
||||||
originalPatterns = this.originalOutboundPatterns;
|
|
||||||
}
|
|
||||||
|
|
||||||
return originalPatterns.find((pattern) => pattern.id === patternId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private patternsAreEqual(patternA: any, patternB: any): boolean {
|
|
||||||
return (
|
fetchServiceData(serviceId: string): void {
|
||||||
patternA.pattern === patternB.pattern &&
|
this.ldnServicesService.findById(serviceId).pipe(
|
||||||
patternA.constraint === patternB.constraint &&
|
getFirstCompletedRemoteData()
|
||||||
patternA.automatic === patternB.automatic
|
).subscribe(
|
||||||
|
(data: RemoteData<LdnService>) => {
|
||||||
|
if (data.hasSucceeded) {
|
||||||
|
this.service = data.payload;
|
||||||
|
|
||||||
|
this.formModel.patchValue({
|
||||||
|
id: this.service.id,
|
||||||
|
name: this.service.name,
|
||||||
|
description: this.service.description,
|
||||||
|
url: this.service.url,
|
||||||
|
ldnUrl: this.service.ldnUrl,
|
||||||
|
type: this.service.type,
|
||||||
|
enabled: this.service.enabled
|
||||||
|
});
|
||||||
|
|
||||||
|
const inboundPatternsArray = this.formModel.get('notifyServiceInboundPatterns') as FormArray;
|
||||||
|
inboundPatternsArray.clear();
|
||||||
|
|
||||||
|
this.service.notifyServiceInboundPatterns.forEach((pattern: any) => {
|
||||||
|
const patternFormGroup = this.initializeInboundPatternFormGroup();
|
||||||
|
patternFormGroup.patchValue(pattern);
|
||||||
|
inboundPatternsArray.push(patternFormGroup);
|
||||||
|
this.cdRef.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
const outboundPatternsArray = this.formModel.get('notifyServiceOutboundPatterns') as FormArray;
|
||||||
|
outboundPatternsArray.clear();
|
||||||
|
|
||||||
|
this.service.notifyServiceOutboundPatterns.forEach((pattern: any) => {
|
||||||
|
const patternFormGroup = this.initializeOutboundPatternFormGroup();
|
||||||
|
patternFormGroup.patchValue(pattern);
|
||||||
|
outboundPatternsArray.push(patternFormGroup);
|
||||||
|
|
||||||
|
this.cdRef.detectChanges();
|
||||||
|
});
|
||||||
|
this.originalInboundPatterns = [...this.service.notifyServiceInboundPatterns];
|
||||||
|
this.originalOutboundPatterns = [...this.service.notifyServiceOutboundPatterns];
|
||||||
|
}
|
||||||
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
fetchServiceData(serviceId: string): void {
|
generatePatchOperations(): any[] {
|
||||||
const apiUrl = `http://localhost:8080/server/api/ldn/ldnservices/${serviceId}`;
|
const patchOperations: any[] = [];
|
||||||
|
|
||||||
this.http.get(apiUrl).subscribe(
|
this.createReplaceOperation(patchOperations, 'name', '/name');
|
||||||
(data: any) => {
|
this.createReplaceOperation(patchOperations, 'description', '/description');
|
||||||
console.log(data);
|
this.createReplaceOperation(patchOperations, 'ldnUrl', '/ldnurl');
|
||||||
|
this.createReplaceOperation(patchOperations, 'url', '/url');
|
||||||
|
|
||||||
this.formModel.patchValue({
|
this.handlePatterns(patchOperations, 'notifyServiceInboundPatterns');
|
||||||
id: data.id,
|
this.handlePatterns(patchOperations, 'notifyServiceOutboundPatterns');
|
||||||
name: data.name,
|
|
||||||
description: data.description,
|
|
||||||
url: data.url,
|
|
||||||
ldnUrl: data.ldnUrl,
|
|
||||||
type: data.type,
|
|
||||||
enabled: data.enabled
|
|
||||||
});
|
|
||||||
|
|
||||||
const inboundPatternsArray = this.formModel.get('notifyServiceInboundPatterns') as FormArray;
|
this.deletedInboundPatterns.forEach(index => {
|
||||||
inboundPatternsArray.clear(); // Clear existing rows
|
const removeOperation: Operation = {
|
||||||
|
op: 'remove',
|
||||||
|
path: `notifyServiceInboundPatterns[${index}]`
|
||||||
|
};
|
||||||
|
patchOperations.push(removeOperation);
|
||||||
|
});
|
||||||
|
|
||||||
data.notifyServiceInboundPatterns.forEach((pattern: any) => {
|
this.deletedOutboundPatterns.forEach(index => {
|
||||||
console.log(pattern);
|
const removeOperation: Operation = {
|
||||||
const patternFormGroup = this.initializeInboundPatternFormGroup();
|
op: 'remove',
|
||||||
console.log();
|
path: `notifyServiceOutboundPatterns[${index}]`
|
||||||
patternFormGroup.patchValue(pattern);
|
};
|
||||||
inboundPatternsArray.push(patternFormGroup);
|
patchOperations.push(removeOperation);
|
||||||
this.cdRef.detectChanges();
|
});
|
||||||
});
|
|
||||||
|
|
||||||
const outboundPatternsArray = this.formModel.get('notifyServiceOutboundPatterns') as FormArray;
|
return patchOperations;
|
||||||
outboundPatternsArray.clear();
|
}
|
||||||
|
|
||||||
data.notifyServiceOutboundPatterns.forEach((pattern: any) => {
|
onSubmit() {
|
||||||
const patternFormGroup = this.initializeOutboundPatternFormGroup();
|
this.openConfirmModal(this.confirmModal);
|
||||||
patternFormGroup.patchValue(pattern);
|
}
|
||||||
outboundPatternsArray.push(patternFormGroup);
|
|
||||||
|
|
||||||
this.cdRef.detectChanges();
|
addInboundPattern() {
|
||||||
});
|
const notifyServiceInboundPatternsArray = this.formModel.get('notifyServiceInboundPatterns') as FormArray;
|
||||||
this.originalInboundPatterns = [...data.notifyServiceInboundPatterns];
|
notifyServiceInboundPatternsArray.push(this.createInboundPatternFormGroup());
|
||||||
|
}
|
||||||
|
|
||||||
this.originalOutboundPatterns = [...data.notifyServiceOutboundPatterns];
|
addOutboundPattern() {
|
||||||
},
|
const notifyServiceOutboundPatternsArray = this.formModel.get('notifyServiceOutboundPatterns') as FormArray;
|
||||||
(error) => {
|
notifyServiceOutboundPatternsArray.push(this.createOutboundPatternFormGroup());
|
||||||
console.error('Error fetching service data:', error);
|
}
|
||||||
|
|
||||||
|
|
||||||
|
toggleAutomatic(i: number) {
|
||||||
|
const automaticControl = this.formModel.get(`notifyServiceInboundPatterns.${i}.automatic`);
|
||||||
|
if (automaticControl) {
|
||||||
|
automaticControl.setValue(!automaticControl.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
toggleEnabled() {
|
||||||
|
const newStatus = !this.formModel.get('enabled').value;
|
||||||
|
|
||||||
|
const patchOperation: Operation = {
|
||||||
|
op: 'replace',
|
||||||
|
path: '/enabled',
|
||||||
|
value: newStatus,
|
||||||
|
};
|
||||||
|
|
||||||
|
this.ldnServicesService.patch(this.service, [patchOperation]).pipe(
|
||||||
|
getFirstCompletedRemoteData()
|
||||||
|
).subscribe(
|
||||||
|
() => {
|
||||||
|
|
||||||
|
this.formModel.get('enabled').setValue(newStatus);
|
||||||
|
this.cdRef.detectChanges();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
generatePatchOperations(): any[] {
|
closeModal() {
|
||||||
const patchOperations: any[] = [];
|
this.modalRef.close();
|
||||||
|
this.cdRef.detectChanges();
|
||||||
this.addReplaceOperation(patchOperations, 'name', '/name');
|
|
||||||
this.addReplaceOperation(patchOperations, 'description', '/description');
|
|
||||||
this.addReplaceOperation(patchOperations, 'ldnUrl', '/ldnurl');
|
|
||||||
this.addReplaceOperation(patchOperations, 'url', '/url');
|
|
||||||
|
|
||||||
this.handlePatterns(patchOperations, 'notifyServiceInboundPatterns');
|
|
||||||
|
|
||||||
this.handlePatterns(patchOperations, 'notifyServiceOutboundPatterns');
|
|
||||||
|
|
||||||
return patchOperations;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private addReplaceOperation(patchOperations: any[], formControlName: string, path: string): void {
|
openConfirmModal(content) {
|
||||||
|
this.modalRef = this.modalService.open(content);
|
||||||
|
}
|
||||||
|
|
||||||
|
openResetFormModal(content) {
|
||||||
|
this.modalRef = this.modalService.open(content);
|
||||||
|
}
|
||||||
|
|
||||||
|
patchService() {
|
||||||
|
this.deleteMarkedInboundPatterns();
|
||||||
|
this.deleteMarkedOutboundPatterns();
|
||||||
|
const patchOperations = this.generatePatchOperations();
|
||||||
|
|
||||||
|
|
||||||
|
this.ldnServicesService.patch(this.service, patchOperations).pipe(
|
||||||
|
getFirstCompletedRemoteData()
|
||||||
|
).subscribe(
|
||||||
|
() => {
|
||||||
|
|
||||||
|
this.closeModal();
|
||||||
|
this.sendBack();
|
||||||
|
this.notificationService.success(this.translateService.get('admin.registries.services-formats.modify.success.head'),
|
||||||
|
this.translateService.get('admin.registries.services-formats.modify.success.content'));
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
resetFormAndLeave() {
|
||||||
|
this.sendBack();
|
||||||
|
this.closeModal();
|
||||||
|
}
|
||||||
|
|
||||||
|
markForInboundPatternDeletion(index: number) {
|
||||||
|
if (!this.markedForDeletionInboundPattern.includes(index)) {
|
||||||
|
this.markedForDeletionInboundPattern.push(index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
unmarkForInboundPatternDeletion(index: number) {
|
||||||
|
const i = this.markedForDeletionInboundPattern.indexOf(index);
|
||||||
|
if (i !== -1) {
|
||||||
|
this.markedForDeletionInboundPattern.splice(i, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
markForOutboundPatternDeletion(index: number) {
|
||||||
|
if (!this.markedForDeletionOutboundPattern.includes(index)) {
|
||||||
|
this.markedForDeletionOutboundPattern.push(index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
unmarkForOutboundPatternDeletion(index: number) {
|
||||||
|
const i = this.markedForDeletionOutboundPattern.indexOf(index);
|
||||||
|
if (i !== -1) {
|
||||||
|
this.markedForDeletionOutboundPattern.splice(i, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
deleteMarkedInboundPatterns() {
|
||||||
|
this.markedForDeletionInboundPattern.sort((a, b) => b - a);
|
||||||
|
const patternsArray = this.formModel.get('notifyServiceInboundPatterns') as FormArray;
|
||||||
|
|
||||||
|
for (const index of this.markedForDeletionInboundPattern) {
|
||||||
|
if (index >= 0 && index < patternsArray.length) {
|
||||||
|
const patternGroup = patternsArray.at(index) as FormGroup;
|
||||||
|
const patternValue = patternGroup.value;
|
||||||
|
if (patternValue.isNew) {
|
||||||
|
patternsArray.removeAt(index);
|
||||||
|
} else {
|
||||||
|
this.deletedInboundPatterns.push(index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.markedForDeletionInboundPattern = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
deleteMarkedOutboundPatterns() {
|
||||||
|
this.markedForDeletionOutboundPattern.sort((a, b) => b - a);
|
||||||
|
const patternsArray = this.formModel.get('notifyServiceOutboundPatterns') as FormArray;
|
||||||
|
|
||||||
|
for (const index of this.markedForDeletionOutboundPattern) {
|
||||||
|
if (index >= 0 && index < patternsArray.length) {
|
||||||
|
const patternGroup = patternsArray.at(index) as FormGroup;
|
||||||
|
const patternValue = patternGroup.value;
|
||||||
|
if (patternValue.isNew) {
|
||||||
|
patternsArray.removeAt(index);
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.deletedOutboundPatterns.push(index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.markedForDeletionOutboundPattern = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
private createReplaceOperation(patchOperations: any[], formControlName: string, path: string): void {
|
||||||
if (this.formModel.get(formControlName).dirty) {
|
if (this.formModel.get(formControlName).dirty) {
|
||||||
patchOperations.push({
|
patchOperations.push({
|
||||||
op: 'replace',
|
op: 'replace',
|
||||||
@@ -185,125 +346,31 @@ export class LdnServiceFormEditComponent {
|
|||||||
private handlePatterns(patchOperations: any[], formArrayName: string): void {
|
private handlePatterns(patchOperations: any[], formArrayName: string): void {
|
||||||
const patternsArray = this.formModel.get(formArrayName) as FormArray;
|
const patternsArray = this.formModel.get(formArrayName) as FormArray;
|
||||||
|
|
||||||
if (patternsArray.dirty) {
|
for (let i = 0; i < patternsArray.length; i++) {
|
||||||
for (let i = 0; i < patternsArray.length; i++) {
|
const patternGroup = patternsArray.at(i) as FormGroup;
|
||||||
const patternGroup = patternsArray.at(i) as FormGroup;
|
const patternValue = patternGroup.value;
|
||||||
const patternValue = patternGroup.value;
|
|
||||||
|
|
||||||
|
if (patternGroup.dirty) {
|
||||||
if (patternValue.isNew) {
|
if (patternValue.isNew) {
|
||||||
console.log(this.getOriginalPatternsForFormArray(formArrayName));
|
delete patternValue.isNew;
|
||||||
console.log(patternGroup);
|
|
||||||
delete patternValue.isNew;
|
|
||||||
const addOperation = {
|
const addOperation = {
|
||||||
op: 'add',
|
op: 'add',
|
||||||
path: `${formArrayName}/-`,
|
path: `${formArrayName}/-`,
|
||||||
value: patternValue,
|
value: patternValue,
|
||||||
};
|
};
|
||||||
patchOperations.push(addOperation);
|
patchOperations.push(addOperation);
|
||||||
} else if (patternGroup.dirty) {
|
} else {
|
||||||
const replaceOperation = {
|
const replaceOperation = {
|
||||||
op: 'replace',
|
op: 'replace',
|
||||||
path: `${formArrayName}[${i}]`,
|
path: `${formArrayName}[${i}]`,
|
||||||
value: patternValue,
|
value: patternValue,
|
||||||
};
|
};
|
||||||
patchOperations.push(replaceOperation);
|
patchOperations.push(replaceOperation);
|
||||||
console.log(patternValue.id);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private getOriginalPatternsForFormArray(formArrayName: string): any[] {
|
|
||||||
if (formArrayName === 'notifyServiceInboundPatterns') {
|
|
||||||
return this.originalInboundPatterns;
|
|
||||||
} else if (formArrayName === 'notifyServiceOutboundPatterns') {
|
|
||||||
return this.originalOutboundPatterns;
|
|
||||||
}
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
submitForm() {
|
|
||||||
const apiUrl = `http://localhost:8080/server/api/ldn/ldnservices/${this.serviceId}`;
|
|
||||||
const patchOperations = this.generatePatchOperations();
|
|
||||||
|
|
||||||
this.http.patch(apiUrl, patchOperations).subscribe(
|
|
||||||
(response) => {
|
|
||||||
console.log('Service updated successfully:', response);
|
|
||||||
this.sendBack();
|
|
||||||
},
|
|
||||||
(error) => {
|
|
||||||
console.error('Error updating service:', error);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
addInboundPattern() {
|
|
||||||
const notifyServiceInboundPatternsArray = this.formModel.get('notifyServiceInboundPatterns') as FormArray;
|
|
||||||
notifyServiceInboundPatternsArray.push(this.createInboundPatternFormGroup());
|
|
||||||
}
|
|
||||||
|
|
||||||
removeInboundPattern(index: number) {
|
|
||||||
const notifyServiceInboundPatternsArray = this.formModel.get('notifyServiceInboundPatterns') as FormArray;
|
|
||||||
if (index >= 0 && index < notifyServiceInboundPatternsArray.length) {
|
|
||||||
const serviceId = this.formModel.get('id').value;
|
|
||||||
|
|
||||||
const patchOperation = [
|
|
||||||
{
|
|
||||||
op: 'remove',
|
|
||||||
path: `notifyServiceInboundPatterns[${index}]`
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
const apiUrl = `http://localhost:8080/server/api/ldn/ldnservices/${serviceId}`;
|
|
||||||
|
|
||||||
this.http.patch(apiUrl, patchOperation).subscribe(
|
|
||||||
(response) => {
|
|
||||||
console.log('Pattern removed successfully:', response);
|
|
||||||
|
|
||||||
notifyServiceInboundPatternsArray.removeAt(index);
|
|
||||||
},
|
|
||||||
(error) => {
|
|
||||||
console.error('Error removing pattern:', error);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
addOutboundPattern() {
|
|
||||||
const notifyServiceOutboundPatternsArray = this.formModel.get('notifyServiceOutboundPatterns') as FormArray;
|
|
||||||
notifyServiceOutboundPatternsArray.push(this.createOutboundPatternFormGroup());
|
|
||||||
}
|
|
||||||
|
|
||||||
removeOutboundPattern(index: number) {
|
|
||||||
const notifyServiceOutboundPatternsArray = this.formModel.get('notifyServiceOutboundPatterns') as FormArray;
|
|
||||||
if (index >= 0 && index < notifyServiceOutboundPatternsArray.length) {
|
|
||||||
const serviceId = this.formModel.get('id').value;
|
|
||||||
|
|
||||||
|
|
||||||
const patchOperation = [
|
|
||||||
{
|
|
||||||
op: 'remove',
|
|
||||||
path: `notifyServiceOutboundPatterns[${index}]`
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
const apiUrl = `http://localhost:8080/server/api/ldn/ldnservices/${serviceId}`;
|
|
||||||
|
|
||||||
this.http.patch(apiUrl, patchOperation).subscribe(
|
|
||||||
(response) => {
|
|
||||||
console.log('Pattern removed successfully:', response);
|
|
||||||
|
|
||||||
notifyServiceOutboundPatternsArray.removeAt(index);
|
|
||||||
},
|
|
||||||
(error) => {
|
|
||||||
console.error('Error removing pattern:', error);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private sendBack() {
|
private sendBack() {
|
||||||
this.router.navigateByUrl('admin/ldn/services');
|
this.router.navigateByUrl('admin/ldn/services');
|
||||||
}
|
}
|
||||||
@@ -320,7 +387,7 @@ export class LdnServiceFormEditComponent {
|
|||||||
return this.formBuilder.group({
|
return this.formBuilder.group({
|
||||||
pattern: '',
|
pattern: '',
|
||||||
constraint: '',
|
constraint: '',
|
||||||
automatic: '',
|
automatic: false,
|
||||||
isNew: true
|
isNew: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -339,36 +406,4 @@ export class LdnServiceFormEditComponent {
|
|||||||
automatic: '',
|
automatic: '',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
toggleAutomatic(i: number) {
|
|
||||||
const automaticControl = this.formModel.get(`notifyServiceInboundPatterns.${i}.automatic`);
|
|
||||||
if (automaticControl) {
|
|
||||||
automaticControl.setValue(!automaticControl.value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
toggleEnabled() {
|
|
||||||
const newStatus = !this.formModel.get('enabled').value;
|
|
||||||
const serviceId = this.formModel.get('id').value;
|
|
||||||
const status = this.formModel.get('enabled').value;
|
|
||||||
|
|
||||||
const apiUrl = `http://localhost:8080/server/api/ldn/ldnservices/${serviceId}`;
|
|
||||||
const patchOperation = {
|
|
||||||
op: 'replace',
|
|
||||||
path: '/enabled',
|
|
||||||
value: newStatus,
|
|
||||||
};
|
|
||||||
|
|
||||||
this.http.patch(apiUrl, [patchOperation]).subscribe(
|
|
||||||
() => {
|
|
||||||
console.log('Status updated successfully.');
|
|
||||||
this.formModel.get('enabled').setValue(newStatus);
|
|
||||||
console.log(this.formModel.get('enabled'));
|
|
||||||
this.cdRef.detectChanges();
|
|
||||||
},
|
|
||||||
(error) => {
|
|
||||||
console.error('Error updating status:', error);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -1,163 +1,266 @@
|
|||||||
<form (ngSubmit)="submitForm()" [formGroup]="formModel">
|
<div class="container">
|
||||||
|
<form (ngSubmit)="onSubmit()" [formGroup]="formModel">
|
||||||
|
<div class="d-flex">
|
||||||
|
<h2 class="flex-grow-1">{{ 'ldn-create-service.title' | translate }}</h2>
|
||||||
|
</div>
|
||||||
|
<!-- In the name section -->
|
||||||
|
<div class="mb-2">
|
||||||
|
<label for="name">{{ 'ldn-new-service.form.label.name' | translate }}</label>
|
||||||
|
<input [class.invalid-field]="formModel.get('name').invalid && formModel.get('name').touched"
|
||||||
|
[placeholder]="'ldn-new-service.form.placeholder.name' | translate" formControlName="name" id="name"
|
||||||
|
name="name"
|
||||||
|
type="text">
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- In the name section -->
|
<div class="mb-4">
|
||||||
<div class="mb-2">
|
|
||||||
<label for="name">{{ 'ldn-new-service.form.label.name' | translate }}</label>
|
</div>
|
||||||
<input [placeholder]="'ldn-new-service.form.placeholder.name' | translate"
|
|
||||||
formControlName="name" id="name" name="name"
|
|
||||||
[class.invalid-field]="formModel.get('name').invalid && formModel.get('name').touched"
|
|
||||||
type="text">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="mb-4">
|
<!-- In the description section -->
|
||||||
|
<div class="mb-2 d-flex flex-column">
|
||||||
</div>
|
<label for="description">{{ 'ldn-new-service.form.label.description' | translate }}</label>
|
||||||
|
<textarea [placeholder]="'ldn-new-service.form.placeholder.description' | translate"
|
||||||
|
formControlName="description" id="description" name="description"></textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- In the description section -->
|
<div class="mb-4">
|
||||||
<div class="mb-2 d-flex flex-column">
|
|
||||||
<label for="description">{{ 'ldn-new-service.form.label.description' | translate }}</label>
|
</div>
|
||||||
<textarea [placeholder]="'ldn-new-service.form.placeholder.description' | translate"
|
|
||||||
formControlName="description" id="description" name="description"></textarea>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="mb-4">
|
<!-- In the url section -->
|
||||||
|
<div class="mb-2">
|
||||||
</div>
|
<label for="url">{{ 'ldn-new-service.form.label.url' | translate }}</label>
|
||||||
|
<input [class.invalid-field]="formModel.get('url').invalid && formModel.get('url').touched"
|
||||||
|
[placeholder]="'ldn-new-service.form.placeholder.url' | translate" formControlName="url" id="url"
|
||||||
|
name="url"
|
||||||
|
type="text">
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- In the url section -->
|
<div class="mb-4">
|
||||||
<div class="mb-2">
|
|
||||||
<label for="url">{{ 'ldn-new-service.form.label.url' | translate }}</label>
|
</div>
|
||||||
<input [placeholder]="'ldn-new-service.form.placeholder.url' | translate"
|
|
||||||
formControlName="url" id="url" name="url"
|
|
||||||
[class.invalid-field]="formModel.get('url').invalid && formModel.get('url').touched"
|
|
||||||
type="text">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="mb-4">
|
<!-- In the ldnUrl section -->
|
||||||
|
<div class="mb-2">
|
||||||
</div>
|
<label for="ldnUrl">{{ 'ldn-new-service.form.label.ldnUrl' | translate }}</label>
|
||||||
|
<input [class.invalid-field]="formModel.get('ldnUrl').invalid && formModel.get('ldnUrl').touched"
|
||||||
|
[placeholder]="'ldn-new-service.form.placeholder.ldnUrl' | translate" formControlName="ldnUrl"
|
||||||
|
id="ldnUrl"
|
||||||
|
name="ldnUrl"
|
||||||
|
type="text">
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- In the ldnUrl section -->
|
<div class="mb-4">
|
||||||
<div class="mb-2">
|
|
||||||
<label for="ldnUrl">{{ 'ldn-new-service.form.label.ldnUrl' | translate }}</label>
|
</div>
|
||||||
<input [placeholder]="'ldn-new-service.form.placeholder.ldnUrl' | translate"
|
|
||||||
formControlName="ldnUrl" id="ldnUrl" name="ldnUrl"
|
|
||||||
[class.invalid-field]="formModel.get('ldnUrl').invalid && formModel.get('ldnUrl').touched"
|
|
||||||
type="text">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="mb-4">
|
<!-- In the Inbound Patterns section -->
|
||||||
|
<div class="row">
|
||||||
</div>
|
<div class="col">
|
||||||
|
<label>{{ 'ldn-new-service.form.label.inboundPattern' | translate }} </label>
|
||||||
<!-- In the Inbound Patterns section -->
|
|
||||||
<div *ngFor="let patternGroup of formModel.get('notifyServiceInboundPatterns')['controls']; let i = index"
|
|
||||||
class="mb-2 d-flex align-content-center" formGroupName="notifyServiceInboundPatterns">
|
|
||||||
|
|
||||||
<ng-container [formGroupName]="i">
|
|
||||||
|
|
||||||
<div class="flex-grow-1">
|
|
||||||
<label *ngIf="i === 0" for="additionalInboundPattern{{i}}">{{ 'ldn-new-service.form.label.inboundPattern' | translate }}</label>
|
|
||||||
|
|
||||||
<select #inboundPattern formControlName="pattern" id="additionalInboundPattern{{i}}"
|
|
||||||
name="additionalInboundPattern{{i}}" required>
|
|
||||||
|
|
||||||
<option value="">{{ 'ldn-new-service.form.label.placeholder.inboundPattern' | translate }}</option>
|
|
||||||
<option *ngFor="let pattern of inboundPatterns" [ngValue]="pattern.name">{{ pattern.name }}</option>
|
|
||||||
|
|
||||||
</select>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<label class="label-box">{{ 'ldn-new-service.form.label.ItemFilter' | translate }}</label>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm1 ">
|
||||||
|
<label class="label-box-2">{{ 'ldn-new-service.form.label.automatic' | translate }}</label>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-1">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<ng-container *ngIf="inboundPattern.value">
|
<div *ngFor="let patternGroup of formModel.get('notifyServiceInboundPatterns')['controls']; let i = index"
|
||||||
|
formGroupName="notifyServiceInboundPatterns">
|
||||||
|
|
||||||
<div class="ml-2 flex-grow-1">
|
<ng-container [formGroupName]="i">
|
||||||
<label *ngIf="i === 0" for="constraint{{i}}">{{ 'ldn-new-service.form.label.ItemFilter' | translate }}</label>
|
|
||||||
|
|
||||||
<select formControlName="constraint" id="constraint{{i}}" name="constraint{{i}}">
|
|
||||||
<option value="">{{ 'ldn-new-service.form.label.placeholder.selectedItemFilter' | translate }}</option>
|
|
||||||
<option *ngFor="let itemFilter of itemFilterList"
|
|
||||||
[value]="itemFilter.name">{{ itemFilter.name }}</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="ml-2 d-flex flex-column align-content-center">
|
<div class="row mb-1">
|
||||||
<label *ngIf="i === 0" for="automatic{{i}}">{{ 'ldn-new-service.form.label.automatic' | translate }}</label>
|
<div class="col">
|
||||||
<div class="d-flex flex-grow-1 align-content-center justify-content-center">
|
<select #inboundPattern formControlName="pattern" id="additionalInboundPattern{{i}}"
|
||||||
<input formControlName="automatic" id="automatic{{i}}" name="automatic{{i}}" type="checkbox" hidden>
|
name="additionalInboundPattern{{i}}" required>
|
||||||
<div class="toggle-switch" [class.checked]="formModel.get('notifyServiceInboundPatterns.' + i + '.automatic').value" (click)="toggleAutomatic(i)">
|
<option value="">{{ 'ldn-new-service.form.label.placeholder.inboundPattern' | translate }}</option>
|
||||||
|
<option *ngFor="let pattern of inboundPatterns"
|
||||||
|
[ngValue]="pattern.name">{{ pattern.name }}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col">
|
||||||
|
<ng-container *ngIf="inboundPattern.value">
|
||||||
|
<select formControlName="constraint" id="constraint{{i}}" name="constraint{{i}}">
|
||||||
|
<option value="">{{ 'ldn-new-service.form.label.placeholder.selectedItemFilter' | translate }}</option>
|
||||||
|
<option *ngFor="let itemFilter of (itemfiltersRD$ | async)?.payload?.page"
|
||||||
|
[value]="itemFilter.id">{{ itemFilter.id }}</option>
|
||||||
|
</select>
|
||||||
|
</ng-container>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div [style.visibility]="inboundPattern.value ? 'visible' : 'hidden'" class="col-sm-1">
|
||||||
|
<input formControlName="automatic" hidden id="automatic{{i}}" name="automatic{{i}}"
|
||||||
|
type="checkbox">
|
||||||
|
<div (click)="toggleAutomatic(i)"
|
||||||
|
[class.checked]="formModel.get('notifyServiceInboundPatterns.' + i + '.automatic').value"
|
||||||
|
class="toggle-switch">
|
||||||
<div class="slider"></div>
|
<div class="slider"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="col-sm-1">
|
||||||
|
<button (click)="removeInboundPattern(i)" class="btn btn-outline-dark trash-button">
|
||||||
|
<i class="fas fa-trash"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<span (click)="addInboundPattern()"
|
||||||
|
class="add-pattern-link mb-2">{{ 'ldn-new-service.form.label.addPattern' | translate }}</span>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="mb-4">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- In the Outbound Patterns section -->
|
||||||
|
<div class="row">
|
||||||
|
<div class="col">
|
||||||
|
<label>{{ 'ldn-new-service.form.label.outboundPattern' | translate }}</label>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<label class="label-box">{{ 'ldn-new-service.form.label.ItemFilter' | translate }}</label>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-1 ">
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-1 ">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div *ngFor="let patternGroup of formModel.get('notifyServiceOutboundPatterns')['controls']; let i = index"
|
||||||
|
formGroupName="notifyServiceOutboundPatterns">
|
||||||
|
|
||||||
|
<ng-container [formGroupName]="i">
|
||||||
|
|
||||||
|
<!-- Input elements in a separate row -->
|
||||||
|
<div class="row mb-1">
|
||||||
|
<div class="col">
|
||||||
|
<select #outboundPattern formControlName="pattern" id="additionalOutboundPattern{{i}}"
|
||||||
|
name="additionalOutboundPattern{{i}}"
|
||||||
|
required>
|
||||||
|
<option value="">{{ 'ldn-new-service.form.label.placeholder.outboundPattern' | translate }}</option>
|
||||||
|
<option *ngFor="let pattern of outboundPatterns"
|
||||||
|
[ngValue]="pattern.name">{{ pattern.name }}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<ng-container *ngIf="outboundPattern.value">
|
||||||
|
<select formControlName="constraint" id="constraint{{i}}" name="constraint{{i}}">
|
||||||
|
<option value="">{{ 'ldn-new-service.form.label.placeholder.selectedItemFilter' | translate }}</option>
|
||||||
|
<option *ngFor="let itemFilter of (itemfiltersRD$ | async)?.payload?.page"
|
||||||
|
[value]="itemFilter.id">{{ itemFilter.id }}</option>
|
||||||
|
</select>
|
||||||
|
</ng-container>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div [style.visibility]="'hidden'" class="col-sm1">
|
||||||
|
<input hidden id="automatic{{i}}" name="automatic{{i}}" type="checkbox">
|
||||||
|
<div
|
||||||
|
class="toggle-switch">
|
||||||
|
<div class="slider"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-sm-1">
|
||||||
|
<button (click)="removeOutboundPattern(i)" class="btn btn-outline-dark trash-button">
|
||||||
|
<i class="fas fa-trash"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<div class="d-flex align-items-end justify-content-center">
|
</div>
|
||||||
<button (click)="removeInboundPattern(patternGroup)" class="btn btn-outline-dark trash-button ml-2">
|
|
||||||
<i class="fas fa-trash"></i>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</ng-container>
|
<span (click)="addOutboundPattern()"
|
||||||
|
class="add-pattern-link">{{ 'ldn-new-service.form.label.addPattern' | translate }}
|
||||||
</div>
|
|
||||||
|
|
||||||
<span (click)="addInboundPattern()"
|
|
||||||
class="add-pattern-link mb-2">{{ 'ldn-new-service.form.label.addPattern' | translate }}</span>
|
|
||||||
|
|
||||||
<div class="mb-4">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- In the Outbound Patterns section -->
|
|
||||||
<div *ngFor="let patternGroup of formModel.get('notifyServiceOutboundPatterns')['controls']; let i = index"
|
|
||||||
class="mb-2 d-flex align-content-center" formGroupName="notifyServiceOutboundPatterns">
|
|
||||||
|
|
||||||
<ng-container [formGroupName]="i">
|
|
||||||
|
|
||||||
<div class="flex-grow-1">
|
|
||||||
<label *ngIf="i === 0" for="additionalOutboundPattern{{i}}">{{ 'ldn-new-service.form.label.outboundPattern' | translate }}</label>
|
|
||||||
|
|
||||||
<select #outboundPattern formControlName="pattern" id="additionalOutboundPattern{{i}}"
|
|
||||||
name="additionalOutboundPattern{{i}}"
|
|
||||||
required>
|
|
||||||
|
|
||||||
<option value="">{{ 'ldn-new-service.form.label.placeholder.outboundPattern' | translate }}</option>
|
|
||||||
<option *ngFor="let pattern of outboundPatterns"
|
|
||||||
[ngValue]="pattern.name">{{ pattern.name }}</option>
|
|
||||||
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div *ngIf="outboundPattern.value" class="ml-2 flex-grow-1">
|
|
||||||
|
|
||||||
<label *ngIf="i === 0" for="constraint{{i}}">{{ 'ldn-new-service.form.label.ItemFilter' | translate }}</label>
|
|
||||||
|
|
||||||
<select formControlName="constraint" id="constraint{{i}}" name="constraint{{i}}">
|
|
||||||
<option value="">{{ 'ldn-new-service.form.label.placeholder.selectedItemFilter' | translate }}</option>
|
|
||||||
<option *ngFor="let itemFilter of itemFilterList"
|
|
||||||
[value]="itemFilter.name">{{ itemFilter.name }}</option>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="d-flex align-items-end justify-content-center">
|
|
||||||
<button (click)="removeOutboundPattern(patternGroup)" class="btn btn-outline-dark trash-button ml-2">
|
|
||||||
<i class="fas fa-trash"></i>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</ng-container>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<span (click)="addOutboundPattern()"
|
|
||||||
class="add-pattern-link mb-2">{{ 'ldn-new-service.form.label.addPattern' | translate }}
|
|
||||||
</span>
|
</span>
|
||||||
<div class="mb-2">
|
<div class="mb-4">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<button class="btn btn-primary" type="submit">{{ 'ldn-new-service.form.label.submit' | translate }}</button>
|
|
||||||
</form>
|
<div aria-label="Basic example" class="submission-form-footer mt-1 mb-1 position-sticky" role="group">
|
||||||
|
<button class="btn btn-primary" type="submit">
|
||||||
|
<span><i class="fas fa-save"></i> {{ 'ldn-new-service.form.label.submit' | translate }}</span>
|
||||||
|
</button>
|
||||||
|
<div class="d-flex">
|
||||||
|
<button (click)="this.openResetFormModal(this.resetFormModal)" class="btn btn-danger" type="button">
|
||||||
|
<span><i class="fas fa-trash"></i> {{ 'submission.general.discard.submit' | translate }}</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<ng-template #confirmModal>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
|
||||||
|
<div class="modal-header">
|
||||||
|
<div>
|
||||||
|
<h4>{{'service.overview.create.modal' | translate }}</h4>
|
||||||
|
</div>
|
||||||
|
<button (click)="closeModal()" aria-label="Close"
|
||||||
|
class="close" type="button">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal-body">
|
||||||
|
<div>
|
||||||
|
{{ 'service.create.body' | translate }}
|
||||||
|
</div>
|
||||||
|
<div class="mt-4">
|
||||||
|
<button (click)="closeModal()" class="btn btn-danger"
|
||||||
|
id="delete-confirm">{{ 'service.refuse.create' | translate }}
|
||||||
|
</button>
|
||||||
|
<button (click)="createService()"
|
||||||
|
class="btn btn-primary mr-2 custom-btn">{{ 'service.confirm.create' | translate }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ng-template>
|
||||||
|
|
||||||
|
<ng-template #resetFormModal>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
|
||||||
|
<div class="modal-header">
|
||||||
|
<div>
|
||||||
|
<h4>{{'service.create.reset-form.modal' | translate }}</h4>
|
||||||
|
</div>
|
||||||
|
<button (click)="closeModal()" aria-label="Close"
|
||||||
|
class="close" type="button">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal-body">
|
||||||
|
<div>
|
||||||
|
{{ 'service.create.reset-form.body' | translate }}
|
||||||
|
</div>
|
||||||
|
<div class="mt-4">
|
||||||
|
<button (click)="resetFormAndLeave()"
|
||||||
|
class="btn btn-primary mr-2 custom-btn"
|
||||||
|
id="reset-confirm">{{ 'service.overview.reset-form.reset-return' | translate }}
|
||||||
|
</button>
|
||||||
|
<button (click)="closeModal()" class="btn btn-danger"
|
||||||
|
id="reset-delete">{{ 'service.overview.reset-form.reset-confirm' | translate }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ng-template>
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,14 +1,8 @@
|
|||||||
form {
|
form {
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: flex-start;
|
|
||||||
max-width: 800px;
|
max-width: 800px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
margin-left: 300px;
|
position: relative;
|
||||||
|
|
||||||
& > * {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type="text"],
|
input[type="text"],
|
||||||
@@ -33,12 +27,13 @@ textarea {
|
|||||||
resize: none;
|
resize: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.add-pattern-link{
|
.add-pattern-link {
|
||||||
color: #0048ff;
|
color: #0048ff;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
.remove-pattern-link{
|
|
||||||
|
.remove-pattern-link {
|
||||||
color: #e34949;
|
color: #e34949;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
@@ -81,7 +76,6 @@ textarea {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.toggle-switch .slider {
|
.toggle-switch .slider {
|
||||||
width: 22px;
|
width: 22px;
|
||||||
height: 22px;
|
height: 22px;
|
||||||
@@ -105,8 +99,31 @@ textarea {
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.label-box {
|
||||||
|
margin-left: 11px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.label-box-2 {
|
||||||
|
margin-left: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.label-box-3 {
|
||||||
|
margin-left: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
form button.btn.btn-primary[type="submit"] {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
right: -10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.submission-form-footer {
|
||||||
|
border-radius: var(--bs-card-border-radius);
|
||||||
|
bottom: 0;
|
||||||
|
background-color: var(--bs-gray-400);
|
||||||
|
padding: calc(var(--bs-spacer) / 2);
|
||||||
|
z-index: var(--ds-submission-footer-z-index);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -3,23 +3,23 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|||||||
import { LdnServiceFormComponent } from './ldn-service-form.component';
|
import { LdnServiceFormComponent } from './ldn-service-form.component';
|
||||||
|
|
||||||
describe('LdnServiceFormComponent', () => {
|
describe('LdnServiceFormComponent', () => {
|
||||||
let component: LdnServiceFormComponent;
|
let component: LdnServiceFormComponent;
|
||||||
let fixture: ComponentFixture<LdnServiceFormComponent>;
|
let fixture: ComponentFixture<LdnServiceFormComponent>;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
declarations: [ LdnServiceFormComponent ]
|
declarations: [LdnServiceFormComponent]
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(LdnServiceFormComponent);
|
fixture = TestBed.createComponent(LdnServiceFormComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create', () => {
|
it('should create', () => {
|
||||||
expect(component).toBeTruthy();
|
expect(component).toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -1,14 +1,33 @@
|
|||||||
import { Component, Input, OnInit } from '@angular/core';
|
import {
|
||||||
import { FormBuilder, FormGroup, Validators, FormArray } from '@angular/forms';
|
ChangeDetectorRef,
|
||||||
import { HttpClient } from '@angular/common/http';
|
Component,
|
||||||
|
EventEmitter,
|
||||||
|
Input,
|
||||||
|
OnInit,
|
||||||
|
Output,
|
||||||
|
TemplateRef,
|
||||||
|
ViewChild
|
||||||
|
} from '@angular/core';
|
||||||
|
import { FormArray, FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
|
|
||||||
import { LdnServicesService } from '../ldn-services-data/ldn-services-data.service';
|
import { LdnServicesService } from '../ldn-services-data/ldn-services-data.service';
|
||||||
import { LdnServiceConstraint } from '../ldn-services-model/ldn-service-constraint.model';
|
|
||||||
import { notifyPatterns } from '../ldn-services-patterns/ldn-service-coar-patterns';
|
import { notifyPatterns } from '../ldn-services-patterns/ldn-service-coar-patterns';
|
||||||
import { LdnDirectoryService } from '../ldn-services-services/ldn-directory.service';
|
|
||||||
import { LDN_SERVICE } from '../ldn-services-model/ldn-service.resource-type';
|
import { LDN_SERVICE } from '../ldn-services-model/ldn-service.resource-type';
|
||||||
import { animate, state, style, transition, trigger } from '@angular/animations';
|
import { animate, state, style, transition, trigger } from '@angular/animations';
|
||||||
|
import { getFirstCompletedRemoteData } from '../../../core/shared/operators';
|
||||||
|
import { RemoteData } from '../../../core/data/remote-data';
|
||||||
|
import { LdnService } from '../ldn-services-model/ldn-services.model';
|
||||||
|
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||||
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
|
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
||||||
|
import { Itemfilter } from '../ldn-services-model/ldn-service-itemfilters';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { FindListOptions } from '../../../core/data/find-list-options.model';
|
||||||
|
import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model';
|
||||||
|
import { LdnItemfiltersService } from '../ldn-services-data/ldn-itemfilters-data.service';
|
||||||
|
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-ldn-service-form',
|
selector: 'ds-ldn-service-form',
|
||||||
@@ -16,27 +35,26 @@ import { animate, state, style, transition, trigger } from '@angular/animations'
|
|||||||
styleUrls: ['./ldn-service-form.component.scss'],
|
styleUrls: ['./ldn-service-form.component.scss'],
|
||||||
animations: [
|
animations: [
|
||||||
trigger('toggleAnimation', [
|
trigger('toggleAnimation', [
|
||||||
state('true', style({})), // Define animation states (empty style)
|
state('true', style({})),
|
||||||
state('false', style({})),
|
state('false', style({})),
|
||||||
transition('true <=> false', animate('300ms ease-in')), // Define animation transition with duration
|
transition('true <=> false', animate('300ms ease-in')),
|
||||||
]),
|
]),
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class LdnServiceFormComponent implements OnInit {
|
export class LdnServiceFormComponent implements OnInit {
|
||||||
formModel: FormGroup;
|
formModel: FormGroup;
|
||||||
|
@ViewChild('confirmModal', {static: true}) confirmModal: TemplateRef<any>;
|
||||||
|
@ViewChild('resetFormModal', {static: true}) resetFormModal: TemplateRef<any>;
|
||||||
|
|
||||||
//showItemFilterDropdown = false;
|
|
||||||
|
|
||||||
public inboundPatterns: object[] = notifyPatterns;
|
public inboundPatterns: object[] = notifyPatterns;
|
||||||
public outboundPatterns: object[] = notifyPatterns;
|
public outboundPatterns: object[] = notifyPatterns;
|
||||||
public itemFilterList: LdnServiceConstraint[];
|
itemfiltersRD$: Observable<RemoteData<PaginatedList<Itemfilter>>>;
|
||||||
//additionalOutboundPatterns: FormGroup[] = [];
|
config: FindListOptions = Object.assign(new FindListOptions(), {
|
||||||
//additionalInboundPatterns: FormGroup[] = [];
|
elementsPerPage: 20
|
||||||
|
});
|
||||||
|
pageConfig: PaginationComponentOptions = Object.assign(new PaginationComponentOptions(), {
|
||||||
//@Input() public status: boolean;
|
id: 'po',
|
||||||
|
pageSize: 20
|
||||||
|
});
|
||||||
@Input() public name: string;
|
@Input() public name: string;
|
||||||
@Input() public description: string;
|
@Input() public description: string;
|
||||||
@Input() public url: string;
|
@Input() public url: string;
|
||||||
@@ -45,21 +63,20 @@ export class LdnServiceFormComponent implements OnInit {
|
|||||||
@Input() public outboundPattern: string;
|
@Input() public outboundPattern: string;
|
||||||
@Input() public constraint: string;
|
@Input() public constraint: string;
|
||||||
@Input() public automatic: boolean;
|
@Input() public automatic: boolean;
|
||||||
|
|
||||||
@Input() public headerKey: string;
|
@Input() public headerKey: string;
|
||||||
|
@Output() submitForm: EventEmitter<any> = new EventEmitter();
|
||||||
/*
|
@Output() cancelForm: EventEmitter<any> = new EventEmitter();
|
||||||
get notifyServiceInboundPatternsFormArray(): FormArray {
|
private modalRef: any;
|
||||||
return this.formModel.get('notifyServiceInboundPatterns') as FormArray;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private ldnServicesService: LdnServicesService,
|
private ldnServicesService: LdnServicesService,
|
||||||
private ldnDirectoryService: LdnDirectoryService,
|
private ldnItemfiltersService: LdnItemfiltersService,
|
||||||
private formBuilder: FormBuilder,
|
private formBuilder: FormBuilder,
|
||||||
private http: HttpClient,
|
private router: Router,
|
||||||
private router: Router
|
private notificationsService: NotificationsService,
|
||||||
|
private translateService: TranslateService,
|
||||||
|
private cdRef: ChangeDetectorRef,
|
||||||
|
protected modalService: NgbModal,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
this.formModel = this.formBuilder.group({
|
this.formModel = this.formBuilder.group({
|
||||||
@@ -79,16 +96,28 @@ export class LdnServiceFormComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.ldnDirectoryService.getItemFilters().subscribe((itemFilters) => {
|
this.setItemfilters();
|
||||||
console.log(itemFilters);
|
|
||||||
this.itemFilterList = itemFilters._embedded.itemfilters.map((filter: { id: string; }) => ({
|
|
||||||
name: filter.id
|
|
||||||
}));
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
submitForm() {
|
setItemfilters() {
|
||||||
|
this.itemfiltersRD$ = this.ldnItemfiltersService.findAll().pipe(
|
||||||
|
getFirstCompletedRemoteData());
|
||||||
|
}
|
||||||
|
|
||||||
|
onSubmit() {
|
||||||
|
this.openConfirmModal(this.confirmModal);
|
||||||
|
}
|
||||||
|
|
||||||
|
openConfirmModal(content) {
|
||||||
|
this.modalRef = this.modalService.open(content);
|
||||||
|
}
|
||||||
|
|
||||||
|
openResetFormModal(content) {
|
||||||
|
this.modalRef = this.modalService.open(content);
|
||||||
|
}
|
||||||
|
|
||||||
|
createService() {
|
||||||
this.formModel.get('name').markAsTouched();
|
this.formModel.get('name').markAsTouched();
|
||||||
this.formModel.get('url').markAsTouched();
|
this.formModel.get('url').markAsTouched();
|
||||||
this.formModel.get('ldnUrl').markAsTouched();
|
this.formModel.get('ldnUrl').markAsTouched();
|
||||||
@@ -98,31 +127,48 @@ export class LdnServiceFormComponent implements OnInit {
|
|||||||
const ldnUrl = this.formModel.get('ldnUrl').value;
|
const ldnUrl = this.formModel.get('ldnUrl').value;
|
||||||
|
|
||||||
if (!name || !url || !ldnUrl) {
|
if (!name || !url || !ldnUrl) {
|
||||||
|
this.closeModal();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.formModel.removeControl('inboundPattern');
|
const values = this.formModel.value;
|
||||||
this.formModel.removeControl('outboundPattern');
|
|
||||||
this.formModel.removeControl('constraintPattern');
|
|
||||||
console.log('JSON Data:', this.formModel.value);
|
|
||||||
|
|
||||||
const apiUrl = 'http://localhost:8080/server/api/ldn/ldnservices';
|
const inboundPatternValue = this.formModel.get('inboundPattern').value;
|
||||||
|
const outboundPatternValue = this.formModel.get('outboundPattern').value;
|
||||||
|
|
||||||
|
if (inboundPatternValue === '') {
|
||||||
|
values.notifyServiceInboundPatterns = [];
|
||||||
|
}
|
||||||
|
if (outboundPatternValue === '') {
|
||||||
|
values.notifyServiceOutboundPatterns = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
const ldnServiceData = this.ldnServicesService.create(values);
|
||||||
|
|
||||||
|
ldnServiceData.pipe(
|
||||||
|
getFirstCompletedRemoteData()
|
||||||
|
).subscribe((rd: RemoteData<LdnService>) => {
|
||||||
|
if (rd.hasSucceeded) {
|
||||||
|
this.notificationsService.success(this.translateService.get('ldn-service-notification.created.success.title'),
|
||||||
|
this.translateService.get('ldn-service-notification.created.success.body'));
|
||||||
|
|
||||||
this.http.post(apiUrl, this.formModel.value).subscribe(
|
|
||||||
(response) => {
|
|
||||||
console.log('Service created successfully:', response);
|
|
||||||
this.formModel.reset();
|
|
||||||
this.sendBack();
|
this.sendBack();
|
||||||
},
|
this.closeModal();
|
||||||
(error) => {
|
} else {
|
||||||
console.error('Error creating service:', error);
|
this.notificationsService.error(this.translateService.get('notification.created.failure'));
|
||||||
}
|
}
|
||||||
);
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private sendBack() {
|
resetFormAndLeave() {
|
||||||
this.router.navigateByUrl('admin/ldn/services');
|
this.sendBack();
|
||||||
|
this.closeModal();
|
||||||
|
}
|
||||||
|
|
||||||
|
closeModal() {
|
||||||
|
this.modalRef.close();
|
||||||
|
this.cdRef.detectChanges();
|
||||||
}
|
}
|
||||||
|
|
||||||
addInboundPattern() {
|
addInboundPattern() {
|
||||||
@@ -130,9 +176,9 @@ export class LdnServiceFormComponent implements OnInit {
|
|||||||
notifyServiceInboundPatternsArray.push(this.createInboundPatternFormGroup());
|
notifyServiceInboundPatternsArray.push(this.createInboundPatternFormGroup());
|
||||||
}
|
}
|
||||||
|
|
||||||
removeInboundPattern(patternGroup: FormGroup) {
|
removeInboundPattern(index: number) {
|
||||||
const notifyServiceInboundPatternsArray = this.formModel.get('notifyServiceInboundPatterns') as FormArray;
|
const notifyServiceInboundPatternsArray = this.formModel.get('notifyServiceInboundPatterns') as FormArray;
|
||||||
notifyServiceInboundPatternsArray.removeAt(notifyServiceInboundPatternsArray.controls.indexOf(patternGroup));
|
notifyServiceInboundPatternsArray.removeAt(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
addOutboundPattern() {
|
addOutboundPattern() {
|
||||||
@@ -140,11 +186,23 @@ export class LdnServiceFormComponent implements OnInit {
|
|||||||
notifyServiceOutboundPatternsArray.push(this.createOutboundPatternFormGroup());
|
notifyServiceOutboundPatternsArray.push(this.createOutboundPatternFormGroup());
|
||||||
}
|
}
|
||||||
|
|
||||||
removeOutboundPattern(patternGroup: FormGroup) {
|
removeOutboundPattern(index: number) {
|
||||||
const notifyServiceOutboundPatternsArray = this.formModel.get('notifyServiceOutboundPatterns') as FormArray;
|
const notifyServiceOutboundPatternsArray = this.formModel.get('notifyServiceOutboundPatterns') as FormArray;
|
||||||
notifyServiceOutboundPatternsArray.removeAt(notifyServiceOutboundPatternsArray.controls.indexOf(patternGroup));
|
notifyServiceOutboundPatternsArray.removeAt(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
toggleAutomatic(i: number) {
|
||||||
|
const automaticControl = this.formModel.get(`notifyServiceInboundPatterns.${i}.automatic`);
|
||||||
|
if (automaticControl) {
|
||||||
|
automaticControl.setValue(!automaticControl.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private sendBack() {
|
||||||
|
this.router.navigateByUrl('admin/ldn/services');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private createOutboundPatternFormGroup(): FormGroup {
|
private createOutboundPatternFormGroup(): FormGroup {
|
||||||
return this.formBuilder.group({
|
return this.formBuilder.group({
|
||||||
pattern: [''],
|
pattern: [''],
|
||||||
@@ -160,12 +218,5 @@ export class LdnServiceFormComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
toggleAutomatic(i: number) {
|
|
||||||
const automaticControl = this.formModel.get(`notifyServiceInboundPatterns.${i}.automatic`);
|
|
||||||
if (automaticControl) {
|
|
||||||
automaticControl.setValue(!automaticControl.value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -3,23 +3,23 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|||||||
import { LdnServiceNewComponent } from './ldn-service-new.component';
|
import { LdnServiceNewComponent } from './ldn-service-new.component';
|
||||||
|
|
||||||
describe('LdnServiceNewComponent', () => {
|
describe('LdnServiceNewComponent', () => {
|
||||||
let component: LdnServiceNewComponent;
|
let component: LdnServiceNewComponent;
|
||||||
let fixture: ComponentFixture<LdnServiceNewComponent>;
|
let fixture: ComponentFixture<LdnServiceNewComponent>;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
declarations: [ LdnServiceNewComponent ]
|
declarations: [LdnServiceNewComponent]
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(LdnServiceNewComponent);
|
fixture = TestBed.createComponent(LdnServiceNewComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create', () => {
|
it('should create', () => {
|
||||||
expect(component).toBeTruthy();
|
expect(component).toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -4,25 +4,24 @@ import { LdnService } from "../ldn-services-model/ldn-services.model";
|
|||||||
import { ActivatedRoute } from "@angular/router";
|
import { ActivatedRoute } from "@angular/router";
|
||||||
import { ProcessDataService } from "../../../core/data/processes/process-data.service";
|
import { ProcessDataService } from "../../../core/data/processes/process-data.service";
|
||||||
import { LinkService } from "../../../core/cache/builders/link.service";
|
import { LinkService } from "../../../core/cache/builders/link.service";
|
||||||
import { getFirstSucceededRemoteDataPayload } from "../../../core/shared/operators";
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-ldn-service-new',
|
selector: 'ds-ldn-service-new',
|
||||||
templateUrl: './ldn-service-new.component.html',
|
templateUrl: './ldn-service-new.component.html',
|
||||||
styleUrls: ['./ldn-service-new.component.scss']
|
styleUrls: ['./ldn-service-new.component.scss']
|
||||||
})
|
})
|
||||||
export class LdnServiceNewComponent implements OnInit {
|
export class LdnServiceNewComponent implements OnInit {
|
||||||
/**
|
/**
|
||||||
* Emits preselected process if there is one
|
* Emits preselected process if there is one
|
||||||
*/
|
*/
|
||||||
ldnService$?: Observable<LdnService>;
|
ldnService$?: Observable<LdnService>;
|
||||||
|
|
||||||
constructor(private route: ActivatedRoute, private processService: ProcessDataService, private linkService: LinkService) {
|
constructor(private route: ActivatedRoute, private processService: ProcessDataService, private linkService: LinkService) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If there's an id parameter, use this the process with this identifier as presets for the form
|
* If there's an id parameter, use this the process with this identifier as presets for the form
|
||||||
*/
|
*/
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -37,8 +37,6 @@ export const mockLdnService: LdnService = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const mockLdnServices = {
|
const mockLdnServices = {
|
||||||
payload: {
|
payload: {
|
||||||
elementsPerPage: 20,
|
elementsPerPage: 20,
|
||||||
@@ -52,7 +50,7 @@ const mockLdnServices = {
|
|||||||
page: [mockLdnService],
|
page: [mockLdnService],
|
||||||
type: LDN_SERVICE,
|
type: LDN_SERVICE,
|
||||||
self: undefined,
|
self: undefined,
|
||||||
getPageLength: function() {
|
getPageLength: function () {
|
||||||
return this.page.length;
|
return this.page.length;
|
||||||
},
|
},
|
||||||
_links: {
|
_links: {
|
||||||
@@ -67,7 +65,5 @@ const mockLdnServices = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Create a mock ldnServicesRD$ observable
|
// Create a mock ldnServicesRD$ observable
|
||||||
export const mockLdnServicesRD$: Observable<RemoteData<PaginatedList<LdnService>>> = of((mockLdnServices as unknown) as RemoteData<PaginatedList<LdnService>>);
|
export const mockLdnServicesRD$: Observable<RemoteData<PaginatedList<LdnService>>> = of((mockLdnServices as unknown) as RemoteData<PaginatedList<LdnService>>);
|
||||||
|
@@ -0,0 +1,47 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { dataService } from '../../../core/data/base/data-service.decorator';
|
||||||
|
import { LDN_SERVICE_CONSTRAINT_FILTERS } from '../ldn-services-model/ldn-service.resource-type';
|
||||||
|
import { IdentifiableDataService } from '../../../core/data/base/identifiable-data.service';
|
||||||
|
import { FindAllData, FindAllDataImpl } from '../../../core/data/base/find-all-data';
|
||||||
|
|
||||||
|
import { RequestService } from '../../../core/data/request.service';
|
||||||
|
import { RemoteDataBuildService } from '../../../core/cache/builders/remote-data-build.service';
|
||||||
|
import { ObjectCacheService } from '../../../core/cache/object-cache.service';
|
||||||
|
import { HALEndpointService } from '../../../core/shared/hal-endpoint.service';
|
||||||
|
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||||
|
import { FindListOptions } from '../../../core/data/find-list-options.model';
|
||||||
|
import { FollowLinkConfig } from '../../../shared/utils/follow-link-config.model';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { RemoteData } from '../../../core/data/remote-data';
|
||||||
|
import { Itemfilter } from '../ldn-services-model/ldn-service-itemfilters';
|
||||||
|
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A service responsible for fetching/sending data from/to the REST API on the itemfilters endpoint
|
||||||
|
*/
|
||||||
|
@Injectable()
|
||||||
|
@dataService(LDN_SERVICE_CONSTRAINT_FILTERS)
|
||||||
|
export class LdnItemfiltersService extends IdentifiableDataService<Itemfilter> implements FindAllData<Itemfilter> {
|
||||||
|
private findAllData: FindAllDataImpl<Itemfilter>;
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
protected requestService: RequestService,
|
||||||
|
protected rdbService: RemoteDataBuildService,
|
||||||
|
protected objectCache: ObjectCacheService,
|
||||||
|
protected halService: HALEndpointService,
|
||||||
|
protected notificationsService: NotificationsService,
|
||||||
|
) {
|
||||||
|
super('itemfilters', requestService, rdbService, objectCache, halService);
|
||||||
|
|
||||||
|
this.findAllData = new FindAllDataImpl(this.linkPath, requestService, rdbService, objectCache, halService, this.responseMsToLive);
|
||||||
|
}
|
||||||
|
|
||||||
|
getEndpoint() {
|
||||||
|
return this.halService.getEndpoint(this.linkPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
findAll(options?: FindListOptions, useCachedVersionIfAvailable?: boolean, reRequestOnStale?: boolean, ...linksToFollow: FollowLinkConfig<Itemfilter>[]): Observable<RemoteData<PaginatedList<Itemfilter>>> {
|
||||||
|
return this.findAllData.findAll(options, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow);
|
||||||
|
}
|
||||||
|
}
|
@@ -1,4 +1,4 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { dataService } from '../../../core/data/base/data-service.decorator';
|
import { dataService } from '../../../core/data/base/data-service.decorator';
|
||||||
import { LDN_SERVICE } from '../ldn-services-model/ldn-service.resource-type';
|
import { LDN_SERVICE } from '../ldn-services-model/ldn-service.resource-type';
|
||||||
import { IdentifiableDataService } from '../../../core/data/base/identifiable-data.service';
|
import { IdentifiableDataService } from '../../../core/data/base/identifiable-data.service';
|
||||||
@@ -19,72 +19,108 @@ import { map, take } from 'rxjs/operators';
|
|||||||
import { URLCombiner } from '../../../core/url-combiner/url-combiner';
|
import { URLCombiner } from '../../../core/url-combiner/url-combiner';
|
||||||
import { MultipartPostRequest } from '../../../core/data/request.models';
|
import { MultipartPostRequest } from '../../../core/data/request.models';
|
||||||
import { RestRequest } from '../../../core/data/rest-request.model';
|
import { RestRequest } from '../../../core/data/rest-request.model';
|
||||||
import { getFirstCompletedRemoteData } from '../../../core/shared/operators';
|
|
||||||
import { hasValue } from '../../../shared/empty.util';
|
|
||||||
|
|
||||||
import { LdnService } from '../ldn-services-model/ldn-services.model';
|
import { LdnService } from '../ldn-services-model/ldn-services.model';
|
||||||
import { LdnServiceConstraint } from '../ldn-services-model/ldn-service-constraint.model';
|
|
||||||
|
|
||||||
|
import { PatchData, PatchDataImpl } from '../../../core/data/base/patch-data';
|
||||||
|
import { ChangeAnalyzer } from '../../../core/data/change-analyzer';
|
||||||
|
import { Operation } from 'fast-json-patch';
|
||||||
|
import { RestRequestMethod } from 'src/app/core/data/rest-request-method';
|
||||||
|
import { CreateData, CreateDataImpl } from '../../../core/data/base/create-data';
|
||||||
|
import { ldnServiceConstrain } from '../ldn-services-model/ldn-service.constrain.model';
|
||||||
|
import { getFirstCompletedRemoteData } from 'src/app/core/shared/operators';
|
||||||
|
import { hasValue } from 'src/app/shared/empty.util';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A service responsible for fetching/sending data from/to the REST API on the ldnservices endpoint
|
||||||
|
*/
|
||||||
@Injectable()
|
@Injectable()
|
||||||
@dataService(LDN_SERVICE)
|
@dataService(LDN_SERVICE)
|
||||||
export class LdnServicesService extends IdentifiableDataService<LdnService> implements FindAllData<LdnService>, DeleteData<LdnService> {
|
export class LdnServicesService extends IdentifiableDataService<LdnService> implements FindAllData<LdnService>, DeleteData<LdnService>, PatchData<LdnService>, CreateData<LdnService> {
|
||||||
private findAllData: FindAllDataImpl<LdnService>; // Corrected the type
|
createData: CreateDataImpl<LdnService>;
|
||||||
private deleteData: DeleteDataImpl<LdnService>; // Corrected the type
|
private findAllData: FindAllDataImpl<LdnService>;
|
||||||
|
private deleteData: DeleteDataImpl<LdnService>;
|
||||||
|
private patchData: PatchDataImpl<LdnService>;
|
||||||
|
private comparator: ChangeAnalyzer<LdnService>;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
protected requestService: RequestService,
|
protected requestService: RequestService,
|
||||||
protected rdbService: RemoteDataBuildService,
|
protected rdbService: RemoteDataBuildService,
|
||||||
protected objectCache: ObjectCacheService,
|
protected objectCache: ObjectCacheService,
|
||||||
protected halService: HALEndpointService,
|
protected halService: HALEndpointService,
|
||||||
protected notificationsService: NotificationsService,
|
protected notificationsService: NotificationsService,
|
||||||
) {
|
) {
|
||||||
super('ldnservices', requestService, rdbService, objectCache, halService);
|
super('ldnservices', requestService, rdbService, objectCache, halService);
|
||||||
|
|
||||||
this.findAllData = new FindAllDataImpl(this.linkPath, requestService, rdbService, objectCache, halService, this.responseMsToLive);
|
this.findAllData = new FindAllDataImpl(this.linkPath, requestService, rdbService, objectCache, halService, this.responseMsToLive);
|
||||||
this.deleteData = new DeleteDataImpl(this.linkPath, requestService, rdbService, objectCache, halService, notificationsService, this.responseMsToLive, this.constructIdEndpoint);
|
this.deleteData = new DeleteDataImpl(this.linkPath, requestService, rdbService, objectCache, halService, notificationsService, this.responseMsToLive, this.constructIdEndpoint);
|
||||||
}
|
this.patchData = new PatchDataImpl(this.linkPath, requestService, rdbService, objectCache, halService, this.comparator, this.responseMsToLive, this.constructIdEndpoint);
|
||||||
|
this.createData = new CreateDataImpl(this.linkPath, requestService, rdbService, objectCache, halService, notificationsService, this.responseMsToLive);
|
||||||
|
}
|
||||||
|
|
||||||
findAll(options?: FindListOptions, useCachedVersionIfAvailable?: boolean, reRequestOnStale?: boolean, ...linksToFollow: FollowLinkConfig<LdnService>[]): Observable<RemoteData<PaginatedList<LdnService>>> {
|
|
||||||
return this.findAllData.findAll(options, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow);
|
|
||||||
}
|
|
||||||
|
|
||||||
public delete(objectId: string, copyVirtualMetadata?: string[]): Observable<RemoteData<NoContent>> {
|
create(object: LdnService): Observable<RemoteData<LdnService>> {
|
||||||
return this.deleteData.delete(objectId, copyVirtualMetadata);
|
return this.createData.create(object);
|
||||||
}
|
}
|
||||||
|
|
||||||
public deleteByHref(href: string, copyVirtualMetadata?: string[]): Observable<RemoteData<NoContent>> {
|
patch(object: LdnService, operations: Operation[]): Observable<RemoteData<LdnService>> {
|
||||||
return this.deleteData.deleteByHref(href, copyVirtualMetadata);
|
return this.patchData.patch(object, operations);
|
||||||
}
|
}
|
||||||
|
|
||||||
public invoke(serviceName: string, parameters: LdnServiceConstraint[], files: File[]): Observable<RemoteData<LdnService>> {
|
update(object: LdnService): Observable<RemoteData<LdnService>> {
|
||||||
const requestId = this.requestService.generateRequestId();
|
return this.patchData.update(object);
|
||||||
this.getBrowseEndpoint().pipe(
|
}
|
||||||
take(1),
|
|
||||||
map((endpoint: string) => new URLCombiner(endpoint, serviceName, 'processes').toString()),
|
|
||||||
map((endpoint: string) => {
|
|
||||||
const body = this.getInvocationFormData(parameters, files);
|
|
||||||
return new MultipartPostRequest(requestId, endpoint, body);
|
|
||||||
})
|
|
||||||
).subscribe((request: RestRequest) => this.requestService.send(request));
|
|
||||||
|
|
||||||
return this.rdbService.buildFromRequestUUID<LdnService>(requestId);
|
commitUpdates(method?: RestRequestMethod): void {
|
||||||
}
|
return this.patchData.commitUpdates(method);
|
||||||
|
}
|
||||||
|
|
||||||
private getInvocationFormData(constrain: LdnServiceConstraint[], files: File[]): FormData {
|
createPatchFromCache(object: LdnService): Observable<Operation[]> {
|
||||||
const form: FormData = new FormData();
|
return this.patchData.createPatchFromCache(object);
|
||||||
form.set('properties', JSON.stringify(constrain));
|
}
|
||||||
files.forEach((file: File) => {
|
|
||||||
form.append('file', file);
|
|
||||||
});
|
|
||||||
return form;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ldnServiceWithNameExistsAndCanExecute(scriptName: string): Observable<boolean> {
|
findAll(options?: FindListOptions, useCachedVersionIfAvailable?: boolean, reRequestOnStale?: boolean, ...linksToFollow: FollowLinkConfig<LdnService>[]): Observable<RemoteData<PaginatedList<LdnService>>> {
|
||||||
return this.findById(scriptName).pipe(
|
return this.findAllData.findAll(options, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow);
|
||||||
getFirstCompletedRemoteData(),
|
}
|
||||||
map((rd: RemoteData<LdnService>) => {
|
|
||||||
return hasValue(rd.payload);
|
public delete(objectId: string, copyVirtualMetadata?: string[]): Observable<RemoteData<NoContent>> {
|
||||||
}),
|
return this.deleteData.delete(objectId, copyVirtualMetadata);
|
||||||
);
|
}
|
||||||
}
|
|
||||||
|
public deleteByHref(href: string, copyVirtualMetadata?: string[]): Observable<RemoteData<NoContent>> {
|
||||||
|
return this.deleteData.deleteByHref(href, copyVirtualMetadata);
|
||||||
|
}
|
||||||
|
|
||||||
|
public invoke(serviceName: string, serviceId: string, parameters: ldnServiceConstrain[], files: File[]): Observable<RemoteData<LdnService>> {
|
||||||
|
const requestId = this.requestService.generateRequestId();
|
||||||
|
this.getBrowseEndpoint().pipe(
|
||||||
|
take(1),
|
||||||
|
map((endpoint: string) => new URLCombiner(endpoint, serviceName, 'processes', serviceId).toString()),
|
||||||
|
map((endpoint: string) => {
|
||||||
|
const body = this.getInvocationFormData(parameters, files);
|
||||||
|
return new MultipartPostRequest(requestId, endpoint, body);
|
||||||
|
})
|
||||||
|
).subscribe((request: RestRequest) => this.requestService.send(request));
|
||||||
|
|
||||||
|
return this.rdbService.buildFromRequestUUID<LdnService>(requestId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ldnServiceWithNameExistsAndCanExecute(scriptName: string): Observable<boolean> {
|
||||||
|
return this.findById(scriptName).pipe(
|
||||||
|
getFirstCompletedRemoteData(),
|
||||||
|
map((rd: RemoteData<LdnService>) => {
|
||||||
|
return hasValue(rd.payload);
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private getInvocationFormData(constrain: ldnServiceConstrain[], files: File[]): FormData {
|
||||||
|
const form: FormData = new FormData();
|
||||||
|
form.set('properties', JSON.stringify(constrain));
|
||||||
|
files.forEach((file: File) => {
|
||||||
|
form.append('file', file);
|
||||||
|
});
|
||||||
|
return form;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -15,32 +15,34 @@
|
|||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table table-striped table-hover">
|
<table class="table table-striped table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="col">{{ 'service.overview.table.name' | translate }}</th>
|
<th scope="col">{{ 'service.overview.table.name' | translate }}</th>
|
||||||
<th scope="col">{{ 'service.overview.table.description' | translate }}</th>
|
<th scope="col">{{ 'service.overview.table.description' | translate }}</th>
|
||||||
<th scope="col">{{ 'service.overview.table.status' | translate }}</th>
|
<th scope="col">{{ 'service.overview.table.status' | translate }}</th>
|
||||||
<th scope="col">{{ 'service.overview.table.actions' | translate }}</th>
|
<th scope="col">{{ 'service.overview.table.actions' | translate }}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr *ngFor="let ldnService of servicesData">
|
<tr *ngFor="let ldnService of (ldnServicesRD$ | async)?.payload?.page">
|
||||||
<td>{{ ldnService.name }}</td>
|
<td>{{ ldnService.name }}</td>
|
||||||
<td>{{ ldnService.description }}</td>
|
<td>{{ ldnService.description }}</td>
|
||||||
<td>
|
<td>
|
||||||
<span [ngClass]="{ 'status-enabled': ldnService.enabled, 'status-disabled': !ldnService.enabled }"
|
<span (click)="toggleStatus(ldnService, ldnServicesService)"
|
||||||
class="status-indicator" (click)="toggleStatus(ldnService)"
|
[ngClass]="{ 'status-enabled': ldnService.enabled, 'status-disabled': !ldnService.enabled }" [title]="ldnService.enabled ? ('ldn-service.overview.table.clickToDisable' | translate) : ('ldn-service.overview.table.clickToEnable' | translate)"
|
||||||
[title]="ldnService.enabled ? ('ldn-service.overview.table.clickToDisable' | translate) : ('ldn-service.overview.table.clickToEnable' | translate)">
|
class="status-indicator">
|
||||||
{{ ldnService.enabled ? ('ldn-service.overview.table.enabled' | translate) : ('ldn-service.overview.table.disabled' | translate) }}
|
{{ ldnService.enabled ? ('ldn-service.overview.table.enabled' | translate) : ('ldn-service.overview.table.disabled' | translate) }}
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<button (click)="selectServiceToDelete(ldnService.id)" class="btn btn-outline-danger">
|
<div class="btn-group">
|
||||||
<i class="fas fa-trash"></i>
|
<button (click)="selectServiceToDelete(ldnService.id)" class="btn btn-outline-danger">
|
||||||
</button>
|
<i class="fas fa-trash"></i>
|
||||||
<button [routerLink]="['/admin/ldn/services/edit/', ldnService.id]"
|
</button>
|
||||||
class="btn btn-outline-dark">
|
<button [routerLink]="['/admin/ldn/services/edit/', ldnService.id]"
|
||||||
<i class="fas fa-edit"></i>
|
class="btn btn-outline-dark">
|
||||||
</button>
|
<i class="fas fa-edit"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
@@ -70,7 +72,8 @@
|
|||||||
<div class="mt-4">
|
<div class="mt-4">
|
||||||
<button (click)="closeModal()"
|
<button (click)="closeModal()"
|
||||||
class="btn btn-primary mr-2">{{ 'service.detail.delete.cancel' | translate }}</button>
|
class="btn btn-primary mr-2">{{ 'service.detail.delete.cancel' | translate }}</button>
|
||||||
<button (click)="deleteSelected()" class="btn btn-danger"
|
<button (click)="deleteSelected(this.selectedServiceId.toString(), ldnServicesService)"
|
||||||
|
class="btn btn-danger"
|
||||||
id="delete-confirm">{{ 'service.overview.delete' | translate }}
|
id="delete-confirm">{{ 'service.overview.delete' | translate }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -3,23 +3,23 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|||||||
import { ServicesDirectoryComponent } from './services-directory.component';
|
import { ServicesDirectoryComponent } from './services-directory.component';
|
||||||
|
|
||||||
describe('ServicesDirectoryComponent', () => {
|
describe('ServicesDirectoryComponent', () => {
|
||||||
let component: ServicesDirectoryComponent;
|
let component: ServicesDirectoryComponent;
|
||||||
let fixture: ComponentFixture<ServicesDirectoryComponent>;
|
let fixture: ComponentFixture<ServicesDirectoryComponent>;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
declarations: [ ServicesDirectoryComponent ]
|
declarations: [ServicesDirectoryComponent]
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(ServicesDirectoryComponent);
|
fixture = TestBed.createComponent(ServicesDirectoryComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create', () => {
|
it('should create', () => {
|
||||||
expect(component).toBeTruthy();
|
expect(component).toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -1,25 +1,38 @@
|
|||||||
import { ChangeDetectorRef, Component, OnDestroy, OnInit, TemplateRef, ViewChild } from '@angular/core';
|
import {
|
||||||
import { LdnDirectoryService } from '../ldn-services-services/ldn-directory.service';
|
ChangeDetectionStrategy,
|
||||||
|
ChangeDetectorRef,
|
||||||
|
Component,
|
||||||
|
OnDestroy,
|
||||||
|
OnInit,
|
||||||
|
TemplateRef,
|
||||||
|
ViewChild
|
||||||
|
} from '@angular/core';
|
||||||
import { Observable, Subscription } from 'rxjs';
|
import { Observable, Subscription } from 'rxjs';
|
||||||
import { RemoteData } from '../../../core/data/remote-data';
|
import { RemoteData } from '../../../core/data/remote-data';
|
||||||
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
||||||
import { FindListOptions } from '../../../core/data/find-list-options.model';
|
import { FindListOptions } from '../../../core/data/find-list-options.model';
|
||||||
import { LdnService } from '../ldn-services-model/ldn-services.model';
|
import { LdnService } from '../ldn-services-model/ldn-services.model';
|
||||||
import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model';
|
import { PaginationComponentOptions } from '../../../shared/pagination/pagination-component-options.model';
|
||||||
import { switchMap } from 'rxjs/operators';
|
import { map, switchMap } from 'rxjs/operators';
|
||||||
import { LdnServicesService } from 'src/app/admin/admin-ldn-services/ldn-services-data/ldn-services-data.service';
|
import { LdnServicesService } from 'src/app/admin/admin-ldn-services/ldn-services-data/ldn-services-data.service';
|
||||||
import { PaginationService } from 'src/app/core/pagination/pagination.service';
|
import { PaginationService } from 'src/app/core/pagination/pagination.service';
|
||||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { hasValue } from '../../../shared/empty.util';
|
import { hasValue } from '../../../shared/empty.util';
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { Operation } from 'fast-json-patch';
|
||||||
|
import { getFirstCompletedRemoteData } from '../../../core/shared/operators';
|
||||||
|
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||||
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-ldn-services-directory',
|
selector: 'ds-ldn-services-directory',
|
||||||
templateUrl: './ldn-services-directory.component.html',
|
templateUrl: './ldn-services-directory.component.html',
|
||||||
styleUrls: ['./ldn-services-directory.component.scss'],
|
styleUrls: ['./ldn-services-directory.component.scss'],
|
||||||
|
changeDetection: ChangeDetectionStrategy.Default
|
||||||
})
|
})
|
||||||
export class LdnServicesOverviewComponent implements OnInit, OnDestroy {
|
export class LdnServicesOverviewComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
selectedServiceId: number | null = null;
|
selectedServiceId: string | number | null = null;
|
||||||
servicesData: any[] = [];
|
servicesData: any[] = [];
|
||||||
@ViewChild('deleteModal', {static: true}) deleteModal: TemplateRef<any>;
|
@ViewChild('deleteModal', {static: true}) deleteModal: TemplateRef<any>;
|
||||||
ldnServicesRD$: Observable<RemoteData<PaginatedList<LdnService>>>;
|
ldnServicesRD$: Observable<RemoteData<PaginatedList<LdnService>>>;
|
||||||
@@ -33,39 +46,27 @@ export class LdnServicesOverviewComponent implements OnInit, OnDestroy {
|
|||||||
isProcessingSub: Subscription;
|
isProcessingSub: Subscription;
|
||||||
private modalRef: any;
|
private modalRef: any;
|
||||||
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
protected processLdnService: LdnServicesService,
|
protected ldnServicesService: LdnServicesService,
|
||||||
protected paginationService: PaginationService,
|
protected paginationService: PaginationService,
|
||||||
protected modalService: NgbModal,
|
protected modalService: NgbModal,
|
||||||
public ldnDirectoryService: LdnDirectoryService,
|
private cdRef: ChangeDetectorRef,
|
||||||
private http: HttpClient,
|
private notificationService: NotificationsService,
|
||||||
private cdRef: ChangeDetectorRef
|
private translateService: TranslateService,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
/*this.ldnDirectoryService.listLdnServices();*/
|
|
||||||
this.findAllServices();
|
|
||||||
this.setLdnServices();
|
this.setLdnServices();
|
||||||
/*this.ldnServicesRD$.subscribe(data => {
|
|
||||||
console.log('searchByLdnUrl()', data);
|
|
||||||
});*/
|
|
||||||
|
|
||||||
/*this.ldnServicesRD$.pipe(
|
|
||||||
tap(data => {
|
|
||||||
console.log('ldnServicesRD$ data:', data);
|
|
||||||
})
|
|
||||||
).subscribe(() => {
|
|
||||||
this.searchByLdnUrl();
|
|
||||||
});*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setLdnServices() {
|
setLdnServices() {
|
||||||
this.ldnServicesRD$ = this.paginationService.getFindListOptions(this.pageConfig.id, this.config).pipe(
|
this.ldnServicesRD$ = this.paginationService.getFindListOptions(this.pageConfig.id, this.config).pipe(
|
||||||
switchMap((config) => this.processLdnService.findAll(config, true, false))
|
switchMap((config) => this.ldnServicesService.findAll(config, false, false).pipe(
|
||||||
|
getFirstCompletedRemoteData()
|
||||||
|
))
|
||||||
);
|
);
|
||||||
console.log();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy(): void {
|
ngOnDestroy(): void {
|
||||||
@@ -84,80 +85,62 @@ export class LdnServicesOverviewComponent implements OnInit, OnDestroy {
|
|||||||
this.cdRef.detectChanges();
|
this.cdRef.detectChanges();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
findAllServices(): void {
|
|
||||||
this.retrieveAll().subscribe(
|
|
||||||
(response) => {
|
|
||||||
this.servicesData = response._embedded.ldnservices;
|
|
||||||
console.log('ServicesData =', this.servicesData);
|
|
||||||
this.cdRef.detectChanges();
|
|
||||||
},
|
|
||||||
(error) => {
|
|
||||||
console.error('Error:', error);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
retrieveAll(): Observable<any> {
|
|
||||||
const url = 'http://localhost:8080/server/api/ldn/ldnservices';
|
|
||||||
return this.http.get(url);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
deleteSelected() {
|
|
||||||
if (this.selectedServiceId !== null) {
|
|
||||||
const deleteUrl = `http://localhost:8080/server/api/ldn/ldnservices/${this.selectedServiceId}`;
|
|
||||||
this.http.delete(deleteUrl).subscribe(
|
|
||||||
() => {
|
|
||||||
this.closeModal();
|
|
||||||
this.findAllServices();
|
|
||||||
},
|
|
||||||
(error) => {
|
|
||||||
console.error('Error deleting service:', error);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
selectServiceToDelete(serviceId: number) {
|
selectServiceToDelete(serviceId: number) {
|
||||||
this.selectedServiceId = serviceId;
|
this.selectedServiceId = serviceId;
|
||||||
this.openDeleteModal(this.deleteModal);
|
this.openDeleteModal(this.deleteModal);
|
||||||
}
|
}
|
||||||
|
|
||||||
toggleStatus(ldnService: any): void {
|
deleteSelected(serviceId: string, ldnServicesService: LdnServicesService): void {
|
||||||
const newStatus = !ldnService.enabled;
|
if (this.selectedServiceId !== null) {
|
||||||
|
ldnServicesService.delete(serviceId).pipe(getFirstCompletedRemoteData()).subscribe((rd: RemoteData<LdnService>) => {
|
||||||
|
if (rd.hasSucceeded) {
|
||||||
|
this.servicesData = this.servicesData.filter(service => service.id !== serviceId);
|
||||||
|
this.ldnServicesRD$ = this.ldnServicesRD$.pipe(
|
||||||
|
map((remoteData: RemoteData<PaginatedList<LdnService>>) => {
|
||||||
|
if (remoteData.hasSucceeded) {
|
||||||
|
remoteData.payload.page = remoteData.payload.page.filter(service => service.id.toString() !== serviceId);
|
||||||
|
}
|
||||||
|
return remoteData;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
this.cdRef.detectChanges();
|
||||||
|
this.closeModal();
|
||||||
|
this.notificationService.success(this.translateService.get('ldn-service-delete.notification.success.title'),
|
||||||
|
this.translateService.get('ldn-service-delete.notification.success.content'));
|
||||||
|
} else {
|
||||||
|
this.notificationService.error(this.translateService.get('ldn-service-delete.notification.error.title'),
|
||||||
|
this.translateService.get('ldn-service-delete.notification.error.content'));
|
||||||
|
this.cdRef.detectChanges();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const apiUrl = `http://localhost:8080/server/api/ldn/ldnservices/${ldnService.id}`;
|
|
||||||
const patchOperation = {
|
toggleStatus(ldnService: any, ldnServicesService: LdnServicesService): void {
|
||||||
|
const newStatus = !ldnService.enabled;
|
||||||
|
const originalStatus = ldnService.enabled;
|
||||||
|
|
||||||
|
const patchOperation: Operation = {
|
||||||
op: 'replace',
|
op: 'replace',
|
||||||
path: '/enabled',
|
path: '/enabled',
|
||||||
value: newStatus,
|
value: newStatus,
|
||||||
};
|
};
|
||||||
|
|
||||||
this.http.patch(apiUrl, [patchOperation]).subscribe(
|
ldnServicesService.patch(ldnService, [patchOperation]).pipe(getFirstCompletedRemoteData()).subscribe(
|
||||||
() => {
|
(rd: RemoteData<LdnService>) => {
|
||||||
console.log('Status updated successfully.');
|
if (rd.hasSucceeded) {
|
||||||
ldnService.enabled = newStatus;
|
ldnService.enabled = newStatus;
|
||||||
this.cdRef.detectChanges();
|
this.notificationService.success(this.translateService.get('ldn-enable-service.notification.success.title'),
|
||||||
},
|
this.translateService.get('ldn-enable-service.notification.success.content'));
|
||||||
(error) => {
|
} else {
|
||||||
console.error('Error updating status:', error);
|
ldnService.enabled = originalStatus;
|
||||||
|
this.notificationService.error(this.translateService.get('ldn-enable-service.notification.error.title'),
|
||||||
|
this.translateService.get('ldn-enable-service.notification.error.content'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
fetchServiceData(serviceId: string): void {
|
|
||||||
const apiUrl = `http://localhost:8080/server/api/ldn/ldnservices/${serviceId}`;
|
|
||||||
|
|
||||||
this.http.get(apiUrl).subscribe(
|
|
||||||
(data: any) => {
|
|
||||||
console.log(data);
|
|
||||||
},
|
|
||||||
(error) => {
|
|
||||||
console.error('Error fetching service data:', error);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -1,29 +0,0 @@
|
|||||||
import { Injectable } from '@angular/core';
|
|
||||||
import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot, UrlTree } from '@angular/router';
|
|
||||||
import { Observable } from 'rxjs';
|
|
||||||
import { map } from 'rxjs/operators';
|
|
||||||
|
|
||||||
@Injectable({
|
|
||||||
providedIn: 'root'
|
|
||||||
})
|
|
||||||
export class LdnServicesGuard implements CanActivate {
|
|
||||||
|
|
||||||
constructor(
|
|
||||||
//private notifyInfoService: NotifyInfoService,
|
|
||||||
private router: Router
|
|
||||||
) {}
|
|
||||||
canActivate(
|
|
||||||
route: ActivatedRouteSnapshot,
|
|
||||||
state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
|
|
||||||
return true;
|
|
||||||
/*return this.notifyInfoService.isCoarConfigEnabled().pipe(
|
|
||||||
map(coarLdnEnabled => {
|
|
||||||
if (coarLdnEnabled) {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return this.router.parseUrl('/404');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
);*/
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,17 +0,0 @@
|
|||||||
import { TestBed } from '@angular/core/testing';
|
|
||||||
|
|
||||||
import { LdnServicesGuard } from './ldn-services-guard.service';
|
|
||||||
|
|
||||||
describe('LdnServicesGuard', () => {
|
|
||||||
let guard: LdnServicesGuard;
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
TestBed.configureTestingModule({});
|
|
||||||
guard = TestBed.inject(LdnServicesGuard);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should be created', () => {
|
|
||||||
// @ts-ignore
|
|
||||||
expect(guard).toBeTruthy();
|
|
||||||
});
|
|
||||||
});
|
|
@@ -1,26 +0,0 @@
|
|||||||
|
|
||||||
/**
|
|
||||||
* A cosntrain that can be used when running a service
|
|
||||||
*/
|
|
||||||
export class LdnServiceConstraint {
|
|
||||||
/**
|
|
||||||
* The name of the constrain
|
|
||||||
*/
|
|
||||||
name: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The value of the constrain
|
|
||||||
*/
|
|
||||||
value: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const EndorsmentConstrain = [
|
|
||||||
{
|
|
||||||
name: 'Type 1 Item',
|
|
||||||
value: 'Type1'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Type 2 Item',
|
|
||||||
value: 'Type2'
|
|
||||||
},
|
|
||||||
];
|
|
@@ -0,0 +1,31 @@
|
|||||||
|
import { autoserialize, deserialize, inheritSerialization } from 'cerialize';
|
||||||
|
import { LDN_SERVICE_CONSTRAINT_FILTER } from './ldn-service.resource-type';
|
||||||
|
import { CacheableObject } from '../../../core/cache/cacheable-object.model';
|
||||||
|
import { typedObject } from '../../../core/cache/builders/build-decorators';
|
||||||
|
import { excludeFromEquals } from '../../../core/utilities/equals.decorators';
|
||||||
|
import { ResourceType } from '../../../core/shared/resource-type';
|
||||||
|
|
||||||
|
/** A single filter value and its properties. */
|
||||||
|
@typedObject
|
||||||
|
@inheritSerialization(CacheableObject)
|
||||||
|
export class Itemfilter extends CacheableObject {
|
||||||
|
static type = LDN_SERVICE_CONSTRAINT_FILTER;
|
||||||
|
|
||||||
|
@excludeFromEquals
|
||||||
|
@autoserialize
|
||||||
|
type: ResourceType;
|
||||||
|
|
||||||
|
@autoserialize
|
||||||
|
id: string;
|
||||||
|
|
||||||
|
@deserialize
|
||||||
|
_links: {
|
||||||
|
self: {
|
||||||
|
href: string;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
get self(): string {
|
||||||
|
return this._links.self.href;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,13 @@
|
|||||||
|
import { autoserialize } from 'cerialize';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* notify service patterns
|
||||||
|
*/
|
||||||
|
export class NotifyServicePattern {
|
||||||
|
@autoserialize
|
||||||
|
pattern: string;
|
||||||
|
@autoserialize
|
||||||
|
constraint: string;
|
||||||
|
@autoserialize
|
||||||
|
automatic: string;
|
||||||
|
}
|
@@ -2,7 +2,7 @@
|
|||||||
* List of services statuses
|
* List of services statuses
|
||||||
*/
|
*/
|
||||||
export enum LdnServiceStatus {
|
export enum LdnServiceStatus {
|
||||||
UNKOWN,
|
UNKOWN,
|
||||||
DISABLED,
|
DISABLED,
|
||||||
ENABLED,
|
ENABLED,
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,3 @@
|
|||||||
|
export class ldnServiceConstrain {
|
||||||
|
void: any;
|
||||||
|
}
|
@@ -6,4 +6,7 @@
|
|||||||
*/
|
*/
|
||||||
import { ResourceType } from '../../../core/shared/resource-type';
|
import { ResourceType } from '../../../core/shared/resource-type';
|
||||||
|
|
||||||
export const LDN_SERVICE = new ResourceType('ldnservices');
|
export const LDN_SERVICE = new ResourceType('ldnservice');
|
||||||
|
export const LDN_SERVICE_CONSTRAINT_FILTERS = new ResourceType('itemfilters');
|
||||||
|
|
||||||
|
export const LDN_SERVICE_CONSTRAINT_FILTER = new ResourceType('itemfilter');
|
||||||
|
@@ -1,12 +1,15 @@
|
|||||||
import { ResourceType } from '../../../core/shared/resource-type';
|
import { ResourceType } from '../../../core/shared/resource-type';
|
||||||
import { CacheableObject } from '../../../core/cache/cacheable-object.model';
|
import { CacheableObject } from '../../../core/cache/cacheable-object.model';
|
||||||
import { autoserialize, deserialize } from 'cerialize';
|
import { autoserialize, deserialize, deserializeAs, inheritSerialization } from 'cerialize';
|
||||||
import { LDN_SERVICE } from './ldn-service.resource-type';
|
import { LDN_SERVICE } from './ldn-service.resource-type';
|
||||||
import { excludeFromEquals } from '../../../core/utilities/equals.decorators';
|
import { excludeFromEquals } from '../../../core/utilities/equals.decorators';
|
||||||
import { typedObject } from '../../../core/cache/builders/build-decorators';
|
import { typedObject } from '../../../core/cache/builders/build-decorators';
|
||||||
|
import { NotifyServicePattern } from './ldn-service-patterns.model';
|
||||||
|
|
||||||
|
|
||||||
|
/** An LdnService and its properties. */
|
||||||
@typedObject
|
@typedObject
|
||||||
|
@inheritSerialization(CacheableObject)
|
||||||
export class LdnService extends CacheableObject {
|
export class LdnService extends CacheableObject {
|
||||||
static type = LDN_SERVICE;
|
static type = LDN_SERVICE;
|
||||||
|
|
||||||
@@ -15,7 +18,10 @@ export class LdnService extends CacheableObject {
|
|||||||
type: ResourceType;
|
type: ResourceType;
|
||||||
|
|
||||||
@autoserialize
|
@autoserialize
|
||||||
id?: number;
|
id: number;
|
||||||
|
|
||||||
|
@deserializeAs('id')
|
||||||
|
uuid: string;
|
||||||
|
|
||||||
@autoserialize
|
@autoserialize
|
||||||
name: string;
|
name: string;
|
||||||
@@ -26,6 +32,9 @@ export class LdnService extends CacheableObject {
|
|||||||
@autoserialize
|
@autoserialize
|
||||||
url: string;
|
url: string;
|
||||||
|
|
||||||
|
@autoserialize
|
||||||
|
enabled: boolean;
|
||||||
|
|
||||||
@autoserialize
|
@autoserialize
|
||||||
ldnUrl: string;
|
ldnUrl: string;
|
||||||
|
|
||||||
@@ -46,13 +55,3 @@ export class LdnService extends CacheableObject {
|
|||||||
return this._links.self.href;
|
return this._links.self.href;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class NotifyServicePattern {
|
|
||||||
@autoserialize
|
|
||||||
pattern: string;
|
|
||||||
@autoserialize
|
|
||||||
constraint?: string;
|
|
||||||
@autoserialize
|
|
||||||
automatic?: boolean;
|
|
||||||
}
|
|
||||||
|
@@ -67,7 +67,3 @@ export const notifyPatterns = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
const pattern = notifyPatterns[0];
|
|
||||||
console.log(`Pattern Name: ${pattern.name}`);
|
|
||||||
console.log(`Pattern Description: ${pattern.description}`);
|
|
||||||
console.log(`Pattern Category: ${pattern.category}`);
|
|
||||||
|
@@ -3,15 +3,15 @@ import { TestBed } from '@angular/core/testing';
|
|||||||
import { LdnDirectoryService } from './ldn-directory.service';
|
import { LdnDirectoryService } from './ldn-directory.service';
|
||||||
|
|
||||||
describe('LdnDirectoryService', () => {
|
describe('LdnDirectoryService', () => {
|
||||||
let service: LdnDirectoryService;
|
let service: LdnDirectoryService;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({});
|
TestBed.configureTestingModule({});
|
||||||
service = TestBed.inject(LdnDirectoryService);
|
service = TestBed.inject(LdnDirectoryService);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should be created', () => {
|
it('should be created', () => {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
expect(service).toBeTruthy();
|
expect(service).toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -1,56 +1,27 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { Observable, tap } from 'rxjs';
|
import { map, Observable } from 'rxjs';
|
||||||
import { LdnService } from '../ldn-services-model/ldn-services.model';
|
import { LdnServicesService } from "../ldn-services-data/ldn-services-data.service";
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class LdnDirectoryService {
|
export class LdnDirectoryService {
|
||||||
private baseUrl = 'http://localhost:8080/server/api/ldn/ldnservices';
|
private itemFilterEndpoint = 'http://localhost:8080/server/api/config/itemfilters';
|
||||||
private itemFilterEndpoint = 'http://localhost:8080/server/api/config/itemfilters';
|
|
||||||
|
|
||||||
|
|
||||||
constructor(private http: HttpClient) {}
|
constructor(private http: HttpClient,
|
||||||
|
private ldnServicesService: LdnServicesService) {
|
||||||
|
}
|
||||||
|
|
||||||
|
public getItemFilters(): Observable<any> {
|
||||||
|
|
||||||
public listLdnServices(): Observable<LdnService[]> {
|
return this.ldnServicesService.findAll().pipe(
|
||||||
const endpoint = `${this.baseUrl}`;
|
map((servicesData) => {
|
||||||
return this.http.get<LdnService[]>(endpoint).pipe(
|
return servicesData;
|
||||||
tap(data => {
|
})
|
||||||
console.log('listLdnServices() Data:', data);
|
);
|
||||||
})
|
}
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public getLdnServiceById(id: string): Observable<LdnService> {
|
|
||||||
const endpoint = `${this.baseUrl}/${id}`;
|
|
||||||
return this.http.get<LdnService>(endpoint);
|
|
||||||
}
|
|
||||||
|
|
||||||
public createLdnService(ldnService: LdnService): Observable<LdnService> {
|
|
||||||
return this.http.post<LdnService>(this.baseUrl, ldnService);
|
|
||||||
}
|
|
||||||
|
|
||||||
public updateLdnService(id: string, ldnService: LdnService): Observable<LdnService> {
|
|
||||||
const endpoint = `${this.baseUrl}/${id}`;
|
|
||||||
return this.http.put<LdnService>(endpoint, ldnService);
|
|
||||||
}
|
|
||||||
|
|
||||||
public deleteLdnService(id: string): Observable<void> {
|
|
||||||
const endpoint = `${this.baseUrl}/${id}`;
|
|
||||||
return this.http.delete<void>(endpoint);
|
|
||||||
}
|
|
||||||
|
|
||||||
public searchLdnServicesByLdnUrl(ldnUrl: string): Observable<LdnService[]> {
|
|
||||||
const endpoint = `${this.baseUrl}/search/byLdnUrl?ldnUrl=${ldnUrl}`;
|
|
||||||
return this.http.get<LdnService[]>(endpoint);
|
|
||||||
}
|
|
||||||
|
|
||||||
public getItemFilters(): Observable<any> {
|
|
||||||
const itemFiltersEndpoint = `${this.itemFilterEndpoint}`;
|
|
||||||
return this.http.get(itemFiltersEndpoint);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -3,15 +3,15 @@ import { TestBed } from '@angular/core/testing';
|
|||||||
import { LdnServicesBulkDeleteService } from './ldn-service-bulk-delete.service';
|
import { LdnServicesBulkDeleteService } from './ldn-service-bulk-delete.service';
|
||||||
|
|
||||||
describe('LdnServiceBulkDeleteService', () => {
|
describe('LdnServiceBulkDeleteService', () => {
|
||||||
let service: LdnServicesBulkDeleteService;
|
let service: LdnServicesBulkDeleteService;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({});
|
TestBed.configureTestingModule({});
|
||||||
service = TestBed.inject(LdnServicesBulkDeleteService);
|
service = TestBed.inject(LdnServicesBulkDeleteService);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should be created', () => {
|
it('should be created', () => {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
expect(service).toBeTruthy();
|
expect(service).toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -1,117 +0,0 @@
|
|||||||
import { Injectable } from '@angular/core';
|
|
||||||
import { BehaviorSubject, count, from } from 'rxjs';
|
|
||||||
import { LdnServicesService } from '../ldn-services-data/ldn-services-data.service';
|
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
|
||||||
import { isNotEmpty } from '../../../shared/empty.util';
|
|
||||||
import { concatMap, filter, tap } from 'rxjs/operators';
|
|
||||||
import { getFirstCompletedRemoteData } from '../../../core/shared/operators';
|
|
||||||
import { RemoteData } from '../../../core/data/remote-data';
|
|
||||||
import { LdnService } from '../ldn-services-model/ldn-services.model';
|
|
||||||
@Injectable({
|
|
||||||
providedIn: 'root'
|
|
||||||
})
|
|
||||||
/**
|
|
||||||
* Service to facilitate removing ldn services in bulk.
|
|
||||||
*/
|
|
||||||
export class LdnServicesBulkDeleteService {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Array to track the services to be deleted
|
|
||||||
*/
|
|
||||||
ldnServicesToDelete: string[] = [];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Behavior subject to track whether the delete is processing
|
|
||||||
* @protected
|
|
||||||
*/
|
|
||||||
protected isProcessingBehaviorSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
|
|
||||||
|
|
||||||
constructor(
|
|
||||||
protected processLdnService: LdnServicesService,
|
|
||||||
protected notificationsService: NotificationsService,
|
|
||||||
protected translateService: TranslateService
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add or remove a process id to/from the list
|
|
||||||
* If the id is already present it will be removed, otherwise it will be added.
|
|
||||||
*
|
|
||||||
* @param notifyServiceName - The process id to add or remove
|
|
||||||
*/
|
|
||||||
toggleDelete(notifyServiceName: string) {
|
|
||||||
if (this.isToBeDeleted(notifyServiceName)) {
|
|
||||||
this.ldnServicesToDelete.splice(this.ldnServicesToDelete.indexOf(notifyServiceName), 1);
|
|
||||||
} else {
|
|
||||||
this.ldnServicesToDelete.push(notifyServiceName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if the provided service id is present in the to be deleted list
|
|
||||||
* @param notifyServiceName
|
|
||||||
*/
|
|
||||||
isToBeDeleted(notifyServiceName: string) {
|
|
||||||
return this.ldnServicesToDelete.includes(notifyServiceName);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Clear the list of services to be deleted
|
|
||||||
*/
|
|
||||||
clearAllServices() {
|
|
||||||
this.ldnServicesToDelete.splice(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the amount of processes selected for deletion
|
|
||||||
*/
|
|
||||||
getAmountOfSelectedServices() {
|
|
||||||
return this.ldnServicesToDelete.length;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a behavior subject to indicate whether the bulk delete is processing
|
|
||||||
*/
|
|
||||||
isProcessing$() {
|
|
||||||
return this.isProcessingBehaviorSubject;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns whether there currently are values selected for deletion
|
|
||||||
*/
|
|
||||||
hasSelected(): boolean {
|
|
||||||
return isNotEmpty(this.ldnServicesToDelete);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Delete all selected processes one by one
|
|
||||||
* When the deletion for a process fails, an error notification will be shown with the process id,
|
|
||||||
* but it will continue deleting the other processes.
|
|
||||||
* At the end it will show a notification stating the amount of successful deletes
|
|
||||||
* The successfully deleted processes will be removed from the list of selected values, the failed ones will be retained.
|
|
||||||
*/
|
|
||||||
deleteSelectedLdnServices() {
|
|
||||||
this.isProcessingBehaviorSubject.next(true);
|
|
||||||
|
|
||||||
from([...this.ldnServicesToDelete]).pipe(
|
|
||||||
concatMap((notifyServiceName) => {
|
|
||||||
return this.processLdnService.delete(notifyServiceName).pipe(
|
|
||||||
getFirstCompletedRemoteData(),
|
|
||||||
tap((rd: RemoteData<LdnService>) => {
|
|
||||||
if (rd.hasFailed) {
|
|
||||||
this.notificationsService.error(this.translateService.get('process.bulk.delete.error.head'), this.translateService.get('process.bulk.delete.error.body', {processId: notifyServiceName}));
|
|
||||||
} else {
|
|
||||||
this.toggleDelete(notifyServiceName);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
filter((rd: RemoteData<LdnService>) => rd.hasSucceeded),
|
|
||||||
count(),
|
|
||||||
).subscribe((value) => {
|
|
||||||
this.notificationsService.success(this.translateService.get('process.bulk.delete.success', {count: value}));
|
|
||||||
this.isProcessingBehaviorSubject.next(false);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
@@ -4,6 +4,8 @@ import { getAdminModuleRoute } from '../app-routing-paths';
|
|||||||
export const REGISTRIES_MODULE_PATH = 'registries';
|
export const REGISTRIES_MODULE_PATH = 'registries';
|
||||||
export const NOTIFICATIONS_MODULE_PATH = 'notifications';
|
export const NOTIFICATIONS_MODULE_PATH = 'notifications';
|
||||||
|
|
||||||
|
export const LDN_PATH = 'ldn';
|
||||||
|
|
||||||
export function getRegistriesModuleRoute() {
|
export function getRegistriesModuleRoute() {
|
||||||
return new URLCombiner(getAdminModuleRoute(), REGISTRIES_MODULE_PATH).toString();
|
return new URLCombiner(getAdminModuleRoute(), REGISTRIES_MODULE_PATH).toString();
|
||||||
}
|
}
|
||||||
@@ -12,4 +14,8 @@ export function getNotificationsModuleRoute() {
|
|||||||
return new URLCombiner(getAdminModuleRoute(), NOTIFICATIONS_MODULE_PATH).toString();
|
return new URLCombiner(getAdminModuleRoute(), NOTIFICATIONS_MODULE_PATH).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
export const LDN_PATH = 'ldn';
|
export function getLdnServicesModuleRoute() {
|
||||||
|
return new URLCombiner(getAdminModuleRoute(), LDN_PATH).toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -188,6 +188,9 @@ import { BulkAccessConditionOptions } from './config/models/bulk-access-conditio
|
|||||||
import { SuggestionTarget } from './suggestion-notifications/reciter-suggestions/models/suggestion-target.model';
|
import { SuggestionTarget } from './suggestion-notifications/reciter-suggestions/models/suggestion-target.model';
|
||||||
import { SuggestionSource } from './suggestion-notifications/reciter-suggestions/models/suggestion-source.model';
|
import { SuggestionSource } from './suggestion-notifications/reciter-suggestions/models/suggestion-source.model';
|
||||||
import { LdnServicesService } from '../admin/admin-ldn-services/ldn-services-data/ldn-services-data.service';
|
import { LdnServicesService } from '../admin/admin-ldn-services/ldn-services-data/ldn-services-data.service';
|
||||||
|
import { LdnService } from '../admin/admin-ldn-services/ldn-services-model/ldn-services.model';
|
||||||
|
import { LdnItemfiltersService } from '../admin/admin-ldn-services/ldn-services-data/ldn-itemfilters-data.service';
|
||||||
|
import { Itemfilter } from "../admin/admin-ldn-services/ldn-services-model/ldn-service-itemfilters";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When not in production, endpoint responses can be mocked for testing purposes
|
* When not in production, endpoint responses can be mocked for testing purposes
|
||||||
@@ -312,6 +315,7 @@ const PROVIDERS = [
|
|||||||
OrcidHistoryDataService,
|
OrcidHistoryDataService,
|
||||||
SupervisionOrderDataService,
|
SupervisionOrderDataService,
|
||||||
LdnServicesService,
|
LdnServicesService,
|
||||||
|
LdnItemfiltersService
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -392,7 +396,10 @@ export const models =
|
|||||||
ItemRequest,
|
ItemRequest,
|
||||||
BulkAccessConditionOptions,
|
BulkAccessConditionOptions,
|
||||||
SuggestionTarget,
|
SuggestionTarget,
|
||||||
SuggestionSource
|
SuggestionSource,
|
||||||
|
LdnService,
|
||||||
|
Itemfilter
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
|
@@ -917,9 +917,15 @@
|
|||||||
"ldn-service.overview.table.clickToEnable": "Click to enable",
|
"ldn-service.overview.table.clickToEnable": "Click to enable",
|
||||||
"ldn-service.overview.table.clickToDisable": "Click to disable",
|
"ldn-service.overview.table.clickToDisable": "Click to disable",
|
||||||
|
|
||||||
|
"ldn-edit-registered-service.title": "Edit Service",
|
||||||
|
"ldn-create-service.title": "Create service",
|
||||||
|
"service.overview.create.modal": "Create Service",
|
||||||
|
"service.overview.create.body": "Please confirm the creation of this service",
|
||||||
"ldn-service-status": "Status",
|
"ldn-service-status": "Status",
|
||||||
|
"service.confirm.create": "Create",
|
||||||
|
"service.refuse.create": "Discard",
|
||||||
"ldn-register-new-service.title": "Register a new service",
|
"ldn-register-new-service.title": "Register a new service",
|
||||||
"ldn-new-service.form.label.submit": "Submit",
|
"ldn-new-service.form.label.submit": "Save",
|
||||||
"ldn-new-service.form.label.name": "Name",
|
"ldn-new-service.form.label.name": "Name",
|
||||||
"ldn-new-service.form.label.description": "Description",
|
"ldn-new-service.form.label.description": "Description",
|
||||||
"ldn-new-service.form.label.url": "Service URL",
|
"ldn-new-service.form.label.url": "Service URL",
|
||||||
@@ -939,6 +945,24 @@
|
|||||||
"ldn-new-service.form.label.removeItemFilter": "Remove",
|
"ldn-new-service.form.label.removeItemFilter": "Remove",
|
||||||
"ldn-register-new-service.breadcrumbs": "New Service",
|
"ldn-register-new-service.breadcrumbs": "New Service",
|
||||||
"service.overview.delete.body": "Are you sure you want to delete this service?",
|
"service.overview.delete.body": "Are you sure you want to delete this service?",
|
||||||
|
"service.overview.edit.body": "Are you sure you want to confirm those service changes?",
|
||||||
|
"service.overview.edit.modal": "Edit Service",
|
||||||
|
"service.detail.update": "Edit Service",
|
||||||
|
"service.detail.return": "Cancel",
|
||||||
|
"service.overview.reset-form.body": "Are you sure you want to discard those changes and leave?",
|
||||||
|
"service.overview.reset-form.modal": "Discard Service Changes",
|
||||||
|
"service.overview.reset-form.reset-confirm":"Discard",
|
||||||
|
"admin.registries.services-formats.modify.success.head": "Successful Edit",
|
||||||
|
"admin.registries.services-formats.modify.success.content": "The service has been edited",
|
||||||
|
"ldn-service-notification.created.success.title": "Successful Create",
|
||||||
|
"ldn-service-notification.created.success.body": "The service has been created",
|
||||||
|
"ldn-enable-service.notification.success.title": "Successful status updated",
|
||||||
|
"ldn-enable-service.notification.success.content": "The service status has been updated",
|
||||||
|
"ldn-service-delete.notification.success.title": "Successful Deletion",
|
||||||
|
"ldn-service-delete.notification.success.content": "The service has been deleted",
|
||||||
|
"ldn-service-delete.notification.error.title": "Failed Deletion",
|
||||||
|
"ldn-service-delete.notification.error.content": "The service has not been deleted",
|
||||||
|
"service.overview.reset-form.reset-return": "Return",
|
||||||
"service.overview.delete": "Delete service",
|
"service.overview.delete": "Delete service",
|
||||||
"ldn-edit-service.title": "Edit service",
|
"ldn-edit-service.title": "Edit service",
|
||||||
"ldn-edit-service.form.label.name": "Name",
|
"ldn-edit-service.form.label.name": "Name",
|
||||||
@@ -954,7 +978,7 @@
|
|||||||
"ldn-edit-service.form.label.outboundPattern": "Outbound Pattern",
|
"ldn-edit-service.form.label.outboundPattern": "Outbound Pattern",
|
||||||
"ldn-edit-service.form.label.noOutboundPatternSelected": "No Outbound Pattern",
|
"ldn-edit-service.form.label.noOutboundPatternSelected": "No Outbound Pattern",
|
||||||
"ldn-edit-service.form.label.addOutboundPattern": "+ Add more",
|
"ldn-edit-service.form.label.addOutboundPattern": "+ Add more",
|
||||||
"ldn-edit-service.form.label.submit": "Submit",
|
"ldn-edit-service.form.label.submit": "Save",
|
||||||
"ldn-edit-service.breadcrumbs": "Edit Service",
|
"ldn-edit-service.breadcrumbs": "Edit Service",
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user