dmp advanced editor changed to remain at the same page when saving

This commit is contained in:
Diamantis Tziotzios 2019-12-11 16:51:03 +02:00
parent bd8120362d
commit 16d57bd0ad
231 changed files with 3192 additions and 1942 deletions

View File

@ -1,31 +1,31 @@
import { OverlayModule } from '@angular/cdk/overlay';
import { HttpClient, HttpClientModule } from '@angular/common/http';
import { LOCALE_ID, NgModule } from '@angular/core';
import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE } from '@angular/material/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MatMomentDateModule, MAT_MOMENT_DATE_FORMATS } from '@angular/material-moment-adapter';
import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE } from '@angular/material/core';
import { BrowserModule, Title } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { AppRoutingModule } from '@app/app-routing.module';
import { AppComponent } from '@app/app.component';
import { CoreServiceModule } from '@app/core/core-service.module';
import { CultureService } from '@app/core/services/culture/culture-service';
import { NotificationModule } from '@app/library/notification/notification.module';
import { LoginModule } from '@app/ui/auth/login/login.module';
import { DatasetCreateWizardModule } from '@app/ui/dataset-create-wizard/dataset-create-wizard.module';
import { BreadcrumbModule } from '@app/ui/misc/breadcrumb/breadcrumb.module';
import { HelpContentModule } from '@app/ui/misc/help-content/help-content.module';
import { NavigationModule } from '@app/ui/misc/navigation/navigation.module';
import { NavbarModule } from '@app/ui/navbar/navbar.module';
import { SidebarModule } from '@app/ui/sidebar/sidebar.module';
import { MomentUtcDateAdapter } from '@common/date/moment-utc-date-adapter';
import { CommonHttpModule } from '@common/http/common-http.module';
import { CommonUiModule } from '@common/ui/common-ui.module';
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { MomentUtcDateAdapter } from './common/date/moment-utc-date-adapter';
import { CommonHttpModule } from './common/http/common-http.module';
import { CommonUiModule } from './common/ui/common-ui.module';
import { CoreServiceModule } from './core/core-service.module';
import { CultureService } from './core/services/culture/culture-service';
import { NotificationModule } from './library/notification/notification.module';
import { BreadcrumbModule } from './ui/misc/breadcrumb/breadcrumb.module';
import { HelpContentModule } from './ui/misc/help-content/help-content.module';
import { NavigationModule } from './ui/misc/navigation/navigation.module';
import { LoginModule } from './ui/auth/login/login.module';
import { ReactiveFormsModule, FormsModule } from '@angular/forms';
import { DatasetCreateWizardModule } from './ui/dataset-create-wizard/dataset-create-wizard.module';
import { NavbarModule } from './ui/navbar/navbar.module';
import { SidebarModule } from './ui/sidebar/sidebar.module';
import { NgcCookieConsentModule, NgcCookieConsentConfig } from 'ngx-cookieconsent';
import { CookieService } from "ngx-cookie-service";
import { environment } from '../environments/environment';
import { environment } from 'environments/environment';
import { CookieService } from 'ngx-cookie-service';
import { NgcCookieConsentConfig, NgcCookieConsentModule } from 'ngx-cookieconsent';
// AoT requires an exported function for factories
export function HttpLoaderFactory(http: HttpClient) {

View File

@ -1,32 +0,0 @@
import { AbstractControl, FormGroup, ValidatorFn, Validators } from '@angular/forms';
import { ValidationErrorModel } from './error-model/validation-error-model';
export function BackendErrorValidator(errorModel: ValidationErrorModel, propertyName: string): ValidatorFn {
return (control: AbstractControl): { [key: string]: any } => {
const error: String = errorModel.getError(propertyName);
return error ? { 'backendError': { message: error } } : null;
};
}
export function E164PhoneValidator(): ValidatorFn {
return Validators.pattern('^\\+?[1-9]\\d{1,14}$');
}
// Getter is required because the index of each element is not fixed (array does not always follow LIFO)
export function BackendArrayErrorValidator(errorModel: ValidationErrorModel, propertyNameGetter: () => string): ValidatorFn {
return (control: AbstractControl): { [key: string]: any } => {
const error: String = errorModel.getError(propertyNameGetter());
return error ? { 'backendError': { message: error } } : null;
};
}
export function CustomErrorValidator(errorModel: ValidationErrorModel, propertyNames: string[]): ValidatorFn {
return (control: AbstractControl): { [key: string]: any } => {
const error: String = errorModel.getErrors(propertyNames);
return error ? { 'customError': { message: error } } : null;
};
}
export function PasswordMatchValidator(formGroup: FormGroup) {
return formGroup.get('password').value === formGroup.get('passwordConfirm').value ? null : { 'passwordMismatch': true };
}

View File

@ -1,5 +1,5 @@
import { ValidationErrorModel } from "../../../common/forms/validation/error-model/validation-error-model";
import { FormGroup, FormBuilder, Validators } from "@angular/forms";
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model';
export interface ContactEmail {
subject: string;
@ -19,8 +19,8 @@ export class ContactEmailFormModel {
buildForm(): FormGroup {
const formGroup = new FormBuilder().group({
subject: [ this.subject, [Validators.required] ],
description: [ this.description, [Validators.required] ]
subject: [this.subject, [Validators.required]],
description: [this.description, [Validators.required]]
});
return formGroup;
}

View File

@ -1,5 +1,3 @@
import { Serializable } from "../../../common/types/json/serializable";
export interface DashboardStatisticsModel {
totalDataManagementPlanCount: number;
totalGrantCount: number;

View File

@ -1,9 +1,9 @@
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
import { BackendErrorValidator } from "../../../../common/forms/validation/custom-validator";
import { ValidationErrorModel } from "../../../../common/forms/validation/error-model/validation-error-model";
import { ValidationContext } from "../../../../common/forms/validation/validation-context";
import { DatasetProfileModel } from "../../dataset/dataset-profile";
import { DmpModel } from "../dmp";
import { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile';
import { DmpModel } from '@app/core/model/dmp/dmp';
import { BackendErrorValidator } from '@common/forms/validation/custom-validator';
import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model';
import { ValidationContext } from '@common/forms/validation/validation-context';
export class DmpCreateWizardFormModel {
dmp: DmpModel;

View File

@ -1,5 +1,5 @@
import { FormBuilder, FormGroup } from '@angular/forms';
import { Serializable } from '../../../../common/types/json/serializable';
import { Serializable } from '@common/types/json/serializable';
export class DmpInvitationUser implements Serializable<DmpInvitationUser> {

View File

@ -1,21 +1,18 @@
import { of as observableOf, throwError as observableThrowError, Observable } from 'rxjs';
import { map, catchError, takeUntil } from 'rxjs/operators';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { MatSnackBar } from '@angular/material/snack-bar';
import { Router } from '@angular/router';
import { Credential } from '@app/core/model/auth/credential';
import { LoginInfo } from '@app/core/model/auth/login-info';
import { Principal } from '@app/core/model/auth/Principal';
import { ConfigurableProvider } from '@app/core/model/configurable-provider/configurableProvider';
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
import { BaseService } from '@common/base/base.service';
import { TranslateService } from '@ngx-translate/core';
import { environment } from '../../../../environments/environment';
import { SnackBarNotificationComponent } from '../../../library/notification/snack-bar/snack-bar-notification.component';
import { BaseService } from '../../common/base/base.service';
import { Credential } from '../../model/auth/credential';
import { LoginInfo } from '../../model/auth/login-info';
import { Principal } from '../../model/auth/Principal';
import { UiNotificationService, SnackBarNotificationLevel } from '../notification/ui-notification-service';
import { ConfigurableProvider } from "../../model/configurable-provider/configurableProvider";
import { environment } from 'environments/environment';
import { Observable, of as observableOf, throwError as observableThrowError } from 'rxjs';
import { catchError, map, takeUntil } from 'rxjs/operators';
@Injectable()
export class AuthService extends BaseService {

View File

@ -1,19 +1,19 @@
import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { DatasetProfile } from '@app/core/model/admin/dataset-profile/dataset-profile';
import { DataTableData } from '@app/core/model/data-table/data-table-data';
import { DataTableRequest } from '@app/core/model/data-table/data-table-request';
import { DatasetProfileDefinitionModel } from '@app/core/model/dataset-profile-definition/dataset-profile-definition';
import { DatasetListingModel } from '@app/core/model/dataset/dataset-listing';
import { DatasetProfileCriteria } from '@app/core/query/dataset-profile/dataset-profile-criteria';
import { BaseHttpService } from '@app/core/services/http/base-http.service';
import { DatasetProfileEditorModel } from '@app/ui/admin/dataset-profile/editor/dataset-profile-editor-model';
import { BaseService } from '@common/base/base.service';
import { BaseHttpParams } from '@common/http/base-http-params';
import { InterceptorType } from '@common/http/interceptors/interceptor-type';
import { environment } from 'environments/environment';
import { Observable } from 'rxjs';
import { takeUntil } from "rxjs/operators";
import { environment } from '../../../../environments/environment';
import { BaseHttpParams } from '../../../common/http/base-http-params';
import { InterceptorType } from '../../../common/http/interceptors/interceptor-type';
import { DatasetProfileEditorModel } from '../../../ui/admin/dataset-profile/editor/dataset-profile-editor-model';
import { BaseService } from "../../common/base/base.service";
import { DatasetProfile } from '../../model/admin/dataset-profile/dataset-profile';
import { DataTableData } from '../../model/data-table/data-table-data';
import { DataTableRequest } from '../../model/data-table/data-table-request';
import { DatasetProfileDefinitionModel } from '../../model/dataset-profile-definition/dataset-profile-definition';
import { DatasetListingModel } from '../../model/dataset/dataset-listing';
import { DatasetProfileCriteria } from '../../query/dataset-profile/dataset-profile-criteria';
import { BaseHttpService } from '../http/base-http.service';
@Injectable()
export class DatasetProfileService extends BaseService {

View File

@ -2,8 +2,8 @@ import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { environment } from '../../../../environments/environment';
import { BaseHttpParams } from '../../../common/http/base-http-params';
import { InterceptorType } from '../../../common/http/interceptors/interceptor-type';
import { BaseHttpParams } from '../../../../common/http/base-http-params';
import { InterceptorType } from '../../../../common/http/interceptors/interceptor-type';
import { DatasetProfileDefinitionModel } from '../../model/dataset-profile-definition/dataset-profile-definition';
import { DatasetProfileModel } from '../../model/dataset/dataset-profile';
import { DatasetWizardModel } from '../../model/dataset/dataset-wizard';

View File

@ -10,8 +10,8 @@ import { RequestItem } from '../../query/request-item';
import { DataTableData } from '../../model/data-table/data-table-data';
import { DmpProfileCriteria } from '../../query/dmp/dmp-profile-criteria';
import { DatasetListingModel } from '../../model/dataset/dataset-listing';
import { BaseHttpParams } from '../../../common/http/base-http-params';
import { InterceptorType } from '../../../common/http/interceptors/interceptor-type';
import { BaseHttpParams } from '../../../../common/http/base-http-params';
import { InterceptorType } from '../../../../common/http/interceptors/interceptor-type';
import { DmpProfileExternalAutocompleteCriteria } from '../../query/dmp/dmp-profile-external-autocomplete-criteria';
@Injectable()

View File

@ -2,8 +2,8 @@ import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { environment } from '../../../../environments/environment';
import { BaseHttpParams } from '../../../common/http/base-http-params';
import { InterceptorType } from '../../../common/http/interceptors/interceptor-type';
import { BaseHttpParams } from '../../../../common/http/base-http-params';
import { InterceptorType } from '../../../../common/http/interceptors/interceptor-type';
import { DynamicFieldGrantCriteria } from '../../../models/dynamic-field-grant/DynamicFieldGrantCriteria';
import { DataTableData } from '../../model/data-table/data-table-data';
import { DataTableRequest } from '../../model/data-table/data-table-request';

View File

@ -4,8 +4,8 @@ import { Observable } from 'rxjs';
import { environment } from '../../../../environments/environment';
import { ContentFile } from '../../model/grant/grant-listing';
import { BaseHttpService } from '../http/base-http.service';
import { BaseHttpParams } from '../../../common/http/base-http-params';
import { InterceptorType } from '../../../common/http/interceptors/interceptor-type';
import { BaseHttpParams } from '../../../../common/http/base-http-params';
import { InterceptorType } from '../../../../common/http/interceptors/interceptor-type';
@Injectable()
export class GrantFileUploadService {

View File

@ -1,9 +1,9 @@
import { NgModule } from '@angular/core';
import { CommonFormsModule } from '../../common/forms/common-forms.module';
import { CommonUiModule } from '../../common/ui/common-ui.module';
import { MultipleAutoCompleteComponent } from './multiple/multiple-auto-complete.component';
import { SingleAutoCompleteComponent } from './single/single-auto-complete.component';
import { FormattingModule } from '../../core/formatting.module';
import { FormattingModule } from '@app/core/formatting.module';
import { MultipleAutoCompleteComponent } from '@app/library/auto-complete/multiple/multiple-auto-complete.component';
import { SingleAutoCompleteComponent } from '@app/library/auto-complete/single/single-auto-complete.component';
import { CommonFormsModule } from '@common/forms/common-forms.module';
import { CommonUiModule } from '@common/ui/common-ui.module';
@NgModule({

View File

@ -1,17 +1,20 @@
import { TemplateRef } from '@angular/core';
import { Observable } from 'rxjs';
import { AutoCompleteGroup } from '../auto-complete-group';
export interface MultipleAutoCompleteConfiguration {
// Delay for performing the request. Default: 200ms.
requestDelay?: number;
// Min characters for the filtering to be applied. Default: 1.
// Min characters for the filtering to be applied. Default: 3.
minFilteringChars?: number;
// Load and present items from start, without user query. Default: true.
loadDataOnStart?: boolean;
// Static or initial items.
initialItems?: (excludedItems: any[]) => Observable<any[]>;
initialItems?: (excludedItems: any[], data?: any) => Observable<any[]>;
// Data retrieval function
filterFn?: (searchQuery: string, excludedItems: any[]) => Observable<any[]>;
// Get selected items. Used when valueAssign is used so the full object can be retrieved for presentation.
getSelectedItems?: (selectedItems: any[]) => Observable<any[]>;
// Property formating for input
displayFn?: (item: any) => string;
// Function to group results in the drop down
@ -20,6 +23,15 @@ export interface MultipleAutoCompleteConfiguration {
titleFn?: (item: any) => string;
// Display function for the drop down subtitle
subtitleFn?: (item: any) => string;
//Extra data passed to query function
extraData?: any;
// Callback to intercept value assignment based on item selection
valueAssign?: (selectedItem: any) => any;
// Property formating template
optionTemplate?: TemplateRef<any>;
// Selected value formating template
selectedValueTemplate?: TemplateRef<any>;
autoSelectFirstOptionOnBlur?: boolean;
}

View File

@ -1,28 +1,57 @@
<div class="row multiple-auto-complete">
<mat-chip-list #chipList ngDefaultControl class="col multi-chip-list" [disabled]="disabled">
<mat-chip *ngFor="let selectedItem of (_chipItems() | jsonParser)" [disabled]="disabled" [selectable]="selectable" [removable]="removable" (removed)="_removeSelectedItem(selectedItem)" class="chip">
{{this._displayFn(selectedItem)}}
<mat-icon matChipRemove *ngIf="!disabled && removable">cancel</mat-icon>
</mat-chip>
<input matInput #textInput autocomplete="off" (focus)="_onInputFocus()" [disabled]="disabled" [placeholder]="placeholder" [ngModel]="_inputValue" (ngModelChange)="_inputValueChange($event)" [matAutocomplete]="auto" [matChipInputFor]="chipList" [matChipInputSeparatorKeyCodes]="separatorKeysCodes" [matChipInputAddOnBlur]="addOnBlur" (matChipInputTokenEnd)="_addItem($event)" (click)="_onInputClick($event)" />
<div class="row multiple-auto-complete" ngForm>
<mat-chip-list class="col-auto" #chipList ngDefaultControl>
<ng-container *ngIf="value as values">
<mat-chip *ngFor="let value of values" [disabled]="disabled" [selectable]="selectable" [removable]="removable">
<ng-container *ngIf="_selectedItems.get(stringify(value)) as selectedItem">
<ng-template #cellTemplate *ngIf="_selectedValueTemplate(selectedItem)" [ngTemplateOutlet]="_selectedValueTemplate(selectedItem)" [ngTemplateOutletContext]="{
item: selectedItem
}"></ng-template>
<div *ngIf="!_selectedValueTemplate(selectedItem)">{{_displayFn(selectedItem)}}</div>
<mat-icon matChipRemove *ngIf="!disabled && removable" (click)="_removeSelectedItem(_selectedItems.get(stringify(value)), $event)">cancel</mat-icon>
</ng-container>
</mat-chip>
</ng-container>
</mat-chip-list>
<mat-progress-spinner mode="indeterminate" class="multi-loading-bar col-auto" [class.not-loading]="!loading" [diameter]="22"></mat-progress-spinner>
<mat-autocomplete [panelWidth]="auto" class="panel-width" #auto="matAutocomplete" [displayWith]="_displayFn.bind(this)" (optionSelected)="_optionSelected($event)">
<input matInput #autocompleteInput class="col" #autocompleteTrigger="matAutocompleteTrigger" [placeholder]="placeholder" [matAutocomplete]="autocomplete" [value]="inputValue" (keyup)="onKeyUp($event)" [disabled]="disabled" (focus)="_onInputFocus()" (blur)="onBlur($event)" [matChipInputFor]="chipList" [matChipInputSeparatorKeyCodes]="separatorKeysCodes" [matChipInputAddOnBlur]="autoSelectFirstOptionOnBlur" (matChipInputTokenEnd)="_addItem($event)">
<mat-icon *ngIf="!disabled" class="align-arrow-right" matSuffix>keyboard_arrow_down</mat-icon>
<mat-autocomplete #autocomplete="matAutocomplete" [displayWith]="_displayFn.bind(this)" (optionSelected)="_optionSelected($event)">
<span *ngIf="_groupedItems">
<mat-optgroup *ngFor="let group of _groupedItems | async" [label]="group.title">
<mat-option *ngFor="let item of group.items" [value]="item" [class.two-line-mat-option]="_subtitleFn(item)">
<span>{{_titleFn(item)}}</span>
<br *ngIf="_subtitleFn(item)">
<small *ngIf="_subtitleFn(item)">{{_subtitleFn(item)}}</small>
<mat-option *ngFor="let item of group.items" [value]="item" [class.two-line-mat-option]="_subtitleFn(item) && !_optionTemplate(item)">
<!-- <img style="vertical-align:middle;" aria-hidden src="{{state.flag}}" height="25" /> -->
<ng-template #cellTemplate *ngIf="_optionTemplate(item)" [ngTemplateOutlet]="_optionTemplate(item)" [ngTemplateOutletContext]="{
item: item
}"></ng-template>
<div *ngIf="!_optionTemplate(item)">
<span>{{_titleFn(item)}}</span>
<br *ngIf="_subtitleFn(item)">
<small *ngIf="_subtitleFn(item)">{{_subtitleFn(item)}}</small>
</div>
</mat-option>
</mat-optgroup>
</span>
<span *ngIf="!_groupedItems">
<mat-option *ngFor="let item of _items | async" [value]="item" [class.two-line-mat-option]="_subtitleFn(item)">
<span>{{_titleFn(item)}}</span>
<br *ngIf="_subtitleFn(item)">
<small *ngIf="_subtitleFn(item)">{{_subtitleFn(item)}}</small>
</mat-option>
<div *ngIf="_items | async as autocompleteItems; else loading">
<ng-container *ngIf="autocompleteItems.length; else noItems">
<mat-option *ngFor="let item of autocompleteItems" [value]="item" [class.two-line-mat-option]="_subtitleFn(item) && !_optionTemplate(item)">
<!-- <img style="vertical-align:middle;" aria-hidden src="{{state.flag}}" height="25" /> -->
<ng-template #cellTemplate *ngIf="_optionTemplate(item)" [ngTemplateOutlet]="_optionTemplate(item)" [ngTemplateOutletContext]="{
item: item
}"></ng-template>
<div *ngIf="!_optionTemplate(item)">
<span *ngIf="!_optionTemplate(item)">{{_titleFn(item)}}</span>
<br *ngIf="_subtitleFn(item)">
<small *ngIf="_subtitleFn(item)">{{_subtitleFn(item)}}</small>
</div>
</mat-option>
</ng-container>
<ng-template #noItems>
<mat-option disabled="true">No results found!</mat-option>
</ng-template>
</div>
<ng-template #loading>
<mat-option disabled="true">loading...</mat-option>
</ng-template>
</span>
</mat-autocomplete>
</div>
</div>

View File

@ -1,32 +1,21 @@
.multiple-auto-complete {
margin-left: inherit;
margin-right: inherit;
margin-left: inherit;
margin-right: inherit;
.multi-chip-list {
padding-left: 0;
.not-loading {
display: none;
}
.chip {
border-radius: 2em !important;
height: auto !important;
min-width: fit-content !important;
}
}
.align-arrow-right {
position: absolute;
right: 0;
vertical-align: middle;
}
.multi-loading-bar {
padding-right: 0;
padding-left: 0;
}
.not-loading {
display: none;
}
}
.two-line-mat-option {
// height: 3.5em;
line-height: 1.2em;
}
::ng-deep .mat-autocomplete-panel.panel-width {
max-width: 78vw !important;
height: 3.5em;
line-height: 1.2em;
}

View File

@ -1,15 +1,25 @@
import { FocusMonitor } from '@angular/cdk/a11y';
import { COMMA, ENTER } from '@angular/cdk/keycodes';
import { Component, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Optional, Output, Self, ViewChild } from '@angular/core';
import { ControlValueAccessor, NgControl } from '@angular/forms';
import { MatAutocompleteSelectedEvent, MatAutocompleteTrigger } from '@angular/material/autocomplete';
import { MatChipInputEvent } from '@angular/material/chips';
import { Component, DoCheck, ElementRef, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Optional, Output, Self, SimpleChanges, TemplateRef, ViewChild } from '@angular/core';
import { ControlValueAccessor, FormGroupDirective, NgControl, NgForm } from '@angular/forms';
import { ErrorStateMatcher, MatChipInputEvent, mixinErrorState } from '@angular/material';
import { MatAutocomplete, MatAutocompleteSelectedEvent, MatAutocompleteTrigger } from '@angular/material/autocomplete';
import { MatFormFieldControl } from '@angular/material/form-field';
import { AutoCompleteGroup } from '@app/library/auto-complete/auto-complete-group';
import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/multiple/multiple-auto-complete-configuration';
import { BaseComponent } from '@common/base/base.component';
import { Observable, of as observableOf, Subject } from 'rxjs';
import { debounceTime, distinctUntilChanged, map, mergeMap, startWith, tap } from 'rxjs/operators';
import { AutoCompleteGroup } from '../auto-complete-group';
import { MultipleAutoCompleteConfiguration } from './multiple-auto-complete-configuration';
import { switchMap } from 'rxjs/internal/operators/switchMap';
import { debounceTime, distinctUntilChanged, map, mergeMap, startWith, takeUntil } from 'rxjs/operators';
export class CustomComponentBase extends BaseComponent {
constructor(
public _defaultErrorStateMatcher: ErrorStateMatcher,
public _parentForm: NgForm,
public _parentFormGroup: FormGroupDirective,
public ngControl: NgControl
) { super(); }
}
export const _CustomComponentMixinBase = mixinErrorState(CustomComponentBase);
@Component({
selector: 'app-multiple-auto-complete',
@ -17,40 +27,39 @@ import { switchMap } from 'rxjs/internal/operators/switchMap';
styleUrls: ['./multiple-auto-complete.component.scss'],
providers: [{ provide: MatFormFieldControl, useExisting: MultipleAutoCompleteComponent }]
})
export class MultipleAutoCompleteComponent implements OnInit, MatFormFieldControl<string>, ControlValueAccessor, OnDestroy {
export class MultipleAutoCompleteComponent extends _CustomComponentMixinBase implements OnInit, MatFormFieldControl<string>, ControlValueAccessor, OnDestroy, DoCheck, OnChanges {
static nextId = 0;
@ViewChild('autocomplete', { static: true }) autocomplete: MatAutocomplete;
@ViewChild('autocompleteTrigger', { static: true }) autocompleteTrigger: MatAutocompleteTrigger;
@ViewChild('autocompleteInput', { static: true }) autocompleteInput: ElementRef;
separatorKeysCodes = [ENTER, COMMA];
@Input()
get configuration(): MultipleAutoCompleteConfiguration { return this._configuration; }
set configuration(configuration: MultipleAutoCompleteConfiguration) {
this._configuration = configuration;
}
private _configuration: MultipleAutoCompleteConfiguration;
@Input() configuration: MultipleAutoCompleteConfiguration;
// Selected Option Event
@Output() optionSelected: EventEmitter<any> = new EventEmitter();
// Removed Option Event
@Output() optionRemoved: EventEmitter<any> = new EventEmitter();
id = `multiple-autocomplete-${MultipleAutoCompleteComponent.nextId++}`;
stateChanges = new Subject<void>();
focused = false;
errorState = false;
controlType = 'multiple-autocomplete';
describedBy = '';
_inputValue: string;
inputValue = '';
_inputSubject = new Subject<string>();
loading = false;
_items: Observable<any[]>;
_selectedItems: Map<string, any> = new Map<any, any>();
_groupedItems: Observable<AutoCompleteGroup[]>;
private requestDelay = 200; //ms
private minFilteringChars = 1;
private loadDataOnStart = true;
visible = true;
selectable = true;
selectable = false;
removable = true;
addOnBlur = false;
separatorKeysCodes = [ENTER, COMMA];
get empty() {
return !this._inputValue || this._inputValue.length === 0;
}
get empty() { return (!this.value || this.value.length === 0) && (!this.inputValue || this.inputValue.length === 0); }
get shouldLabelFloat() { return this.focused || !this.empty; }
@ -83,21 +92,22 @@ export class MultipleAutoCompleteComponent implements OnInit, MatFormFieldContro
return this._selectedValue;
}
set value(value: any | null) {
this._selectedValue = value;
this._inputValue = value;
this._selectedValue = (value != null && value.length === 0) ? null : value;
this.stateChanges.next();
}
private _selectedValue;
@ViewChild('textInput', { static: true }) textInput: ElementRef;
@ViewChild(MatAutocompleteTrigger, { static: true }) autocomplete: MatAutocompleteTrigger;
constructor(
private fm: FocusMonitor,
private elRef: ElementRef,
@Optional() @Self() public ngControl: NgControl) {
@Optional() @Self() public ngControl: NgControl,
@Optional() _parentForm: NgForm,
@Optional() _parentFormGroup: FormGroupDirective,
_defaultErrorStateMatcher: ErrorStateMatcher
) {
super(_defaultErrorStateMatcher, _parentForm, _parentFormGroup, ngControl);
fm.monitor(elRef.nativeElement, true).subscribe((origin) => {
fm.monitor(elRef.nativeElement, true).pipe(takeUntil(this._destroyed)).subscribe((origin) => {
this.focused = !!origin;
this.stateChanges.next();
});
@ -109,83 +119,84 @@ export class MultipleAutoCompleteComponent implements OnInit, MatFormFieldContro
}
}
ngOnInit() {
ngOnInit() { }
ngDoCheck(): void {
if (this.ngControl) {
this.updateErrorState();
}
}
ngOnChanges(changes: SimpleChanges) {
if (changes['configuration'] && changes['configuration'].isFirstChange) {
this.getSelectedItems(this.value);
}
}
getSelectedItems(value: any) {
if (value != null && Array.isArray(value) && this.configuration) {
const newSelections = value.filter(x => !this._selectedItems.has(JSON.stringify(x)));
if (newSelections.length > 0 && this.configuration.getSelectedItems != null) {
this.configuration.getSelectedItems(newSelections).pipe(takeUntil(this._destroyed)).subscribe(x => {
x.forEach(element => {
this._selectedItems.set(JSON.stringify(this.configuration.valueAssign != null ? this.configuration.valueAssign(element) : element), element);
});
});
} else {
newSelections.forEach(element => {
this._selectedItems.set(JSON.stringify(this.configuration.valueAssign != null ? this.configuration.valueAssign(element) : element), element);
});
}
}
}
filter(query: string): Observable<any[]> {
// If loadDataOnStart is enabled and query is empty we return the initial items.
if (this.isNullOrEmpty(query) && this.loadDataOnStart) {
return this.configuration.initialItems(this.value || []) || observableOf([]);
return this.configuration.initialItems(this.configuration.extraData) || observableOf([]);
} else if (query && query.length >= this.minFilteringChars) {
if (this.configuration.filterFn) {
return this.configuration.filterFn(query, this.value || []);
return this.configuration.filterFn(query, this.configuration.extraData);
} else {
return this.configuration.initialItems(this.value || []) || observableOf([]);
return this.configuration.initialItems(this.configuration.extraData) || observableOf([]);
}
} else {
return observableOf([]);
}
}
stringify(value: any): string {
return JSON.stringify(value);
}
isNullOrEmpty(query: string): boolean {
return typeof query !== 'string' || query === null || query.length === 0;
}
_displayFn(item: any): string {
if (this.configuration.displayFn && item) { return this.configuration.displayFn(item); }
return item;
}
_titleFn(item: any): string {
if (this.configuration.titleFn && item) { return this.configuration.titleFn(item); }
return item;
}
_subtitleFn(item: any): string {
if (this.configuration.subtitleFn && item) { return this.configuration.subtitleFn(item); }
return null;
}
_requestDelay(): number {
return this.configuration.requestDelay || this.requestDelay;
}
_minFilteringChars(): number {
return this.configuration.minFilteringChars || this.minFilteringChars;
}
_loadDataOnStart(): boolean {
return this.configuration.loadDataOnStart || this.loadDataOnStart;
}
_chipItems(): any[] {
return this.value || [];
}
_arraysEqual(arr1, arr2) {
if (arr1.length !== arr2.length)
return false;
for (var i = arr1.length; i--;) {
if (arr1[i].id !== arr2[i].id)
return false;
}
return true;
}
_optionSelected(event: MatAutocompleteSelectedEvent) {
if (this.configuration.valueAssign) {
const newValue = this.configuration.valueAssign(this.value) || [];
newValue.push(event.option.value);
this._setValue(this.configuration.valueAssign(newValue));
}
else {
const newValue = this.value || [];
newValue.push(event.option.value);
this._setValue(newValue);
this.stateChanges.next();
this.optionSelected.emit(newValue);
this.textInput.nativeElement.value = '';
this.optionSelectedInternal(event.option.value);
this.autocompleteInput.nativeElement.value = '';
}
private optionSelectedInternal(item: any) {
const newValue = this._valueToAssign(item);
//Update selected items
this._selectedItems.set(JSON.stringify(newValue), item);
const newValueArray = (Array.isArray(this.value) ? this.value : []);
newValueArray.push(newValue);
this._setValue(newValueArray);
this.stateChanges.next();
this.optionSelected.emit(item);
}
public onKeyUp(event) {
this.inputValue = event.target.value;
// prevent filtering results if arrow were pressed
if (event.keyCode !== ENTER && (event.keyCode < 37 || event.keyCode > 40)) {
this._inputSubject.next(this.inputValue);
}
}
@ -201,88 +212,39 @@ export class MultipleAutoCompleteComponent implements OnInit, MatFormFieldContro
startWith(null),
debounceTime(this.requestDelay),
distinctUntilChanged(),
tap(() => { this.loading = true; }),
switchMap(query => {
// If its a valid object, a selection just made and the object is set as the value of the form control. That means we should fire an extra request to the server.
if (this._isValidObject(query)) { return observableOf([]); }
// Since the object is changed we need to clear any existing selections, except for the first time.
// if (query !== null) { this.pushChanges(null); }
return this.filter(query);
}),
tap(() => { this.loading = false; }));
distinctUntilChanged(),
mergeMap(query => this.filter(query)));
if (this.configuration.groupingFn) { this._groupedItems = this._items.pipe(map(items => this.configuration.groupingFn(items))); }
}
}
_inputValueChange(value: string) {
this._inputValue = value;
this._inputSubject.next(value);
this.stateChanges.next();
}
_isValidObject(value: any): boolean {
try {
if (!value) { return false; }
if (typeof value !== 'object') { JSON.parse(value); }
} catch (e) {
return false;
}
return true;
}
_removeSelectedItem(item: any): void {
if (this.configuration.valueAssign) {
this.optionRemoved.emit(item);
this.textInput.nativeElement.focus();
}
else {
const index = this.value.indexOf(item);
if (index >= 0) {
this.value.splice(index, 1);
this.optionRemoved.emit(item);
}
this.textInput.nativeElement.focus();
this.pushChanges(this.value);
public onBlur($event: MouseEvent) {
if (this.inputValue && this.inputValue.length > 1 && this.autocomplete.options && this.autocomplete.options.length > 0 && this.autoSelectFirstOptionOnBlur) {
this.optionSelectedInternal(this.autocomplete.options.first.value);
}
}
_onInputClick(item: any) {
if (!this.autocomplete.panelOpen) {
this.autocomplete.openPanel();
}
}
_addItem(event: MatChipInputEvent): void {
// const input = event.input;
// const value = event.value;
// // Add our fruit
// if ((value || '').trim()) {
// this.selectedItems.push(value.trim());
// }
// // Reset the input value
// if (input) {
// input.value = '';
// }
// this.inputFormControl.setValue(null);
}
onChange = (_: any) => { };
onTouched = () => { };
writeValue(value: any): void { this.value = value || ''; }
private _onTouched = () => { };
writeValue(value: any): void {
this.value = Array.isArray(value) ? value : null;
// Update chips observable
this.getSelectedItems(value);
}
pushChanges(value: any) { this.onChange(value); }
registerOnChange(fn: (_: any) => {}): void { this.onChange = fn; }
registerOnTouched(fn: () => {}): void { this.onTouched = fn; }
registerOnTouched(fn: () => {}): void { this._onTouched = fn; }
setDisabledState(isDisabled: boolean): void { this.disabled = isDisabled; }
setDescribedByIds(ids: string[]) {
this.describedBy = ids.join(' ');
}
setDescribedByIds(ids: string[]) { this.describedBy = ids.join(' '); }
onContainerClick(event: MouseEvent) {
if ((event.target as Element).tagName.toLowerCase() !== 'input') {
this.elRef.nativeElement.querySelector('input').focus();
event.stopPropagation();
this._onInputFocus();
if (this.disabled) { return; }
if (!this.autocomplete.isOpen) {
this.autocompleteTrigger.openPanel();
}
}
@ -290,4 +252,80 @@ export class MultipleAutoCompleteComponent implements OnInit, MatFormFieldContro
this.stateChanges.complete();
this.fm.stopMonitoring(this.elRef.nativeElement);
}
}
//Configuration getters
_displayFn(item: any): string {
// console.log('_displayFn' + item);
if (this.configuration.displayFn && item) { return this.configuration.displayFn(item); }
return item;
}
_titleFn(item: any): string {
if (this.configuration.titleFn && item) { return this.configuration.titleFn(item); }
return item;
}
_optionTemplate(item: any): TemplateRef<any> {
if (this.configuration.optionTemplate && item) { return this.configuration.optionTemplate; }
return null;
}
_selectedValueTemplate(item: any): TemplateRef<any> {
if (this.configuration.selectedValueTemplate && item) { return this.configuration.selectedValueTemplate; }
return null;
}
_subtitleFn(item: any): string {
if (this.configuration.subtitleFn && item) { return this.configuration.subtitleFn(item); }
return null;
}
_valueToAssign(item: any): any {
if (this.configuration.valueAssign && item) { return this.configuration.valueAssign(item); }
return item;
}
get requestDelay(): number {
return this.configuration.requestDelay != null ? this.configuration.requestDelay : 200;
}
get minFilteringChars(): number {
return this.configuration.minFilteringChars != null ? this.configuration.minFilteringChars : 1;
}
get loadDataOnStart(): boolean {
return this.configuration.loadDataOnStart != null ? this.configuration.loadDataOnStart : true;
}
get autoSelectFirstOptionOnBlur(): boolean {
return this.configuration.autoSelectFirstOptionOnBlur != null ? this.configuration.autoSelectFirstOptionOnBlur : false;
}
//Chip Functions
_addItem(event: MatChipInputEvent): void {
const input = event.input;
const value = event.value;
// Add our fruit
// if ((value || '').trim()) {
// this.selectedItems.push(value.trim());
// }
// Reset the input value
if (input) {
this.inputValue = '';
}
//this.inputFormControl.setValue(null);
}
_removeSelectedItem(item: any, event: MouseEvent): void {
if (event != null) { event.stopPropagation(); }
const valueToDelete = this._valueToAssign(item);
this.value = this.value.filter(x => JSON.stringify(x) !== JSON.stringify(valueToDelete)); //TODO, maybe we need to implement equality here differently.
this.optionRemoved.emit(item);
//Update chips
this._selectedItems.delete(JSON.stringify(valueToDelete));
this.autocompleteInput.nativeElement.focus();
this.pushChanges(this.value);
}
}

View File

@ -1,3 +1,4 @@
import { TemplateRef } from '@angular/core';
import { Observable } from 'rxjs';
import { AutoCompleteGroup } from '../auto-complete-group';
@ -8,28 +9,29 @@ export interface SingleAutoCompleteConfiguration {
minFilteringChars?: number;
// Load and present items from start, without user query. Default: true.
loadDataOnStart?: boolean;
// Remove item after selection.
removeAfterSelection?: boolean;
// Static or initial items.
initialItems?: (data?: any) => Observable<any[]>;
// Data retrieval function
filterFn?: (searchQuery: string, data?: any) => Observable<any[]>;
// Get selected items. Used when valueAssign is used so the full object can be retrieved for presentation.
getSelectedItem?: (selectedItem: any) => Observable<any>;
// Property formating for input
displayFn?: (item: any) => string;
// Property formating for dropdown
// Function to group results in the drop down
groupingFn?: (items: any[]) => AutoCompleteGroup[];
// Property formating for dropdown
// Display function for the drop down title
titleFn?: (item: any) => string;
// Property formating for dropdown
// Display function for the drop down subtitle
subtitleFn?: (item: any) => string;
// Property formating for icon on chip
iconFn?: (item: any) => string;
// Property for link on chip
linkFn?: (item: any) => string;
// Disable option.
disableOption?: (item: any) => boolean;
//Extra data passed to query function
extraData?: any;
// Callback to intercept value assignment based on item selection
valueAssign?: (selectedItem: any) => any;
// Property formating template
optionTemplate?: TemplateRef<any>;
// Selected value formating template
selectedValueTemplate?: TemplateRef<any>;
autoSelectFirstOptionOnBlur?: boolean;
}

View File

@ -1,32 +1,44 @@
<div class="row auto-complete">
<mat-chip-list #chipList [disabled]="disabled" class="chip-list">
<mat-chip *ngIf="value" [removable]="true" (removed)="chipRemove()" (click)="linkToOption(value)" [ngClass]="{'chip': this._linkFn(value)}">
<mat-icon matChipRemove *ngIf="_iconFn(value)" class="ml-0 mr-1">{{_iconFn(value)}}</mat-icon>
{{_displayFn(value)}}
<mat-icon matChipRemove *ngIf="!disabled">cancel</mat-icon>
</mat-chip>
<input matInput class="col" autocomplete="off" [placeholder]="placeholder" [matAutocomplete]="auto" [ngModel]="_inputValue" (ngModelChange)="_inputValueChange($event)" [disabled]="disabled || (value != null && value !== '')" (focus)="_onInputFocus()" [matChipInputFor]="chipList" [matChipInputSeparatorKeyCodes]="separatorKeysCodes" [matChipInputAddOnBlur]="true">
</mat-chip-list>
<mat-progress-spinner class="progress-loader" mode="indeterminate" [class.not-loading]="!loading" [diameter]="17"></mat-progress-spinner>
<mat-autocomplete [panelWidth]="auto" class="panel-width" #auto="matAutocomplete" [displayWith]="autoCompleteDisplayFn()" (optionSelected)="_optionSelected($event)">
<input matInput #autocompleteInput class="col-12" #autocompleteTrigger="matAutocompleteTrigger" [placeholder]="placeholder" [matAutocomplete]="autocomplete" [value]="inputValue" (keyup)="onKeyUp($event)" [disabled]="disabled" (focus)="_onInputFocus()" (blur)="onBlur($event)">
<mat-icon *ngIf="!disabled" class="align-arrow-right" matSuffix>keyboard_arrow_down</mat-icon>
<mat-autocomplete #autocomplete="matAutocomplete" [displayWith]="_displayFn.bind(this)" (optionSelected)="_optionSelected($event)">
<span *ngIf="_groupedItems">
<mat-optgroup *ngFor="let group of _groupedItems | async" [label]="group.title">
<mat-option *ngFor="let item of group.items" [value]="item" [disabled]="_disableOption(item)" [class.two-line-mat-option]="_subtitleFn(item)">
<mat-option *ngFor="let item of group.items" [value]="item" [class.two-line-mat-option]="_subtitleFn(item) && !_optionTemplate(item)">
<!-- <img style="vertical-align:middle;" aria-hidden src="{{state.flag}}" height="25" /> -->
<span>{{_titleFn(item)}}</span>
<br *ngIf="_subtitleFn(item)">
<small *ngIf="_subtitleFn(item)">{{_subtitleFn(item)}}</small>
<ng-template #cellTemplate *ngIf="_optionTemplate(item)" [ngTemplateOutlet]="_optionTemplate(item)" [ngTemplateOutletContext]="{
item: item
}"></ng-template>
<div *ngIf="!_optionTemplate(item)">
<span>{{_titleFn(item)}}</span>
<br *ngIf="_subtitleFn(item)">
<small *ngIf="_subtitleFn(item)">{{_subtitleFn(item)}}</small>
</div>
</mat-option>
</mat-optgroup>
</span>
<span *ngIf="!_groupedItems">
<mat-option *ngFor="let item of _items | async" [value]="item" [disabled]="_disableOption(item)" [class.two-line-mat-option]="_subtitleFn(item)">
<!-- <img style="vertical-align:middle;" aria-hidden src="{{state.flag}}" height="25" /> -->
<span>{{_titleFn(item)}}</span>
<br *ngIf="_subtitleFn(item)">
<small *ngIf="_subtitleFn(item)">{{_subtitleFn(item)}}</small>
</mat-option>
<div *ngIf="_items | async as autocompleteItems; else loading">
<ng-container *ngIf="autocompleteItems.length; else noItems">
<mat-option *ngFor="let item of autocompleteItems" [value]="item" [class.two-line-mat-option]="_subtitleFn(item) && !_optionTemplate(item)">
<!-- <img style="vertical-align:middle;" aria-hidden src="{{state.flag}}" height="25" /> -->
<ng-template #cellTemplate *ngIf="_optionTemplate(item)" [ngTemplateOutlet]="_optionTemplate(item)" [ngTemplateOutletContext]="{
item: item
}"></ng-template>
<div *ngIf="!_optionTemplate(item)">
<span *ngIf="!_optionTemplate(item)">{{_titleFn(item)}}</span>
<br *ngIf="_subtitleFn(item)">
<small *ngIf="_subtitleFn(item)">{{_subtitleFn(item)}}</small>
</div>
</mat-option>
</ng-container>
<ng-template #noItems>
<mat-option disabled="true">No results found!</mat-option>
</ng-template>
</div>
<ng-template #loading>
<mat-option disabled="true">loading...</mat-option>
</ng-template>
</span>
</mat-autocomplete>
</div>

View File

@ -1,35 +1,60 @@
.auto-complete {
margin-left: inherit;
margin-right: inherit;
margin-left: inherit;
margin-right: inherit;
.not-loading {
display: none;
}
.not-loading {
display: none;
}
.chip-list {
width: 100%;
}
.chip-item {
transition: none;
background-color: transparent;
padding: 0;
box-shadow: none !important;
border-radius: unset;
min-height: auto;
height: auto;
}
.progress-loader {
position: absolute;
right: 0;
}
.chip-list {
width: 100%;
}
.progress-loader {
position: absolute;
right: 0;
}
.align-arrow-right {
position: absolute;
right: 0;
vertical-align: middle;
}
}
.chip-list {
width: auto;
}
.two-line-mat-option {
// height: 3.5em;
line-height: 1.2em;
height: 3.5em;
line-height: 1.2em;
}
.chip {
cursor: pointer;
opacity: 1 !important;
// .two-line-mat-option {
// height: 3.5em;
// line-height: 1.2em;
// }
.mat-standard-chip:hover::after {
opacity: 0;
}
.chip:hover {
background-color: #c5c5c5;
.mat-standard-chip:focus::after {
opacity: 0;
}
::ng-deep .mat-autocomplete-panel.panel-width {
max-width: 78vw !important;
}
// .mat-form-field-type-single-autocomplete:not(.mat-form-field-disabled) .mat-form-field-flex {
// cursor: pointer;
// }

View File

@ -1,52 +1,69 @@
import { FocusMonitor } from '@angular/cdk/a11y';
import { COMMA, ENTER } from '@angular/cdk/keycodes';
import { Component, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Optional, Output, Self } from '@angular/core';
import { ControlValueAccessor, NgControl } from '@angular/forms';
import { MatAutocompleteSelectedEvent } from '@angular/material/autocomplete';
import { ENTER } from '@angular/cdk/keycodes';
import { Component, DoCheck, ElementRef, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Optional, Output, Self, SimpleChanges, TemplateRef, ViewChild } from '@angular/core';
import { ControlValueAccessor, FormGroupDirective, NgControl, NgForm } from '@angular/forms';
import { MatAutocomplete, MatAutocompleteSelectedEvent, MatAutocompleteTrigger } from '@angular/material/autocomplete';
import { ErrorStateMatcher, mixinErrorState } from '@angular/material/core';
import { MatFormFieldControl } from '@angular/material/form-field';
import { AutoCompleteGroup } from '@app/library/auto-complete/auto-complete-group';
import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration';
import { BaseComponent } from '@common/base/base.component';
import { Observable, of as observableOf, Subject } from 'rxjs';
import { debounceTime, distinctUntilChanged, map, mergeMap, startWith, tap } from 'rxjs/operators';
import { AutoCompleteGroup } from '../auto-complete-group';
import { SingleAutoCompleteConfiguration } from './single-auto-complete-configuration';
import { switchMap } from 'rxjs/internal/operators/switchMap';
import { Router } from '@angular/router';
import { debounceTime, distinctUntilChanged, map, mergeMap, startWith, takeUntil } from 'rxjs/operators';
export class CustomComponentBase extends BaseComponent {
constructor(
public _defaultErrorStateMatcher: ErrorStateMatcher,
public _parentForm: NgForm,
public _parentFormGroup: FormGroupDirective,
public ngControl: NgControl
) { super(); }
}
export const _CustomComponentMixinBase = mixinErrorState(CustomComponentBase);
@Component({
selector: 'app-single-auto-complete',
templateUrl: './single-auto-complete.component.html',
styleUrls: ['./single-auto-complete.component.scss'],
providers: [{ provide: MatFormFieldControl, useExisting: SingleAutoCompleteComponent }],
})
export class SingleAutoCompleteComponent implements OnInit, MatFormFieldControl<string>, ControlValueAccessor, OnDestroy {
export class SingleAutoCompleteComponent extends _CustomComponentMixinBase implements OnInit, MatFormFieldControl<string>, ControlValueAccessor, OnDestroy, DoCheck, OnChanges {
static nextId = 0;
@ViewChild('autocomplete', { static: true }) autocomplete: MatAutocomplete;
@ViewChild('autocompleteTrigger', { static: true }) autocompleteTrigger: MatAutocompleteTrigger;
@ViewChild('autocompleteInput', { static: true }) autocompleteInput: ElementRef;
@Input() initialSelectedData: any;
@Input()
get configuration(): SingleAutoCompleteConfiguration { return this._configuration; }
set configuration(configuration: SingleAutoCompleteConfiguration) {
this._configuration = configuration;
//On startup, fill the input with the existing value
if (this.autocompleteInput && this.value) {
this.inputValue = this._displayFn(this.value);
}
}
private _configuration: SingleAutoCompleteConfiguration;
@Input() configuration: SingleAutoCompleteConfiguration;
// Selected Option Event
@Output() optionSelected: EventEmitter<any> = new EventEmitter();
// Removed Option Event
@Output() optionRemoved: EventEmitter<any> = new EventEmitter();
id = `single-autocomplete-${SingleAutoCompleteComponent.nextId++}`;
stateChanges = new Subject<void>();
focused = false;
errorState = false;
controlType = 'single-autocomplete';
describedBy = '';
_inputValue: string;
inputValue = '';
_inputSubject = new Subject<string>();
loading = false;
_items: Observable<any[]>;
_groupedItems: Observable<AutoCompleteGroup[]>;
private requestDelay = 200; //ms
private minFilteringChars = 1;
private loadDataOnStart = true;
separatorKeysCodes: number[] = [ENTER, COMMA];
_selectedItems: Map<string, any> = new Map<any, any>();
get empty() {
return !this._inputValue || this._inputValue.length === 0;
}
get empty() { return (this.value == null) && (!this.inputValue || this.inputValue.length === 0); }
get shouldLabelFloat() { return this.focused || !this.empty; }
@ -80,7 +97,6 @@ export class SingleAutoCompleteComponent implements OnInit, MatFormFieldControl<
}
set value(value: any | null) {
this._selectedValue = value;
this._inputValue = (value && value != "") ? " " : null;
this.stateChanges.next();
}
private _selectedValue;
@ -88,10 +104,14 @@ export class SingleAutoCompleteComponent implements OnInit, MatFormFieldControl<
constructor(
private fm: FocusMonitor,
private elRef: ElementRef,
private router: Router,
@Optional() @Self() public ngControl: NgControl) {
@Optional() @Self() public ngControl: NgControl,
@Optional() _parentForm: NgForm,
@Optional() _parentFormGroup: FormGroupDirective,
_defaultErrorStateMatcher: ErrorStateMatcher
) {
super(_defaultErrorStateMatcher, _parentForm, _parentFormGroup, ngControl);
fm.monitor(elRef.nativeElement, true).subscribe((origin) => {
fm.monitor(elRef.nativeElement, true).pipe(takeUntil(this._destroyed)).subscribe((origin) => {
this.focused = !!origin;
this.stateChanges.next();
});
@ -103,8 +123,43 @@ export class SingleAutoCompleteComponent implements OnInit, MatFormFieldControl<
}
}
ngOnInit() {
ngOnInit() { }
ngDoCheck(): void {
if (this.ngControl) {
this.updateErrorState();
}
}
ngOnChanges(changes: SimpleChanges) {
if (changes['initialSelectedData'] && changes['initialSelectedData'].currentValue && changes['initialSelectedData'].isFirstChange && this.configuration != null) {
this._selectedItems.set(JSON.stringify(this.configuration.valueAssign != null ? this.configuration.valueAssign(this.initialSelectedData) : this.initialSelectedData), this.initialSelectedData);
this.inputValue = this._displayFn(this.initialSelectedData);
}
if (changes['configuration'] && changes['configuration'].isFirstChange) {
if (changes['initialSelectedData'] != null && this.value != null) {
if (this._valueToAssign(this.initialSelectedData) != this.value) { this.getSelectedItems(this.value); }
} else {
this.getSelectedItems(this.value);
}
}
}
getSelectedItems(value: any) {
if (value != null && !this._selectedItems.has(JSON.stringify(value)) && this.configuration) {
if (this.configuration.getSelectedItem != null) {
this.configuration.getSelectedItem(value).pipe(takeUntil(this._destroyed)).subscribe(x => {
if (x != null) {
this._selectedItems.set(JSON.stringify(this.configuration.valueAssign != null ? this.configuration.valueAssign(x) : x), x);
this.inputValue = this._displayFn(x);
}
});
} else {
this._selectedItems.set(JSON.stringify(this.configuration.valueAssign != null ? this.configuration.valueAssign(value) : value), value);
this.inputValue = this._displayFn(value);
}
}
}
filter(query: string): Observable<any[]> {
@ -122,64 +177,40 @@ export class SingleAutoCompleteComponent implements OnInit, MatFormFieldControl<
}
}
stringify(value: any): string {
return JSON.stringify(value);
}
isNullOrEmpty(query: string): boolean {
return typeof query !== 'string' || query === null || query.length === 0;
}
_displayFn(item: any): string {
if (this.configuration.displayFn && item) { return this.configuration.displayFn(item); }
return item;
}
_titleFn(item: any): string {
if (this.configuration.titleFn && item) { return this.configuration.titleFn(item); }
return item;
}
_subtitleFn(item: any): string {
if (this.configuration.subtitleFn && item) { return this.configuration.subtitleFn(item); }
return null;
}
_iconFn(item: any): string {
if (this.configuration.iconFn && item) { return this.configuration.iconFn(item); }
return null;
}
_linkFn(item: any): string {
if (this.configuration.linkFn && item) { return this.configuration.linkFn(item); }
return null;
}
_disableOption(item: any): boolean {
if (this.configuration.disableOption && item) { return this.configuration.disableOption(item); }
return null;
}
_requestDelay(): number {
return this.configuration.requestDelay || this.requestDelay;
}
_minFilteringChars(): number {
return this.configuration.minFilteringChars || this.minFilteringChars;
}
_loadDataOnStart(): boolean {
return this.configuration.loadDataOnStart || this.loadDataOnStart;
}
_optionSelected(event: MatAutocompleteSelectedEvent) {
this._setValue(this.configuration.valueAssign ? this.configuration.valueAssign(event.option.value) : event.option.value);
//this._inputValue = " ";
this.stateChanges.next();
this.optionSelected.emit(event.option.value);
if (this.configuration.removeAfterSelection) {
this.clearAutocomplete()
}
this.inputValue = this._displayFn(event.option.value);
this.optionSelectedInternal(event.option.value);
}
private clearAutocomplete() {
this._setValue(null);
private optionSelectedInternal(item: any) {
const newValue = this._valueToAssign(item);
//Update selected items
this._selectedItems.set(JSON.stringify(newValue), item);
this._setValue(newValue);
this.stateChanges.next();
this.optionSelected.emit(item);
}
public onKeyUp(event) {
this.inputValue = event.target.value;
// prevent filtering results if arrow were pressed
if (event.keyCode !== ENTER && (event.keyCode < 37 || event.keyCode > 40)) {
if (this.inputValue.length === 0 && this.value != null) {
this.optionSelectedInternal(null);
}
this._inputSubject.next(this.inputValue);
}
}
private _setValue(value: any) {
@ -194,72 +225,100 @@ export class SingleAutoCompleteComponent implements OnInit, MatFormFieldControl<
startWith(null),
debounceTime(this.requestDelay),
distinctUntilChanged(),
tap(() => { this.loading = true; }),
switchMap(query => {
// If its a valid object, a selection just made and the object is set as the value of the form control. That means we should fire an extra request to the server.
if (this._isValidObject(query)) { return observableOf([]); }
// Since the object is changed we need to clear any existing selections, except for the first time.
if (query !== null) { this.pushChanges(null); }
return this.filter(query);
}),
tap(() => { this.loading = false; }));
mergeMap(query => this.filter(query)));
if (this.configuration.groupingFn) { this._groupedItems = this._items.pipe(map(items => this.configuration.groupingFn(items))); }
}
}
_inputValueChange(value: string) {
//this._inputValue = value;
this._inputSubject.next(value);
this.stateChanges.next();
}
_isValidObject(value: any): boolean {
try {
if (!value) { return false; }
if (typeof value !== 'object') { JSON.parse(value); }
} catch (e) {
return false;
public onBlur($event: MouseEvent) {
if (this.value != null) {
const inputLabel = this.inputValue;
const selectedLabel = this._displayFn(this._selectedItems.get(JSON.stringify(this.value)));
if (inputLabel && selectedLabel !== inputLabel) {
this.inputValue = selectedLabel;
}
} else if (this.inputValue && this.inputValue.length > 1 && this.autocomplete.options && this.autocomplete.options.length > 0 && this.autoSelectFirstOptionOnBlur) {
this.inputValue = this._displayFn(this.autocomplete.options.first.value);
this.optionSelectedInternal(this.autocomplete.options.first.value);
}
return true;
}
onChange = (_: any) => { };
onTouched = () => { };
writeValue(value: any): void { this.value = value || ''; }
private _onTouched = () => { };
writeValue(value: any): void {
this.value = value;
// Update chips observable
if (value != null) { this.getSelectedItems(value); } else {
if (this.autocompleteInput && this.autocompleteInput.nativeElement && this.autocompleteInput.nativeElement.value) { this.autocompleteInput.nativeElement.value = ''; }
this.inputValue = null;
}
}
pushChanges(value: any) { this.onChange(value); }
registerOnChange(fn: (_: any) => {}): void { this.onChange = fn; }
registerOnTouched(fn: () => {}): void { this.onTouched = fn; }
registerOnTouched(fn: () => {}): void { this._onTouched = fn; }
setDisabledState(isDisabled: boolean): void { this.disabled = isDisabled; }
setDescribedByIds(ids: string[]) {
this.describedBy = ids.join(' ');
}
setDescribedByIds(ids: string[]) { this.describedBy = ids.join(' '); }
onContainerClick(event: MouseEvent) {
if ((event.target as Element).tagName.toLowerCase() !== 'input') {
this.elRef.nativeElement.querySelector('input').focus();
event.stopPropagation();
this._onInputFocus();
if (this.disabled) { return; }
if (!this.autocomplete.isOpen) {
this.autocompleteTrigger.openPanel();
}
}
chipRemove(): void {
this._setValue(null);
this.optionRemoved.emit();
}
linkToOption(value: any): void {
if (this._linkFn(value)) {
this.router.navigate([]).then(result => { window.open(this._linkFn(value), '_blank'); });
}
}
autoCompleteDisplayFn() {
return (val) => "";
}
ngOnDestroy() {
this.stateChanges.complete();
this.fm.stopMonitoring(this.elRef.nativeElement);
}
//Configuration getters
_displayFn(item: any): string {
// console.log('_displayFn' + item);
if (this.configuration.displayFn && item) { return this.configuration.displayFn(item); }
return item;
}
_titleFn(item: any): string {
if (this.configuration.titleFn && item) { return this.configuration.titleFn(item); }
return item;
}
_optionTemplate(item: any): TemplateRef<any> {
if (this.configuration.optionTemplate && item) { return this.configuration.optionTemplate; }
return null;
}
_selectedValueTemplate(item: any): TemplateRef<any> {
if (this.configuration.selectedValueTemplate && item) { return this.configuration.selectedValueTemplate; }
return null;
}
_subtitleFn(item: any): string {
if (this.configuration.subtitleFn && item) { return this.configuration.subtitleFn(item); }
return null;
}
_valueToAssign(item: any): any {
if (this.configuration.valueAssign && item) { return this.configuration.valueAssign(item); }
return item;
}
get requestDelay(): number {
return this.configuration.requestDelay != null ? this.configuration.requestDelay : 200;
}
get minFilteringChars(): number {
return this.configuration.minFilteringChars != null ? this.configuration.minFilteringChars : 1;
}
get loadDataOnStart(): boolean {
return this.configuration.loadDataOnStart != null ? this.configuration.loadDataOnStart : true;
}
get autoSelectFirstOptionOnBlur(): boolean {
return this.configuration.autoSelectFirstOptionOnBlur != null ? this.configuration.autoSelectFirstOptionOnBlur : false;
}
}

View File

@ -1,44 +0,0 @@
.confirmation-dialog {
.confirmation {
padding-bottom: 20px;
}
.privacy-policy-names {
font-weight: 700;
padding: 1em;
}
.close-btn {
margin-left: auto;
cursor: pointer;
}
.warn-text {
color: #f44336;
}
.cancel {
background-color: #aaaaaa;
color: #ffffff;
}
.confirm {
background-color: #2cba6c;
color: #ffffff;
}
.delete {
background-color: #ba2c2c;
color: #ffffff;
}
.checkbox-privacy {
padding: 0em 1em;
}
.required-policy {
padding: 0em 1.2em 1em;
font-size: smaller;
color: #f44336;
}
}

View File

@ -1,13 +0,0 @@
import { NgModule } from '@angular/core';
import { CommonUiModule } from '../../common/ui/common-ui.module';
import { ConfirmationDialogComponent } from './confirmation-dialog.component';
@NgModule({
imports: [CommonUiModule],
declarations: [ConfirmationDialogComponent],
exports: [ConfirmationDialogComponent],
entryComponents: [ConfirmationDialogComponent]
})
export class ConfirmationDialogModule {
constructor() { }
}

View File

@ -1,12 +1,12 @@
import { Injectable } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { CanDeactivate } from '@angular/router';
import { Observable } from 'rxjs';
import { CheckDeactivateBaseComponent } from '@app/library/deactivate/deactivate.component';
import { BaseComponent } from '@common/base/base.component';
import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component';
import { TranslateService } from '@ngx-translate/core';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { BaseComponent } from '../../core/common/base/base.component';
import { CheckDeactivateBaseComponent } from './deactivate.component';
import { ConfirmationDialogComponent } from '../confirmation-dialog/confirmation-dialog.component';
@Injectable()
export class CanDeactivateGuard extends BaseComponent implements CanDeactivate<CheckDeactivateBaseComponent> {
@ -21,19 +21,19 @@ export class CanDeactivateGuard extends BaseComponent implements CanDeactivate<C
canDeactivate(component: CheckDeactivateBaseComponent): boolean | Observable<boolean> {
if (component.canDeactivate()) {
return true;
} else {
const dialogRef = this.dialog.open(ConfirmationDialogComponent, {
maxWidth: '700px',
data: {
return true;
} else {
const dialogRef = this.dialog.open(ConfirmationDialogComponent, {
maxWidth: '700px',
data: {
message: this.language.instant('GENERAL.CONFIRMATION-DIALOG.LEAVE-PAGE'),
warning: this.language.instant('GENERAL.CONFIRMATION-DIALOG.LEAVE-WARNING'),
cancelButton: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.CANCEL'),
cancelButton: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.CANCEL'),
confirmButton: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.LEAVE'),
icon: 'error_outline'
}
});
return dialogRef.afterClosed().pipe(map(x => x ? true : false));
}
}
});
return dialogRef.afterClosed().pipe(map(x => x ? true : false));
}
}
}

View File

@ -1,5 +1,5 @@
import { BaseComponent } from '../../core/common/base/base.component';
import { HostListener } from '@angular/core';
import { BaseComponent } from '@common/base/base.component';
export abstract class CheckDeactivateBaseComponent extends BaseComponent {

View File

@ -1,6 +1,6 @@
import { NgModule } from '@angular/core';
import { CommonUiModule } from '../../common/ui/common-ui.module';
import { ExportMethodDialogComponent } from './export-method-dialog.component';
import { ExportMethodDialogComponent } from '@app/library/export-method-dialog/export-method-dialog.component';
import { CommonUiModule } from '@common/ui/common-ui.module';
@NgModule({
imports: [CommonUiModule],

View File

@ -1,11 +1,11 @@
import { Component, OnInit } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { MatSnackBar } from '@angular/material/snack-bar';
import { PopupNotification, SnackBarNotification, SnackBarNotificationLevel, UiNotificationService, UiNotificationType } from '@app/core/services/notification/ui-notification-service';
import { PopupNotificationDialogComponent } from '@app/library/notification/popup/popup-notification.component';
import { SnackBarNotificationComponent } from '@app/library/notification/snack-bar/snack-bar-notification.component';
import { BaseComponent } from '@common/base/base.component';
import { takeUntil } from 'rxjs/operators';
import { BaseComponent } from '../../core/common/base/base.component';
import { UiNotificationService, UiNotificationType, PopupNotification, SnackBarNotification, SnackBarNotificationLevel } from '../../core/services/notification/ui-notification-service';
import { PopupNotificationDialogComponent } from './popup/popup-notification.component';
import { SnackBarNotificationComponent } from './snack-bar/snack-bar-notification.component';
@Component({
selector: 'app-notification',

View File

@ -1,8 +1,8 @@
import { NgModule } from '@angular/core';
import { CommonUiModule } from '../../common/ui/common-ui.module';
import { NotificationComponent } from './notification.component';
import { PopupNotificationDialogComponent } from './popup/popup-notification.component';
import { SnackBarNotificationComponent } from './snack-bar/snack-bar-notification.component';
import { NotificationComponent } from '@app/library/notification/notification.component';
import { PopupNotificationDialogComponent } from '@app/library/notification/popup/popup-notification.component';
import { SnackBarNotificationComponent } from '@app/library/notification/snack-bar/snack-bar-notification.component';
import { CommonUiModule } from '@common/ui/common-ui.module';
@NgModule({
imports: [

View File

@ -1,7 +1,7 @@
import { NgModule } from '@angular/core';
import { CommonUiModule } from '../../common/ui/common-ui.module';
import { FormattingModule } from '../../core/formatting.module';
import { UrlListingComponent } from './url-listing.component';
import { FormattingModule } from '@app/core/formatting.module';
import { UrlListingComponent } from '@app/library/url-listing/url-listing.component';
import { CommonUiModule } from '@common/ui/common-ui.module';
@NgModule({
imports: [

View File

@ -1,7 +1,7 @@
import { NgModule } from '@angular/core';
import { CommonUiModule } from '../../common/ui/common-ui.module';
import { AboutComponent } from './about.component';
import { AboutRoutingModule } from './about.routing';
import { AboutComponent } from '@app/ui/about/about.component';
import { AboutRoutingModule } from '@app/ui/about/about.routing';
import { CommonUiModule } from '@common/ui/common-ui.module';
@NgModule({
imports: [

View File

@ -1,7 +1,7 @@
import { FormGroup, Validators } from '@angular/forms';
import { Page } from '../../../../core/model/admin/dataset-profile/dataset-profile';
import { BaseFormModel } from '../../../../core/model/base-form-model';
import { Guid } from '../../../../common/types/guid';
import { Page } from '@app/core/model/admin/dataset-profile/dataset-profile';
import { BaseFormModel } from '@app/core/model/base-form-model';
import { Guid } from '@common/types/guid';
export class PageEditorModel extends BaseFormModel {
public title: string;

View File

@ -1,32 +1,32 @@
import { NgModule } from '@angular/core';
import { CommonFormsModule } from '../../../common/forms/common-forms.module';
import { CommonUiModule } from '../../../common/ui/common-ui.module';
import { FormattingModule } from '../../../core/formatting.module';
import { DatasetProfileRoutingModule } from './dataset-profile.routing';
import { DatasetProfileEditorDefaultValueComponent } from './editor/components/composite-profile-editor-default-value/component-profile-editor-default-value.component';
import { DatasetProfileEditorCompositeFieldComponent } from './editor/components/composite-field/dataset-profile-editor-composite-field.component';
import { DatasetProfileEditorAutoCompleteFieldComponent } from './editor/components/field-type/auto-complete/dataset-profile-editor-auto-complete-field.component';
import { DatasetProfileEditorBooleanDecisionFieldComponent } from './editor/components/field-type/boolean-decision/dataset-profile-editor-boolean-decision-field.component';
import { DatasetProfileEditorCheckboxFieldComponent } from './editor/components/field-type/checkbox/dataset-profile-editor-checkbox-field.component';
import { DatasetProfileEditorComboBoxFieldComponent } from './editor/components/field-type/combo-box/dataset-profile-editor-combo-box-field.component';
import { DatasetProfileEditorFreeTextFieldComponent } from './editor/components/field-type/free-text/dataset-profile-editor-free-text-field.component';
import { DatasetProfileEditorRadioBoxFieldComponent } from './editor/components/field-type/radio-box/dataset-profile-editor-radio-box-field.component';
import { DatasetProfileEditorTextAreaFieldComponent } from './editor/components/field-type/textarea/dataset-profile-editor-text-area-field.component';
import { DatasetProfileEditorWordListFieldComponent } from './editor/components/field-type/word-list/dataset-profile-editor-word-list-field.component';
import { DatasetProfileEditorFieldComponent } from './editor/components/field/dataset-profile-editor-field.component';
import { DatasetProfileEditorPageComponent } from './editor/components/page/dataset-profile-editor-page.component';
import { DatasetProfileEditorRuleComponent } from './editor/components/rule/dataset-profile-editor-rule.component';
import { DatasetProfileEditorSectionComponent } from './editor/components/section/dataset-profile-editor-section.component';
import { DatasetProfileEditorComponent } from './editor/dataset-profile-editor.component';
import { DatasetProfileCriteriaComponent } from './listing/criteria/dataset-profile.component';
import { DatasetProfileListingComponent } from './listing/dataset-profile-listing.component';
import { ConfirmationDialogModule } from '../../../library/confirmation-dialog/confirmation-dialog.module';
import { DatasetProfileEditorDatePickerFieldComponent } from './editor/components/field-type/datepicker/dataset-profile-editor-date-picker-field.component';
import { DialodConfirmationUploadDatasetProfiles } from './listing/criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component';
import { DatasetProfileEditorInternalDmpEntitiesFieldComponent } from './editor/components/field-type/internal-dmp-entities/dataset-profile-editor-internal-dmp-entities-field.component';
import { DatasetProfileEditorResearchersAutoCompleteFieldComponent } from './editor/components/field-type/researchers-auto-complete/dataset-profile-editor-researchers-auto-complete-field.component';
import { DatasetProfileEditorDatasetsAutoCompleteFieldComponent } from './editor/components/field-type/datasets-auto-complete/dataset-profile-editor-datasets-autocomplete-field.component';
import { DatasetProfileEditorDmpsAutoCompleteFieldComponent } from './editor/components/field-type/dmps-auto-complete/dataset-profile-editor-dmps-autocomplete-field.component';
import { FormattingModule } from '@app/core/formatting.module';
import { ConfirmationDialogModule } from '@common/modules/confirmation-dialog/confirmation-dialog.module';
import { DatasetProfileRoutingModule } from '@app/ui/admin/dataset-profile/dataset-profile.routing';
import { DatasetProfileEditorCompositeFieldComponent } from '@app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component';
import { DatasetProfileEditorDefaultValueComponent } from '@app/ui/admin/dataset-profile/editor/components/composite-profile-editor-default-value/component-profile-editor-default-value.component';
import { DatasetProfileEditorAutoCompleteFieldComponent } from '@app/ui/admin/dataset-profile/editor/components/field-type/auto-complete/dataset-profile-editor-auto-complete-field.component';
import { DatasetProfileEditorBooleanDecisionFieldComponent } from '@app/ui/admin/dataset-profile/editor/components/field-type/boolean-decision/dataset-profile-editor-boolean-decision-field.component';
import { DatasetProfileEditorCheckboxFieldComponent } from '@app/ui/admin/dataset-profile/editor/components/field-type/checkbox/dataset-profile-editor-checkbox-field.component';
import { DatasetProfileEditorComboBoxFieldComponent } from '@app/ui/admin/dataset-profile/editor/components/field-type/combo-box/dataset-profile-editor-combo-box-field.component';
import { DatasetProfileEditorDatasetsAutoCompleteFieldComponent } from '@app/ui/admin/dataset-profile/editor/components/field-type/datasets-auto-complete/dataset-profile-editor-datasets-autocomplete-field.component';
import { DatasetProfileEditorDatePickerFieldComponent } from '@app/ui/admin/dataset-profile/editor/components/field-type/datepicker/dataset-profile-editor-date-picker-field.component';
import { DatasetProfileEditorDmpsAutoCompleteFieldComponent } from '@app/ui/admin/dataset-profile/editor/components/field-type/dmps-auto-complete/dataset-profile-editor-dmps-autocomplete-field.component';
import { DatasetProfileEditorFreeTextFieldComponent } from '@app/ui/admin/dataset-profile/editor/components/field-type/free-text/dataset-profile-editor-free-text-field.component';
import { DatasetProfileEditorInternalDmpEntitiesFieldComponent } from '@app/ui/admin/dataset-profile/editor/components/field-type/internal-dmp-entities/dataset-profile-editor-internal-dmp-entities-field.component';
import { DatasetProfileEditorRadioBoxFieldComponent } from '@app/ui/admin/dataset-profile/editor/components/field-type/radio-box/dataset-profile-editor-radio-box-field.component';
import { DatasetProfileEditorResearchersAutoCompleteFieldComponent } from '@app/ui/admin/dataset-profile/editor/components/field-type/researchers-auto-complete/dataset-profile-editor-researchers-auto-complete-field.component';
import { DatasetProfileEditorTextAreaFieldComponent } from '@app/ui/admin/dataset-profile/editor/components/field-type/textarea/dataset-profile-editor-text-area-field.component';
import { DatasetProfileEditorWordListFieldComponent } from '@app/ui/admin/dataset-profile/editor/components/field-type/word-list/dataset-profile-editor-word-list-field.component';
import { DatasetProfileEditorFieldComponent } from '@app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component';
import { DatasetProfileEditorPageComponent } from '@app/ui/admin/dataset-profile/editor/components/page/dataset-profile-editor-page.component';
import { DatasetProfileEditorRuleComponent } from '@app/ui/admin/dataset-profile/editor/components/rule/dataset-profile-editor-rule.component';
import { DatasetProfileEditorSectionComponent } from '@app/ui/admin/dataset-profile/editor/components/section/dataset-profile-editor-section.component';
import { DatasetProfileEditorComponent } from '@app/ui/admin/dataset-profile/editor/dataset-profile-editor.component';
import { DatasetProfileCriteriaComponent } from '@app/ui/admin/dataset-profile/listing/criteria/dataset-profile.component';
import { DialodConfirmationUploadDatasetProfiles } from '@app/ui/admin/dataset-profile/listing/criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component';
import { DatasetProfileListingComponent } from '@app/ui/admin/dataset-profile/listing/dataset-profile-listing.component';
import { CommonFormsModule } from '@common/forms/common-forms.module';
import { CommonUiModule } from '@common/ui/common-ui.module';
@NgModule({
imports: [

View File

@ -1,7 +1,7 @@
import { Component, Input, OnInit } from '@angular/core';
import { FormArray, FormControl, FormGroup } from '@angular/forms';
import { FieldEditorModel } from '../../../admin/field-editor-model';
import { Guid } from '../../../../../../common/types/guid';
import { Guid } from '@common/types/guid';
@Component({
selector: 'app-dataset-profile-editor-composite-field-component',

View File

@ -1,11 +1,11 @@
import { Component, Input, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { DatasetProfileComboBoxType } from '@app/core/common/enum/dataset-profile-combo-box-type';
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
import { AutoCompleteFieldDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/auto-complete-field-data-editor-model';
import { WordListFieldDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/word-list-field-data-editor-model';
import { BaseComponent } from '@common/base/base.component';
import { takeUntil } from 'rxjs/operators';
import { BaseComponent } from '../../../../../../../core/common/base/base.component';
import { DatasetProfileComboBoxType } from '../../../../../../../core/common/enum/dataset-profile-combo-box-type';
import { EnumUtils } from '../../../../../../../core/services/utilities/enum-utils.service';
import { AutoCompleteFieldDataEditorModel } from '../../../../admin/field-data/auto-complete-field-data-editor-model';
import { WordListFieldDataEditorModel } from '../../../../admin/field-data/word-list-field-data-editor-model';
@Component({
selector: 'app-dataset-profile-editor-combo-box-field-component',

View File

@ -1,13 +1,12 @@
import { DatasetProfileInternalDmpEntitiesType } from "../../../../../../../core/common/enum/dataset-profile-internal-dmp-entities-type";
import { EnumUtils } from "../../../../../../../core/services/utilities/enum-utils.service";
import { Component, Input, OnInit } from "@angular/core";
import { FormGroup } from "@angular/forms";
import { BaseComponent } from "../../../../../../../core/common/base/base.component";
import { takeUntil } from "rxjs/operators";
import { ResearchersAutoCompleteFieldDataEditorModel } from "../../../../admin/field-data/researchers-auto-complete-field-data-editor-model";
import { DatasetsAutoCompleteFieldDataEditorModel } from "../../../../admin/field-data/datasets-autocomplete-field-data-editor-mode";
import { DmpsAutoCompleteFieldDataEditorModel } from "../../../../admin/field-data/dmps-autocomplete-field-data-editor-model";
import { Component, Input, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { DatasetProfileInternalDmpEntitiesType } from '@app/core/common/enum/dataset-profile-internal-dmp-entities-type';
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
import { DatasetsAutoCompleteFieldDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/datasets-autocomplete-field-data-editor-mode';
import { DmpsAutoCompleteFieldDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/dmps-autocomplete-field-data-editor-model';
import { ResearchersAutoCompleteFieldDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/researchers-auto-complete-field-data-editor-model';
import { BaseComponent } from '@common/base/base.component';
import { takeUntil } from 'rxjs/operators';
@Component({
selector: 'app-dataset-profile-internal-dmp-entities-field-component',

View File

@ -1,22 +1,21 @@

import { Component, Input, OnInit } from '@angular/core';
import { FormArray, FormControl, FormGroup } from '@angular/forms';
import { DatasetProfileFieldViewStyle } from '@app/core/common/enum/dataset-profile-field-view-style';
import { ValidationType } from '@app/core/common/enum/validation-type';
import { DatasetProfileService } from '@app/core/services/dataset-profile/dataset-profile.service';
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
import { BooleanDecisionFieldDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/boolean-decision-field-data-editor-model';
import { CheckBoxFieldDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/check-box-field-data-editor-model';
import { DatePickerDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/date-picker-data-editor-models';
import { FreeTextFieldDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/free-text-field-data-editor-model';
import { RadioBoxFieldDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/radio-box-field-data-editor-model';
import { ResearchersAutoCompleteFieldDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/researchers-auto-complete-field-data-editor-model';
import { TextAreaFieldDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/text-area-field-data-editor-model';
import { WordListFieldDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/word-list-field-data-editor-model';
import { RuleEditorModel } from '@app/ui/admin/dataset-profile/admin/rule-editor-model';
import { BaseComponent } from '@common/base/base.component';
import { takeUntil } from 'rxjs/operators';
import { BaseComponent } from '../../../../../../core/common/base/base.component';
import { DatasetProfileFieldViewStyle } from '../../../../../../core/common/enum/dataset-profile-field-view-style';
import { ValidationType } from '../../../../../../core/common/enum/validation-type';
import { EnumUtils } from '../../../../../../core/services/utilities/enum-utils.service';
import { BooleanDecisionFieldDataEditorModel } from '../../../admin/field-data/boolean-decision-field-data-editor-model';
import { CheckBoxFieldDataEditorModel } from '../../../admin/field-data/check-box-field-data-editor-model';
import { FreeTextFieldDataEditorModel } from '../../../admin/field-data/free-text-field-data-editor-model';
import { RadioBoxFieldDataEditorModel } from '../../../admin/field-data/radio-box-field-data-editor-model';
import { TextAreaFieldDataEditorModel } from '../../../admin/field-data/text-area-field-data-editor-model';
import { WordListFieldDataEditorModel } from '../../../admin/field-data/word-list-field-data-editor-model';
import { RuleEditorModel } from '../../../admin/rule-editor-model';
import { DatePickerDataEditorModel } from '../../../admin/field-data/date-picker-data-editor-models';
import { ResearchersAutoCompleteFieldDataEditorModel } from '../../../admin/field-data/researchers-auto-complete-field-data-editor-model';
import { DatasetProfileInternalDmpEntitiesType } from '../../../../../../core/common/enum/dataset-profile-internal-dmp-entities-type';
import { DatasetProfileService } from "../../../../../../core/services/dataset-profile/dataset-profile.service";
@Component({
selector: 'app-dataset-profile-editor-field-component',

View File

@ -1,11 +1,11 @@
import { Component, Input, OnInit } from '@angular/core';
import { FormArray, FormGroup } from '@angular/forms';
import { FieldEditorModel } from '@app/ui/admin/dataset-profile/admin/field-editor-model';
import { FieldSetEditorModel } from '@app/ui/admin/dataset-profile/admin/field-set-editor-model';
import { SectionEditorModel } from '@app/ui/admin/dataset-profile/admin/section-editor-model';
import { BaseComponent } from '@common/base/base.component';
import { Guid } from '@common/types/guid';
import { takeUntil } from 'rxjs/operators';
import { BaseComponent } from '../../../../../../core/common/base/base.component';
import { FieldEditorModel } from '../../../admin/field-editor-model';
import { FieldSetEditorModel } from '../../../admin/field-set-editor-model';
import { SectionEditorModel } from '../../../admin/section-editor-model';
import { Guid } from '../../../../../../common/types/guid';
@Component({
selector: 'app-dataset-profile-editor-section-component',
@ -32,10 +32,10 @@ export class DatasetProfileEditorSectionComponent extends BaseComponent implemen
addField() {
const fieldSet: FieldSetEditorModel = new FieldSetEditorModel();
const field: FieldEditorModel = new FieldEditorModel();
field.id=Guid.create().toString();
field.id = Guid.create().toString();
fieldSet.fields.push(field);
if (this.dataModel.fieldSets) {
fieldSet.id=Guid.create().toString();
fieldSet.id = Guid.create().toString();
this.dataModel.fieldSets.push(fieldSet);
}
(<FormArray>this.form.get('fieldSets')).push(fieldSet.buildForm());
@ -48,7 +48,7 @@ export class DatasetProfileEditorSectionComponent extends BaseComponent implemen
}
DeleteSectionInSection(index) {
this.dataModel.sections.splice(index,1);
this.dataModel.sections.splice(index, 1);
(<FormArray>this.form.get('sections')).removeAt(index);
}

View File

@ -8,21 +8,20 @@ import { MatHorizontalStepper } from '@angular/material/stepper';
import { ActivatedRoute, ParamMap, Router } from '@angular/router';
import { TranslateService } from '@ngx-translate/core';
import { map, takeUntil } from 'rxjs/operators';
import { BaseComponent } from '../../../../core/common/base/base.component';
import { DatasetProfile } from '../../../../core/model/admin/dataset-profile/dataset-profile';
import { DatasetWizardModel } from '../../../../core/model/dataset/dataset-wizard';
import { DatasetProfileService } from '../../../../core/services/dataset-profile/dataset-profile.service';
import { LoggingService } from '../../../../core/services/logging/logging-service';
import { SnackBarNotificationLevel, UiNotificationService } from '../../../../core/services/notification/ui-notification-service';
import { PageEditorModel } from '../admin/page-editor-model';
import { SectionEditorModel } from '../admin/section-editor-model';
import { DatasetProfileEditorModel } from './dataset-profile-editor-model';
import { ConfirmationDialogComponent } from '../../../../library/confirmation-dialog/confirmation-dialog.component';
import { DatasetProfileEnum } from '../../../../core/common/enum/dataset-profile';
import * as FileSaver from 'file-saver';
import { BreadcrumbItem } from '../../../misc/breadcrumb/definition/breadcrumb-item';
import { DatasetStatus } from '../../../../core/common/enum/dataset-status';
//import * as data from 'src/assets/resources/skipDisable.json';
import { BaseComponent } from '@common/base/base.component';
import { DatasetProfileEditorModel } from '@app/ui/admin/dataset-profile/editor/dataset-profile-editor-model';
import { DatasetWizardModel } from '@app/core/model/dataset/dataset-wizard';
import { BreadcrumbItem } from '@app/ui/misc/breadcrumb/definition/breadcrumb-item';
import { DatasetProfileService } from '@app/core/services/dataset-profile/dataset-profile.service';
import { LoggingService } from '@app/core/services/logging/logging-service';
import { UiNotificationService, SnackBarNotificationLevel } from '@app/core/services/notification/ui-notification-service';
import { DatasetProfile } from '@app/core/model/admin/dataset-profile/dataset-profile';
import { DatasetProfileEnum } from '@app/core/common/enum/dataset-profile';
import { SectionEditorModel } from '@app/ui/admin/dataset-profile/admin/section-editor-model';
import { PageEditorModel } from '@app/ui/admin/dataset-profile/admin/page-editor-model';
import { DatasetStatus } from '@app/core/common/enum/dataset-status';
import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component';
const skipDisable: any[] = require('../../../../../assets/resources/skipDisable.json');

View File

@ -1,12 +1,12 @@
import { Component, OnInit } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { DatasetProfileCriteria } from '@app/core/query/dataset-profile/dataset-profile-criteria';
import { DatasetProfileService } from '@app/core/services/dataset-profile/dataset-profile.service';
import { DialodConfirmationUploadDatasetProfiles } from '@app/ui/admin/dataset-profile/listing/criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component';
import { BaseCriteriaComponent } from '@app/ui/misc/criteria/base-criteria.component';
import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model';
import { TranslateService } from '@ngx-translate/core';
import { takeUntil } from 'rxjs/operators';
import { ValidationErrorModel } from '../../../../../common/forms/validation/error-model/validation-error-model';
import { DatasetProfileCriteria } from '../../../../../core/query/dataset-profile/dataset-profile-criteria';
import { DatasetProfileService } from '../../../../../core/services/dataset-profile/dataset-profile.service';
import { BaseCriteriaComponent } from '../../../../misc/criteria/base-criteria.component';
import { DialodConfirmationUploadDatasetProfiles } from './dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component';
@Component({
selector: 'app-dataset-profile-criteria-component',

View File

@ -3,19 +3,19 @@ import { Component, OnInit, ViewChild } from '@angular/core';
import { MatPaginator, PageEvent } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
import { ActivatedRoute, Params, Router } from '@angular/router';
import { DataTableRequest } from '@app/core/model/data-table/data-table-request';
import { DatasetListingModel } from '@app/core/model/dataset/dataset-listing';
import { DmpModel } from '@app/core/model/dmp/dmp';
import { DatasetProfileCriteria } from '@app/core/query/dataset-profile/dataset-profile-criteria';
import { DatasetProfileService } from '@app/core/services/dataset-profile/dataset-profile.service';
import { DmpService } from '@app/core/services/dmp/dmp.service';
import { UiNotificationService } from '@app/core/services/notification/ui-notification-service';
import { DatasetProfileCriteriaComponent } from '@app/ui/admin/dataset-profile/listing/criteria/dataset-profile.component';
import { BreadcrumbItem } from '@app/ui/misc/breadcrumb/definition/breadcrumb-item';
import { BaseComponent } from '@common/base/base.component';
import { TranslateService } from '@ngx-translate/core';
import { merge as observableMerge, Observable, of as observableOf } from 'rxjs';
import { map, startWith, switchMap, takeUntil } from 'rxjs/operators';
import { BaseComponent } from '../../../../core/common/base/base.component';
import { DataTableRequest } from '../../../../core/model/data-table/data-table-request';
import { DatasetListingModel } from '../../../../core/model/dataset/dataset-listing';
import { DmpModel } from '../../../../core/model/dmp/dmp';
import { DatasetProfileCriteria } from '../../../../core/query/dataset-profile/dataset-profile-criteria';
import { DatasetProfileService } from '../../../../core/services/dataset-profile/dataset-profile.service';
import { DmpService } from '../../../../core/services/dmp/dmp.service';
import { UiNotificationService } from '../../../../core/services/notification/ui-notification-service';
import { BreadcrumbItem } from '../../../misc/breadcrumb/definition/breadcrumb-item';
import { DatasetProfileCriteriaComponent } from './criteria/dataset-profile.component';
@Component({
selector: 'app-dataset-profile-listing-component',

View File

@ -1,10 +1,10 @@
import { Component, Inject, OnInit } from '@angular/core';
import { Inject, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { DatasetProfileService } from '@app/core/services/dataset-profile/dataset-profile.service';
import { DatasetWizardEditorModel } from '@app/ui/dataset/dataset-wizard/dataset-wizard-editor.model';
import { BaseComponent } from '@common/base/base.component';
import { takeUntil } from 'rxjs/operators';
import { BaseComponent } from '../../../../core/common/base/base.component';
import { DatasetProfileService } from '../../../../core/services/dataset-profile/dataset-profile.service';
import { DatasetWizardEditorModel } from '../../../dataset/dataset-wizard/dataset-wizard-editor.model';
// @Component({
// selector: 'app-dataset-profile-preview-component',

View File

@ -1,14 +1,14 @@
import { NgModule } from "@angular/core";
import { CommonFormsModule } from "../../../common/forms/common-forms.module";
import { CommonUiModule } from "../../../common/ui/common-ui.module";
import { ConfirmationDialogModule } from "../../../library/confirmation-dialog/confirmation-dialog.module";
import { UrlListingModule } from "../../../library/url-listing/url-listing.module";
import { DmpProfileRoutingModule } from "./dmp-profile.routing";
import { DmpProfileEditorComponent } from "./editor/dmp-profile-editor.component";
import { DmpProfileCriteriaComponent } from "./listing/criteria/dmp-profile-criteria.component";
import { DmpProfileListingComponent } from "./listing/dmp-profile-listing.component";
import { DialodConfirmationUploadDmpProfiles } from "./listing/criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component";
import { DmpProfileExternalAutocompleteFieldEditorComponent } from "./editor/external-autocomplete/dmp-profile-external-autocomplete-field-editor.component";
import { ConfirmationDialogModule } from '@common/modules/confirmation-dialog/confirmation-dialog.module';
import { UrlListingModule } from '@app/library/url-listing/url-listing.module';
import { CommonFormsModule } from '@common/forms/common-forms.module';
import { CommonUiModule } from '@common/ui/common-ui.module';
import { DmpProfileRoutingModule } from './dmp-profile.routing';
import { DmpProfileEditorComponent } from './editor/dmp-profile-editor.component';
import { DmpProfileExternalAutocompleteFieldEditorComponent } from './editor/external-autocomplete/dmp-profile-external-autocomplete-field-editor.component';
import { DialodConfirmationUploadDmpProfiles } from './listing/criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component';
import { DmpProfileCriteriaComponent } from './listing/criteria/dmp-profile-criteria.component';
import { DmpProfileListingComponent } from './listing/dmp-profile-listing.component';
@NgModule({
imports: [

View File

@ -1,25 +1,25 @@
import {of as observableOf, Observable } from 'rxjs';
import {map, takeUntil } from 'rxjs/operators';
import { AfterViewInit, Component, OnInit } from '@angular/core';
import { AfterViewInit, Component } from '@angular/core';
import { AbstractControl, FormArray, FormControl, FormGroup } from '@angular/forms';
import { ActivatedRoute, Params, Router } from '@angular/router';
import { DmpProfileFieldDataType } from '@app/core/common/enum/dmp-profile-field-type';
import { DmpProfileStatus } from '@app/core/common/enum/dmp-profile-status';
import { DmpProfileType } from '@app/core/common/enum/dmp-profile-type';
import { DmpProfile } from '@app/core/model/dmp-profile/dmp-profile';
import { DmpProfileService } from '@app/core/services/dmp/dmp-profile.service';
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
import { DmpProfileEditorModel, DmpProfileFieldEditorModel } from '@app/ui/admin/dmp-profile/editor/dmp-profile-editor.model';
import { DmpProfileExternalAutoCompleteFieldDataEditorModel } from '@app/ui/admin/dmp-profile/editor/external-autocomplete/dmp-profile-external-autocomplete-field-editor.model';
import { BreadcrumbItem } from '@app/ui/misc/breadcrumb/definition/breadcrumb-item';
import { BaseComponent } from '@common/base/base.component';
import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model';
import { TranslateService } from '@ngx-translate/core';
import { environment } from 'environments/environment';
import * as FileSaver from 'file-saver';
import { environment } from '../../../../../environments/environment';
import { ValidationErrorModel } from '../../../../common/forms/validation/error-model/validation-error-model';
import { BaseComponent } from '../../../../core/common/base/base.component';
import { DmpProfileFieldDataType } from '../../../../core/common/enum/dmp-profile-field-type';
import { DmpProfileStatus } from '../../../../core/common/enum/dmp-profile-status';
import { DmpProfileType } from '../../../../core/common/enum/dmp-profile-type';
import { DmpProfile } from '../../../../core/model/dmp-profile/dmp-profile';
import { DmpProfileService } from '../../../../core/services/dmp/dmp-profile.service';
import { SnackBarNotificationLevel, UiNotificationService } from '../../../../core/services/notification/ui-notification-service';
import { EnumUtils } from '../../../../core/services/utilities/enum-utils.service';
import { DmpProfileEditorModel, DmpProfileFieldEditorModel } from './dmp-profile-editor.model';
import { BreadcrumbItem } from '../../../misc/breadcrumb/definition/breadcrumb-item';
import { DmpProfileExternalAutoCompleteFieldDataEditorModel } from './external-autocomplete/dmp-profile-external-autocomplete-field-editor.model';
import { Observable, of as observableOf } from 'rxjs';
import { map, takeUntil } from 'rxjs/operators';
@Component({
selector: 'app-dmp-profile-editor-component',
@ -99,8 +99,8 @@ export class DmpProfileEditorComponent extends BaseComponent implements AfterVie
this.dmpProfileService.createDmp(this.formGroup.value)
.pipe(takeUntil(this._destroyed))
.subscribe(
complete => this.onCallbackSuccess(),
error => this.onCallbackError(error)
complete => this.onCallbackSuccess(),
error => this.onCallbackError(error)
);
}
@ -202,8 +202,8 @@ export class DmpProfileEditorComponent extends BaseComponent implements AfterVie
this.dmpProfileService.createDmp(this.formGroup.value)
.pipe(takeUntil(this._destroyed))
.subscribe(
complete => this.onCallbackSuccess(),
error => this.onCallbackError(error)
complete => this.onCallbackSuccess(),
error => this.onCallbackError(error)
);
}

View File

@ -1,10 +1,10 @@
import { FormBuilder, FormGroup } from '@angular/forms';
import { ValidationErrorModel } from '../../../../common/forms/validation/error-model/validation-error-model';
import { DmpProfileFieldDataType } from '../../../../core/common/enum/dmp-profile-field-type';
import { DmpProfileType } from '../../../../core/common/enum/dmp-profile-type';
import { DmpProfile, DmpProfileDefinition } from '../../../../core/model/dmp-profile/dmp-profile';
import { DmpProfileField } from '../../../../core/model/dmp-profile/dmp-profile-field';
import { DmpProfileExternalAutoCompleteFieldDataEditorModel } from './external-autocomplete/dmp-profile-external-autocomplete-field-editor.model';
import { DmpProfileFieldDataType } from '@app/core/common/enum/dmp-profile-field-type';
import { DmpProfileType } from '@app/core/common/enum/dmp-profile-type';
import { DmpProfile, DmpProfileDefinition } from '@app/core/model/dmp-profile/dmp-profile';
import { DmpProfileField } from '@app/core/model/dmp-profile/dmp-profile-field';
import { DmpProfileExternalAutoCompleteFieldDataEditorModel } from '@app/ui/admin/dmp-profile/editor/external-autocomplete/dmp-profile-external-autocomplete-field-editor.model';
import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model';
export class DmpProfileEditorModel {

View File

@ -1,14 +1,14 @@
import { Component, Input, OnInit } from '@angular/core';
import { ValidationErrorModel } from '../../../../../common/forms/validation/error-model/validation-error-model';
import { GrantListingModel } from '../../../../../core/model/grant/grant-listing';
import { DmpCriteria } from '../../../../../core/query/dmp/dmp-criteria';
import { DmpProfileCriteria } from '../../../../../core/query/dmp/dmp-profile-criteria';
import { BaseCriteriaComponent } from '../../../../misc/criteria/base-criteria.component';
import { DialodConfirmationUploadDmpProfiles } from './dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component';
import { MatDialog } from '@angular/material/dialog';
import { MatDialog } from '@angular/material';
import { GrantListingModel } from '@app/core/model/grant/grant-listing';
import { DmpCriteria } from '@app/core/query/dmp/dmp-criteria';
import { DmpProfileCriteria } from '@app/core/query/dmp/dmp-profile-criteria';
import { DmpProfileService } from '@app/core/services/dmp/dmp-profile.service';
import { DialodConfirmationUploadDmpProfiles } from '@app/ui/admin/dmp-profile/listing/criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component';
import { BaseCriteriaComponent } from '@app/ui/misc/criteria/base-criteria.component';
import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model';
import { TranslateService } from '@ngx-translate/core';
import { takeUntil } from 'rxjs/operators';
import { DmpProfileService } from '../../../../../core/services/dmp/dmp-profile.service';
@Component({
selector: 'app-dmp-profile-criteria-component',

View File

@ -1,21 +1,21 @@
import {merge as observableMerge, of as observableOf, Observable } from 'rxjs';
import {map, switchMap, startWith, takeUntil } from 'rxjs/operators';
import { DataSource } from '@angular/cdk/table';
import { Component, OnInit, ViewChild } from '@angular/core';
import { MatPaginator, PageEvent } from '@angular/material/paginator';
import { MatSnackBar } from '@angular/material/snack-bar';
import { MatSort } from '@angular/material/sort';
import { ActivatedRoute, Params, Router } from '@angular/router';
import { DataTableRequest } from '@app/core/model/data-table/data-table-request';
import { DmpProfileListing } from '@app/core/model/dmp-profile/dmp-profile-listing';
import { DmpProfileCriteria } from '@app/core/query/dmp/dmp-profile-criteria';
import { DmpProfileService } from '@app/core/services/dmp/dmp-profile.service';
import { DmpProfileCriteriaComponent } from '@app/ui/admin/dmp-profile/listing/criteria/dmp-profile-criteria.component';
import { BreadcrumbItem } from '@app/ui/misc/breadcrumb/definition/breadcrumb-item';
import { BaseComponent } from '@common/base/base.component';
import { TranslateService } from '@ngx-translate/core';
import { BaseComponent } from '../../../../core/common/base/base.component';
import { DmpProfileListing } from '../../../../core/model/dmp-profile/dmp-profile-listing';
import { DmpProfileCriteria } from '../../../../core/query/dmp/dmp-profile-criteria';
import { DmpProfileService } from '../../../../core/services/dmp/dmp-profile.service';
import { DataTableRequest } from '../../../../core/model/data-table/data-table-request';
import { DmpProfileCriteriaComponent } from './criteria/dmp-profile-criteria.component';
import { BreadcrumbItem } from '../../../misc/breadcrumb/definition/breadcrumb-item';
import { merge as observableMerge, Observable, of as observableOf } from 'rxjs';
import { map, startWith, switchMap, takeUntil } from 'rxjs/operators';
@Component({
selector: 'app-dmp-profile-listing-component',
@ -131,7 +131,7 @@ export class DatasetDataSource extends DataSource<DmpProfileListing> {
if (!result) { return []; }
if (this._paginator.pageIndex === 0) { this.totalCount = result.totalCount; }
return result.data;
}),);
}));
}
disconnect() {

View File

@ -1,11 +1,11 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
import { AppRole } from '@app/core/common/enum/app-role';
import { UserCriteria } from '@app/core/query/user/user-criteria';
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
import { BaseCriteriaComponent } from '@app/ui/misc/criteria/base-criteria.component';
import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model';
import { debounceTime, takeUntil } from 'rxjs/operators';
import { ValidationErrorModel } from '../../../../../common/forms/validation/error-model/validation-error-model';
import { AppRole } from '../../../../../core/common/enum/app-role';
import { UserCriteria } from '../../../../../core/query/user/user-criteria';
import { EnumUtils } from '../../../../../core/services/utilities/enum-utils.service';
import { BaseCriteriaComponent } from '../../../../misc/criteria/base-criteria.component';
@Component({
selector: 'app-user-criteria-component',

View File

@ -1,14 +1,14 @@
import { Component, Input, OnInit } from '@angular/core';
import { AbstractControl, FormArray, FormBuilder, FormControl, FormGroup } from '@angular/forms';
import { AppRole } from '@app/core/common/enum/app-role';
import { UserListingModel } from '@app/core/model/user/user-listing';
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
import { UserService } from '@app/core/services/user/user.service';
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
import { BaseComponent } from '@common/base/base.component';
import { Validation, ValidationContext } from '@common/forms/validation/validation-context';
import { TranslateService } from '@ngx-translate/core';
import { takeUntil } from 'rxjs/operators';
import { Validation, ValidationContext } from '../../../../../common/forms/validation/validation-context';
import { BaseComponent } from '../../../../../core/common/base/base.component';
import { AppRole } from '../../../../../core/common/enum/app-role';
import { UserListingModel } from '../../../../../core/model/user/user-listing';
import { UserService } from '../../../../../core/services/user/user.service';
import { EnumUtils } from '../../../../../core/services/utilities/enum-utils.service';
import { SnackBarNotificationLevel, UiNotificationService } from '../../../../../core/services/notification/ui-notification-service';
@Component({
selector: 'app-user-role-editor-component',
@ -26,7 +26,7 @@ export class UserRoleEditorComponent extends BaseComponent implements OnInit {
private userService: UserService,
private formBuilder: FormBuilder,
private enumUtils: EnumUtils,
private uiNotificationService:UiNotificationService
private uiNotificationService: UiNotificationService
) { super(); }
ngOnInit() {
@ -117,12 +117,12 @@ export class UserRoleEditorComponent extends BaseComponent implements OnInit {
onCallbackSuccess() {
this.nowEditing = false;
this.formGroup.disable();
this.uiNotificationService.snackBarNotification( this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE'), SnackBarNotificationLevel.Success);
this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE'), SnackBarNotificationLevel.Success);
}
onCallbackError(error: any) {
this.validateAllFormFields(this.formGroup);
this.uiNotificationService.snackBarNotification( this.language.instant('GENERAL.SNACK-BAR.UNSUCCESSFUL-UPDATE'), SnackBarNotificationLevel.Error);
this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.SNACK-BAR.UNSUCCESSFUL-UPDATE'), SnackBarNotificationLevel.Error);
}
getPrincipalAppRoleValues(): Number[] {

View File

@ -1,7 +1,7 @@
import { NgModule } from '@angular/core';
import { CommonFormsModule } from '../../../common/forms/common-forms.module';
import { CommonUiModule } from '../../../common/ui/common-ui.module';
import { FormattingModule } from '../../../core/formatting.module';
import { FormattingModule } from '@app/core/formatting.module';
import { CommonFormsModule } from '@common/forms/common-forms.module';
import { CommonUiModule } from '@common/ui/common-ui.module';
import { UserCriteriaComponent } from './listing/criteria/user-criteria.component';
import { UserRoleEditorComponent } from './listing/role-editor/user-role-editor.component';
import { UserListingComponent } from './listing/user-listing.component';

View File

@ -1,13 +1,12 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { Credential } from '@app/core/model/auth/credential';
import { AuthService } from '@app/core/services/auth/auth.service';
import { CultureService } from '@app/core/services/culture/culture-service';
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
import { BaseComponent } from '@common/base/base.component';
import { TranslateService } from '@ngx-translate/core';
import { takeUntil } from 'rxjs/operators';
import { BaseComponent } from '../../../core/common/base/base.component';
import { Credential } from '../../../core/model/auth/credential';
import { CultureService } from '../../../core/services/culture/culture-service';
import { SnackBarNotificationLevel, UiNotificationService } from '../../../core/services/notification/ui-notification-service';
import { AuthService } from '../../../core/services/auth/auth.service';
@Component({
selector: 'app-admin-login',
templateUrl: './admin-login.component.html',

View File

@ -1,8 +1,8 @@
import { NgModule } from '@angular/core';
import { CommonFormsModule } from '../../../common/forms/common-forms.module';
import { CommonUiModule } from '../../../common/ui/common-ui.module';
import { AdminLoginComponent } from './admin-login.component';
import { AdminLoginRoutingModule } from './admin-login.routing';
import { AdminLoginComponent } from '@app/ui/auth/admin-login/admin-login.component';
import { AdminLoginRoutingModule } from '@app/ui/auth/admin-login/admin-login.routing';
import { CommonFormsModule } from '@common/forms/common-forms.module';
import { CommonUiModule } from '@common/ui/common-ui.module';
@NgModule({
imports: [

View File

@ -1,12 +1,12 @@
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Params } from '@angular/router';
import { AuthProvider } from '@app/core/common/enum/auth-provider';
import { AuthService } from '@app/core/services/auth/auth.service';
import { LoginService } from '@app/ui/auth/login/utilities/login.service';
import { BaseComponent } from '@common/base/base.component';
import { environment } from 'environments/environment';
import { takeUntil } from 'rxjs/operators';
import { environment } from '../../../../../environments/environment';
import { BaseComponent } from '../../../../core/common/base/base.component';
import { AuthProvider } from '../../../../core/common/enum/auth-provider';
import { AuthService } from '../../../../core/services/auth/auth.service';
import { LoginService } from '../utilities/login.service';
@Component({
selector: 'app-b2access-login',
@ -37,10 +37,10 @@ export class B2AccessLoginComponent extends BaseComponent implements OnInit {
public b2AccessGetAuthCode() {
window.location.href = environment.loginProviders.b2accessConfiguration.oauthUrl
+ '?response_type=code&client_id=' + environment.loginProviders.b2accessConfiguration.clientId
+ '&redirect_uri=' + environment.loginProviders.b2accessConfiguration.redirectUri
+ '&state=' + environment.loginProviders.b2accessConfiguration.state
+ '&scope=USER_PROFILE';
+ '?response_type=code&client_id=' + environment.loginProviders.b2accessConfiguration.clientId
+ '&redirect_uri=' + environment.loginProviders.b2accessConfiguration.redirectUri
+ '&state=' + environment.loginProviders.b2accessConfiguration.state
+ '&scope=USER_PROFILE';
}
public b2AccessLogin(code: String) {

View File

@ -1,14 +1,14 @@
import { Component, OnInit, Input } from "@angular/core";
import { BaseComponent } from "../../../../core/common/base/base.component";
import { ActivatedRoute, Router, Params } from "@angular/router";
import { HttpClient } from "@angular/common/http";
import { LoginService } from "../utilities/login.service";
import { AuthService } from "../../../../core/services/auth/auth.service";
import { takeUntil } from "rxjs/operators";
import { environment } from "../../../../../environments/environment";
import { AuthProvider } from "../../../../core/common/enum/auth-provider";
import { ConfigurableProvider } from "../../../../core/model/configurable-provider/configurableProvider";
import { ConfigurableProvidersService } from "../utilities/configurableProviders.service";
import { HttpClient } from '@angular/common/http';
import { Component, OnInit } from "@angular/core";
import { ActivatedRoute, Params, Router } from '@angular/router';
import { AuthProvider } from '@app/core/common/enum/auth-provider';
import { ConfigurableProvider } from '@app/core/model/configurable-provider/configurableProvider';
import { AuthService } from '@app/core/services/auth/auth.service';
import { ConfigurableProvidersService } from '@app/ui/auth/login/utilities/configurableProviders.service';
import { LoginService } from '@app/ui/auth/login/utilities/login.service';
import { BaseComponent } from '@common/base/base.component';
import { environment } from 'environments/environment';
import { takeUntil } from 'rxjs/operators';
@Component({
selector: 'app-configurable-login',

View File

@ -1,11 +1,11 @@
import { Component, OnInit } from "@angular/core";
import { ActivatedRoute, Params, Router } from "@angular/router";
import { FormControl } from '@angular/forms';
import { ActivatedRoute, Router } from "@angular/router";
import { EmailConfirmationService } from '@app/core/services/email-confirmation/email-confirmation.service';
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
import { BaseComponent } from '@common/base/base.component';
import { TranslateService } from '@ngx-translate/core';
import { takeUntil } from "rxjs/operators";
import { BaseComponent } from "../../../../core/common/base/base.component";
import { EmailConfirmationService } from "../../../../core/services/email-confirmation/email-confirmation.service";
import { UiNotificationService, SnackBarNotificationLevel } from "../../../../core/services/notification/ui-notification-service";
import { TranslateService } from "@ngx-translate/core";
import { FormControl } from "@angular/forms";
@Component({
selector: 'app-email-confirmation-component',
@ -35,8 +35,8 @@ export class EmailConfirmation extends BaseComponent implements OnInit {
this.emailConfirmationService.emailConfirmation(token)
.pipe(takeUntil(this._destroyed))
.subscribe(
result => this.onCallbackEmailConfirmationSuccess(),
error => this.onCallbackError(error)
result => this.onCallbackEmailConfirmationSuccess(),
error => this.onCallbackError(error)
)
} else {
this.showForm = true;
@ -48,8 +48,8 @@ export class EmailConfirmation extends BaseComponent implements OnInit {
this.emailConfirmationService.sendConfirmationEmail(this.emailFormControl.value)
.pipe(takeUntil(this._destroyed))
.subscribe(
result => this.onCallbackSuccess(),
error => this.onCallbackError(error)
result => this.onCallbackSuccess(),
error => this.onCallbackError(error)
)
}

View File

@ -1,12 +1,12 @@
import { HttpClient } from "@angular/common/http";
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Params, Router } from '@angular/router';
import { AuthProvider } from '@app/core/common/enum/auth-provider';
import { AuthService } from '@app/core/services/auth/auth.service';
import { LoginService } from '@app/ui/auth/login/utilities/login.service';
import { BaseComponent } from '@common/base/base.component';
import { environment } from 'environments/environment';
import { takeUntil } from 'rxjs/operators';
import { environment } from '../../../../../environments/environment';
import { BaseComponent } from '../../../../core/common/base/base.component';
import { AuthProvider } from '../../../../core/common/enum/auth-provider';
import { AuthService } from '../../../../core/services/auth/auth.service';
import { LoginService } from '../utilities/login.service';
import { HttpClient } from "@angular/common/http";
@Component({
selector: 'app-linkedin-login',

View File

@ -1,13 +1,14 @@
import { AfterViewInit, Component, OnInit } from '@angular/core';
import { ActivatedRoute, Params, Router } from '@angular/router';
import { AuthProvider } from '@app/core/common/enum/auth-provider';
import { ConfigurableProvider } from '@app/core/model/configurable-provider/configurableProvider';
import { AuthService } from '@app/core/services/auth/auth.service';
import { ConfigurableProvidersService } from '@app/ui/auth/login/utilities/configurableProviders.service';
import { LoginService } from '@app/ui/auth/login/utilities/login.service';
import { BaseComponent } from '@common/base/base.component';
import { environment } from 'environments/environment';
import { takeUntil } from 'rxjs/operators';
import { environment } from '../../../../environments/environment';
import { BaseComponent } from '../../../core/common/base/base.component';
import { AuthProvider } from '../../../core/common/enum/auth-provider';
import { AuthService } from '../../../core/services/auth/auth.service';
import { LoginService } from './utilities/login.service';
import { ConfigurableProvider } from "../../../core/model/configurable-provider/configurableProvider";
import { ConfigurableProvidersService } from "./utilities/configurableProviders.service";
/// <reference types="gapi" />
/// <reference types="facebook-js-sdk" />

View File

@ -1,17 +1,17 @@
import { NgModule } from '@angular/core';
import { CommonFormsModule } from '../../../common/forms/common-forms.module';
import { CommonUiModule } from '../../../common/ui/common-ui.module';
import { LinkedInLoginComponent } from './linkedin-login/linkedin-login.component';
import { LoginComponent } from './login.component';
import { LoginRoutingModule } from './login.routing';
import { TwitterLoginComponent } from './twitter-login/twitter-login.component';
import { LoginService } from './utilities/login.service';
import { B2AccessLoginComponent } from './b2access/b2access-login.component';
import { OrcidLoginComponent } from './orcid-login/orcid-login.component';
import { EmailConfirmation } from './email-confirmation/email-confirmation.component';
import { OpenAireLoginComponent } from "./openaire-login/openaire-login.component";
import { ConfigurableLoginComponent } from "./configurable-login/configurable-login.component";
import { ConfigurableProvidersService } from "./utilities/configurableProviders.service";
import { B2AccessLoginComponent } from '@app/ui/auth/login/b2access/b2access-login.component';
import { ConfigurableLoginComponent } from '@app/ui/auth/login/configurable-login/configurable-login.component';
import { EmailConfirmation } from '@app/ui/auth/login/email-confirmation/email-confirmation.component';
import { LinkedInLoginComponent } from '@app/ui/auth/login/linkedin-login/linkedin-login.component';
import { LoginComponent } from '@app/ui/auth/login/login.component';
import { LoginRoutingModule } from '@app/ui/auth/login/login.routing';
import { OpenAireLoginComponent } from '@app/ui/auth/login/openaire-login/openaire-login.component';
import { OrcidLoginComponent } from '@app/ui/auth/login/orcid-login/orcid-login.component';
import { TwitterLoginComponent } from '@app/ui/auth/login/twitter-login/twitter-login.component';
import { ConfigurableProvidersService } from '@app/ui/auth/login/utilities/configurableProviders.service';
import { LoginService } from '@app/ui/auth/login/utilities/login.service';
import { CommonFormsModule } from '@common/forms/common-forms.module';
import { CommonUiModule } from '@common/ui/common-ui.module';
@NgModule({
imports: [

View File

@ -1,12 +1,12 @@
import { HttpClient } from '@angular/common/http';
import { Component, OnInit } from "@angular/core";
import { BaseComponent } from "../../../../core/common/base/base.component";
import { ActivatedRoute, Router, Params } from "@angular/router";
import { LoginService } from "../utilities/login.service";
import { AuthService } from "../../../../core/services/auth/auth.service";
import { HttpClient } from "@angular/common/http";
import { takeUntil } from "rxjs/operators";
import { environment } from "../../../../../environments/environment";
import { AuthProvider } from "../../../../core/common/enum/auth-provider";
import { ActivatedRoute, Params, Router } from '@angular/router';
import { AuthProvider } from '@app/core/common/enum/auth-provider';
import { AuthService } from '@app/core/services/auth/auth.service';
import { LoginService } from '@app/ui/auth/login/utilities/login.service';
import { BaseComponent } from '@common/base/base.component';
import { environment } from 'environments/environment';
import { takeUntil } from 'rxjs/operators';
@Component({
selector: 'app-openaire-login',

View File

@ -1,14 +1,14 @@
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
import { BaseComponent } from '../../../../core/common/base/base.component';
import { LoginService } from '../utilities/login.service';
import { ActivatedRoute, Params } from '@angular/router';
import { takeUntil } from 'rxjs/operators';
import { environment } from '../../../../../environments/environment';
import { AuthService } from '../../../../core/services/auth/auth.service';
import { AuthProvider } from '../../../../core/common/enum/auth-provider';
import { HttpHeaders, HttpClient } from '@angular/common/http';
import { OrcidUser } from '../../../../core/model/orcid/orcidUser';
import { FormControl } from '@angular/forms';
import { ActivatedRoute, Params } from '@angular/router';
import { AuthProvider } from '@app/core/common/enum/auth-provider';
import { OrcidUser } from '@app/core/model/orcid/orcidUser';
import { AuthService } from '@app/core/services/auth/auth.service';
import { LoginService } from '@app/ui/auth/login/utilities/login.service';
import { BaseComponent } from '@common/base/base.component';
import { environment } from 'environments/environment';
import { takeUntil } from 'rxjs/operators';
@Component({
selector: 'app-orcid-login',
@ -63,8 +63,8 @@ export class OrcidLoginComponent extends BaseComponent implements OnInit {
this.authService.login({ ticket: this.accessToken, provider: AuthProvider.ORCID, data: this.orcidUser })
.pipe(takeUntil(this._destroyed))
.subscribe(
res => this.loginService.onLogInSuccess(res, this.returnUrl),
error => this.loginService.onLogInError(error)
res => this.loginService.onLogInSuccess(res, this.returnUrl),
error => this.loginService.onLogInError(error)
);
});
}
@ -74,8 +74,8 @@ export class OrcidLoginComponent extends BaseComponent implements OnInit {
this.authService.login({ ticket: this.accessToken, provider: AuthProvider.ORCID, data: this.orcidUser })
.pipe(takeUntil(this._destroyed))
.subscribe(
res => this.loginService.onLogInSuccess(res, this.returnUrl),
error => this.loginService.onLogInError(error)
res => this.loginService.onLogInSuccess(res, this.returnUrl),
error => this.loginService.onLogInError(error)
);
}
}

View File

@ -1,13 +1,13 @@
import { HttpHeaders } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Params } from '@angular/router';
import { AuthProvider } from '@app/core/common/enum/auth-provider';
import { AuthService } from '@app/core/services/auth/auth.service';
import { BaseHttpService } from '@app/core/services/http/base-http.service';
import { LoginService } from '@app/ui/auth/login/utilities/login.service';
import { BaseComponent } from '@common/base/base.component';
import { environment } from 'environments/environment';
import { takeUntil } from 'rxjs/operators';
import { environment } from '../../../../../environments/environment';
import { BaseComponent } from '../../../../core/common/base/base.component';
import { AuthService } from '../../../../core/services/auth/auth.service';
import { BaseHttpService } from '../../../../core/services/http/base-http.service';
import { LoginService } from '../utilities/login.service';
import { AuthProvider } from '../../../../core/common/enum/auth-provider';
@Component({
selector: 'app-twitter-login',

View File

@ -1,6 +1,6 @@
import { Injectable } from "@angular/core";
import { BaseService } from "../../../../core/common/base/base.service";
import { ConfigurableProvider } from "../../../../core/model/configurable-provider/configurableProvider";
import { BaseService } from '@common/base/base.service';
import { ConfigurableProvider } from '@app/core/model/configurable-provider/configurableProvider';
@Injectable()
export class ConfigurableProvidersService extends BaseService {

View File

@ -1,10 +1,10 @@
import { Injectable, NgZone } from '@angular/core';
import { Router } from '@angular/router';
import { AuthService } from '@app/core/services/auth/auth.service';
import { CultureService } from '@app/core/services/culture/culture-service';
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
import { BaseService } from '@common/base/base.service';
import { TranslateService } from '@ngx-translate/core';
import { BaseService } from '../../../../core/common/base/base.service';
import { CultureService } from '../../../../core/services/culture/culture-service';
import { UiNotificationService, SnackBarNotificationLevel } from '../../../../core/services/notification/ui-notification-service';
import { AuthService } from '../../../../core/services/auth/auth.service';
@Injectable()
export class LoginService extends BaseService {

View File

@ -1,13 +1,13 @@
import { FormGroup, AbstractControl, FormControl, FormArray } from '@angular/forms';
import { Component, OnInit, Input } from '@angular/core';
import { Location } from '@angular/common';
import { takeUntil } from 'rxjs/operators';
import { Component, Input, OnInit } from '@angular/core';
import { AbstractControl, FormArray, FormControl, FormGroup } from '@angular/forms';
import { ContactEmailFormModel } from '@app/core/model/contact/contact-email-form-model';
import { ContactSupportService } from '@app/core/services/contact-support/contact-support.service';
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
import { BaseComponent } from '@common/base/base.component';
import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model';
import { TranslateService } from '@ngx-translate/core';
import { ContactEmailFormModel } from '../../../core/model/contact/contact-email-form-model';
import { ContactSupportService } from '../../../core/services/contact-support/contact-support.service';
import { BaseComponent } from '../../../core/common/base/base.component';
import { UiNotificationService, SnackBarNotificationLevel } from '../../../core/services/notification/ui-notification-service';
import { ValidationErrorModel } from '../../../common/forms/validation/error-model/validation-error-model';
import { takeUntil } from 'rxjs/operators';
@Component({
selector: 'app-contact-content',

View File

@ -1,9 +1,9 @@
import { NgModule } from '@angular/core';
import { CommonUiModule } from '../../common/ui/common-ui.module';
import { ContactRoutingModule } from './contact.routing';
import { ContactContentComponent } from './contact-content/contact-content.component';
import { ContactDialogComponent } from './contact-dialog/contact-dialog.component';
import { ReactiveFormsModule } from '@angular/forms';
import { ContactContentComponent } from '@app/ui/contact/contact-content/contact-content.component';
import { ContactDialogComponent } from '@app/ui/contact/contact-dialog/contact-dialog.component';
import { ContactRoutingModule } from '@app/ui/contact/contact.routing';
import { CommonUiModule } from '@common/ui/common-ui.module';
@NgModule({
imports: [

View File

@ -1,33 +1,32 @@
import {of as observableOf, Observable } from 'rxjs';
import {mergeMap, takeUntil } from 'rxjs/operators';
import { Component, OnInit } from '@angular/core';
import { FormControl } from '@angular/forms';
import { Router, ActivatedRoute, Params } from '@angular/router';
import { BaseComponent } from '../../core/common/base/base.component';
import { RecentActivityType } from '../../core/common/enum/recent-activity-type';
import { DashboardStatisticsModel } from '../../core/model/dashboard/dashboard-statistics-model';
import { SearchBarItem } from '../../core/model/dashboard/search-bar-item';
import { GrantCriteria } from '../../core/query/grant/grant-criteria';
import { AuthService } from '../../core/services/auth/auth.service';
import { DashboardService } from '../../core/services/dashboard/dashboard.service';
import { GrantService } from '../../core/services/grant/grant.service';
import { SearchBarService } from '../../core/services/search-bar/search-bar.service';
import { UserService } from '../../core/services/user/user.service';
import { SingleAutoCompleteConfiguration } from '../../library/auto-complete/single/single-auto-complete-configuration';
import { RequestItem } from '../../core/query/request-item';
import { DmpListingModel } from '../../core/model/dmp/dmp-listing';
import { DmpService } from '../../core/services/dmp/dmp.service';
import { DataTableRequest } from '../../core/model/data-table/data-table-request';
import { DmpCriteria } from '../../core/query/dmp/dmp-criteria';
import { ExploreDmpCriteriaModel } from '../../core/query/explore-dmp/explore-dmp-criteria';
import { DatasetListingModel } from '../../core/model/dataset/dataset-listing';
import { DatasetService } from '../../core/services/dataset/dataset.service';
import { ExploreDatasetCriteriaModel } from '../../core/query/explore-dataset/explore-dataset-criteria';
import { ActivatedRoute, Router } from '@angular/router';
import { RecentActivityType } from '@app/core/common/enum/recent-activity-type';
import { DashboardStatisticsModel } from '@app/core/model/dashboard/dashboard-statistics-model';
import { SearchBarItem } from '@app/core/model/dashboard/search-bar-item';
import { DataTableRequest } from '@app/core/model/data-table/data-table-request';
import { DatasetListingModel } from '@app/core/model/dataset/dataset-listing';
import { DmpListingModel } from '@app/core/model/dmp/dmp-listing';
import { ExploreDatasetCriteriaModel } from '@app/core/query/explore-dataset/explore-dataset-criteria';
import { ExploreDmpCriteriaModel } from '@app/core/query/explore-dmp/explore-dmp-criteria';
import { GrantCriteria } from '@app/core/query/grant/grant-criteria';
import { RequestItem } from '@app/core/query/request-item';
import { AuthService } from '@app/core/services/auth/auth.service';
import { DashboardService } from '@app/core/services/dashboard/dashboard.service';
import { DatasetService } from '@app/core/services/dataset/dataset.service';
import { DmpService } from '@app/core/services/dmp/dmp.service';
import { GrantService } from '@app/core/services/grant/grant.service';
import { SearchBarService } from '@app/core/services/search-bar/search-bar.service';
import { UserService } from '@app/core/services/user/user.service';
import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration';
import { BaseComponent } from '@common/base/base.component';
import { Observable, of as observableOf } from 'rxjs';
import { mergeMap, takeUntil } from 'rxjs/operators';
import { BreadcrumbItem } from '../misc/breadcrumb/definition/breadcrumb-item';
import { IBreadCrumbComponent } from '../misc/breadcrumb/definition/IBreadCrumbComponent';
@Component({
selector: 'app-dashboard',
templateUrl: './dashboard.component.html',

View File

@ -1,25 +1,26 @@
import { NgModule } from '@angular/core';
import { CommonUiModule } from '../../common/ui/common-ui.module';
import { CardComponent } from './card/card.component';
import { DashboardComponent } from './dashboard.component';
import { DashboardRoutingModule } from './dashboard.routing';
import { DraftsComponent } from './drafts/drafts.component';
import { InfoCounterComponent } from './info-counter/info-counter.component';
import { QuickWizardCreateAdd } from './quick-wizard-create-add/quick-wizard-create-add.component';
import { RecentActivityComponent } from './recent-activity/recent-activity.component';
import { RecentEditedActivityComponent } from './recent-edited-activity/recent-edited-activity.component';
import { RecentVisitedActivityComponent } from './recent-visited-activity/recent-visited-activity.component';
import { WizardComponent } from './wizard/wizard.component';
import { DmpInfoCounterComponent } from './dmp-info-counter/dmp-info-counter.component';
import { DatasetInfoCounterComponent } from './dataset-info-counter/dataset-info-counter.component';
import { ExportMethodDialogModule } from '../../library/export-method-dialog/export-method-dialog.module';
import { ExportMethodDialogModule } from '@app/library/export-method-dialog/export-method-dialog.module';
import { CardComponent } from '@app/ui/dashboard/card/card.component';
import { DashboardComponent } from '@app/ui/dashboard/dashboard.component';
import { DashboardRoutingModule } from '@app/ui/dashboard/dashboard.routing';
import { DatasetInfoCounterComponent } from '@app/ui/dashboard/dataset-info-counter/dataset-info-counter.component';
import { DmpInfoCounterComponent } from '@app/ui/dashboard/dmp-info-counter/dmp-info-counter.component';
import { DraftsComponent } from '@app/ui/dashboard/drafts/drafts.component';
import { InfoCounterComponent } from '@app/ui/dashboard/info-counter/info-counter.component';
import { QuickWizardCreateAdd } from '@app/ui/dashboard/quick-wizard-create-add/quick-wizard-create-add.component';
import { RecentActivityComponent } from '@app/ui/dashboard/recent-activity/recent-activity.component';
import { RecentEditedActivityComponent } from '@app/ui/dashboard/recent-edited-activity/recent-edited-activity.component';
import { RecentVisitedActivityComponent } from '@app/ui/dashboard/recent-visited-activity/recent-visited-activity.component';
import { WizardComponent } from '@app/ui/dashboard/wizard/wizard.component';
import { CommonUiModule } from '@common/ui/common-ui.module';
import { ConfirmationDialogModule } from '@common/modules/confirmation-dialog/confirmation-dialog.module';
@NgModule({
imports: [
CommonUiModule,
DashboardRoutingModule,
ExportMethodDialogModule
ExportMethodDialogModule,
ConfirmationDialogModule
],
declarations: [
DashboardComponent,

View File

@ -1,8 +1,8 @@
import { BaseComponent } from "../../../core/common/base/base.component";
import { OnInit, Component } from "@angular/core";
import { Router, ActivatedRoute } from "@angular/router";
import { TranslateService } from "@ngx-translate/core";
import { Component, OnInit } from "@angular/core";
import { MatSnackBar } from "@angular/material/snack-bar";
import { ActivatedRoute, Router } from "@angular/router";
import { BaseComponent } from '@common/base/base.component';
import { TranslateService } from "@ngx-translate/core";
@Component({
selector: 'app-quick-wizard-create-add-component',
@ -22,15 +22,15 @@ export class QuickWizardCreateAdd extends BaseComponent implements OnInit {
ngOnInit(): void {
}
navigateToCreate(){
navigateToCreate() {
this.router.navigate(["/quick-wizard"]);
}
navigateToAdd(){
navigateToAdd() {
this.router.navigate(["/datasetcreatewizard"]);
}

View File

@ -1,9 +1,9 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { RecentActivityType } from '@app/core/common/enum/recent-activity-type';
import { UserService } from '@app/core/services/user/user.service';
import { BaseComponent } from '@common/base/base.component';
import { takeUntil } from 'rxjs/operators';
import { BaseComponent } from '../../../core/common/base/base.component';
import { RecentActivityType } from '../../../core/common/enum/recent-activity-type';
import { UserService } from '../../../core/services/user/user.service';
@Component({
selector: 'app-recent-activity',

View File

@ -1,19 +1,18 @@
import { Component, OnInit } from '@angular/core';
import { DmpListingModel } from '../../../core/model/dmp/dmp-listing';
import { EnumUtils } from '../../../core/services/utilities/enum-utils.service';
import { AuthService } from '../../../core/services/auth/auth.service';
import { DataTableRequest } from '../../../core/model/data-table/data-table-request';
import { DmpCriteria } from '../../../core/query/dmp/dmp-criteria';
import { DmpService } from '../../../core/services/dmp/dmp.service';
import { RecentActivityType } from '../../../core/common/enum/recent-activity-type';
import { MatDialog } from '@angular/material';
import { Router } from '@angular/router';
import { Principal } from '../../../core/model/auth/Principal';
import { RecentActivityType } from '@app/core/common/enum/recent-activity-type';
import { Principal } from '@app/core/model/auth/Principal';
import { DataTableRequest } from '@app/core/model/data-table/data-table-request';
import { DmpListingModel } from '@app/core/model/dmp/dmp-listing';
import { DmpCriteria } from '@app/core/query/dmp/dmp-criteria';
import { AuthService } from '@app/core/services/auth/auth.service';
import { DmpService } from '@app/core/services/dmp/dmp.service';
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component';
import { BaseComponent } from '@common/base/base.component';
import { TranslateService } from '@ngx-translate/core';
import { ConfirmationDialogComponent } from '../../../library/confirmation-dialog/confirmation-dialog.component';
import { MatDialog } from '@angular/material/dialog';
import { ExportMethodDialogComponent } from '../../../library/export-method-dialog/export-method-dialog.component';
import { BaseComponent } from '../../../core/common/base/base.component';
import { UiNotificationService, SnackBarNotificationLevel } from '../../../core/services/notification/ui-notification-service';
import * as FileSaver from 'file-saver';
import { takeUntil } from 'rxjs/operators';
@ -80,8 +79,8 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn
this.dmpService.delete(dmp.id)
.pipe(takeUntil(this._destroyed))
.subscribe(
complete => { this.onCallbackSuccess() },
error => this.onDeleteCallbackError(error)
complete => { this.onCallbackSuccess() },
error => this.onDeleteCallbackError(error)
);
}
});

View File

@ -1,15 +1,13 @@
import { Component, OnInit } from "@angular/core";
import { RecentActivityType } from "../../../core/common/enum/recent-activity-type";
import { BaseComponent } from "../../../core/common/base/base.component";
import { Router } from "@angular/router";
import { AuthService } from "../../../core/services/auth/auth.service";
import { UserService } from "../../../core/services/user/user.service";
import { takeUntil } from "rxjs/operators";
import { DmpService } from "../../../core/services/dmp/dmp.service";
import { DataTableRequest } from "../../../core/model/data-table/data-table-request";
import { DmpCriteria } from "../../../core/query/dmp/dmp-criteria";
import { DmpListingModel } from "../../../core/model/dmp/dmp-listing";
import { EnumUtils } from "../../../core/services/utilities/enum-utils.service";
import { Router } from '@angular/router';
import { RecentActivityType } from '@app/core/common/enum/recent-activity-type';
import { DataTableRequest } from '@app/core/model/data-table/data-table-request';
import { DmpListingModel } from '@app/core/model/dmp/dmp-listing';
import { DmpCriteria } from '@app/core/query/dmp/dmp-criteria';
import { AuthService } from '@app/core/services/auth/auth.service';
import { DmpService } from '@app/core/services/dmp/dmp.service';
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
import { BaseComponent } from '@common/base/base.component';
@Component({
selector: "app-recent-visited-activity",

View File

@ -1,22 +1,21 @@
import { of as observableOf, Observable } from 'rxjs';
import { Component, OnInit, ViewChild } from '@angular/core';
import { FormBuilder, FormGroup, FormArray } from '@angular/forms';
import { FormArray, FormBuilder, FormGroup } from '@angular/forms';
import { MatDialog } from '@angular/material/dialog';
import { MatStepper } from '@angular/material/stepper';
import { Router } from '@angular/router';
import { BaseComponent } from '../../core/common/base/base.component';
import { QuickWizardService } from '../../core/services/quick-wizard/quick-wizard.service';
import { DatasetCreateWizardModel } from './dataset-create-wizard.model';
import { IBreadCrumbComponent } from '../misc/breadcrumb/definition/IBreadCrumbComponent';
import { takeUntil } from 'rxjs/operators';
import { BreadcrumbItem } from '../misc/breadcrumb/definition/breadcrumb-item';
import { SnackBarNotificationLevel, UiNotificationService } from '../../core/services/notification/ui-notification-service';
import { DatasetStatus } from '@app/core/common/enum/dataset-status';
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
import { QuickWizardService } from '@app/core/services/quick-wizard/quick-wizard.service';
import { CheckDeactivateBaseComponent } from '@app/library/deactivate/deactivate.component';
import { DatasetCreateWizardModel } from '@app/ui/dataset-create-wizard/dataset-create-wizard.model';
import { BreadcrumbItem } from '@app/ui/misc/breadcrumb/definition/breadcrumb-item';
import { IBreadCrumbComponent } from '@app/ui/misc/breadcrumb/definition/IBreadCrumbComponent';
import { DatasetEditorWizardComponent } from '@app/ui/quick-wizard/dataset-editor/dataset-editor-wizard.component';
import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component';
import { TranslateService } from '@ngx-translate/core';
import { DatasetEditorWizardComponent } from '../quick-wizard/dataset-editor/dataset-editor-wizard.component';
import { DatasetStatus } from '../../core/common/enum/dataset-status';
import { ConfirmationDialogComponent } from '../../library/confirmation-dialog/confirmation-dialog.component';
import { CheckDeactivateBaseComponent } from '../../library/deactivate/deactivate.component';
import { Observable, of as observableOf } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
@Component({
selector: 'dataset-create-wizard.component',

View File

@ -1,10 +1,10 @@
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
import { BackendErrorValidator } from "../../common/forms/validation/custom-validator";
import { ValidationErrorModel } from "../../common/forms/validation/error-model/validation-error-model";
import { ValidationContext } from "../../common/forms/validation/validation-context";
import { DmpCreateWizardFormModel } from "../../core/model/dmp/dmp-create-wizard/dmp-create-wizard-form.model";
import { DatasetWizardEditorModel } from "../dataset/dataset-wizard/dataset-wizard-editor.model";
import { DatasetEditorWizardModel } from "../quick-wizard/dataset-editor/dataset-editor-wizard-model";
import { DmpCreateWizardFormModel } from '@app/core/model/dmp/dmp-create-wizard/dmp-create-wizard-form.model';
import { DatasetWizardEditorModel } from '@app/ui/dataset/dataset-wizard/dataset-wizard-editor.model';
import { DatasetEditorWizardModel } from '@app/ui/quick-wizard/dataset-editor/dataset-editor-wizard-model';
import { BackendErrorValidator } from '@common/forms/validation/custom-validator';
import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model';
import { ValidationContext } from '@common/forms/validation/validation-context';
export class DatasetCreateWizardModel {

View File

@ -1,18 +1,17 @@
import { NgModule } from '@angular/core';
import { CommonFormsModule } from '../../common/forms/common-forms.module';
import { CommonUiModule } from '../../common/ui/common-ui.module';
import { FormattingModule } from '../../core/formatting.module';
import { AutoCompleteModule } from '../../library/auto-complete/auto-complete.module';
import { ConfirmationDialogModule } from '../../library/confirmation-dialog/confirmation-dialog.module';
import { UrlListingModule } from '../../library/url-listing/url-listing.module';
import { DatasetDescriptionFormModule } from '../misc/dataset-description-form/dataset-description-form.module';
import { OuickWizardModule } from '../quick-wizard/quick-wizard.module';
import { DatasetCreateWizard } from './dataset-create-wizard.component';
import { DatasetCreateWizardRoutingModule } from './dataset-create-wizard.routing';
import { DatasetDmpSelector } from './dmp-selector/dataset-dmp-selector.component';
import { QuickWizardRoutingModule } from '../quick-wizard/quick-wizard.routing';
import { CanDeactivateGuard } from '../../library/deactivate/can-deactivate.guard';
import { FormattingModule } from '@app/core/formatting.module';
import { AutoCompleteModule } from '@app/library/auto-complete/auto-complete.module';
import { ConfirmationDialogModule } from '@common/modules/confirmation-dialog/confirmation-dialog.module';
import { CanDeactivateGuard } from '@app/library/deactivate/can-deactivate.guard';
import { UrlListingModule } from '@app/library/url-listing/url-listing.module';
import { DatasetCreateWizard } from '@app/ui/dataset-create-wizard/dataset-create-wizard.component';
import { DatasetCreateWizardRoutingModule } from '@app/ui/dataset-create-wizard/dataset-create-wizard.routing';
import { DatasetDmpSelector } from '@app/ui/dataset-create-wizard/dmp-selector/dataset-dmp-selector.component';
import { DatasetDescriptionFormModule } from '@app/ui/misc/dataset-description-form/dataset-description-form.module';
import { OuickWizardModule } from '@app/ui/quick-wizard/quick-wizard.module';
import { QuickWizardRoutingModule } from '@app/ui/quick-wizard/quick-wizard.routing';
import { CommonFormsModule } from '@common/forms/common-forms.module';
import { CommonUiModule } from '@common/ui/common-ui.module';
@NgModule({
imports: [

View File

@ -3,21 +3,21 @@ import { Component, Input, OnInit } from '@angular/core';
import { FormArray, FormControl, FormGroup } from '@angular/forms';
import { MatStepper } from '@angular/material/stepper';
import { ActivatedRoute, Router } from '@angular/router';
import { DmpStatus } from '@app/core/common/enum/dmp-status';
import { DataTableRequest } from '@app/core/model/data-table/data-table-request';
import { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile';
import { DmpListingModel } from '@app/core/model/dmp/dmp-listing';
import { DatasetProfileCriteria } from '@app/core/query/dataset-profile/dataset-profile-criteria';
import { DmpCriteria } from '@app/core/query/dmp/dmp-criteria';
import { RequestItem } from '@app/core/query/request-item';
import { DatasetWizardService } from '@app/core/services/dataset-wizard/dataset-wizard.service';
import { DmpService } from '@app/core/services/dmp/dmp.service';
import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration';
import { BreadcrumbItem } from '@app/ui/misc/breadcrumb/definition/breadcrumb-item';
import { IBreadCrumbComponent } from '@app/ui/misc/breadcrumb/definition/IBreadCrumbComponent';
import { BaseComponent } from '@common/base/base.component';
import { Observable } from 'rxjs';
import { map, takeUntil } from 'rxjs/operators';
import { BaseComponent } from '../../../core/common/base/base.component';
import { DmpStatus } from '../../../core/common/enum/dmp-status';
import { DataTableRequest } from '../../../core/model/data-table/data-table-request';
import { DatasetProfileModel } from '../../../core/model/dataset/dataset-profile';
import { DmpListingModel } from '../../../core/model/dmp/dmp-listing';
import { DatasetProfileCriteria } from '../../../core/query/dataset-profile/dataset-profile-criteria';
import { DmpCriteria } from '../../../core/query/dmp/dmp-criteria';
import { RequestItem } from '../../../core/query/request-item';
import { DatasetWizardService } from '../../../core/services/dataset-wizard/dataset-wizard.service';
import { DmpService } from '../../../core/services/dmp/dmp.service';
import { SingleAutoCompleteConfiguration } from '../../../library/auto-complete/single/single-auto-complete-configuration';
import { BreadcrumbItem } from '../../misc/breadcrumb/definition/breadcrumb-item';
import { IBreadCrumbComponent } from '../../misc/breadcrumb/definition/IBreadCrumbComponent';
@Component({
selector: 'dataset-dmp-selector-component',

View File

@ -1,5 +1,5 @@
import {map} from 'rxjs/operators';
import { map, filter } from 'rxjs/operators';
import { Component } from "@angular/core";
import { MatDialogRef, MAT_DIALOG_DATA } from "@angular/material/dialog";
import { SingleAutoCompleteConfiguration } from "../../../../library/auto-complete/single/single-auto-complete-configuration";
@ -37,8 +37,6 @@ export class DatasetCopyDialogueComponent {
initialItems: (extraData) => this.searchDmp(''),
displayFn: (item) => item['label'],
titleFn: (item) => item['label'],
disableOption: (item) => !this.existsDatasetDescriptionTemplate(item['associatedProfiles']),
subtitleFn: (item) => !this.existsDatasetDescriptionTemplate(item['associatedProfiles']) ? this.getErrorMessage() : null
};
}
@ -52,7 +50,7 @@ export class DatasetCopyDialogueComponent {
this.dialogRef.close(this.data);
}
else if (!this.data.datasetProfileExist) {
this.data.formControl.setErrors({'incorrect': true});
this.data.formControl.setErrors({ 'incorrect': true });
}
});
}
@ -63,7 +61,7 @@ export class DatasetCopyDialogueComponent {
const dmpDataTableRequest: DataTableRequest<DmpCriteria> = new DataTableRequest(0, null, { fields: fields });
dmpDataTableRequest.criteria = new DmpCriteria();
dmpDataTableRequest.criteria.like = query;
return this.dmpService.getPaged(dmpDataTableRequest, "autocomplete").pipe(map(x => x.data));
return this.dmpService.getPaged(dmpDataTableRequest, "autocomplete").pipe(map(x => x.data), map(x => x.filter(y => this.existsDatasetDescriptionTemplate(y.associatedProfiles))));
}
existsDatasetDescriptionTemplate(associatedProfiles: DmpAssociatedProfileModel[]): boolean {
@ -79,7 +77,7 @@ export class DatasetCopyDialogueComponent {
this.data.datasetProfileExist = true;
}
})
}),);
}));
}
getErrorMessage() {

View File

@ -1,7 +1,7 @@
import { Component, Input } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { Router } from '@angular/router';
import { BaseComponent } from '../../../../core/common/base/base.component';
import { BaseComponent } from '@common/base/base.component';
@Component({
selector: 'app-dataset-editor-component',

View File

@ -1,17 +1,17 @@
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
import { BackendErrorValidator } from "../../../common/forms/validation/custom-validator";
import { ValidationErrorModel } from "../../../common/forms/validation/error-model/validation-error-model";
import { ValidationContext } from "../../../common/forms/validation/validation-context";
import { ExternalDatasetType } from "../../../core/common/enum/external-dataset-type";
import { DataRepositoryModel } from "../../../core/model/data-repository/data-repository";
import { DatasetProfileModel } from "../../../core/model/dataset/dataset-profile";
import { DatasetWizardModel } from "../../../core/model/dataset/dataset-wizard";
import { DmpModel } from "../../../core/model/dmp/dmp";
import { ExternalDatasetModel } from "../../../core/model/external-dataset/external-dataset";
import { RegistryModel } from "../../../core/model/registry/registry";
import { ServiceModel } from "../../../core/model/service/service";
import { TagModel } from "../../../core/model/tag/tag";
import { DatasetDescriptionFormEditorModel } from "../../misc/dataset-description-form/dataset-description-form.model";
import { ExternalDatasetType } from '@app/core/common/enum/external-dataset-type';
import { DataRepositoryModel } from '@app/core/model/data-repository/data-repository';
import { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile';
import { DatasetWizardModel } from '@app/core/model/dataset/dataset-wizard';
import { DmpModel } from '@app/core/model/dmp/dmp';
import { ExternalDatasetModel } from '@app/core/model/external-dataset/external-dataset';
import { RegistryModel } from '@app/core/model/registry/registry';
import { ServiceModel } from '@app/core/model/service/service';
import { TagModel } from '@app/core/model/tag/tag';
import { DatasetDescriptionFormEditorModel } from '@app/ui/misc/dataset-description-form/dataset-description-form.model';
import { BackendErrorValidator } from '@common/forms/validation/custom-validator';
import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model';
import { ValidationContext } from '@common/forms/validation/validation-context';
export class DatasetWizardEditorModel {
public id: string;

View File

@ -1,37 +1,36 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { Component, OnInit } from '@angular/core';
import { FormControl, FormGroup } from '@angular/forms';
import { MatDialog } from '@angular/material/dialog';
import { MatSnackBar } from '@angular/material/snack-bar';
import { MatStepper } from '@angular/material/stepper';
import { ActivatedRoute, Router } from '@angular/router';
import { DatasetStatus } from '@app/core/common/enum/dataset-status';
import { DmpStatus } from '@app/core/common/enum/dmp-status';
import { DataTableRequest } from '@app/core/model/data-table/data-table-request';
import { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile';
import { DmpModel } from '@app/core/model/dmp/dmp';
import { DmpListingModel } from '@app/core/model/dmp/dmp-listing';
import { DatasetProfileCriteria } from '@app/core/query/dataset-profile/dataset-profile-criteria';
import { DmpCriteria } from '@app/core/query/dmp/dmp-criteria';
import { RequestItem } from '@app/core/query/request-item';
import { DatasetWizardService } from '@app/core/services/dataset-wizard/dataset-wizard.service';
import { DmpService } from '@app/core/services/dmp/dmp.service';
import { ExternalSourcesConfigurationService } from '@app/core/services/external-sources/external-sources-configuration.service';
import { ExternalSourcesService } from '@app/core/services/external-sources/external-sources.service';
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration';
import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component';
import { DatasetCopyDialogueComponent } from '@app/ui/dataset/dataset-wizard/dataset-copy-dialogue/dataset-copy-dialogue.component';
import { DatasetWizardEditorModel } from '@app/ui/dataset/dataset-wizard/dataset-wizard-editor.model';
import { BreadcrumbItem } from '@app/ui/misc/breadcrumb/definition/breadcrumb-item';
import { IBreadCrumbComponent } from '@app/ui/misc/breadcrumb/definition/IBreadCrumbComponent';
import { DatasetDescriptionFormEditorModel } from '@app/ui/misc/dataset-description-form/dataset-description-form.model';
import { LinkToScroll } from '@app/ui/misc/dataset-description-form/tableOfContentsMaterial/table-of-contents';
import { BaseComponent } from '@common/base/base.component';
import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model';
import { TranslateService } from '@ngx-translate/core';
import * as FileSaver from 'file-saver';
import { Observable, of as observableOf } from 'rxjs';
import { catchError, map, takeUntil } from 'rxjs/operators';
import { ValidationErrorModel } from '../../../common/forms/validation/error-model/validation-error-model';
import { BaseComponent } from '../../../core/common/base/base.component';
import { DatasetStatus } from '../../../core/common/enum/dataset-status';
import { DmpStatus } from '../../../core/common/enum/dmp-status';
import { DataTableRequest } from '../../../core/model/data-table/data-table-request';
import { DatasetProfileModel } from '../../../core/model/dataset/dataset-profile';
import { DmpModel } from '../../../core/model/dmp/dmp';
import { DmpListingModel } from '../../../core/model/dmp/dmp-listing';
import { DatasetProfileCriteria } from '../../../core/query/dataset-profile/dataset-profile-criteria';
import { DmpCriteria } from '../../../core/query/dmp/dmp-criteria';
import { RequestItem } from '../../../core/query/request-item';
import { DatasetWizardService } from '../../../core/services/dataset-wizard/dataset-wizard.service';
import { DmpService } from '../../../core/services/dmp/dmp.service';
import { ExternalSourcesConfigurationService } from '../../../core/services/external-sources/external-sources-configuration.service';
import { ExternalSourcesService } from '../../../core/services/external-sources/external-sources.service';
import { SnackBarNotificationLevel, UiNotificationService } from '../../../core/services/notification/ui-notification-service';
import { SingleAutoCompleteConfiguration } from '../../../library/auto-complete/single/single-auto-complete-configuration';
import { ConfirmationDialogComponent } from '../../../library/confirmation-dialog/confirmation-dialog.component';
import { BreadcrumbItem } from '../../misc/breadcrumb/definition/breadcrumb-item';
import { IBreadCrumbComponent } from '../../misc/breadcrumb/definition/IBreadCrumbComponent';
import { DatasetDescriptionFormEditorModel } from '../../misc/dataset-description-form/dataset-description-form.model';
import { LinkToScroll } from '../../misc/dataset-description-form/tableOfContentsMaterial/table-of-contents';
import { DatasetCopyDialogueComponent } from './dataset-copy-dialogue/dataset-copy-dialogue.component';
import { DatasetWizardEditorModel } from './dataset-wizard-editor.model';
@Component({
selector: 'app-dataset-wizard-component',
@ -397,7 +396,7 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr
public isSemiFormValid(formGroup: FormGroup): boolean {
var isValid: boolean = true;
Object.keys(formGroup.controls).forEach(controlName => {
if (controlName != 'datasetProfileDefinition' && !formGroup.get(controlName).disabled && !(formGroup.get(controlName).valid)) {
if (controlName != 'datasetProfileDefinition' && !formGroup.get(controlName).disabled && !(formGroup.get(controlName).valid)) {
isValid = false;
}
});

View File

@ -2,26 +2,26 @@ import { Component, Input, OnInit } from '@angular/core';
import { FormArray, FormGroup } from '@angular/forms';
import { MatDialog } from '@angular/material/dialog';
import { Router } from '@angular/router';
import { ExternalSourceItemModel } from '@app/core/model/external-sources/external-source-item';
import { ExternalSourcesConfiguration } from '@app/core/model/external-sources/external-sources-configuration';
import { DataRepositoryCriteria } from '@app/core/query/data-repository/data-repository-criteria';
import { ExternalDatasetCriteria } from '@app/core/query/external-dataset/external-dataset-criteria';
import { RegistryCriteria } from '@app/core/query/registry/registry-criteria';
import { RequestItem } from '@app/core/query/request-item';
import { ServiceCriteria } from '@app/core/query/service/service-criteria';
import { TagCriteria } from '@app/core/query/tag/tag-criteria';
import { ExternalSourcesConfigurationService } from '@app/core/services/external-sources/external-sources-configuration.service';
import { ExternalSourcesService } from '@app/core/services/external-sources/external-sources.service';
import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration';
import { ExternalDataRepositoryEditorModel, ExternalDatasetEditorModel, ExternalRegistryEditorModel, ExternalServiceEditorModel, ExternalTagEditorModel } from '@app/ui/dataset/dataset-wizard/dataset-wizard-editor.model';
import { DatasetExternalDataRepositoryDialogEditorComponent } from '@app/ui/dataset/dataset-wizard/external-references/editors/data-repository/dataset-external-data-repository-dialog-editor.component';
import { DatasetExternalDatasetDialogEditorComponent } from '@app/ui/dataset/dataset-wizard/external-references/editors/external-dataset/dataset-external-dataset-dialog-editor.component';
import { DatasetExternalRegistryDialogEditorComponent } from '@app/ui/dataset/dataset-wizard/external-references/editors/registry/dataset-external-registry-dialog-editor.component';
import { DatasetExternalServiceDialogEditorComponent } from '@app/ui/dataset/dataset-wizard/external-references/editors/service/dataset-external-service-dialog-editor.component';
import { BaseComponent } from '@common/base/base.component';
import { TranslateService } from '@ngx-translate/core';
import { Observable } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { BaseComponent } from '../../../../core/common/base/base.component';
import { ExternalSourceItemModel } from '../../../../core/model/external-sources/external-source-item';
import { ExternalSourcesConfiguration } from '../../../../core/model/external-sources/external-sources-configuration';
import { DataRepositoryCriteria } from '../../../../core/query/data-repository/data-repository-criteria';
import { ExternalDatasetCriteria } from '../../../../core/query/external-dataset/external-dataset-criteria';
import { RegistryCriteria } from '../../../../core/query/registry/registry-criteria';
import { ServiceCriteria } from '../../../../core/query/service/service-criteria';
import { TagCriteria } from '../../../../core/query/tag/tag-criteria';
import { ExternalSourcesConfigurationService } from '../../../../core/services/external-sources/external-sources-configuration.service';
import { ExternalSourcesService } from '../../../../core/services/external-sources/external-sources.service';
import { SingleAutoCompleteConfiguration } from '../../../../library/auto-complete/single/single-auto-complete-configuration';
import { RequestItem } from '../../../../core/query/request-item';
import { ExternalDataRepositoryEditorModel, ExternalDatasetEditorModel, ExternalRegistryEditorModel, ExternalServiceEditorModel, ExternalTagEditorModel } from '../dataset-wizard-editor.model';
import { DatasetExternalDataRepositoryDialogEditorComponent } from './editors/data-repository/dataset-external-data-repository-dialog-editor.component';
import { DatasetExternalDatasetDialogEditorComponent } from './editors/external-dataset/dataset-external-dataset-dialog-editor.component';
import { DatasetExternalRegistryDialogEditorComponent } from './editors/registry/dataset-external-registry-dialog-editor.component';
import { DatasetExternalServiceDialogEditorComponent } from './editors/service/dataset-external-service-dialog-editor.component';
import { TranslateService } from '@ngx-translate/core';
@Component({
selector: 'app-dataset-external-references-editor-component',
@ -33,11 +33,45 @@ export class DatasetExternalReferencesEditorComponent extends BaseComponent impl
@Input() formGroup: FormGroup = null;
@Input() viewOnly = false;
externalDatasetAutoCompleteConfiguration: SingleAutoCompleteConfiguration;
registriesAutoCompleteConfiguration: SingleAutoCompleteConfiguration;
dataRepositoriesAutoCompleteConfiguration: SingleAutoCompleteConfiguration;
servicesAutoCompleteConfiguration: SingleAutoCompleteConfiguration;
tagsAutoCompleteConfiguration: SingleAutoCompleteConfiguration;
externalDatasetAutoCompleteConfiguration: SingleAutoCompleteConfiguration = {
filterFn: this.searchDatasetExternalDatasets.bind(this),
initialItems: (type) => this.searchDatasetExternalDatasets('', type),//.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1),
displayFn: (item) => item ? item.name : null,
titleFn: (item) => item ? item.name : null,
subtitleFn: (item) => item.source ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.source : this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.NO-SOURCE')
};
registriesAutoCompleteConfiguration: SingleAutoCompleteConfiguration = {
filterFn: this.searchDatasetExternalRegistries.bind(this),
initialItems: (type) => this.searchDatasetExternalRegistries('', type),
displayFn: (item) => item ? item.name : null,
titleFn: (item) => item ? item.name : null,
subtitleFn: (item) => item.source ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.source : this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.NO-SOURCE')
};
dataRepositoriesAutoCompleteConfiguration: SingleAutoCompleteConfiguration = {
filterFn: this.searchDatasetExternalDataRepositories.bind(this),
initialItems: (type) => this.searchDatasetExternalDataRepositories('', type),
displayFn: (item) => item ? item.name : null,
titleFn: (item) => item ? item.name : null,
subtitleFn: (item) => item.source ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.source : this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.NO-SOURCE')
};
servicesAutoCompleteConfiguration: SingleAutoCompleteConfiguration = {
filterFn: this.searchDatasetExternalServices.bind(this),
initialItems: (type) => this.searchDatasetExternalServices('', type),
displayFn: (item) => item ? item.label : null,
titleFn: (item) => item ? item.label : null,
subtitleFn: (item) => item.source ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.source : this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.NO-SOURCE')
};
tagsAutoCompleteConfiguration: SingleAutoCompleteConfiguration = {
filterFn: this.searchDatasetTags.bind(this),
initialItems: (type) => this.searchDatasetTags('', type),
displayFn: (item) => item ? item.name : null,
titleFn: (item) => item ? item.name : null,
subtitleFn: (item) => item.tag ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.tag : this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.NO-SOURCE')
};
externalSourcesConfiguration: ExternalSourcesConfiguration;
@ -63,51 +97,6 @@ export class DatasetExternalReferencesEditorComponent extends BaseComponent impl
this.externalSourcesConfiguration.services.push({ key: '', label: 'All' });
this.externalSourcesConfiguration.tags.push({ key: '', label: 'All' });
});
this.dataRepositoriesAutoCompleteConfiguration = {
filterFn: this.searchDatasetExternalDataRepositories.bind(this),
removeAfterSelection: true,
initialItems: (type) => this.searchDatasetExternalDataRepositories('', type),
displayFn: (item) => item ? item.name : null,
titleFn: (item) => item ? item.name : null,
subtitleFn: (item) => item.source ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.source : this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.NO-SOURCE')
};
this.externalDatasetAutoCompleteConfiguration = {
filterFn: this.searchDatasetExternalDatasets.bind(this),
removeAfterSelection: true,
initialItems: (type) => this.searchDatasetExternalDatasets('', type),//.filter(resultItem => excludedItems.map(x => x.id).indexOf(resultItem.id) === -1),
displayFn: (item) => item ? item.name : null,
titleFn: (item) => item ? item.name : null,
subtitleFn: (item) => item.source ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.source : this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.NO-SOURCE')
};
this.registriesAutoCompleteConfiguration = {
filterFn: this.searchDatasetExternalRegistries.bind(this),
removeAfterSelection: true,
initialItems: (type) => this.searchDatasetExternalRegistries('', type),
displayFn: (item) => item ? item.name : null,
titleFn: (item) => item ? item.name : null,
subtitleFn: (item) => item.source ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.source : this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.NO-SOURCE')
};
this.servicesAutoCompleteConfiguration = {
filterFn: this.searchDatasetExternalServices.bind(this),
removeAfterSelection: true,
initialItems: (type) => this.searchDatasetExternalServices('', type),
displayFn: (item) => item ? item.label : null,
titleFn: (item) => item ? item.label : null,
subtitleFn: (item) => item.source ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.source : this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.NO-SOURCE')
};
this.tagsAutoCompleteConfiguration = {
filterFn: this.searchDatasetTags.bind(this),
removeAfterSelection: true,
initialItems: (type) => this.searchDatasetTags('', type),
displayFn: (item) => item ? item.name : null,
titleFn: (item) => item ? item.name : null,
subtitleFn: (item) => item.tag ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item.tag : this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.NO-SOURCE')
};
}
public cancel(): void {

View File

@ -1,10 +1,10 @@
import { Component, Inject, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { ExternalDataRepositoryService } from '@app/core/services/external-sources/data-repository/extternal-data-repository.service';
import { ExternalDataRepositoryEditorModel } from '@app/ui/dataset/dataset-wizard/dataset-wizard-editor.model';
import { BaseComponent } from '@common/base/base.component';
import { takeUntil } from 'rxjs/operators';
import { BaseComponent } from '../../../../../../core/common/base/base.component';
import { ExternalDataRepositoryService } from '../../../../../../core/services/external-sources/data-repository/extternal-data-repository.service';
import { ExternalDataRepositoryEditorModel } from '../../../dataset-wizard-editor.model';
@Component({
templateUrl: 'dataset-external-data-repository-dialog-editor.component.html',

View File

@ -1,10 +1,10 @@
import { Component, Inject, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { ExternalDatasetService } from '@app/core/services/external-sources/dataset/external-dataset.service';
import { ExternalDatasetEditorModel } from '@app/ui/dataset/dataset-wizard/dataset-wizard-editor.model';
import { BaseComponent } from '@common/base/base.component';
import { takeUntil } from 'rxjs/operators';
import { BaseComponent } from '../../../../../../core/common/base/base.component';
import { ExternalDatasetService } from '../../../../../../core/services/external-sources/dataset/external-dataset.service';
import { ExternalDatasetEditorModel } from '../../../dataset-wizard-editor.model';
@Component({
templateUrl: 'dataset-external-dataset-dialog-editor.component.html',

View File

@ -1,10 +1,10 @@
import { Component, Inject, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { ExternalRegistryService } from '@app/core/services/external-sources/registry/external-registry.service';
import { ExternalRegistryEditorModel } from '@app/ui/dataset/dataset-wizard/dataset-wizard-editor.model';
import { BaseComponent } from '@common/base/base.component';
import { takeUntil } from 'rxjs/operators';
import { BaseComponent } from '../../../../../../core/common/base/base.component';
import { ExternalRegistryService } from '../../../../../../core/services/external-sources/registry/external-registry.service';
import { ExternalRegistryEditorModel } from '../../../dataset-wizard-editor.model';
@Component({
templateUrl: 'dataset-external-registry-dialog-editor.component.html',

View File

@ -1,10 +1,10 @@
import { Component, Inject, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { ExternalServiceService } from '@app/core/services/external-sources/service/external-service.service';
import { ExternalServiceEditorModel } from '@app/ui/dataset/dataset-wizard/dataset-wizard-editor.model';
import { BaseComponent } from '@common/base/base.component';
import { takeUntil } from 'rxjs/operators';
import { BaseComponent } from '../../../../../../core/common/base/base.component';
import { ExternalServiceService } from '../../../../../../core/services/external-sources/service/external-service.service';
import { ExternalServiceEditorModel } from '../../../dataset-wizard-editor.model';
@Component({
templateUrl: 'dataset-external-service-dialog-editor.component.html',

View File

@ -1,27 +1,27 @@
import { NgModule } from '@angular/core';
import { AutoCompleteModule } from '@app/library/auto-complete/auto-complete.module';
import { ConfirmationDialogModule } from '@common/modules/confirmation-dialog/confirmation-dialog.module';
import { ExportMethodDialogModule } from '@app/library/export-method-dialog/export-method-dialog.module';
import { UrlListingModule } from '@app/library/url-listing/url-listing.module';
import { DatasetCopyDialogueComponent } from '@app/ui/dataset/dataset-wizard/dataset-copy-dialogue/dataset-copy-dialogue.component';
import { DatasetEditorComponent } from '@app/ui/dataset/dataset-wizard/dataset-editor/dataset-editor.component';
import { DatasetWizardComponent } from '@app/ui/dataset/dataset-wizard/dataset-wizard.component';
import { DatasetExternalReferencesEditorComponent } from '@app/ui/dataset/dataset-wizard/external-references/dataset-external-references-editor.component';
import { DatasetExternalDataRepositoryDialogEditorComponent } from '@app/ui/dataset/dataset-wizard/external-references/editors/data-repository/dataset-external-data-repository-dialog-editor.component';
import { DatasetExternalDatasetDialogEditorComponent } from '@app/ui/dataset/dataset-wizard/external-references/editors/external-dataset/dataset-external-dataset-dialog-editor.component';
import { DatasetExternalRegistryDialogEditorComponent } from '@app/ui/dataset/dataset-wizard/external-references/editors/registry/dataset-external-registry-dialog-editor.component';
import { DatasetExternalServiceDialogEditorComponent } from '@app/ui/dataset/dataset-wizard/external-references/editors/service/dataset-external-service-dialog-editor.component';
import { DatasetRoutingModule } from '@app/ui/dataset/dataset.routing';
import { DatasetCriteriaComponent } from '@app/ui/dataset/listing/criteria/dataset-criteria.component';
import { DatasetUploadDialogue } from '@app/ui/dataset/listing/criteria/dataset-upload-dialogue/dataset-upload-dialogue.component';
import { DatasetListingComponent } from '@app/ui/dataset/listing/dataset-listing.component';
import { DatasetListingItemComponent } from '@app/ui/dataset/listing/listing-item/dataset-listing-item.component';
import { DatasetDescriptionFormModule } from '@app/ui/misc/dataset-description-form/dataset-description-form.module';
import { TableOfContentsModule } from '@app/ui/misc/dataset-description-form/tableOfContentsMaterial/table-of-contents.module';
import { ExternalSourcesModule } from '@app/ui/misc/external-sources/external-sources.module';
import { CommonFormsModule } from '@common/forms/common-forms.module';
import { CommonUiModule } from '@common/ui/common-ui.module';
import { AngularStickyThingsModule } from '@w11k/angular-sticky-things';
import { CommonFormsModule } from '../../common/forms/common-forms.module';
import { CommonUiModule } from '../../common/ui/common-ui.module';
import { AutoCompleteModule } from '../../library/auto-complete/auto-complete.module';
import { ConfirmationDialogModule } from '../../library/confirmation-dialog/confirmation-dialog.module';
import { ExportMethodDialogModule } from '../../library/export-method-dialog/export-method-dialog.module';
import { UrlListingModule } from '../../library/url-listing/url-listing.module';
import { DatasetDescriptionFormModule } from '../misc/dataset-description-form/dataset-description-form.module';
import { TableOfContentsModule } from '../misc/dataset-description-form/tableOfContentsMaterial/table-of-contents.module';
import { ExternalSourcesModule } from '../misc/external-sources/external-sources.module';
import { DatasetCopyDialogueComponent } from './dataset-wizard/dataset-copy-dialogue/dataset-copy-dialogue.component';
import { DatasetEditorComponent } from './dataset-wizard/dataset-editor/dataset-editor.component';
import { DatasetWizardComponent } from './dataset-wizard/dataset-wizard.component';
import { DatasetExternalReferencesEditorComponent } from './dataset-wizard/external-references/dataset-external-references-editor.component';
import { DatasetExternalDataRepositoryDialogEditorComponent } from './dataset-wizard/external-references/editors/data-repository/dataset-external-data-repository-dialog-editor.component';
import { DatasetExternalDatasetDialogEditorComponent } from './dataset-wizard/external-references/editors/external-dataset/dataset-external-dataset-dialog-editor.component';
import { DatasetExternalRegistryDialogEditorComponent } from './dataset-wizard/external-references/editors/registry/dataset-external-registry-dialog-editor.component';
import { DatasetExternalServiceDialogEditorComponent } from './dataset-wizard/external-references/editors/service/dataset-external-service-dialog-editor.component';
import { DatasetRoutingModule } from './dataset.routing';
import { DatasetCriteriaComponent } from './listing/criteria/dataset-criteria.component';
import { DatasetUploadDialogue } from './listing/criteria/dataset-upload-dialogue/dataset-upload-dialogue.component';
import { DatasetListingComponent } from './listing/dataset-listing.component';
import { DatasetListingItemComponent } from './listing/listing-item/dataset-listing-item.component';
@NgModule({
imports: [

View File

@ -4,35 +4,35 @@ import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
import { MatDialog } from '@angular/material/dialog';
import { MatSnackBar } from '@angular/material/snack-bar';
import { Router } from '@angular/router';
import { DatasetStatus } from '@app/core/common/enum/dataset-status';
import { DataTableData } from '@app/core/model/data-table/data-table-data';
import { DataTableRequest } from '@app/core/model/data-table/data-table-request';
import { DmpListingModel } from '@app/core/model/dmp/dmp-listing';
import { ExternalSourceItemModel } from '@app/core/model/external-sources/external-source-item';
import { DatasetProfileCriteria } from '@app/core/query/dataset-profile/dataset-profile-criteria';
import { DatasetCriteria } from '@app/core/query/dataset/dataset-criteria';
import { DmpCriteria } from '@app/core/query/dmp/dmp-criteria';
import { GrantCriteria } from '@app/core/query/grant/grant-criteria';
import { OrganisationCriteria } from '@app/core/query/organisation/organisation-criteria';
import { RequestItem } from '@app/core/query/request-item';
import { TagCriteria } from '@app/core/query/tag/tag-criteria';
import { UserCriteria } from '@app/core/query/user/user-criteria';
import { DatasetWizardService } from '@app/core/services/dataset-wizard/dataset-wizard.service';
import { DatasetService } from '@app/core/services/dataset/dataset.service';
import { DmpService } from '@app/core/services/dmp/dmp.service';
import { ExternalSourcesService } from '@app/core/services/external-sources/external-sources.service';
import { GrantService } from '@app/core/services/grant/grant.service';
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
import { OrganisationService } from '@app/core/services/organisation/organisation.service';
import { UserService } from '@app/core/services/user/user.service';
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/multiple/multiple-auto-complete-configuration';
import { DatasetUploadDialogue } from '@app/ui/dataset/listing/criteria/dataset-upload-dialogue/dataset-upload-dialogue.component';
import { BaseCriteriaComponent } from '@app/ui/misc/criteria/base-criteria.component';
import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model';
import { TranslateService } from '@ngx-translate/core';
import { Observable } from 'rxjs';
import { map, takeUntil } from 'rxjs/operators';
import { ValidationErrorModel } from '../../../../common/forms/validation/error-model/validation-error-model';
import { DatasetStatus } from '../../../../core/common/enum/dataset-status';
import { DataTableData } from '../../../../core/model/data-table/data-table-data';
import { DataTableRequest } from '../../../../core/model/data-table/data-table-request';
import { DmpListingModel } from '../../../../core/model/dmp/dmp-listing';
import { ExternalSourceItemModel } from '../../../../core/model/external-sources/external-source-item';
import { DatasetProfileCriteria } from '../../../../core/query/dataset-profile/dataset-profile-criteria';
import { DatasetCriteria } from '../../../../core/query/dataset/dataset-criteria';
import { DmpCriteria } from '../../../../core/query/dmp/dmp-criteria';
import { GrantCriteria } from '../../../../core/query/grant/grant-criteria';
import { OrganisationCriteria } from '../../../../core/query/organisation/organisation-criteria';
import { RequestItem } from '../../../../core/query/request-item';
import { TagCriteria } from '../../../../core/query/tag/tag-criteria';
import { UserCriteria } from '../../../../core/query/user/user-criteria';
import { DatasetWizardService } from '../../../../core/services/dataset-wizard/dataset-wizard.service';
import { DatasetService } from '../../../../core/services/dataset/dataset.service';
import { DmpService } from '../../../../core/services/dmp/dmp.service';
import { ExternalSourcesService } from '../../../../core/services/external-sources/external-sources.service';
import { GrantService } from '../../../../core/services/grant/grant.service';
import { SnackBarNotificationLevel, UiNotificationService } from '../../../../core/services/notification/ui-notification-service';
import { OrganisationService } from '../../../../core/services/organisation/organisation.service';
import { UserService } from '../../../../core/services/user/user.service';
import { EnumUtils } from '../../../../core/services/utilities/enum-utils.service';
import { MultipleAutoCompleteConfiguration } from '../../../../library/auto-complete/multiple/multiple-auto-complete-configuration';
import { BaseCriteriaComponent } from '../../../misc/criteria/base-criteria.component';
import { DatasetUploadDialogue } from './dataset-upload-dialogue/dataset-upload-dialogue.component';
@Component({
selector: 'app-dataset-criteria-component',
@ -64,14 +64,14 @@ export class DatasetCriteriaComponent extends BaseCriteriaComponent implements O
tagsAutoCompleteConfiguration = {
filterFn: this.filterTags.bind(this),
initialItems: (excludedItems: any[]) => this.filterTags('').pipe(map(result => result.filter(resultItem => excludedItems.map(x => x.id).indexOf(resultItem.id) === -1))),
initialItems: (excludedItems: any[]) => this.filterTags('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))),
displayFn: (item) => item['name'],
titleFn: (item) => item['name']
};
datasetTemplateAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = {
filterFn: this.filterDatasetTemplate.bind(this),
initialItems: (excludedItems: any[]) => this.filterDatasetTemplate('').pipe(map(result => result.filter(resultItem => excludedItems.map(x => x.id).indexOf(resultItem.id) === -1))),
initialItems: (excludedItems: any[]) => this.filterDatasetTemplate('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))),
displayFn: (item) => item['label'],
titleFn: (item) => item['label'],
subtitleFn: (item) => item['description']
@ -86,21 +86,21 @@ export class DatasetCriteriaComponent extends BaseCriteriaComponent implements O
collaboratorsAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = {
filterFn: this.filterCollaborators.bind(this),
initialItems: (excludedItems: any[]) => this.filterCollaborators('').pipe(map(result => result.filter(resultItem => excludedItems.map(x => x.id).indexOf(resultItem.id) === -1))),
initialItems: (excludedItems: any[]) => this.filterCollaborators('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))),
displayFn: (item) => item['name'],
titleFn: (item) => item['name']
};
grantAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = {
filterFn: this.filterGrant.bind(this),
initialItems: (excludedItems: any[]) => this.filterGrant('').pipe(map(result => result.filter(resultItem => excludedItems.map(x => x.id).indexOf(resultItem.id) === -1))),
initialItems: (excludedItems: any[]) => this.filterGrant('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))),
displayFn: (item) => item['label'],
titleFn: (item) => item['label']
};
organisationAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = {
filterFn: this.filterOrganisations.bind(this),
initialItems: (excludedItems: any[]) => this.filterOrganisations('').pipe(map(result => result.filter(resultItem => excludedItems.map(x => x.id).indexOf(resultItem.id) === -1))),
initialItems: (excludedItems: any[]) => this.filterOrganisations('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))),
displayFn: (item) => item['name'],
titleFn: (item) => item['name']
}

View File

@ -1,22 +1,21 @@
import {map, takeUntil } from 'rxjs/operators';
import { Component, Inject, OnInit } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { DataTableData } from '@app/core/model/data-table/data-table-data';
import { DataTableRequest } from '@app/core/model/data-table/data-table-request';
import { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile';
import { DmpModel } from '@app/core/model/dmp/dmp';
import { DmpListingModel } from '@app/core/model/dmp/dmp-listing';
import { DatasetProfileCriteria } from '@app/core/query/dataset-profile/dataset-profile-criteria';
import { DatasetCriteria } from '@app/core/query/dataset/dataset-criteria';
import { DmpCriteria } from '@app/core/query/dmp/dmp-criteria';
import { RequestItem } from '@app/core/query/request-item';
import { DatasetWizardService } from '@app/core/services/dataset-wizard/dataset-wizard.service';
import { DmpService } from '@app/core/services/dmp/dmp.service';
import { BaseCriteriaComponent } from '@app/ui/misc/criteria/base-criteria.component';
import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model';
import { Observable } from 'rxjs';
import { DataTableData } from '../../../../../core/model/data-table/data-table-data';
import { DmpListingModel } from '../../../../../core/model/dmp/dmp-listing';
import { DataTableRequest } from '../../../../../core/model/data-table/data-table-request';
import { DmpCriteria } from '../../../../../core/query/dmp/dmp-criteria';
import { DmpService } from '../../../../../core/services/dmp/dmp.service';
import { ValidationErrorModel } from '../../../../../common/forms/validation/error-model/validation-error-model';
import { BaseCriteriaComponent } from '../../../../misc/criteria/base-criteria.component';
import { DmpModel } from '../../../../../core/model/dmp/dmp';
import { DatasetProfileModel } from '../../../../../core/model/dataset/dataset-profile';
import { DatasetWizardService } from '../../../../../core/services/dataset-wizard/dataset-wizard.service';
import { RequestItem } from '../../../../../core/query/request-item';
import { DatasetProfileCriteria } from '../../../../../core/query/dataset-profile/dataset-profile-criteria';
import { DatasetCriteria } from '../../../../../core/query/dataset/dataset-criteria';
import { DatasetCriteriaComponent } from '../dataset-criteria.component';
import { map, takeUntil } from 'rxjs/operators';
@Component({
selector: 'dataset-upload-dialogue',

View File

@ -1,21 +1,21 @@
import { of as observableOf, Observable } from 'rxjs';
import { Component, OnInit, ViewChild } from '@angular/core';
import { MatPaginator, PageEvent } from '@angular/material/paginator';
import { MatPaginator } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
import { ActivatedRoute, Params, Router } from '@angular/router';
import { takeUntil } from 'rxjs/operators';
import { BaseComponent } from '../../../core/common/base/base.component';
import { DataTableRequest } from '../../../core/model/data-table/data-table-request';
import { DatasetListingModel } from '../../../core/model/dataset/dataset-listing';
import { DatasetCriteria } from '../../../core/query/dataset/dataset-criteria';
import { DatasetService } from '../../../core/services/dataset/dataset.service';
import { DmpService } from '../../../core/services/dmp/dmp.service';
import { BreadcrumbItem } from '../../misc/breadcrumb/definition/breadcrumb-item';
import { IBreadCrumbComponent } from '../../misc/breadcrumb/definition/IBreadCrumbComponent';
import { DatasetCriteriaComponent } from './criteria/dataset-criteria.component';
import { DatasetStatus } from '@app/core/common/enum/dataset-status';
import { DataTableRequest } from '@app/core/model/data-table/data-table-request';
import { DatasetListingModel } from '@app/core/model/dataset/dataset-listing';
import { DatasetCriteria } from '@app/core/query/dataset/dataset-criteria';
import { DatasetService } from '@app/core/services/dataset/dataset.service';
import { DmpService } from '@app/core/services/dmp/dmp.service';
import { DatasetCriteriaComponent } from '@app/ui/dataset/listing/criteria/dataset-criteria.component';
import { BreadcrumbItem } from '@app/ui/misc/breadcrumb/definition/breadcrumb-item';
import { IBreadCrumbComponent } from '@app/ui/misc/breadcrumb/definition/IBreadCrumbComponent';
import { BaseComponent } from '@common/base/base.component';
import { TranslateService } from '@ngx-translate/core';
import { DatasetStatus } from '../../../core/common/enum/dataset-status';
import { Observable, of as observableOf } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
@Component({
selector: 'app-dataset-listing-component',

View File

@ -1,22 +1,22 @@
import {of as observableOf, Observable } from 'rxjs';
import {map, takeUntil } from 'rxjs/operators';
import { Component, OnInit } from '@angular/core';
import { DmpWizardEditorModel } from '../wizard/dmp-wizard-editor.model';
import { FormGroup } from '@angular/forms';
import { BaseComponent } from '../../../core/common/base/base.component';
import { ActivatedRoute, Params, Router } from '@angular/router';
import { DmpModel } from '../../../core/model/dmp/dmp';
import { TranslateService } from '@ngx-translate/core';
import { DmpService } from '../../../core/services/dmp/dmp.service';
import { BreadcrumbItem } from '../../misc/breadcrumb/definition/breadcrumb-item';
import { ValidationErrorModel } from '../../../common/forms/validation/error-model/validation-error-model';
import { UiNotificationService, SnackBarNotificationLevel } from '../../../core/services/notification/ui-notification-service';
import { FunderFormModel } from '../editor/grant-tab/funder-form-model';
import { ProjectFormModel } from '../editor/grant-tab/project-form-model';
import { GrantTabModel } from '../editor/grant-tab/grant-tab-model';
import { HttpErrorResponse } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { ActivatedRoute, Params, Router } from '@angular/router';
import { DmpModel } from '@app/core/model/dmp/dmp';
import { DmpService } from '@app/core/services/dmp/dmp.service';
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
import { FunderFormModel } from '@app/ui/dmp/editor/grant-tab/funder-form-model';
import { GrantTabModel } from '@app/ui/dmp/editor/grant-tab/grant-tab-model';
import { ProjectFormModel } from '@app/ui/dmp/editor/grant-tab/project-form-model';
import { DmpWizardEditorModel } from '@app/ui/dmp/wizard/dmp-wizard-editor.model';
import { BreadcrumbItem } from '@app/ui/misc/breadcrumb/definition/breadcrumb-item';
import { BaseComponent } from '@common/base/base.component';
import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model';
import { TranslateService } from '@ngx-translate/core';
import { Observable, of as observableOf } from 'rxjs';
import { map, takeUntil } from 'rxjs/operators';
@Component({
selector: 'app-dmp-clone',

View File

@ -1,34 +1,35 @@
import { NgModule } from '@angular/core';
import { CommonFormsModule } from '../../common/forms/common-forms.module';
import { CommonUiModule } from '../../common/ui/common-ui.module';
import { FormattingModule } from '../../core/formatting.module';
import { AutoCompleteModule } from '../../library/auto-complete/auto-complete.module';
import { ConfirmationDialogModule } from '../../library/confirmation-dialog/confirmation-dialog.module';
import { UrlListingModule } from '../../library/url-listing/url-listing.module';
import { DmpRoutingModule } from './dmp.routing';
import { AddResearcherComponent } from './editor/add-researcher/add-researcher.component';
import { AvailableProfilesComponent } from './editor/available-profiles/available-profiles.component';
import { DmpEditorComponent } from './editor/dmp-editor.component';
import { DmpFinalizeDialogComponent } from './editor/dmp-finalize-dialog/dmp-finalize-dialog.component';
import { DynamicDmpFieldResolverComponent } from './editor/dynamic-field-resolver/dynamic-dmp-field-resolver.component';
import { DynamicFieldGrantComponent } from './editor/dynamic-fields-grant/dynamic-field-grant/dynamic-field-grant.component';
import { DynamicFieldsGrantComponent } from './editor/dynamic-fields-grant/dynamic-fields-grant.component';
import { InvitationAcceptedComponent } from './invitation/accepted/dmp-invitation-accepted.component';
import { DmpInvitationDialogComponent } from './invitation/dmp-invitation.component';
import { DmpCriteriaComponent } from './listing/criteria/dmp-criteria.component';
import { DmpUploadDialogue } from './listing/criteria/upload-dialogue/dmp-upload-dialogue.component';
import { DmpListingComponent } from './listing/dmp-listing.component';
import { DmpListingItemComponent } from './listing/listing-item/dmp-listing-item.component';
import { DmpWizardComponent } from './wizard/dmp-wizard.component';
import { DmpWizardEditorComponent } from './wizard/editor/dmp-wizard-editor.component';
import { DmpWizardDatasetListingComponent } from './wizard/listing/dmp-wizard-dataset-listing.component';
import { ExportMethodDialogModule } from '../../library/export-method-dialog/export-method-dialog.module';
import { GeneralTabComponent } from './editor/general-tab/general-tab.component';
import { PeopleTabComponent } from './editor/people-tab/people-tab.component';
import { GrantTabComponent } from './editor/grant-tab/grant-tab.component';
import { DatasetsTabComponent } from './editor/datasets-tab/datasets-tab.component';
import { DmpOverviewModule } from './overview/dmp-overview.module';
import { DmpCloneComponent } from './clone/dmp-clone.component';
import { FormattingModule } from '@app/core/formatting.module';
import { AutoCompleteModule } from '@app/library/auto-complete/auto-complete.module';
import { ConfirmationDialogModule } from '@common/modules/confirmation-dialog/confirmation-dialog.module';
import { ExportMethodDialogModule } from '@app/library/export-method-dialog/export-method-dialog.module';
import { UrlListingModule } from '@app/library/url-listing/url-listing.module';
import { DmpCloneComponent } from '@app/ui/dmp/clone/dmp-clone.component';
import { DmpRoutingModule } from '@app/ui/dmp/dmp.routing';
import { AddResearcherComponent } from '@app/ui/dmp/editor/add-researcher/add-researcher.component';
import { AvailableProfilesComponent } from '@app/ui/dmp/editor/available-profiles/available-profiles.component';
import { DatasetsTabComponent } from '@app/ui/dmp/editor/datasets-tab/datasets-tab.component';
import { DmpEditorComponent } from '@app/ui/dmp/editor/dmp-editor.component';
import { DmpFinalizeDialogComponent } from '@app/ui/dmp/editor/dmp-finalize-dialog/dmp-finalize-dialog.component';
import { DynamicDmpFieldResolverComponent } from '@app/ui/dmp/editor/dynamic-field-resolver/dynamic-dmp-field-resolver.component';
import { DynamicFieldGrantComponent } from '@app/ui/dmp/editor/dynamic-fields-grant/dynamic-field-grant/dynamic-field-grant.component';
import { DynamicFieldsGrantComponent } from '@app/ui/dmp/editor/dynamic-fields-grant/dynamic-fields-grant.component';
import { GeneralTabComponent } from '@app/ui/dmp/editor/general-tab/general-tab.component';
import { GrantTabComponent } from '@app/ui/dmp/editor/grant-tab/grant-tab.component';
import { PeopleTabComponent } from '@app/ui/dmp/editor/people-tab/people-tab.component';
import { InvitationAcceptedComponent } from '@app/ui/dmp/invitation/accepted/dmp-invitation-accepted.component';
import { DmpInvitationDialogComponent } from '@app/ui/dmp/invitation/dmp-invitation.component';
import { DmpCriteriaComponent } from '@app/ui/dmp/listing/criteria/dmp-criteria.component';
import { DmpUploadDialogue } from '@app/ui/dmp/listing/criteria/upload-dialogue/dmp-upload-dialogue.component';
import { DmpListingComponent } from '@app/ui/dmp/listing/dmp-listing.component';
import { DmpListingItemComponent } from '@app/ui/dmp/listing/listing-item/dmp-listing-item.component';
import { DmpOverviewModule } from '@app/ui/dmp/overview/dmp-overview.module';
import { DmpWizardComponent } from '@app/ui/dmp/wizard/dmp-wizard.component';
import { DmpWizardEditorComponent } from '@app/ui/dmp/wizard/editor/dmp-wizard-editor.component';
import { DmpWizardDatasetListingComponent } from '@app/ui/dmp/wizard/listing/dmp-wizard-dataset-listing.component';
import { CommonFormsModule } from '@common/forms/common-forms.module';
import { FormValidationErrorsDialogModule } from '@common/forms/form-validation-errors-dialog/form-validation-errors-dialog.module';
import { CommonUiModule } from '@common/ui/common-ui.module';
@NgModule({
imports: [
@ -40,7 +41,8 @@ import { DmpCloneComponent } from './clone/dmp-clone.component';
FormattingModule,
AutoCompleteModule,
DmpRoutingModule,
DmpOverviewModule
DmpOverviewModule,
FormValidationErrorsDialogModule
],
declarations: [
DmpListingComponent,

View File

@ -1,11 +1,10 @@
import { Component, Inject, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { ExternalResearcherService } from '@app/core/services/external-sources/researcher/external-researcher.service';
import { ResearcherEditorModel } from '@app/ui/dmp/editor/add-researcher/add-researcher.model';
import { BaseComponent } from '@common/base/base.component';
import { takeUntil } from 'rxjs/operators';
import { BaseComponent } from '../../../../core/common/base/base.component';
import { ExternalResearcherService } from '../../../../core/services/external-sources/researcher/external-researcher.service';
import { ResearcherEditorModel } from './add-researcher.model';
import { ResearcherModel } from '../../../../core/model/researcher/researcher';
@Component({
selector: 'app-add-researcher-component',
@ -30,7 +29,7 @@ export class AddResearcherComponent extends BaseComponent implements OnInit {
this.externalResearcherService.createResearcher(this.formGroup.value)
.pipe(takeUntil(this._destroyed))
.subscribe(
null, null, () => this.dialogRef.close()
null, null, () => this.dialogRef.close()
);
}

View File

@ -1,8 +1,8 @@
import { FormBuilder, FormGroup } from '@angular/forms';
import { ResearcherModel } from '../../../../core/model/researcher/researcher';
import { ValidationContext } from "../../../../common/forms/validation/validation-context";
import { BackendErrorValidator } from "../../../../common/forms/validation/custom-validator";
import { ValidationErrorModel } from "../../../../common/forms/validation/error-model/validation-error-model";
import { ResearcherModel } from '@app/core/model/researcher/researcher';
import { BackendErrorValidator } from '@common/forms/validation/custom-validator';
import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model';
import { ValidationContext } from '@common/forms/validation/validation-context';
export class ResearcherEditorModel {
public id: String;

View File

@ -1,12 +1,12 @@
import { Component, Inject, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { DataTableRequest } from '@app/core/model/data-table/data-table-request';
import { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile';
import { DatasetProfileCriteria } from '@app/core/query/dataset-profile/dataset-profile-criteria';
import { DatasetService } from '@app/core/services/dataset/dataset.service';
import { BaseComponent } from '@common/base/base.component';
import { takeUntil } from 'rxjs/operators';
import { BaseComponent } from '../../../../core/common/base/base.component';
import { DatasetProfileModel } from '../../../../core/model/dataset/dataset-profile';
import { DatasetService } from '../../../../core/services/dataset/dataset.service';
import { DataTableRequest } from "../../../../core/model/data-table/data-table-request";
import { DatasetProfileCriteria } from "../../../../core/query/dataset-profile/dataset-profile-criteria";
@Component({
selector: 'app-available-profiles-component',

View File

@ -107,15 +107,15 @@
</button>
</div>
<div *ngIf="formGroup.enabled">
<button *ngIf="!isNew" mat-raised-button type="submit" [disabled]="!isFormValid()" class="text-uppercase dark-theme mr-2" color="primary">
<button *ngIf="!isNew" mat-raised-button type="submit" class="text-uppercase dark-theme mr-2" color="primary">
{{'DMP-EDITOR.ACTIONS.SAVE-CHANGES' | translate}}
</button>
<button *ngIf="isNew" mat-raised-button type="button" (click)="addDataset()" [disabled]="!isFormValid()" class="text-uppercase dark-theme mr-2" color="primary">
<button *ngIf="isNew" mat-raised-button type="button" (click)="addDataset()" class="text-uppercase dark-theme mr-2" color="primary">
{{'DMP-EDITOR.ACTIONS.SAVE' | translate}}
</button>
</div>
<div *ngIf="formGroup.enabled && !isNew">
<button type="button" mat-raised-button color="primary" [disabled]="!isFormValid()" class="text-uppercase mr-2" (click)="saveAndFinalize()">{{'DMP-EDITOR.ACTIONS.FINALISE' | translate}}
<button type="button" mat-raised-button color="primary" class="text-uppercase mr-2" (click)="saveAndFinalize()">{{'DMP-EDITOR.ACTIONS.FINALISE' | translate}}
</button>
</div>
</div>

View File

@ -1,39 +1,41 @@
import { of as observableOf, Observable } from 'rxjs';
import { map, takeUntil } from 'rxjs/operators';
import { Component, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { MatDialog } from '@angular/material/dialog';
import { ActivatedRoute, Params, Router } from '@angular/router';
import { DmpStatus } from '@app/core/common/enum/dmp-status';
import { Status } from '@app/core/common/enum/Status';
import { DataTableRequest } from '@app/core/model/data-table/data-table-request';
import { DmpProfileDefinition } from '@app/core/model/dmp-profile/dmp-profile';
import { DmpProfileListing } from '@app/core/model/dmp-profile/dmp-profile-listing';
import { DmpModel } from '@app/core/model/dmp/dmp';
import { UserModel } from '@app/core/model/user/user';
import { UserInfoListingModel } from '@app/core/model/user/user-info-listing';
import { BaseCriteria } from '@app/core/query/base-criteria';
import { DmpProfileCriteria } from '@app/core/query/dmp/dmp-profile-criteria';
import { GrantCriteria } from '@app/core/query/grant/grant-criteria';
import { RequestItem } from '@app/core/query/request-item';
import { AuthService } from '@app/core/services/auth/auth.service';
import { DmpProfileService } from '@app/core/services/dmp/dmp-profile.service';
import { DmpService } from '@app/core/services/dmp/dmp.service';
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component';
import { DmpEditorModel } from '@app/ui/dmp/editor/dmp-editor.model';
import { DmpFinalizeDialogComponent, DmpFinalizeDialogInput } from '@app/ui/dmp/editor/dmp-finalize-dialog/dmp-finalize-dialog.component';
import { FunderFormModel } from '@app/ui/dmp/editor/grant-tab/funder-form-model';
import { GrantTabModel } from '@app/ui/dmp/editor/grant-tab/grant-tab-model';
import { ProjectFormModel } from '@app/ui/dmp/editor/grant-tab/project-form-model';
import { BreadcrumbItem } from '@app/ui/misc/breadcrumb/definition/breadcrumb-item';
import { IBreadCrumbComponent } from '@app/ui/misc/breadcrumb/definition/IBreadCrumbComponent';
import { BaseComponent } from '@common/base/base.component';
import { FormService } from '@common/forms/form-service';
import { FormValidationErrorsDialogComponent } from '@common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component';
import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model';
import { TranslateService } from '@ngx-translate/core';
import * as FileSaver from 'file-saver';
import { ValidationErrorModel } from '../../../common/forms/validation/error-model/validation-error-model';
import { BaseComponent } from '../../../core/common/base/base.component';
import { DmpStatus } from '../../../core/common/enum/dmp-status';
import { Status } from '../../../core/common/enum/Status';
import { DataTableRequest } from '../../../core/model/data-table/data-table-request';
import { DmpProfileDefinition } from '../../../core/model/dmp-profile/dmp-profile';
import { DmpProfileListing } from '../../../core/model/dmp-profile/dmp-profile-listing';
import { DmpModel } from '../../../core/model/dmp/dmp';
import { UserModel } from '../../../core/model/user/user';
import { BaseCriteria } from '../../../core/query/base-criteria';
import { DmpProfileCriteria } from '../../../core/query/dmp/dmp-profile-criteria';
import { GrantCriteria } from '../../../core/query/grant/grant-criteria';
import { RequestItem } from '../../../core/query/request-item';
import { DmpProfileService } from '../../../core/services/dmp/dmp-profile.service';
import { DmpService } from '../../../core/services/dmp/dmp.service';
import { SnackBarNotificationLevel, UiNotificationService } from '../../../core/services/notification/ui-notification-service';
import { ConfirmationDialogComponent } from '../../../library/confirmation-dialog/confirmation-dialog.component';
import { BreadcrumbItem } from '../../misc/breadcrumb/definition/breadcrumb-item';
import { IBreadCrumbComponent } from '../../misc/breadcrumb/definition/IBreadCrumbComponent';
import { DmpEditorModel } from './dmp-editor.model';
import { DmpFinalizeDialogComponent, DmpFinalizeDialogInput } from './dmp-finalize-dialog/dmp-finalize-dialog.component';
import { AuthService } from '../../../core/services/auth/auth.service';
import { UserInfoListingModel } from '../../../core/model/user/user-info-listing';
import { GrantTabModel } from './grant-tab/grant-tab-model';
import { ProjectFormModel } from './grant-tab/project-form-model';
import { FunderFormModel } from './grant-tab/funder-form-model';
import { Observable, of as observableOf } from 'rxjs';
import { map, takeUntil } from 'rxjs/operators';
import { Guid } from '@common/types/guid';
@Component({
selector: 'app-dmp-editor-component',
@ -69,6 +71,7 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
private dialog: MatDialog,
private uiNotificationService: UiNotificationService,
private authService: AuthService,
private formService: FormService
) {
super();
}
@ -223,15 +226,29 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
// }
formSubmit(showAddDatasetDialog?: boolean): void {
//this.touchAllFormFields(this.formGroup);
if (!this.isFormValid()) { return; }
this.formService.touchAllFormFields(this.formGroup);
if (!this.isFormValid()) {
this.showValidationErrorsDialog();
return;
}
this.onSubmit(showAddDatasetDialog);
}
public isFormValid() {
return this.formGroup.get('label').valid && this.formGroup.get('profiles').valid &&
(this.formGroup.get('funder').get('label').valid || this.formGroup.get('funder').get('existFunder').valid) &&
(this.formGroup.get('grant').get('label').valid || this.formGroup.get('grant').get('existGrant').valid);
return this.formGroup.valid;
// return this.formGroup.get('label').valid && this.formGroup.get('profiles').valid &&
// (this.formGroup.get('funder').get('label').valid || this.formGroup.get('funder').get('existFunder').valid) &&
// (this.formGroup.get('grant').get('label').valid || this.formGroup.get('grant').get('existGrant').valid);
}
private showValidationErrorsDialog(projectOnly?: boolean) {
const dialogRef = this.dialog.open(FormValidationErrorsDialogComponent, {
disableClose: true,
data: {
formGroup: this.formGroup,
projectOnly: projectOnly
},
});
}
onSubmit(showAddDatasetDialog?: boolean): void {
@ -242,7 +259,7 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
if (showAddDatasetDialog) {
this.addDatasetOpenDialog(complete);
}
else { this.onCallbackSuccess() }
else { this.onCallbackSuccess(complete) }
},
error => {
this.formGroup.get('status').setValue(DmpStatus.Draft);
@ -252,9 +269,9 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
}
onCallbackSuccess(): void {
onCallbackSuccess(id?: String): void {
this.uiNotificationService.snackBarNotification(this.isNew ? this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-CREATION') : this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE'), SnackBarNotificationLevel.Success);
this.router.navigate(['/plans']);
id != null ? this.router.navigate(['/plans', 'edit', id]) : this.router.navigate(['/plans']);
}
onCallbackError(error: any) {
@ -430,7 +447,7 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
if (result) {
this.router.navigate(['datasets/new/' + id]);
} else {
this.router.navigate(['/plans']);
id != null ? this.router.navigate(['/plans', 'edit', id]) : this.router.navigate(['/plans']);
}
});
}

View File

@ -1,25 +1,25 @@
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
import { BackendErrorValidator } from "../../../common/forms/validation/custom-validator";
import { ValidationErrorModel } from "../../../common/forms/validation/error-model/validation-error-model";
import { ValidationContext } from "../../../common/forms/validation/validation-context";
import { Status } from "../../../core/common/enum/Status";
import { DmpProfile, DmpProfileDefinition } from "../../../core/model/dmp-profile/dmp-profile";
import { DmpModel } from "../../../core/model/dmp/dmp";
import { DmpDynamicField } from "../../../core/model/dmp/dmp-dynamic-field";
import { DmpDynamicFieldDependency } from "../../../core/model/dmp/dmp-dynamic-field-dependency";
import { OrganizationModel } from "../../../core/model/organisation/organization";
import { ResearcherModel } from "../../../core/model/researcher/researcher";
import { UserModel } from "../../../core/model/user/user";
import { ValidJsonValidator } from "../../../library/auto-complete/auto-complete-custom-validator";
import { UserInfoListingModel } from "../../../core/model/user/user-info-listing";
import { DatasetModel } from "../../../core/model/dataset/dataset";
import { GrantTabModel } from "./grant-tab/grant-tab-model";
import { DmpProfileExternalAutoCompleteFieldDataEditorModel } from "../../admin/dmp-profile/editor/external-autocomplete/dmp-profile-external-autocomplete-field-editor.model";
import { DmpProfileType } from "../../../core/common/enum/dmp-profile-type";
import { DmpProfileFieldDataType } from "../../../core/common/enum/dmp-profile-field-type";
import { DmpProfileField } from "../../../core/model/dmp-profile/dmp-profile-field";
import { ProjectFormModel } from "./grant-tab/project-form-model";
import { FunderFormModel } from "./grant-tab/funder-form-model";
import { DmpProfileFieldDataType } from '@app/core/common/enum/dmp-profile-field-type';
import { DmpProfileType } from '@app/core/common/enum/dmp-profile-type';
import { Status } from '@app/core/common/enum/Status';
import { DatasetModel } from '@app/core/model/dataset/dataset';
import { DmpProfile, DmpProfileDefinition } from '@app/core/model/dmp-profile/dmp-profile';
import { DmpProfileField } from '@app/core/model/dmp-profile/dmp-profile-field';
import { DmpModel } from '@app/core/model/dmp/dmp';
import { DmpDynamicField } from '@app/core/model/dmp/dmp-dynamic-field';
import { DmpDynamicFieldDependency } from '@app/core/model/dmp/dmp-dynamic-field-dependency';
import { OrganizationModel } from '@app/core/model/organisation/organization';
import { ResearcherModel } from '@app/core/model/researcher/researcher';
import { UserModel } from '@app/core/model/user/user';
import { UserInfoListingModel } from '@app/core/model/user/user-info-listing';
import { ValidJsonValidator } from '@app/library/auto-complete/auto-complete-custom-validator';
import { DmpProfileExternalAutoCompleteFieldDataEditorModel } from '@app/ui/admin/dmp-profile/editor/external-autocomplete/dmp-profile-external-autocomplete-field-editor.model';
import { FunderFormModel } from '@app/ui/dmp/editor/grant-tab/funder-form-model';
import { GrantTabModel } from '@app/ui/dmp/editor/grant-tab/grant-tab-model';
import { ProjectFormModel } from '@app/ui/dmp/editor/grant-tab/project-form-model';
import { BackendErrorValidator } from '@common/forms/validation/custom-validator';
import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model';
import { ValidationContext } from '@common/forms/validation/validation-context';
export class DmpEditorModel {
public id: string;

View File

@ -1,9 +1,9 @@
import { Component, Inject, OnInit } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { Router } from '@angular/router';
import { BaseComponent } from '../../../../core/common/base/base.component';
import { DatasetStatus } from '../../../../core/common/enum/dataset-status';
import { DatasetService } from '../../../../core/services/dataset/dataset.service';
import { DatasetStatus } from '@app/core/common/enum/dataset-status';
import { DatasetService } from '@app/core/services/dataset/dataset.service';
import { BaseComponent } from '@common/base/base.component';
@Component({
selector: 'app-dmp-finalize-dialog-component',

View File

@ -2,24 +2,24 @@
import { Component, Input, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { MatDialog } from '@angular/material/dialog';
import { DataTableRequest } from '@app/core/model/data-table/data-table-request';
import { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile';
import { DmpProfileDefinition } from '@app/core/model/dmp-profile/dmp-profile';
import { ExternalSourceItemModel } from '@app/core/model/external-sources/external-source-item';
import { DatasetProfileCriteria } from '@app/core/query/dataset-profile/dataset-profile-criteria';
import { DmpProfileCriteria } from '@app/core/query/dmp/dmp-profile-criteria';
import { RequestItem } from '@app/core/query/request-item';
import { DmpProfileService } from '@app/core/services/dmp/dmp-profile.service';
import { DmpService } from '@app/core/services/dmp/dmp.service';
import { ExternalSourcesService } from '@app/core/services/external-sources/external-sources.service';
import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/multiple/multiple-auto-complete-configuration';
import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration';
import { AddResearcherComponent } from '@app/ui/dmp/editor/add-researcher/add-researcher.component';
import { AvailableProfilesComponent } from '@app/ui/dmp/editor/available-profiles/available-profiles.component';
import { BaseComponent } from '@common/base/base.component';
import { TranslateService } from '@ngx-translate/core';
import { Observable } from 'rxjs';
import { map, takeUntil } from 'rxjs/operators';
import { BaseComponent } from '../../../../core/common/base/base.component';
import { DataTableRequest } from '../../../../core/model/data-table/data-table-request';
import { DatasetProfileModel } from '../../../../core/model/dataset/dataset-profile';
import { DmpProfileDefinition } from '../../../../core/model/dmp-profile/dmp-profile';
import { ExternalSourceItemModel } from '../../../../core/model/external-sources/external-source-item';
import { DatasetProfileCriteria } from '../../../../core/query/dataset-profile/dataset-profile-criteria';
import { DmpProfileCriteria } from '../../../../core/query/dmp/dmp-profile-criteria';
import { RequestItem } from '../../../../core/query/request-item';
import { DmpProfileService } from '../../../../core/services/dmp/dmp-profile.service';
import { DmpService } from '../../../../core/services/dmp/dmp.service';
import { ExternalSourcesService } from '../../../../core/services/external-sources/external-sources.service';
import { MultipleAutoCompleteConfiguration } from '../../../../library/auto-complete/multiple/multiple-auto-complete-configuration';
import { SingleAutoCompleteConfiguration } from '../../../../library/auto-complete/single/single-auto-complete-configuration';
import { AddResearcherComponent } from '../add-researcher/add-researcher.component';
import { AvailableProfilesComponent } from '../available-profiles/available-profiles.component';
@Component({
selector: 'app-general-tab',

View File

@ -1,9 +1,10 @@
import { Status } from "../../../../core/common/enum/Status";
import { FunderModel } from "../../../../core/model/funder/funder";
import { ValidationErrorModel } from "../../../../common/forms/validation/error-model/validation-error-model";
import { ValidationContext } from "../../../../common/forms/validation/validation-context";
import { FormGroup, FormBuilder, Validators } from "@angular/forms";
import { BackendErrorValidator } from "../../../../common/forms/validation/custom-validator";
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { Status } from '@app/core/common/enum/Status';
import { FunderModel } from '@app/core/model/funder/funder';
import { BackendErrorValidator } from '@common/forms/validation/custom-validator';
import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model';
import { ValidationContext } from '@common/forms/validation/validation-context';
export class FunderFormModel {
public id: string;

View File

@ -1,10 +1,11 @@
import { Status } from "../../../../core/common/enum/Status";
import { GrantListingModel } from "../../../../core/model/grant/grant-listing";
import { ValidationErrorModel } from "../../../../common/forms/validation/error-model/validation-error-model";
import { ValidationContext } from "../../../../common/forms/validation/validation-context";
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
import { BackendErrorValidator } from "../../../../common/forms/validation/custom-validator";
import { ValidJsonValidator } from "../../../../library/auto-complete/auto-complete-custom-validator";
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { Status } from '@app/core/common/enum/Status';
import { GrantListingModel } from '@app/core/model/grant/grant-listing';
import { ValidJsonValidator } from '@app/library/auto-complete/auto-complete-custom-validator';
import { BackendErrorValidator } from '@common/forms/validation/custom-validator';
import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model';
import { ValidationContext } from '@common/forms/validation/validation-context';
export class GrantTabModel {
public id: string;

View File

@ -1,17 +1,17 @@
import { Component, OnInit, Input } from '@angular/core';
import { Component, Input, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { SingleAutoCompleteConfiguration } from '../../../../library/auto-complete/single/single-auto-complete-configuration';
import { RequestItem } from '../../../../core/query/request-item';
import { GrantCriteria } from '../../../../core/query/grant/grant-criteria';
import { GrantService } from '../../../../core/services/grant/grant.service';
import { GrantTabModel } from './grant-tab-model';
import { ProjectService } from '../../../../core/services/project/project.service';
import { FunderService } from '../../../../core/services/funder/funder.service';
import { FunderCriteria } from '../../../../core/query/funder/funder-criteria';
import { ProjectCriteria } from '../../../../core/query/project/project-criteria';
import { FunderCriteria } from '@app/core/query/funder/funder-criteria';
import { GrantCriteria } from '@app/core/query/grant/grant-criteria';
import { ProjectCriteria } from '@app/core/query/project/project-criteria';
import { RequestItem } from '@app/core/query/request-item';
import { FunderService } from '@app/core/services/funder/funder.service';
import { GrantService } from '@app/core/services/grant/grant.service';
import { ProjectService } from '@app/core/services/project/project.service';
import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration';
import { GrantTabModel } from '@app/ui/dmp/editor/grant-tab/grant-tab-model';
import { BaseComponent } from '@common/base/base.component';
import { TranslateService } from '@ngx-translate/core';
import { takeUntil } from "rxjs/operators";
import { BaseComponent } from "../../../../core/common/base/base.component";
import { takeUntil } from 'rxjs/operators';
@Component({
selector: 'app-grant-tab',

Some files were not shown because too many files have changed in this diff Show More