mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
CST-12455 Code refactor and new dropdowns implementation
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
import { NgModule } from '@angular/core';
|
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 { 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: [
|
||||||
|
@@ -1,13 +1,13 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import {NgModule} from '@angular/core';
|
||||||
import { CommonModule } from '@angular/common';
|
import {CommonModule} from '@angular/common';
|
||||||
import { AdminLdnServicesRoutingModule } from './admin-ldn-services-routing.module';
|
import {AdminLdnServicesRoutingModule} from './admin-ldn-services-routing.module';
|
||||||
import { LdnServicesOverviewComponent } from './ldn-services-directory/ldn-services-directory.component';
|
import {LdnServicesOverviewComponent} from './ldn-services-directory/ldn-services-directory.component';
|
||||||
import { SharedModule } from '../../shared/shared.module';
|
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 {FormsModule} from '@angular/forms';
|
||||||
import { LdnItemfiltersService } from './ldn-services-data/ldn-itemfilters-data.service';
|
import {LdnItemfiltersService} from './ldn-services-data/ldn-itemfilters-data.service';
|
||||||
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
|
@@ -87,7 +87,8 @@
|
|||||||
|
|
||||||
<div class="row mb-1">
|
<div class="row mb-1">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div #inboundPatternDropdown="ngbDropdown" class="w-100" id="additionalInboundPattern{{i}}" ngbDropdown>
|
<div #inboundPatternDropdown="ngbDropdown" class="w-80" display="dynamic" id="additionalInboundPattern{{i}}"
|
||||||
|
ngbDropdown placement="bottom">
|
||||||
<div class="position-relative right-addon" role="combobox">
|
<div class="position-relative right-addon" role="combobox">
|
||||||
<i aria-hidden="true" class="position-absolute scrollable-dropdown-toggle"
|
<i aria-hidden="true" class="position-absolute scrollable-dropdown-toggle"
|
||||||
ngbDropdownToggle></i>
|
ngbDropdownToggle></i>
|
||||||
@@ -95,17 +96,12 @@
|
|||||||
(click)="inboundPatternDropdown.open();"
|
(click)="inboundPatternDropdown.open();"
|
||||||
[readonly]="true"
|
[readonly]="true"
|
||||||
[value]="selectedInboundPatterns"
|
[value]="selectedInboundPatterns"
|
||||||
class="form-control w-100 scrollable-dropdown-input"
|
class="form-control w-80 scrollable-dropdown-input"
|
||||||
formControlName="pattern"
|
formControlName="pattern"
|
||||||
id="inboundPatternDropdownButton"
|
id="inboundPatternDropdownButton"
|
||||||
ngbDropdownAnchor
|
ngbDropdownAnchor
|
||||||
type="text"
|
type="text"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- Main label TODO: remove after developing done cause it will pick the selected value to show -->
|
|
||||||
<div>{{ selectedInboundPatterns ? ('ldn-service.form.pattern.' + selectedInboundPatterns + '.label' | translate) : ('ldn-new-service.form.label.placeholder.inboundPattern' | translate) }}</div>
|
|
||||||
<div
|
|
||||||
class="small-text">{{ selectedInboundPatterns ? ('ldn-service.form.pattern.' + selectedInboundPatterns + '.description' | translate) : ('' | translate) }}</div>
|
|
||||||
<!-- TODO: infinite scroll with 3 selects -->
|
<!-- TODO: infinite scroll with 3 selects -->
|
||||||
<div aria-labelledby="inboundPatternDropdownButton" ngbDropdownMenu>
|
<div aria-labelledby="inboundPatternDropdownButton" ngbDropdownMenu>
|
||||||
<button (click)="selectInboundPattern(pattern, i); $event.stopPropagation()"
|
<button (click)="selectInboundPattern(pattern, i); $event.stopPropagation()"
|
||||||
@@ -137,10 +133,6 @@
|
|||||||
ngbDropdownAnchor
|
ngbDropdownAnchor
|
||||||
type="text"
|
type="text"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div>{{ selectedInboundItemfilters ? ('ldn-service.form.pattern.' + selectedInboundItemfilters + '.label' | translate) : ('ldn-new-service.form.label.placeholder.outboundPattern' | translate) }}</div>
|
|
||||||
<div
|
|
||||||
class="small-text">{{ selectedInboundItemfilters ? ('ldn-service.form.pattern.' + selectedInboundItemfilters + '.description' | translate) : ('' | translate) }}</div>
|
|
||||||
<!-- TODO: infinite scroll with 3 selects -->
|
<!-- TODO: infinite scroll with 3 selects -->
|
||||||
<div aria-labelledby="inboundItemfilterDropdownButton" ngbDropdownMenu>
|
<div aria-labelledby="inboundItemfilterDropdownButton" ngbDropdownMenu>
|
||||||
<button (click)="selectInboundItemFilter(constraint.id, i); $event.stopPropagation()"
|
<button (click)="selectInboundItemFilter(constraint.id, i); $event.stopPropagation()"
|
||||||
@@ -266,10 +258,6 @@
|
|||||||
ngbDropdownAnchor
|
ngbDropdownAnchor
|
||||||
type="text"
|
type="text"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div>{{ selectedOutboundItemfilters ? ('ldn-service.form.pattern.' + selectedOutboundItemfilters + '.label' | translate) : ('ldn-new-service.form.label.placeholder.outboundPattern' | translate) }}</div>
|
|
||||||
<div
|
|
||||||
class="small-text">{{ selectedOutboundItemfilters ? ('ldn-service.form.pattern.' + selectedOutboundItemfilters + '.description' | translate) : ('' | translate) }}</div>
|
|
||||||
<!-- TODO: infinite scroll with 3 selects -->
|
<!-- TODO: infinite scroll with 3 selects -->
|
||||||
<div aria-labelledby="outboundItemfilterDropdownButton" ngbDropdownMenu>
|
<div aria-labelledby="outboundItemfilterDropdownButton" ngbDropdownMenu>
|
||||||
<button (click)="selectOutboundItemFilter(constraint.id, i); $event.stopPropagation()"
|
<button (click)="selectOutboundItemFilter(constraint.id, i); $event.stopPropagation()"
|
||||||
|
@@ -99,6 +99,7 @@ textarea {
|
|||||||
font-size: 0.7em;
|
font-size: 0.7em;
|
||||||
color: #888;
|
color: #888;
|
||||||
}
|
}
|
||||||
|
|
||||||
.toggle-switch {
|
.toggle-switch {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
margin-top: 3px;
|
margin-top: 3px;
|
||||||
|
@@ -1,21 +1,21 @@
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import {ComponentFixture, TestBed} from '@angular/core/testing';
|
||||||
|
|
||||||
import { LdnServiceFormEditComponent } from './ldn-service-form-edit.component';
|
import {LdnServiceFormEditComponent} from './ldn-service-form-edit.component';
|
||||||
import { ChangeDetectorRef, EventEmitter } from '@angular/core';
|
import {ChangeDetectorRef, EventEmitter} from '@angular/core';
|
||||||
import { ReactiveFormsModule, FormBuilder } from '@angular/forms';
|
import {FormBuilder, ReactiveFormsModule} from '@angular/forms';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import {ActivatedRoute, Router} from '@angular/router';
|
||||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
import {NgbModal} from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
import {TranslateModule, TranslateService} from '@ngx-translate/core';
|
||||||
import { PaginationService } from 'ngx-pagination';
|
import {PaginationService} from 'ngx-pagination';
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
import {NotificationsService} from '../../../shared/notifications/notifications.service';
|
||||||
import { LdnItemfiltersService } from '../ldn-services-data/ldn-itemfilters-data.service';
|
import {LdnItemfiltersService} from '../ldn-services-data/ldn-itemfilters-data.service';
|
||||||
import { LdnServicesService } from '../ldn-services-data/ldn-services-data.service';
|
import {LdnServicesService} from '../ldn-services-data/ldn-services-data.service';
|
||||||
import { RouterStub } from '../../../shared/testing/router.stub';
|
import {RouterStub} from '../../../shared/testing/router.stub';
|
||||||
import { MockActivatedRoute } from '../../../shared/mocks/active-router.mock';
|
import {MockActivatedRoute} from '../../../shared/mocks/active-router.mock';
|
||||||
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub';
|
import {NotificationsServiceStub} from '../../../shared/testing/notifications-service.stub';
|
||||||
import { of } from 'rxjs';
|
import {of} from 'rxjs';
|
||||||
import { RouteService } from '../../../core/services/route.service';
|
import {RouteService} from '../../../core/services/route.service';
|
||||||
import { provideMockStore } from '@ngrx/store/testing';
|
import {provideMockStore} from '@ngrx/store/testing';
|
||||||
|
|
||||||
describe('LdnServiceFormEditComponent', () => {
|
describe('LdnServiceFormEditComponent', () => {
|
||||||
let component: LdnServiceFormEditComponent;
|
let component: LdnServiceFormEditComponent;
|
||||||
@@ -52,18 +52,18 @@ describe('LdnServiceFormEditComponent', () => {
|
|||||||
imports: [ReactiveFormsModule, TranslateModule.forRoot()],
|
imports: [ReactiveFormsModule, TranslateModule.forRoot()],
|
||||||
declarations: [LdnServiceFormEditComponent],
|
declarations: [LdnServiceFormEditComponent],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: LdnServicesService, useValue: ldnServicesService },
|
{provide: LdnServicesService, useValue: ldnServicesService},
|
||||||
{ provide: LdnItemfiltersService, useValue: ldnItemfiltersService },
|
{provide: LdnItemfiltersService, useValue: ldnItemfiltersService},
|
||||||
{ provide: Router, useValue: new RouterStub() },
|
{provide: Router, useValue: new RouterStub()},
|
||||||
{ provide: ActivatedRoute, useValue: new MockActivatedRoute() },
|
{provide: ActivatedRoute, useValue: new MockActivatedRoute()},
|
||||||
{ provide: ChangeDetectorRef, useValue: cdRefStub },
|
{provide: ChangeDetectorRef, useValue: cdRefStub},
|
||||||
{ provide: NgbModal, useValue: modalService },
|
{provide: NgbModal, useValue: modalService},
|
||||||
{ provide: NotificationsService, useValue: NotificationsServiceStub },
|
{provide: NotificationsService, useValue: NotificationsServiceStub},
|
||||||
{ provide: TranslateService, useValue: translateServiceStub },
|
{provide: TranslateService, useValue: translateServiceStub},
|
||||||
{ provide: PaginationService, useValue: {} },
|
{provide: PaginationService, useValue: {}},
|
||||||
FormBuilder,
|
FormBuilder,
|
||||||
RouteService,
|
RouteService,
|
||||||
provideMockStore({ }),
|
provideMockStore({}),
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
@@ -202,13 +202,9 @@ export class LdnServiceFormEditComponent implements OnInit {
|
|||||||
|
|
||||||
|
|
||||||
selectOutboundPattern(patternValue: string, index: number): void {
|
selectOutboundPattern(patternValue: string, index: number): void {
|
||||||
// this.selectedOutboundPatterns = patternValue;
|
|
||||||
const patternArray = (this.formModel.get('notifyServiceOutboundPatterns') as FormArray)
|
const patternArray = (this.formModel.get('notifyServiceOutboundPatterns') as FormArray)
|
||||||
console.log((this.formModel.get('notifyServiceOutboundPatterns') as FormArray))
|
console.log((this.formModel.get('notifyServiceOutboundPatterns') as FormArray))
|
||||||
patternArray.controls[index].patchValue({pattern: patternValue})
|
patternArray.controls[index].patchValue({pattern: patternValue})
|
||||||
|
|
||||||
//console.log(patternArray);
|
|
||||||
//this.getPatternControlNames(index)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
selectOutboundItemFilter(filterValue: string, index: number) {
|
selectOutboundItemFilter(filterValue: string, index: number) {
|
||||||
@@ -218,42 +214,17 @@ export class LdnServiceFormEditComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
selectInboundPattern(patternValue: string, index: number): void {
|
selectInboundPattern(patternValue: string, index: number): void {
|
||||||
// this.selectedOutboundPatterns = patternValue;
|
|
||||||
const patternArray = (this.formModel.get('notifyServiceInboundPatterns') as FormArray)
|
const patternArray = (this.formModel.get('notifyServiceInboundPatterns') as FormArray)
|
||||||
console.log((this.formModel.get('notifyServiceInboundPatterns') as FormArray))
|
console.log((this.formModel.get('notifyServiceInboundPatterns') as FormArray))
|
||||||
patternArray.controls[index].patchValue({pattern: patternValue})
|
patternArray.controls[index].patchValue({pattern: patternValue})
|
||||||
|
|
||||||
//console.log(patternArray);
|
|
||||||
//this.getPatternControlNames(index)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
selectInboundItemFilter(filterValue: string, index: number): void {
|
selectInboundItemFilter(filterValue: string, index: number): void {
|
||||||
// this.selectedOutboundPatterns = patternValue;
|
|
||||||
const filterArray = (this.formModel.get('notifyServiceInboundPatterns') as FormArray)
|
const filterArray = (this.formModel.get('notifyServiceInboundPatterns') as FormArray)
|
||||||
console.log((this.formModel.get('notifyServiceInboundPatterns') as FormArray))
|
console.log((this.formModel.get('notifyServiceInboundPatterns') as FormArray))
|
||||||
filterArray.controls[index].patchValue({constraint: filterValue})
|
filterArray.controls[index].patchValue({constraint: filterValue})
|
||||||
|
|
||||||
//console.log(patternArray);
|
|
||||||
//this.getPatternControlNames(index)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
getOutboundPatternControlNames(index: number) {
|
|
||||||
const patternArrayValue = (this.formModel.get('notifyServiceOutboundPatterns') as FormArray).controls[index]?.value
|
|
||||||
console.log(patternArrayValue)
|
|
||||||
return patternArrayValue
|
|
||||||
}
|
|
||||||
|
|
||||||
getInboundPatternControlNames(index: number) {
|
|
||||||
const patternArrayValue = (this.formModel.get('notifyServiceInboundPatterns') as FormArray).controls[index]?.value
|
|
||||||
console.log(patternArrayValue)
|
|
||||||
return patternArrayValue
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//TODO: make a method that checks if user selected one value for the
|
|
||||||
|
|
||||||
|
|
||||||
toggleAutomatic(i: number) {
|
toggleAutomatic(i: number) {
|
||||||
const automaticControl = this.formModel.get(`notifyServiceInboundPatterns.${i}.automatic`);
|
const automaticControl = this.formModel.get(`notifyServiceInboundPatterns.${i}.automatic`);
|
||||||
if (automaticControl) {
|
if (automaticControl) {
|
||||||
@@ -478,12 +449,4 @@ export class LdnServiceFormEditComponent implements OnInit {
|
|||||||
automatic: '',
|
automatic: '',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//setValueForControlInOutboundArray(formArrayName: string, index: number, value: string) {
|
|
||||||
// const formArray = this.formModel.get(formArrayName) as FormArray;
|
|
||||||
//console.warn('inside setValueForControlInOutboundArray', formArray);
|
|
||||||
//formArray.at(index).setValue(value);
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -77,31 +77,31 @@
|
|||||||
|
|
||||||
<div class="row mb-1">
|
<div class="row mb-1">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div ngbDropdown #inboundPatternDropdown="ngbDropdown" class="w-100" id="additionalInboundPattern{{i}}">
|
<div #inboundPatternDropdown="ngbDropdown" class="w-100" id="additionalInboundPattern{{i}}" ngbDropdown>
|
||||||
<div class="position-relative right-addon" role="combobox">
|
<div class="position-relative right-addon" role="combobox">
|
||||||
<i ngbDropdownToggle class="position-absolute scrollable-dropdown-toggle"
|
<i aria-hidden="true" class="position-absolute scrollable-dropdown-toggle"
|
||||||
aria-hidden="true">
|
ngbDropdownToggle>
|
||||||
|
|
||||||
</i>
|
</i>
|
||||||
<input
|
<input
|
||||||
formControlName="pattern"
|
|
||||||
type="text"
|
|
||||||
[readonly]="true"
|
|
||||||
ngbDropdownAnchor
|
|
||||||
class="form-control w-100 scrollable-dropdown-input"
|
|
||||||
[value]="selectedInboundPatterns"
|
|
||||||
(click)="inboundPatternDropdown.open();"
|
(click)="inboundPatternDropdown.open();"
|
||||||
|
[readonly]="true"
|
||||||
|
[value]="selectedInboundPatterns"
|
||||||
|
class="form-control w-100 scrollable-dropdown-input"
|
||||||
|
formControlName="pattern"
|
||||||
id="inboundPatternDropdownButton"
|
id="inboundPatternDropdownButton"
|
||||||
|
ngbDropdownAnchor
|
||||||
|
type="text"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- Main label TODO: remove after developing done cause it will pick the selected value to show -->
|
|
||||||
<div>{{ selectedInboundPatterns ? ('ldn-service.form.pattern.' + selectedInboundPatterns + '.label' | translate) : ('ldn-new-service.form.label.placeholder.inboundPattern' | translate) }}</div>
|
|
||||||
<div class="small-text">{{ selectedInboundPatterns ? ('ldn-service.form.pattern.' + selectedInboundPatterns + '.description' | translate) : ('' | translate) }}</div>
|
|
||||||
<!-- TODO: infinite scroll with 3 selects -->
|
<!-- TODO: infinite scroll with 3 selects -->
|
||||||
<div ngbDropdownMenu aria-labelledby="inboundPatternDropdownButton">
|
<div aria-labelledby="inboundPatternDropdownButton" ngbDropdownMenu>
|
||||||
<button type="button" ngbDropdownItem *ngFor="let pattern of outboundPatterns; let internalIndex = index" (click)="selectInboundPattern(pattern, i); $event.stopPropagation()">
|
<button (click)="selectInboundPattern(pattern, i); $event.stopPropagation()"
|
||||||
<div>{{ 'ldn-service.form.pattern.'+pattern+'.label' | translate }}</div>
|
*ngFor="let pattern of inboundPatterns; let internalIndex = index"
|
||||||
<div class="small-text">{{ 'ldn-service.form.pattern.'+pattern+'.description' | translate }}</div>
|
ngbDropdownItem
|
||||||
|
type="button">
|
||||||
|
<div>{{ 'ldn-service.form.pattern.' + pattern + '.label' | translate }}</div>
|
||||||
|
<div
|
||||||
|
class="small-text">{{ 'ldn-service.form.pattern.' + pattern + '.description' | translate }}</div>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -143,7 +143,9 @@
|
|||||||
</ng-container>
|
</ng-container>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div [style.visibility]="formModel.get('notifyServiceInboundPatterns')['controls'][i]?.value?.pattern ? 'visible' : 'hidden'" class="col-sm-1">
|
<div
|
||||||
|
[style.visibility]="formModel.get('notifyServiceInboundPatterns')['controls'][i]?.value?.pattern ? 'visible' : 'hidden'"
|
||||||
|
class="col-sm-1">
|
||||||
<input formControlName="automatic" hidden id="automatic{{i}}" name="automatic{{i}}"
|
<input formControlName="automatic" hidden id="automatic{{i}}" name="automatic{{i}}"
|
||||||
type="checkbox">
|
type="checkbox">
|
||||||
<div (click)="toggleAutomatic(i)"
|
<div (click)="toggleAutomatic(i)"
|
||||||
@@ -193,29 +195,33 @@
|
|||||||
<!-- Input elements in a separate row -->
|
<!-- Input elements in a separate row -->
|
||||||
<div class="row mb-1">
|
<div class="row mb-1">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div ngbDropdown #outboundPatternDropdown="ngbDropdown" class="w-100" id="additionalOutboundPattern{{i}}">
|
<div #outboundPatternDropdown="ngbDropdown" class="w-100" id="additionalOutboundPattern{{i}}" ngbDropdown>
|
||||||
<div class="position-relative right-addon" role="combobox">
|
<div class="position-relative right-addon" role="combobox">
|
||||||
<i ngbDropdownToggle class="position-absolute scrollable-dropdown-toggle"
|
<i aria-hidden="true" class="position-absolute scrollable-dropdown-toggle"
|
||||||
aria-hidden="true"></i>
|
ngbDropdownToggle></i>
|
||||||
<input
|
<input
|
||||||
formControlName="pattern"
|
|
||||||
type="text"
|
|
||||||
[readonly]="true"
|
|
||||||
ngbDropdownAnchor
|
|
||||||
class="form-control w-100 scrollable-dropdown-input"
|
|
||||||
[value]="selectedOutboundPatterns"
|
|
||||||
(click)="outboundPatternDropdown.open();"
|
(click)="outboundPatternDropdown.open();"
|
||||||
|
[readonly]="true"
|
||||||
|
[value]="selectedOutboundPatterns"
|
||||||
|
class="form-control w-100 scrollable-dropdown-input"
|
||||||
|
formControlName="pattern"
|
||||||
id="outboundPatternDropdownButton"
|
id="outboundPatternDropdownButton"
|
||||||
|
ngbDropdownAnchor
|
||||||
|
type="text"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- Main label TODO: remove after developing done cause it will pick the selected value to show -->
|
<!-- Main label TODO: remove after developing done cause it will pick the selected value to show -->
|
||||||
<div>{{ selectedOutboundPatterns ? ('ldn-service.form.pattern.' + selectedOutboundPatterns + '.label' | translate) : ('ldn-new-service.form.label.placeholder.outboundPattern' | translate) }}</div>
|
<div>{{ selectedOutboundPatterns ? ('ldn-service.form.pattern.' + selectedOutboundPatterns + '.label' | translate) : ('ldn-new-service.form.label.placeholder.outboundPattern' | translate) }}</div>
|
||||||
<div class="small-text">{{ selectedOutboundPatterns ? ('ldn-service.form.pattern.' + selectedOutboundPatterns + '.description' | translate) : ('' | translate) }}</div>
|
<div
|
||||||
|
class="small-text">{{ selectedOutboundPatterns ? ('ldn-service.form.pattern.' + selectedOutboundPatterns + '.description' | translate) : ('' | translate) }}</div>
|
||||||
<!-- TODO: infinite scroll with 3 selects -->
|
<!-- TODO: infinite scroll with 3 selects -->
|
||||||
<div ngbDropdownMenu aria-labelledby="outboundPatternDropdownButton">
|
<div aria-labelledby="outboundPatternDropdownButton" ngbDropdownMenu>
|
||||||
<button type="button" ngbDropdownItem *ngFor="let pattern of outboundPatterns" (click)="selectOutboundPattern(pattern, i); $event.stopPropagation()">
|
<button (click)="selectOutboundPattern(pattern, i); $event.stopPropagation()"
|
||||||
<div>{{ 'ldn-service.form.pattern.'+pattern+'.label' | translate }}</div>
|
*ngFor="let pattern of outboundPatterns" ngbDropdownItem
|
||||||
<div class="small-text">{{ 'ldn-service.form.pattern.'+pattern+'.description' | translate }}</div>
|
type="button">
|
||||||
|
<div>{{ 'ldn-service.form.pattern.' + pattern + '.label' | translate }}</div>
|
||||||
|
<div
|
||||||
|
class="small-text">{{ 'ldn-service.form.pattern.' + pattern + '.description' | translate }}</div>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -1,20 +1,20 @@
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import {ComponentFixture, TestBed} from '@angular/core/testing';
|
||||||
|
|
||||||
import { LdnServiceFormComponent } from './ldn-service-form.component';
|
import {LdnServiceFormComponent} from './ldn-service-form.component';
|
||||||
import { FormBuilder, ReactiveFormsModule } from '@angular/forms';
|
import {FormBuilder, ReactiveFormsModule} from '@angular/forms';
|
||||||
import { RouterTestingModule } from '@angular/router/testing';
|
import {RouterTestingModule} from '@angular/router/testing';
|
||||||
import { NgbModal, NgbModalModule } from '@ng-bootstrap/ng-bootstrap';
|
import {NgbModal, NgbModalModule} from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
import {TranslateModule, TranslateService} from '@ngx-translate/core';
|
||||||
import { LdnItemfiltersService } from '../ldn-services-data/ldn-itemfilters-data.service';
|
import {LdnItemfiltersService} from '../ldn-services-data/ldn-itemfilters-data.service';
|
||||||
import { LdnServicesService } from '../ldn-services-data/ldn-services-data.service';
|
import {LdnServicesService} from '../ldn-services-data/ldn-services-data.service';
|
||||||
import { NotificationsService } from 'src/app/shared/notifications/notifications.service';
|
import {NotificationsService} from 'src/app/shared/notifications/notifications.service';
|
||||||
import { Router } from '@angular/router';
|
import {Router} from '@angular/router';
|
||||||
import { RouterStub } from 'src/app/shared/testing/router.stub';
|
import {RouterStub} from 'src/app/shared/testing/router.stub';
|
||||||
import { createPaginatedList } from 'src/app/shared/testing/utils.test';
|
import {createPaginatedList} from 'src/app/shared/testing/utils.test';
|
||||||
import { Itemfilter } from '../ldn-services-model/ldn-service-itemfilters';
|
import {Itemfilter} from '../ldn-services-model/ldn-service-itemfilters';
|
||||||
import { createSuccessfulRemoteDataObject$ } from 'src/app/shared/remote-data.utils';
|
import {createSuccessfulRemoteDataObject$} from 'src/app/shared/remote-data.utils';
|
||||||
import { of } from 'rxjs';
|
import {of} from 'rxjs';
|
||||||
import { EventEmitter } from '@angular/core';
|
import {EventEmitter} from '@angular/core';
|
||||||
|
|
||||||
describe('LdnServiceFormComponent', () => {
|
describe('LdnServiceFormComponent', () => {
|
||||||
let component: LdnServiceFormComponent;
|
let component: LdnServiceFormComponent;
|
||||||
@@ -54,12 +54,17 @@ describe('LdnServiceFormComponent', () => {
|
|||||||
TranslateModule.forRoot()
|
TranslateModule.forRoot()
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: LdnItemfiltersService, useValue: ldnItemfiltersService },
|
{provide: LdnItemfiltersService, useValue: ldnItemfiltersService},
|
||||||
{ provide: LdnServicesService, useValue: ldnServicesService },
|
{provide: LdnServicesService, useValue: ldnServicesService},
|
||||||
{ provide: NotificationsService, useValue: notificationsService },
|
{provide: NotificationsService, useValue: notificationsService},
|
||||||
{ provide: TranslateService, useValue: translateServiceStub },
|
{provide: TranslateService, useValue: translateServiceStub},
|
||||||
{ provide: Router, useValue: new RouterStub() },
|
{provide: Router, useValue: new RouterStub()},
|
||||||
{ provide: NgbModal, useValue: { open: () => {/*comment*/ } } },
|
{
|
||||||
|
provide: NgbModal, useValue: {
|
||||||
|
open: () => {/*comment*/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
FormBuilder
|
FormBuilder
|
||||||
],
|
],
|
||||||
declarations: [LdnServiceFormComponent]
|
declarations: [LdnServiceFormComponent]
|
||||||
|
@@ -36,8 +36,6 @@ export class LdnServiceFormComponent implements OnInit {
|
|||||||
formModel: FormGroup;
|
formModel: FormGroup;
|
||||||
@ViewChild('confirmModal', {static: true}) confirmModal: TemplateRef<any>;
|
@ViewChild('confirmModal', {static: true}) confirmModal: TemplateRef<any>;
|
||||||
@ViewChild('resetFormModal', {static: true}) resetFormModal: TemplateRef<any>;
|
@ViewChild('resetFormModal', {static: true}) resetFormModal: TemplateRef<any>;
|
||||||
//public inboundPatterns: object[] = notifyPatterns;
|
|
||||||
//public outboundPatterns: object[] = notifyPatterns;
|
|
||||||
public inboundPatterns: string[] = notifyPatterns;
|
public inboundPatterns: string[] = notifyPatterns;
|
||||||
public outboundPatterns: string[] = notifyPatterns;
|
public outboundPatterns: string[] = notifyPatterns;
|
||||||
itemfiltersRD$: Observable<RemoteData<PaginatedList<Itemfilter>>>;
|
itemfiltersRD$: Observable<RemoteData<PaginatedList<Itemfilter>>>;
|
||||||
@@ -207,18 +205,12 @@ export class LdnServiceFormComponent implements OnInit {
|
|||||||
const patternArray = (this.formModel.get('notifyServiceInboundPatterns') as FormArray).controls[index]
|
const patternArray = (this.formModel.get('notifyServiceInboundPatterns') as FormArray).controls[index]
|
||||||
console.log((this.formModel.get('notifyServiceInboundPatterns') as FormArray))
|
console.log((this.formModel.get('notifyServiceInboundPatterns') as FormArray))
|
||||||
patternArray.patchValue({pattern: patternValue})
|
patternArray.patchValue({pattern: patternValue})
|
||||||
//console.log(patternArray);
|
|
||||||
//this.getPatternControlNames(index)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
selectInboundItemFilter(filterValue: string, index: number): void {
|
selectInboundItemFilter(filterValue: string, index: number): void {
|
||||||
// this.selectedOutboundPatterns = patternValue;
|
|
||||||
const filterArray = (this.formModel.get('notifyServiceInboundPatterns') as FormArray)
|
const filterArray = (this.formModel.get('notifyServiceInboundPatterns') as FormArray)
|
||||||
console.log((this.formModel.get('notifyServiceInboundPatterns') as FormArray))
|
console.log((this.formModel.get('notifyServiceInboundPatterns') as FormArray))
|
||||||
filterArray.controls[index].patchValue({constraint: filterValue})
|
filterArray.controls[index].patchValue({constraint: filterValue})
|
||||||
|
|
||||||
//console.log(patternArray);
|
|
||||||
//this.getPatternControlNames(index)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
selectOutboundItemFilter(filterValue: string, index: number) {
|
selectOutboundItemFilter(filterValue: string, index: number) {
|
||||||
@@ -227,19 +219,10 @@ export class LdnServiceFormComponent implements OnInit {
|
|||||||
filterArray.controls[index].patchValue({constraint: filterValue})
|
filterArray.controls[index].patchValue({constraint: filterValue})
|
||||||
}
|
}
|
||||||
|
|
||||||
getPatternControlNames(index: number) {
|
|
||||||
const patternArrayValue = (this.formModel.get('notifyServiceOutboundPatterns') as FormArray).controls[index].value
|
|
||||||
return patternArrayValue
|
|
||||||
}
|
|
||||||
|
|
||||||
private sendBack() {
|
private sendBack() {
|
||||||
this.router.navigateByUrl('admin/ldn/services');
|
this.router.navigateByUrl('admin/ldn/services');
|
||||||
}
|
}
|
||||||
|
|
||||||
//selectInboundPattern(pattern: string, index: number): void {
|
|
||||||
//this.selectedInboundPatterns = pattern;
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
private createOutboundPatternFormGroup(): FormGroup {
|
private createOutboundPatternFormGroup(): FormGroup {
|
||||||
return this.formBuilder.group({
|
return this.formBuilder.group({
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
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;
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { Component } from '@angular/core';
|
import {Component} from '@angular/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-ldn-service-new',
|
selector: 'ds-ldn-service-new',
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
import { LdnService } from '../ldn-services-model/ldn-services.model';
|
import {LdnService} from '../ldn-services-model/ldn-services.model';
|
||||||
import { LDN_SERVICE } from '../ldn-services-model/ldn-service.resource-type';
|
import {LDN_SERVICE} from '../ldn-services-model/ldn-service.resource-type';
|
||||||
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 { Observable, of } from 'rxjs';
|
import {Observable, of} from 'rxjs';
|
||||||
// Create a mock data object for a single LDN notify service
|
// Create a mock data object for a single LDN notify service
|
||||||
export const mockLdnService: LdnService = {
|
export const mockLdnService: LdnService = {
|
||||||
id: 1,
|
id: 1,
|
||||||
|
@@ -1,20 +1,20 @@
|
|||||||
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_CONSTRAINT_FILTERS } from '../ldn-services-model/ldn-service.resource-type';
|
import {LDN_SERVICE_CONSTRAINT_FILTERS} 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';
|
||||||
import { FindAllData, FindAllDataImpl } from '../../../core/data/base/find-all-data';
|
import {FindAllData, FindAllDataImpl} from '../../../core/data/base/find-all-data';
|
||||||
|
|
||||||
import { RequestService } from '../../../core/data/request.service';
|
import {RequestService} from '../../../core/data/request.service';
|
||||||
import { RemoteDataBuildService } from '../../../core/cache/builders/remote-data-build.service';
|
import {RemoteDataBuildService} from '../../../core/cache/builders/remote-data-build.service';
|
||||||
import { ObjectCacheService } from '../../../core/cache/object-cache.service';
|
import {ObjectCacheService} from '../../../core/cache/object-cache.service';
|
||||||
import { HALEndpointService } from '../../../core/shared/hal-endpoint.service';
|
import {HALEndpointService} from '../../../core/shared/hal-endpoint.service';
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
import {NotificationsService} from '../../../shared/notifications/notifications.service';
|
||||||
import { FindListOptions } from '../../../core/data/find-list-options.model';
|
import {FindListOptions} from '../../../core/data/find-list-options.model';
|
||||||
import { FollowLinkConfig } from '../../../shared/utils/follow-link-config.model';
|
import {FollowLinkConfig} from '../../../shared/utils/follow-link-config.model';
|
||||||
import { Observable } from 'rxjs';
|
import {Observable} from 'rxjs';
|
||||||
import { RemoteData } from '../../../core/data/remote-data';
|
import {RemoteData} from '../../../core/data/remote-data';
|
||||||
import { Itemfilter } from '../ldn-services-model/ldn-service-itemfilters';
|
import {Itemfilter} from '../ldn-services-model/ldn-service-itemfilters';
|
||||||
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
import {PaginatedList} from '../../../core/data/paginated-list.model';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,38 +1,38 @@
|
|||||||
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';
|
||||||
import { FindAllData, FindAllDataImpl } from '../../../core/data/base/find-all-data';
|
import {FindAllData, FindAllDataImpl} from '../../../core/data/base/find-all-data';
|
||||||
import { DeleteData, DeleteDataImpl } from '../../../core/data/base/delete-data';
|
import {DeleteData, DeleteDataImpl} from '../../../core/data/base/delete-data';
|
||||||
import { RequestService } from '../../../core/data/request.service';
|
import {RequestService} from '../../../core/data/request.service';
|
||||||
import { RemoteDataBuildService } from '../../../core/cache/builders/remote-data-build.service';
|
import {RemoteDataBuildService} from '../../../core/cache/builders/remote-data-build.service';
|
||||||
import { ObjectCacheService } from '../../../core/cache/object-cache.service';
|
import {ObjectCacheService} from '../../../core/cache/object-cache.service';
|
||||||
import { HALEndpointService } from '../../../core/shared/hal-endpoint.service';
|
import {HALEndpointService} from '../../../core/shared/hal-endpoint.service';
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
import {NotificationsService} from '../../../shared/notifications/notifications.service';
|
||||||
import { FindListOptions } from '../../../core/data/find-list-options.model';
|
import {FindListOptions} from '../../../core/data/find-list-options.model';
|
||||||
import { FollowLinkConfig } from '../../../shared/utils/follow-link-config.model';
|
import {FollowLinkConfig} from '../../../shared/utils/follow-link-config.model';
|
||||||
import { Observable } from 'rxjs';
|
import {Observable} 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 { NoContent } from '../../../core/shared/NoContent.model';
|
import {NoContent} from '../../../core/shared/NoContent.model';
|
||||||
import { map, take } from 'rxjs/operators';
|
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 { LdnService } from '../ldn-services-model/ldn-services.model';
|
import {LdnService} from '../ldn-services-model/ldn-services.model';
|
||||||
|
|
||||||
import { PatchData, PatchDataImpl } from '../../../core/data/base/patch-data';
|
import {PatchData, PatchDataImpl} from '../../../core/data/base/patch-data';
|
||||||
import { ChangeAnalyzer } from '../../../core/data/change-analyzer';
|
import {ChangeAnalyzer} from '../../../core/data/change-analyzer';
|
||||||
import { Operation } from 'fast-json-patch';
|
import {Operation} from 'fast-json-patch';
|
||||||
import { RestRequestMethod } from '../../../core/data/rest-request-method';
|
import {RestRequestMethod} from '../../../core/data/rest-request-method';
|
||||||
import { CreateData, CreateDataImpl } from '../../../core/data/base/create-data';
|
import {CreateData, CreateDataImpl} from '../../../core/data/base/create-data';
|
||||||
import { LdnServiceConstrain } from '../ldn-services-model/ldn-service.constrain.model';
|
import {LdnServiceConstrain} from '../ldn-services-model/ldn-service.constrain.model';
|
||||||
import { getFirstCompletedRemoteData } from '../../../core/shared/operators';
|
import {getFirstCompletedRemoteData} from '../../../core/shared/operators';
|
||||||
import { hasValue } from '../../../shared/empty.util';
|
import {hasValue} from '../../../shared/empty.util';
|
||||||
import { SearchDataImpl } from '../../../core/data/base/search-data';
|
import {SearchDataImpl} from '../../../core/data/base/search-data';
|
||||||
import { RequestParam } from '../../../core/cache/models/request-param.model';
|
import {RequestParam} from '../../../core/cache/models/request-param.model';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A service responsible for fetching/sending data from/to the REST API on the ldnservices endpoint
|
* A service responsible for fetching/sending data from/to the REST API on the ldnservices endpoint
|
||||||
@@ -92,7 +92,7 @@ export class LdnServicesService extends IdentifiableDataService<LdnService> impl
|
|||||||
|
|
||||||
findByInboundPattern(pattern: string, options?: FindListOptions, useCachedVersionIfAvailable?: boolean, reRequestOnStale?: boolean, ...linksToFollow: FollowLinkConfig<LdnService>[]): Observable<RemoteData<PaginatedList<LdnService>>> {
|
findByInboundPattern(pattern: string, options?: FindListOptions, useCachedVersionIfAvailable?: boolean, reRequestOnStale?: boolean, ...linksToFollow: FollowLinkConfig<LdnService>[]): Observable<RemoteData<PaginatedList<LdnService>>> {
|
||||||
const params = [new RequestParam('pattern', pattern)];
|
const params = [new RequestParam('pattern', pattern)];
|
||||||
const findListOptions = Object.assign(new FindListOptions(), options, { searchParams: params });
|
const findListOptions = Object.assign(new FindListOptions(), options, {searchParams: params});
|
||||||
return this.searchData.searchBy(this.findByPatternEndpoint, findListOptions, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow);
|
return this.searchData.searchBy(this.findByPatternEndpoint, findListOptions, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -28,7 +28,8 @@
|
|||||||
<td>{{ ldnService.description }}</td>
|
<td>{{ ldnService.description }}</td>
|
||||||
<td>
|
<td>
|
||||||
<span (click)="toggleStatus(ldnService, ldnServicesService)"
|
<span (click)="toggleStatus(ldnService, ldnServicesService)"
|
||||||
[ngClass]="{ 'status-enabled': ldnService.enabled, 'status-disabled': !ldnService.enabled }" [title]="ldnService.enabled ? ('ldn-service.overview.table.clickToDisable' | translate) : ('ldn-service.overview.table.clickToEnable' | translate)"
|
[ngClass]="{ 'status-enabled': ldnService.enabled, 'status-disabled': !ldnService.enabled }"
|
||||||
|
[title]="ldnService.enabled ? ('ldn-service.overview.table.clickToDisable' | translate) : ('ldn-service.overview.table.clickToEnable' | translate)"
|
||||||
class="status-indicator">
|
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>
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import {ComponentFixture, TestBed} from '@angular/core/testing';
|
||||||
import { LdnServicesOverviewComponent } from './ldn-services-directory.component';
|
import {LdnServicesOverviewComponent} from './ldn-services-directory.component';
|
||||||
import { ChangeDetectorRef, EventEmitter } from '@angular/core';
|
import {ChangeDetectorRef, EventEmitter} from '@angular/core';
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
import {NotificationsService} from '../../../shared/notifications/notifications.service';
|
||||||
import { NotificationsServiceStub } from '../../../shared/testing/notifications-service.stub';
|
import {NotificationsServiceStub} from '../../../shared/testing/notifications-service.stub';
|
||||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
import {TranslateModule, TranslateService} from '@ngx-translate/core';
|
||||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
import {NgbModal} from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { LdnServicesService } from '../ldn-services-data/ldn-services-data.service';
|
import {LdnServicesService} from '../ldn-services-data/ldn-services-data.service';
|
||||||
import { PaginationService } from '../../../core/pagination/pagination.service';
|
import {PaginationService} from '../../../core/pagination/pagination.service';
|
||||||
import { PaginationServiceStub } from '../../../shared/testing/pagination-service.stub';
|
import {PaginationServiceStub} from '../../../shared/testing/pagination-service.stub';
|
||||||
import { of } from 'rxjs';
|
import {of} from 'rxjs';
|
||||||
|
|
||||||
describe('LdnServicesOverviewComponent', () => {
|
describe('LdnServicesOverviewComponent', () => {
|
||||||
let component: LdnServicesOverviewComponent;
|
let component: LdnServicesOverviewComponent;
|
||||||
@@ -26,17 +26,17 @@ describe('LdnServicesOverviewComponent', () => {
|
|||||||
imports: [TranslateModule.forRoot()],
|
imports: [TranslateModule.forRoot()],
|
||||||
declarations: [LdnServicesOverviewComponent],
|
declarations: [LdnServicesOverviewComponent],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: LdnServicesService, useValue: {} },
|
{provide: LdnServicesService, useValue: {}},
|
||||||
{ provide: PaginationService, useValue: new PaginationServiceStub() },
|
{provide: PaginationService, useValue: new PaginationServiceStub()},
|
||||||
{
|
{
|
||||||
provide: NgbModal, useValue: {
|
provide: NgbModal, useValue: {
|
||||||
open: () => {/*comment*/
|
open: () => {/*comment*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ provide: ChangeDetectorRef, useValue: {} },
|
{provide: ChangeDetectorRef, useValue: {}},
|
||||||
{ provide: NotificationsService, useValue: NotificationsServiceStub },
|
{provide: NotificationsService, useValue: NotificationsServiceStub},
|
||||||
{ provide: TranslateService, useValue: translateServiceStub },
|
{provide: TranslateService, useValue: translateServiceStub},
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
@@ -7,21 +7,21 @@ import {
|
|||||||
TemplateRef,
|
TemplateRef,
|
||||||
ViewChild
|
ViewChild
|
||||||
} from '@angular/core';
|
} 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 { map, 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 { Operation } from 'fast-json-patch';
|
import {Operation} from 'fast-json-patch';
|
||||||
import { getFirstCompletedRemoteData } from '../../../core/shared/operators';
|
import {getFirstCompletedRemoteData} from '../../../core/shared/operators';
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
import {NotificationsService} from '../../../shared/notifications/notifications.service';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import {TranslateService} from '@ngx-translate/core';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
import { autoserialize, deserialize, inheritSerialization } from 'cerialize';
|
import {autoserialize, deserialize, inheritSerialization} from 'cerialize';
|
||||||
import { LDN_SERVICE_CONSTRAINT_FILTER } from './ldn-service.resource-type';
|
import {LDN_SERVICE_CONSTRAINT_FILTER} from './ldn-service.resource-type';
|
||||||
import { CacheableObject } from '../../../core/cache/cacheable-object.model';
|
import {CacheableObject} from '../../../core/cache/cacheable-object.model';
|
||||||
import { typedObject } from '../../../core/cache/builders/build-decorators';
|
import {typedObject} from '../../../core/cache/builders/build-decorators';
|
||||||
import { excludeFromEquals } from '../../../core/utilities/equals.decorators';
|
import {excludeFromEquals} from '../../../core/utilities/equals.decorators';
|
||||||
import { ResourceType } from '../../../core/shared/resource-type';
|
import {ResourceType} from '../../../core/shared/resource-type';
|
||||||
|
|
||||||
/** A single filter value and its properties. */
|
/** A single filter value and its properties. */
|
||||||
@typedObject
|
@typedObject
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { autoserialize } from 'cerialize';
|
import {autoserialize} from 'cerialize';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* notify service patterns
|
* notify service patterns
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
* Needs to be in a separate file to prevent circular
|
* Needs to be in a separate file to prevent circular
|
||||||
* dependencies in webpack.
|
* dependencies in webpack.
|
||||||
*/
|
*/
|
||||||
import { ResourceType } from '../../../core/shared/resource-type';
|
import {ResourceType} from '../../../core/shared/resource-type';
|
||||||
|
|
||||||
export const LDN_SERVICE = new ResourceType('ldnservice');
|
export const LDN_SERVICE = new ResourceType('ldnservice');
|
||||||
export const LDN_SERVICE_CONSTRAINT_FILTERS = new ResourceType('itemfilters');
|
export const LDN_SERVICE_CONSTRAINT_FILTERS = new ResourceType('itemfilters');
|
||||||
|
@@ -1,10 +1,10 @@
|
|||||||
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, deserializeAs, inheritSerialization } 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';
|
import {NotifyServicePattern} from './ldn-service-patterns.model';
|
||||||
|
|
||||||
|
|
||||||
/** An LdnService and its properties. */
|
/** An LdnService and its properties. */
|
||||||
|
Reference in New Issue
Block a user