dmp advanced editor changed to remain at the same page when saving
This commit is contained in:
parent
bd8120362d
commit
16d57bd0ad
|
@ -1,31 +1,31 @@
|
||||||
import { OverlayModule } from '@angular/cdk/overlay';
|
import { OverlayModule } from '@angular/cdk/overlay';
|
||||||
import { HttpClient, HttpClientModule } from '@angular/common/http';
|
import { HttpClient, HttpClientModule } from '@angular/common/http';
|
||||||
import { LOCALE_ID, NgModule } from '@angular/core';
|
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 { 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 { BrowserModule, Title } from '@angular/platform-browser';
|
||||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
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 { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||||
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
|
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
|
||||||
import { AppRoutingModule } from './app-routing.module';
|
import { environment } from 'environments/environment';
|
||||||
import { AppComponent } from './app.component';
|
import { CookieService } from 'ngx-cookie-service';
|
||||||
import { MomentUtcDateAdapter } from './common/date/moment-utc-date-adapter';
|
import { NgcCookieConsentConfig, NgcCookieConsentModule } from 'ngx-cookieconsent';
|
||||||
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';
|
|
||||||
|
|
||||||
// AoT requires an exported function for factories
|
// AoT requires an exported function for factories
|
||||||
export function HttpLoaderFactory(http: HttpClient) {
|
export function HttpLoaderFactory(http: HttpClient) {
|
||||||
|
|
|
@ -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 };
|
|
||||||
}
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { ValidationErrorModel } from "../../../common/forms/validation/error-model/validation-error-model";
|
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
|
||||||
import { FormGroup, FormBuilder, Validators } from "@angular/forms";
|
import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model';
|
||||||
|
|
||||||
export interface ContactEmail {
|
export interface ContactEmail {
|
||||||
subject: string;
|
subject: string;
|
||||||
|
@ -19,8 +19,8 @@ export class ContactEmailFormModel {
|
||||||
|
|
||||||
buildForm(): FormGroup {
|
buildForm(): FormGroup {
|
||||||
const formGroup = new FormBuilder().group({
|
const formGroup = new FormBuilder().group({
|
||||||
subject: [ this.subject, [Validators.required] ],
|
subject: [this.subject, [Validators.required]],
|
||||||
description: [ this.description, [Validators.required] ]
|
description: [this.description, [Validators.required]]
|
||||||
});
|
});
|
||||||
return formGroup;
|
return formGroup;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
import { Serializable } from "../../../common/types/json/serializable";
|
|
||||||
|
|
||||||
export interface DashboardStatisticsModel {
|
export interface DashboardStatisticsModel {
|
||||||
totalDataManagementPlanCount: number;
|
totalDataManagementPlanCount: number;
|
||||||
totalGrantCount: number;
|
totalGrantCount: number;
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
|
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
|
||||||
import { BackendErrorValidator } from "../../../../common/forms/validation/custom-validator";
|
import { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile';
|
||||||
import { ValidationErrorModel } from "../../../../common/forms/validation/error-model/validation-error-model";
|
import { DmpModel } from '@app/core/model/dmp/dmp';
|
||||||
import { ValidationContext } from "../../../../common/forms/validation/validation-context";
|
import { BackendErrorValidator } from '@common/forms/validation/custom-validator';
|
||||||
import { DatasetProfileModel } from "../../dataset/dataset-profile";
|
import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model';
|
||||||
import { DmpModel } from "../dmp";
|
import { ValidationContext } from '@common/forms/validation/validation-context';
|
||||||
|
|
||||||
export class DmpCreateWizardFormModel {
|
export class DmpCreateWizardFormModel {
|
||||||
dmp: DmpModel;
|
dmp: DmpModel;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
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> {
|
export class DmpInvitationUser implements Serializable<DmpInvitationUser> {
|
||||||
|
|
||||||
|
|
|
@ -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 { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { MatSnackBar } from '@angular/material/snack-bar';
|
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||||
import { Router } from '@angular/router';
|
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 { TranslateService } from '@ngx-translate/core';
|
||||||
import { environment } from '../../../../environments/environment';
|
import { environment } from 'environments/environment';
|
||||||
import { SnackBarNotificationComponent } from '../../../library/notification/snack-bar/snack-bar-notification.component';
|
import { Observable, of as observableOf, throwError as observableThrowError } from 'rxjs';
|
||||||
import { BaseService } from '../../common/base/base.service';
|
import { catchError, map, takeUntil } from 'rxjs/operators';
|
||||||
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";
|
|
||||||
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class AuthService extends BaseService {
|
export class AuthService extends BaseService {
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http';
|
import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http';
|
||||||
import { Injectable } from '@angular/core';
|
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 { Observable } from 'rxjs';
|
||||||
import { takeUntil } from "rxjs/operators";
|
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()
|
@Injectable()
|
||||||
export class DatasetProfileService extends BaseService {
|
export class DatasetProfileService extends BaseService {
|
||||||
|
|
|
@ -2,8 +2,8 @@ import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { environment } from '../../../../environments/environment';
|
import { environment } from '../../../../environments/environment';
|
||||||
import { BaseHttpParams } from '../../../common/http/base-http-params';
|
import { BaseHttpParams } from '../../../../common/http/base-http-params';
|
||||||
import { InterceptorType } from '../../../common/http/interceptors/interceptor-type';
|
import { InterceptorType } from '../../../../common/http/interceptors/interceptor-type';
|
||||||
import { DatasetProfileDefinitionModel } from '../../model/dataset-profile-definition/dataset-profile-definition';
|
import { DatasetProfileDefinitionModel } from '../../model/dataset-profile-definition/dataset-profile-definition';
|
||||||
import { DatasetProfileModel } from '../../model/dataset/dataset-profile';
|
import { DatasetProfileModel } from '../../model/dataset/dataset-profile';
|
||||||
import { DatasetWizardModel } from '../../model/dataset/dataset-wizard';
|
import { DatasetWizardModel } from '../../model/dataset/dataset-wizard';
|
||||||
|
|
|
@ -10,8 +10,8 @@ import { RequestItem } from '../../query/request-item';
|
||||||
import { DataTableData } from '../../model/data-table/data-table-data';
|
import { DataTableData } from '../../model/data-table/data-table-data';
|
||||||
import { DmpProfileCriteria } from '../../query/dmp/dmp-profile-criteria';
|
import { DmpProfileCriteria } from '../../query/dmp/dmp-profile-criteria';
|
||||||
import { DatasetListingModel } from '../../model/dataset/dataset-listing';
|
import { DatasetListingModel } from '../../model/dataset/dataset-listing';
|
||||||
import { BaseHttpParams } from '../../../common/http/base-http-params';
|
import { BaseHttpParams } from '../../../../common/http/base-http-params';
|
||||||
import { InterceptorType } from '../../../common/http/interceptors/interceptor-type';
|
import { InterceptorType } from '../../../../common/http/interceptors/interceptor-type';
|
||||||
import { DmpProfileExternalAutocompleteCriteria } from '../../query/dmp/dmp-profile-external-autocomplete-criteria';
|
import { DmpProfileExternalAutocompleteCriteria } from '../../query/dmp/dmp-profile-external-autocomplete-criteria';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
|
|
@ -2,8 +2,8 @@ import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { environment } from '../../../../environments/environment';
|
import { environment } from '../../../../environments/environment';
|
||||||
import { BaseHttpParams } from '../../../common/http/base-http-params';
|
import { BaseHttpParams } from '../../../../common/http/base-http-params';
|
||||||
import { InterceptorType } from '../../../common/http/interceptors/interceptor-type';
|
import { InterceptorType } from '../../../../common/http/interceptors/interceptor-type';
|
||||||
import { DynamicFieldGrantCriteria } from '../../../models/dynamic-field-grant/DynamicFieldGrantCriteria';
|
import { DynamicFieldGrantCriteria } from '../../../models/dynamic-field-grant/DynamicFieldGrantCriteria';
|
||||||
import { DataTableData } from '../../model/data-table/data-table-data';
|
import { DataTableData } from '../../model/data-table/data-table-data';
|
||||||
import { DataTableRequest } from '../../model/data-table/data-table-request';
|
import { DataTableRequest } from '../../model/data-table/data-table-request';
|
||||||
|
|
|
@ -4,8 +4,8 @@ import { Observable } from 'rxjs';
|
||||||
import { environment } from '../../../../environments/environment';
|
import { environment } from '../../../../environments/environment';
|
||||||
import { ContentFile } from '../../model/grant/grant-listing';
|
import { ContentFile } from '../../model/grant/grant-listing';
|
||||||
import { BaseHttpService } from '../http/base-http.service';
|
import { BaseHttpService } from '../http/base-http.service';
|
||||||
import { BaseHttpParams } from '../../../common/http/base-http-params';
|
import { BaseHttpParams } from '../../../../common/http/base-http-params';
|
||||||
import { InterceptorType } from '../../../common/http/interceptors/interceptor-type';
|
import { InterceptorType } from '../../../../common/http/interceptors/interceptor-type';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class GrantFileUploadService {
|
export class GrantFileUploadService {
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { CommonFormsModule } from '../../common/forms/common-forms.module';
|
import { FormattingModule } from '@app/core/formatting.module';
|
||||||
import { CommonUiModule } from '../../common/ui/common-ui.module';
|
import { MultipleAutoCompleteComponent } from '@app/library/auto-complete/multiple/multiple-auto-complete.component';
|
||||||
import { MultipleAutoCompleteComponent } from './multiple/multiple-auto-complete.component';
|
import { SingleAutoCompleteComponent } from '@app/library/auto-complete/single/single-auto-complete.component';
|
||||||
import { SingleAutoCompleteComponent } from './single/single-auto-complete.component';
|
import { CommonFormsModule } from '@common/forms/common-forms.module';
|
||||||
import { FormattingModule } from '../../core/formatting.module';
|
import { CommonUiModule } from '@common/ui/common-ui.module';
|
||||||
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
|
|
|
@ -1,17 +1,20 @@
|
||||||
|
import { TemplateRef } from '@angular/core';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { AutoCompleteGroup } from '../auto-complete-group';
|
import { AutoCompleteGroup } from '../auto-complete-group';
|
||||||
|
|
||||||
export interface MultipleAutoCompleteConfiguration {
|
export interface MultipleAutoCompleteConfiguration {
|
||||||
// Delay for performing the request. Default: 200ms.
|
// Delay for performing the request. Default: 200ms.
|
||||||
requestDelay?: number;
|
requestDelay?: number;
|
||||||
// Min characters for the filtering to be applied. Default: 1.
|
// Min characters for the filtering to be applied. Default: 3.
|
||||||
minFilteringChars?: number;
|
minFilteringChars?: number;
|
||||||
// Load and present items from start, without user query. Default: true.
|
// Load and present items from start, without user query. Default: true.
|
||||||
loadDataOnStart?: boolean;
|
loadDataOnStart?: boolean;
|
||||||
// Static or initial items.
|
// Static or initial items.
|
||||||
initialItems?: (excludedItems: any[]) => Observable<any[]>;
|
initialItems?: (excludedItems: any[], data?: any) => Observable<any[]>;
|
||||||
// Data retrieval function
|
// Data retrieval function
|
||||||
filterFn?: (searchQuery: string, excludedItems: any[]) => Observable<any[]>;
|
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
|
// Property formating for input
|
||||||
displayFn?: (item: any) => string;
|
displayFn?: (item: any) => string;
|
||||||
// Function to group results in the drop down
|
// Function to group results in the drop down
|
||||||
|
@ -20,6 +23,15 @@ export interface MultipleAutoCompleteConfiguration {
|
||||||
titleFn?: (item: any) => string;
|
titleFn?: (item: any) => string;
|
||||||
// Display function for the drop down subtitle
|
// Display function for the drop down subtitle
|
||||||
subtitleFn?: (item: any) => string;
|
subtitleFn?: (item: any) => string;
|
||||||
|
//Extra data passed to query function
|
||||||
|
extraData?: any;
|
||||||
// Callback to intercept value assignment based on item selection
|
// Callback to intercept value assignment based on item selection
|
||||||
valueAssign?: (selectedItem: any) => any;
|
valueAssign?: (selectedItem: any) => any;
|
||||||
|
// Property formating template
|
||||||
|
optionTemplate?: TemplateRef<any>;
|
||||||
|
// Selected value formating template
|
||||||
|
selectedValueTemplate?: TemplateRef<any>;
|
||||||
|
|
||||||
|
|
||||||
|
autoSelectFirstOptionOnBlur?: boolean;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,28 +1,57 @@
|
||||||
<div class="row multiple-auto-complete">
|
<div class="row multiple-auto-complete" ngForm>
|
||||||
<mat-chip-list #chipList ngDefaultControl class="col multi-chip-list" [disabled]="disabled">
|
<mat-chip-list class="col-auto" #chipList ngDefaultControl>
|
||||||
<mat-chip *ngFor="let selectedItem of (_chipItems() | jsonParser)" [disabled]="disabled" [selectable]="selectable" [removable]="removable" (removed)="_removeSelectedItem(selectedItem)" class="chip">
|
<ng-container *ngIf="value as values">
|
||||||
{{this._displayFn(selectedItem)}}
|
<mat-chip *ngFor="let value of values" [disabled]="disabled" [selectable]="selectable" [removable]="removable">
|
||||||
<mat-icon matChipRemove *ngIf="!disabled && removable">cancel</mat-icon>
|
<ng-container *ngIf="_selectedItems.get(stringify(value)) as selectedItem">
|
||||||
</mat-chip>
|
<ng-template #cellTemplate *ngIf="_selectedValueTemplate(selectedItem)" [ngTemplateOutlet]="_selectedValueTemplate(selectedItem)" [ngTemplateOutletContext]="{
|
||||||
<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)" />
|
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-chip-list>
|
||||||
<mat-progress-spinner mode="indeterminate" class="multi-loading-bar col-auto" [class.not-loading]="!loading" [diameter]="22"></mat-progress-spinner>
|
<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-autocomplete [panelWidth]="auto" class="panel-width" #auto="matAutocomplete" [displayWith]="_displayFn.bind(this)" (optionSelected)="_optionSelected($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">
|
<span *ngIf="_groupedItems">
|
||||||
<mat-optgroup *ngFor="let group of _groupedItems | async" [label]="group.title">
|
<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)">
|
<mat-option *ngFor="let item of group.items" [value]="item" [class.two-line-mat-option]="_subtitleFn(item) && !_optionTemplate(item)">
|
||||||
<span>{{_titleFn(item)}}</span>
|
<!-- <img style="vertical-align:middle;" aria-hidden src="{{state.flag}}" height="25" /> -->
|
||||||
<br *ngIf="_subtitleFn(item)">
|
<ng-template #cellTemplate *ngIf="_optionTemplate(item)" [ngTemplateOutlet]="_optionTemplate(item)" [ngTemplateOutletContext]="{
|
||||||
<small *ngIf="_subtitleFn(item)">{{_subtitleFn(item)}}</small>
|
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-option>
|
||||||
</mat-optgroup>
|
</mat-optgroup>
|
||||||
</span>
|
</span>
|
||||||
<span *ngIf="!_groupedItems">
|
<span *ngIf="!_groupedItems">
|
||||||
<mat-option *ngFor="let item of _items | async" [value]="item" [class.two-line-mat-option]="_subtitleFn(item)">
|
<div *ngIf="_items | async as autocompleteItems; else loading">
|
||||||
<span>{{_titleFn(item)}}</span>
|
<ng-container *ngIf="autocompleteItems.length; else noItems">
|
||||||
<br *ngIf="_subtitleFn(item)">
|
<mat-option *ngFor="let item of autocompleteItems" [value]="item" [class.two-line-mat-option]="_subtitleFn(item) && !_optionTemplate(item)">
|
||||||
<small *ngIf="_subtitleFn(item)">{{_subtitleFn(item)}}</small>
|
<!-- <img style="vertical-align:middle;" aria-hidden src="{{state.flag}}" height="25" /> -->
|
||||||
</mat-option>
|
<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>
|
</span>
|
||||||
</mat-autocomplete>
|
</mat-autocomplete>
|
||||||
</div>
|
</div>
|
|
@ -1,32 +1,21 @@
|
||||||
.multiple-auto-complete {
|
.multiple-auto-complete {
|
||||||
margin-left: inherit;
|
margin-left: inherit;
|
||||||
margin-right: inherit;
|
margin-right: inherit;
|
||||||
|
|
||||||
.multi-chip-list {
|
.not-loading {
|
||||||
padding-left: 0;
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
.chip {
|
|
||||||
border-radius: 2em !important;
|
|
||||||
height: auto !important;
|
|
||||||
min-width: fit-content !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.multi-loading-bar {
|
.align-arrow-right {
|
||||||
padding-right: 0;
|
position: absolute;
|
||||||
padding-left: 0;
|
right: 0;
|
||||||
}
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
.not-loading {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.two-line-mat-option {
|
.two-line-mat-option {
|
||||||
// height: 3.5em;
|
height: 3.5em;
|
||||||
line-height: 1.2em;
|
line-height: 1.2em;
|
||||||
}
|
|
||||||
|
|
||||||
::ng-deep .mat-autocomplete-panel.panel-width {
|
|
||||||
max-width: 78vw !important;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,25 @@
|
||||||
import { FocusMonitor } from '@angular/cdk/a11y';
|
import { FocusMonitor } from '@angular/cdk/a11y';
|
||||||
import { COMMA, ENTER } from '@angular/cdk/keycodes';
|
import { COMMA, ENTER } from '@angular/cdk/keycodes';
|
||||||
import { Component, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Optional, Output, Self, ViewChild } from '@angular/core';
|
import { Component, DoCheck, ElementRef, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Optional, Output, Self, SimpleChanges, TemplateRef, ViewChild } from '@angular/core';
|
||||||
import { ControlValueAccessor, NgControl } from '@angular/forms';
|
import { ControlValueAccessor, FormGroupDirective, NgControl, NgForm } from '@angular/forms';
|
||||||
import { MatAutocompleteSelectedEvent, MatAutocompleteTrigger } from '@angular/material/autocomplete';
|
import { ErrorStateMatcher, MatChipInputEvent, mixinErrorState } from '@angular/material';
|
||||||
import { MatChipInputEvent } from '@angular/material/chips';
|
import { MatAutocomplete, MatAutocompleteSelectedEvent, MatAutocompleteTrigger } from '@angular/material/autocomplete';
|
||||||
import { MatFormFieldControl } from '@angular/material/form-field';
|
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 { Observable, of as observableOf, Subject } from 'rxjs';
|
||||||
import { debounceTime, distinctUntilChanged, map, mergeMap, startWith, tap } from 'rxjs/operators';
|
import { debounceTime, distinctUntilChanged, map, mergeMap, startWith, takeUntil } from 'rxjs/operators';
|
||||||
import { AutoCompleteGroup } from '../auto-complete-group';
|
|
||||||
import { MultipleAutoCompleteConfiguration } from './multiple-auto-complete-configuration';
|
export class CustomComponentBase extends BaseComponent {
|
||||||
import { switchMap } from 'rxjs/internal/operators/switchMap';
|
constructor(
|
||||||
|
public _defaultErrorStateMatcher: ErrorStateMatcher,
|
||||||
|
public _parentForm: NgForm,
|
||||||
|
public _parentFormGroup: FormGroupDirective,
|
||||||
|
public ngControl: NgControl
|
||||||
|
) { super(); }
|
||||||
|
}
|
||||||
|
export const _CustomComponentMixinBase = mixinErrorState(CustomComponentBase);
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-multiple-auto-complete',
|
selector: 'app-multiple-auto-complete',
|
||||||
|
@ -17,40 +27,39 @@ import { switchMap } from 'rxjs/internal/operators/switchMap';
|
||||||
styleUrls: ['./multiple-auto-complete.component.scss'],
|
styleUrls: ['./multiple-auto-complete.component.scss'],
|
||||||
providers: [{ provide: MatFormFieldControl, useExisting: MultipleAutoCompleteComponent }]
|
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;
|
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
|
// Selected Option Event
|
||||||
@Output() optionSelected: EventEmitter<any> = new EventEmitter();
|
@Output() optionSelected: EventEmitter<any> = new EventEmitter();
|
||||||
// Removed Option Event
|
|
||||||
@Output() optionRemoved: EventEmitter<any> = new EventEmitter();
|
@Output() optionRemoved: EventEmitter<any> = new EventEmitter();
|
||||||
|
|
||||||
id = `multiple-autocomplete-${MultipleAutoCompleteComponent.nextId++}`;
|
id = `multiple-autocomplete-${MultipleAutoCompleteComponent.nextId++}`;
|
||||||
stateChanges = new Subject<void>();
|
stateChanges = new Subject<void>();
|
||||||
focused = false;
|
focused = false;
|
||||||
errorState = false;
|
|
||||||
controlType = 'multiple-autocomplete';
|
controlType = 'multiple-autocomplete';
|
||||||
describedBy = '';
|
describedBy = '';
|
||||||
_inputValue: string;
|
inputValue = '';
|
||||||
_inputSubject = new Subject<string>();
|
_inputSubject = new Subject<string>();
|
||||||
loading = false;
|
|
||||||
_items: Observable<any[]>;
|
_items: Observable<any[]>;
|
||||||
|
_selectedItems: Map<string, any> = new Map<any, any>();
|
||||||
_groupedItems: Observable<AutoCompleteGroup[]>;
|
_groupedItems: Observable<AutoCompleteGroup[]>;
|
||||||
private requestDelay = 200; //ms
|
selectable = false;
|
||||||
private minFilteringChars = 1;
|
|
||||||
private loadDataOnStart = true;
|
|
||||||
visible = true;
|
|
||||||
selectable = true;
|
|
||||||
removable = true;
|
removable = true;
|
||||||
addOnBlur = false;
|
separatorKeysCodes = [ENTER, COMMA];
|
||||||
|
|
||||||
get empty() {
|
get empty() { return (!this.value || this.value.length === 0) && (!this.inputValue || this.inputValue.length === 0); }
|
||||||
return !this._inputValue || this._inputValue.length === 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
get shouldLabelFloat() { return this.focused || !this.empty; }
|
get shouldLabelFloat() { return this.focused || !this.empty; }
|
||||||
|
|
||||||
|
@ -83,21 +92,22 @@ export class MultipleAutoCompleteComponent implements OnInit, MatFormFieldContro
|
||||||
return this._selectedValue;
|
return this._selectedValue;
|
||||||
}
|
}
|
||||||
set value(value: any | null) {
|
set value(value: any | null) {
|
||||||
this._selectedValue = value;
|
this._selectedValue = (value != null && value.length === 0) ? null : value;
|
||||||
this._inputValue = value;
|
|
||||||
this.stateChanges.next();
|
this.stateChanges.next();
|
||||||
}
|
}
|
||||||
private _selectedValue;
|
private _selectedValue;
|
||||||
|
|
||||||
@ViewChild('textInput', { static: true }) textInput: ElementRef;
|
|
||||||
@ViewChild(MatAutocompleteTrigger, { static: true }) autocomplete: MatAutocompleteTrigger;
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private fm: FocusMonitor,
|
private fm: FocusMonitor,
|
||||||
private elRef: ElementRef,
|
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.focused = !!origin;
|
||||||
this.stateChanges.next();
|
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[]> {
|
filter(query: string): Observable<any[]> {
|
||||||
// If loadDataOnStart is enabled and query is empty we return the initial items.
|
// If loadDataOnStart is enabled and query is empty we return the initial items.
|
||||||
if (this.isNullOrEmpty(query) && this.loadDataOnStart) {
|
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) {
|
} else if (query && query.length >= this.minFilteringChars) {
|
||||||
if (this.configuration.filterFn) {
|
if (this.configuration.filterFn) {
|
||||||
return this.configuration.filterFn(query, this.value || []);
|
return this.configuration.filterFn(query, this.configuration.extraData);
|
||||||
} else {
|
} else {
|
||||||
return this.configuration.initialItems(this.value || []) || observableOf([]);
|
return this.configuration.initialItems(this.configuration.extraData) || observableOf([]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return observableOf([]);
|
return observableOf([]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stringify(value: any): string {
|
||||||
|
return JSON.stringify(value);
|
||||||
|
}
|
||||||
|
|
||||||
isNullOrEmpty(query: string): boolean {
|
isNullOrEmpty(query: string): boolean {
|
||||||
return typeof query !== 'string' || query === null || query.length === 0;
|
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) {
|
_optionSelected(event: MatAutocompleteSelectedEvent) {
|
||||||
if (this.configuration.valueAssign) {
|
this.optionSelectedInternal(event.option.value);
|
||||||
const newValue = this.configuration.valueAssign(this.value) || [];
|
this.autocompleteInput.nativeElement.value = '';
|
||||||
newValue.push(event.option.value);
|
}
|
||||||
this._setValue(this.configuration.valueAssign(newValue));
|
|
||||||
}
|
private optionSelectedInternal(item: any) {
|
||||||
else {
|
const newValue = this._valueToAssign(item);
|
||||||
const newValue = this.value || [];
|
|
||||||
newValue.push(event.option.value);
|
//Update selected items
|
||||||
this._setValue(newValue);
|
this._selectedItems.set(JSON.stringify(newValue), item);
|
||||||
this.stateChanges.next();
|
|
||||||
this.optionSelected.emit(newValue);
|
const newValueArray = (Array.isArray(this.value) ? this.value : []);
|
||||||
this.textInput.nativeElement.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),
|
startWith(null),
|
||||||
debounceTime(this.requestDelay),
|
debounceTime(this.requestDelay),
|
||||||
distinctUntilChanged(),
|
distinctUntilChanged(),
|
||||||
tap(() => { this.loading = true; }),
|
distinctUntilChanged(),
|
||||||
switchMap(query => {
|
mergeMap(query => this.filter(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; }));
|
|
||||||
|
|
||||||
if (this.configuration.groupingFn) { this._groupedItems = this._items.pipe(map(items => this.configuration.groupingFn(items))); }
|
if (this.configuration.groupingFn) { this._groupedItems = this._items.pipe(map(items => this.configuration.groupingFn(items))); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_inputValueChange(value: string) {
|
public onBlur($event: MouseEvent) {
|
||||||
this._inputValue = value;
|
if (this.inputValue && this.inputValue.length > 1 && this.autocomplete.options && this.autocomplete.options.length > 0 && this.autoSelectFirstOptionOnBlur) {
|
||||||
this._inputSubject.next(value);
|
this.optionSelectedInternal(this.autocomplete.options.first.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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_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) => { };
|
onChange = (_: any) => { };
|
||||||
onTouched = () => { };
|
private _onTouched = () => { };
|
||||||
writeValue(value: any): void { this.value = value || ''; }
|
writeValue(value: any): void {
|
||||||
|
this.value = Array.isArray(value) ? value : null;
|
||||||
|
// Update chips observable
|
||||||
|
this.getSelectedItems(value);
|
||||||
|
}
|
||||||
pushChanges(value: any) { this.onChange(value); }
|
pushChanges(value: any) { this.onChange(value); }
|
||||||
registerOnChange(fn: (_: any) => {}): void { this.onChange = fn; }
|
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; }
|
setDisabledState(isDisabled: boolean): void { this.disabled = isDisabled; }
|
||||||
|
setDescribedByIds(ids: string[]) { this.describedBy = ids.join(' '); }
|
||||||
setDescribedByIds(ids: string[]) {
|
|
||||||
this.describedBy = ids.join(' ');
|
|
||||||
}
|
|
||||||
|
|
||||||
onContainerClick(event: MouseEvent) {
|
onContainerClick(event: MouseEvent) {
|
||||||
if ((event.target as Element).tagName.toLowerCase() !== 'input') {
|
event.stopPropagation();
|
||||||
this.elRef.nativeElement.querySelector('input').focus();
|
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.stateChanges.complete();
|
||||||
this.fm.stopMonitoring(this.elRef.nativeElement);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { TemplateRef } from '@angular/core';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { AutoCompleteGroup } from '../auto-complete-group';
|
import { AutoCompleteGroup } from '../auto-complete-group';
|
||||||
|
|
||||||
|
@ -8,28 +9,29 @@ export interface SingleAutoCompleteConfiguration {
|
||||||
minFilteringChars?: number;
|
minFilteringChars?: number;
|
||||||
// Load and present items from start, without user query. Default: true.
|
// Load and present items from start, without user query. Default: true.
|
||||||
loadDataOnStart?: boolean;
|
loadDataOnStart?: boolean;
|
||||||
// Remove item after selection.
|
|
||||||
removeAfterSelection?: boolean;
|
|
||||||
// Static or initial items.
|
// Static or initial items.
|
||||||
initialItems?: (data?: any) => Observable<any[]>;
|
initialItems?: (data?: any) => Observable<any[]>;
|
||||||
// Data retrieval function
|
// Data retrieval function
|
||||||
filterFn?: (searchQuery: string, data?: any) => Observable<any[]>;
|
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
|
// Property formating for input
|
||||||
displayFn?: (item: any) => string;
|
displayFn?: (item: any) => string;
|
||||||
// Property formating for dropdown
|
// Function to group results in the drop down
|
||||||
groupingFn?: (items: any[]) => AutoCompleteGroup[];
|
groupingFn?: (items: any[]) => AutoCompleteGroup[];
|
||||||
// Property formating for dropdown
|
// Display function for the drop down title
|
||||||
titleFn?: (item: any) => string;
|
titleFn?: (item: any) => string;
|
||||||
// Property formating for dropdown
|
// Display function for the drop down subtitle
|
||||||
subtitleFn?: (item: any) => string;
|
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
|
//Extra data passed to query function
|
||||||
extraData?: any;
|
extraData?: any;
|
||||||
// Callback to intercept value assignment based on item selection
|
// Callback to intercept value assignment based on item selection
|
||||||
valueAssign?: (selectedItem: any) => any;
|
valueAssign?: (selectedItem: any) => any;
|
||||||
|
// Property formating template
|
||||||
|
optionTemplate?: TemplateRef<any>;
|
||||||
|
// Selected value formating template
|
||||||
|
selectedValueTemplate?: TemplateRef<any>;
|
||||||
|
|
||||||
|
|
||||||
|
autoSelectFirstOptionOnBlur?: boolean;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,32 +1,44 @@
|
||||||
<div class="row auto-complete">
|
<div class="row auto-complete">
|
||||||
<mat-chip-list #chipList [disabled]="disabled" class="chip-list">
|
<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-chip *ngIf="value" [removable]="true" (removed)="chipRemove()" (click)="linkToOption(value)" [ngClass]="{'chip': this._linkFn(value)}">
|
<mat-icon *ngIf="!disabled" class="align-arrow-right" matSuffix>keyboard_arrow_down</mat-icon>
|
||||||
<mat-icon matChipRemove *ngIf="_iconFn(value)" class="ml-0 mr-1">{{_iconFn(value)}}</mat-icon>
|
<mat-autocomplete #autocomplete="matAutocomplete" [displayWith]="_displayFn.bind(this)" (optionSelected)="_optionSelected($event)">
|
||||||
{{_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)">
|
|
||||||
<span *ngIf="_groupedItems">
|
<span *ngIf="_groupedItems">
|
||||||
<mat-optgroup *ngFor="let group of _groupedItems | async" [label]="group.title">
|
<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" /> -->
|
<!-- <img style="vertical-align:middle;" aria-hidden src="{{state.flag}}" height="25" /> -->
|
||||||
<span>{{_titleFn(item)}}</span>
|
<ng-template #cellTemplate *ngIf="_optionTemplate(item)" [ngTemplateOutlet]="_optionTemplate(item)" [ngTemplateOutletContext]="{
|
||||||
<br *ngIf="_subtitleFn(item)">
|
item: item
|
||||||
<small *ngIf="_subtitleFn(item)">{{_subtitleFn(item)}}</small>
|
}"></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-option>
|
||||||
</mat-optgroup>
|
</mat-optgroup>
|
||||||
</span>
|
</span>
|
||||||
<span *ngIf="!_groupedItems">
|
<span *ngIf="!_groupedItems">
|
||||||
<mat-option *ngFor="let item of _items | async" [value]="item" [disabled]="_disableOption(item)" [class.two-line-mat-option]="_subtitleFn(item)">
|
<div *ngIf="_items | async as autocompleteItems; else loading">
|
||||||
<!-- <img style="vertical-align:middle;" aria-hidden src="{{state.flag}}" height="25" /> -->
|
<ng-container *ngIf="autocompleteItems.length; else noItems">
|
||||||
<span>{{_titleFn(item)}}</span>
|
<mat-option *ngFor="let item of autocompleteItems" [value]="item" [class.two-line-mat-option]="_subtitleFn(item) && !_optionTemplate(item)">
|
||||||
<br *ngIf="_subtitleFn(item)">
|
<!-- <img style="vertical-align:middle;" aria-hidden src="{{state.flag}}" height="25" /> -->
|
||||||
<small *ngIf="_subtitleFn(item)">{{_subtitleFn(item)}}</small>
|
<ng-template #cellTemplate *ngIf="_optionTemplate(item)" [ngTemplateOutlet]="_optionTemplate(item)" [ngTemplateOutletContext]="{
|
||||||
</mat-option>
|
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>
|
</span>
|
||||||
</mat-autocomplete>
|
</mat-autocomplete>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,35 +1,60 @@
|
||||||
.auto-complete {
|
.auto-complete {
|
||||||
margin-left: inherit;
|
margin-left: inherit;
|
||||||
margin-right: inherit;
|
margin-right: inherit;
|
||||||
|
|
||||||
.not-loading {
|
.not-loading {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.chip-list {
|
.chip-item {
|
||||||
width: 100%;
|
transition: none;
|
||||||
}
|
background-color: transparent;
|
||||||
|
padding: 0;
|
||||||
|
box-shadow: none !important;
|
||||||
|
border-radius: unset;
|
||||||
|
min-height: auto;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
.progress-loader {
|
.chip-list {
|
||||||
position: absolute;
|
width: 100%;
|
||||||
right: 0;
|
}
|
||||||
}
|
|
||||||
|
.progress-loader {
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.align-arrow-right {
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.chip-list {
|
||||||
|
width: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.two-line-mat-option {
|
.two-line-mat-option {
|
||||||
// height: 3.5em;
|
height: 3.5em;
|
||||||
line-height: 1.2em;
|
line-height: 1.2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.chip {
|
// .two-line-mat-option {
|
||||||
cursor: pointer;
|
// height: 3.5em;
|
||||||
opacity: 1 !important;
|
// line-height: 1.2em;
|
||||||
|
// }
|
||||||
|
|
||||||
|
.mat-standard-chip:hover::after {
|
||||||
|
opacity: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.chip:hover {
|
.mat-standard-chip:focus::after {
|
||||||
background-color: #c5c5c5;
|
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;
|
||||||
|
// }
|
||||||
|
|
|
@ -1,52 +1,69 @@
|
||||||
import { FocusMonitor } from '@angular/cdk/a11y';
|
import { FocusMonitor } from '@angular/cdk/a11y';
|
||||||
import { COMMA, ENTER } from '@angular/cdk/keycodes';
|
import { ENTER } from '@angular/cdk/keycodes';
|
||||||
import { Component, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Optional, Output, Self } from '@angular/core';
|
import { Component, DoCheck, ElementRef, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Optional, Output, Self, SimpleChanges, TemplateRef, ViewChild } from '@angular/core';
|
||||||
import { ControlValueAccessor, NgControl } from '@angular/forms';
|
import { ControlValueAccessor, FormGroupDirective, NgControl, NgForm } from '@angular/forms';
|
||||||
import { MatAutocompleteSelectedEvent } from '@angular/material/autocomplete';
|
import { MatAutocomplete, MatAutocompleteSelectedEvent, MatAutocompleteTrigger } from '@angular/material/autocomplete';
|
||||||
|
import { ErrorStateMatcher, mixinErrorState } from '@angular/material/core';
|
||||||
import { MatFormFieldControl } from '@angular/material/form-field';
|
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 { Observable, of as observableOf, Subject } from 'rxjs';
|
||||||
import { debounceTime, distinctUntilChanged, map, mergeMap, startWith, tap } from 'rxjs/operators';
|
import { debounceTime, distinctUntilChanged, map, mergeMap, startWith, takeUntil } 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';
|
|
||||||
|
|
||||||
|
|
||||||
|
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({
|
@Component({
|
||||||
selector: 'app-single-auto-complete',
|
selector: 'app-single-auto-complete',
|
||||||
templateUrl: './single-auto-complete.component.html',
|
templateUrl: './single-auto-complete.component.html',
|
||||||
styleUrls: ['./single-auto-complete.component.scss'],
|
styleUrls: ['./single-auto-complete.component.scss'],
|
||||||
providers: [{ provide: MatFormFieldControl, useExisting: SingleAutoCompleteComponent }],
|
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;
|
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
|
// Selected Option Event
|
||||||
@Output() optionSelected: EventEmitter<any> = new EventEmitter();
|
@Output() optionSelected: EventEmitter<any> = new EventEmitter();
|
||||||
// Removed Option Event
|
|
||||||
@Output() optionRemoved: EventEmitter<any> = new EventEmitter();
|
|
||||||
|
|
||||||
id = `single-autocomplete-${SingleAutoCompleteComponent.nextId++}`;
|
id = `single-autocomplete-${SingleAutoCompleteComponent.nextId++}`;
|
||||||
stateChanges = new Subject<void>();
|
stateChanges = new Subject<void>();
|
||||||
focused = false;
|
focused = false;
|
||||||
errorState = false;
|
|
||||||
controlType = 'single-autocomplete';
|
controlType = 'single-autocomplete';
|
||||||
describedBy = '';
|
describedBy = '';
|
||||||
_inputValue: string;
|
inputValue = '';
|
||||||
_inputSubject = new Subject<string>();
|
_inputSubject = new Subject<string>();
|
||||||
loading = false;
|
loading = false;
|
||||||
_items: Observable<any[]>;
|
_items: Observable<any[]>;
|
||||||
_groupedItems: Observable<AutoCompleteGroup[]>;
|
_groupedItems: Observable<AutoCompleteGroup[]>;
|
||||||
private requestDelay = 200; //ms
|
_selectedItems: Map<string, any> = new Map<any, any>();
|
||||||
private minFilteringChars = 1;
|
|
||||||
private loadDataOnStart = true;
|
|
||||||
separatorKeysCodes: number[] = [ENTER, COMMA];
|
|
||||||
|
|
||||||
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; }
|
get shouldLabelFloat() { return this.focused || !this.empty; }
|
||||||
|
|
||||||
|
@ -80,7 +97,6 @@ export class SingleAutoCompleteComponent implements OnInit, MatFormFieldControl<
|
||||||
}
|
}
|
||||||
set value(value: any | null) {
|
set value(value: any | null) {
|
||||||
this._selectedValue = value;
|
this._selectedValue = value;
|
||||||
this._inputValue = (value && value != "") ? " " : null;
|
|
||||||
this.stateChanges.next();
|
this.stateChanges.next();
|
||||||
}
|
}
|
||||||
private _selectedValue;
|
private _selectedValue;
|
||||||
|
@ -88,10 +104,14 @@ export class SingleAutoCompleteComponent implements OnInit, MatFormFieldControl<
|
||||||
constructor(
|
constructor(
|
||||||
private fm: FocusMonitor,
|
private fm: FocusMonitor,
|
||||||
private elRef: ElementRef,
|
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.focused = !!origin;
|
||||||
this.stateChanges.next();
|
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[]> {
|
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 {
|
isNullOrEmpty(query: string): boolean {
|
||||||
return typeof query !== 'string' || query === null || query.length === 0;
|
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) {
|
_optionSelected(event: MatAutocompleteSelectedEvent) {
|
||||||
this._setValue(this.configuration.valueAssign ? this.configuration.valueAssign(event.option.value) : event.option.value);
|
this.inputValue = this._displayFn(event.option.value);
|
||||||
//this._inputValue = " ";
|
this.optionSelectedInternal(event.option.value);
|
||||||
this.stateChanges.next();
|
|
||||||
this.optionSelected.emit(event.option.value);
|
|
||||||
if (this.configuration.removeAfterSelection) {
|
|
||||||
this.clearAutocomplete()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private clearAutocomplete() {
|
private optionSelectedInternal(item: any) {
|
||||||
this._setValue(null);
|
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) {
|
private _setValue(value: any) {
|
||||||
|
@ -194,72 +225,100 @@ export class SingleAutoCompleteComponent implements OnInit, MatFormFieldControl<
|
||||||
startWith(null),
|
startWith(null),
|
||||||
debounceTime(this.requestDelay),
|
debounceTime(this.requestDelay),
|
||||||
distinctUntilChanged(),
|
distinctUntilChanged(),
|
||||||
tap(() => { this.loading = true; }),
|
mergeMap(query => this.filter(query)));
|
||||||
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; }));
|
|
||||||
|
|
||||||
if (this.configuration.groupingFn) { this._groupedItems = this._items.pipe(map(items => this.configuration.groupingFn(items))); }
|
if (this.configuration.groupingFn) { this._groupedItems = this._items.pipe(map(items => this.configuration.groupingFn(items))); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_inputValueChange(value: string) {
|
public onBlur($event: MouseEvent) {
|
||||||
//this._inputValue = value;
|
if (this.value != null) {
|
||||||
this._inputSubject.next(value);
|
const inputLabel = this.inputValue;
|
||||||
this.stateChanges.next();
|
const selectedLabel = this._displayFn(this._selectedItems.get(JSON.stringify(this.value)));
|
||||||
}
|
if (inputLabel && selectedLabel !== inputLabel) {
|
||||||
|
this.inputValue = selectedLabel;
|
||||||
_isValidObject(value: any): boolean {
|
}
|
||||||
try {
|
} else if (this.inputValue && this.inputValue.length > 1 && this.autocomplete.options && this.autocomplete.options.length > 0 && this.autoSelectFirstOptionOnBlur) {
|
||||||
if (!value) { return false; }
|
this.inputValue = this._displayFn(this.autocomplete.options.first.value);
|
||||||
if (typeof value !== 'object') { JSON.parse(value); }
|
this.optionSelectedInternal(this.autocomplete.options.first.value);
|
||||||
} catch (e) {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onChange = (_: any) => { };
|
onChange = (_: any) => { };
|
||||||
onTouched = () => { };
|
private _onTouched = () => { };
|
||||||
writeValue(value: any): void { this.value = value || ''; }
|
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); }
|
pushChanges(value: any) { this.onChange(value); }
|
||||||
registerOnChange(fn: (_: any) => {}): void { this.onChange = fn; }
|
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; }
|
setDisabledState(isDisabled: boolean): void { this.disabled = isDisabled; }
|
||||||
|
setDescribedByIds(ids: string[]) { this.describedBy = ids.join(' '); }
|
||||||
setDescribedByIds(ids: string[]) {
|
|
||||||
this.describedBy = ids.join(' ');
|
|
||||||
}
|
|
||||||
|
|
||||||
onContainerClick(event: MouseEvent) {
|
onContainerClick(event: MouseEvent) {
|
||||||
if ((event.target as Element).tagName.toLowerCase() !== 'input') {
|
event.stopPropagation();
|
||||||
this.elRef.nativeElement.querySelector('input').focus();
|
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() {
|
ngOnDestroy() {
|
||||||
this.stateChanges.complete();
|
this.stateChanges.complete();
|
||||||
this.fm.stopMonitoring(this.elRef.nativeElement);
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -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() { }
|
|
||||||
}
|
|
|
@ -1,12 +1,12 @@
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import { CanDeactivate } from '@angular/router';
|
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 { TranslateService } from '@ngx-translate/core';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
import { map } from 'rxjs/operators';
|
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()
|
@Injectable()
|
||||||
export class CanDeactivateGuard extends BaseComponent implements CanDeactivate<CheckDeactivateBaseComponent> {
|
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> {
|
canDeactivate(component: CheckDeactivateBaseComponent): boolean | Observable<boolean> {
|
||||||
|
|
||||||
if (component.canDeactivate()) {
|
if (component.canDeactivate()) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
const dialogRef = this.dialog.open(ConfirmationDialogComponent, {
|
const dialogRef = this.dialog.open(ConfirmationDialogComponent, {
|
||||||
maxWidth: '700px',
|
maxWidth: '700px',
|
||||||
data: {
|
data: {
|
||||||
message: this.language.instant('GENERAL.CONFIRMATION-DIALOG.LEAVE-PAGE'),
|
message: this.language.instant('GENERAL.CONFIRMATION-DIALOG.LEAVE-PAGE'),
|
||||||
warning: this.language.instant('GENERAL.CONFIRMATION-DIALOG.LEAVE-WARNING'),
|
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'),
|
confirmButton: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.LEAVE'),
|
||||||
icon: 'error_outline'
|
icon: 'error_outline'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return dialogRef.afterClosed().pipe(map(x => x ? true : false));
|
return dialogRef.afterClosed().pipe(map(x => x ? true : false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { BaseComponent } from '../../core/common/base/base.component';
|
|
||||||
import { HostListener } from '@angular/core';
|
import { HostListener } from '@angular/core';
|
||||||
|
import { BaseComponent } from '@common/base/base.component';
|
||||||
|
|
||||||
export abstract class CheckDeactivateBaseComponent extends BaseComponent {
|
export abstract class CheckDeactivateBaseComponent extends BaseComponent {
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { CommonUiModule } from '../../common/ui/common-ui.module';
|
import { ExportMethodDialogComponent } from '@app/library/export-method-dialog/export-method-dialog.component';
|
||||||
import { ExportMethodDialogComponent } from './export-method-dialog.component';
|
import { CommonUiModule } from '@common/ui/common-ui.module';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [CommonUiModule],
|
imports: [CommonUiModule],
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import { MatSnackBar } from '@angular/material/snack-bar';
|
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 { 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({
|
@Component({
|
||||||
selector: 'app-notification',
|
selector: 'app-notification',
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { CommonUiModule } from '../../common/ui/common-ui.module';
|
import { NotificationComponent } from '@app/library/notification/notification.component';
|
||||||
import { NotificationComponent } from './notification.component';
|
import { PopupNotificationDialogComponent } from '@app/library/notification/popup/popup-notification.component';
|
||||||
import { PopupNotificationDialogComponent } from './popup/popup-notification.component';
|
import { SnackBarNotificationComponent } from '@app/library/notification/snack-bar/snack-bar-notification.component';
|
||||||
import { SnackBarNotificationComponent } from './snack-bar/snack-bar-notification.component';
|
import { CommonUiModule } from '@common/ui/common-ui.module';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { CommonUiModule } from '../../common/ui/common-ui.module';
|
import { FormattingModule } from '@app/core/formatting.module';
|
||||||
import { FormattingModule } from '../../core/formatting.module';
|
import { UrlListingComponent } from '@app/library/url-listing/url-listing.component';
|
||||||
import { UrlListingComponent } from './url-listing.component';
|
import { CommonUiModule } from '@common/ui/common-ui.module';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { CommonUiModule } from '../../common/ui/common-ui.module';
|
import { AboutComponent } from '@app/ui/about/about.component';
|
||||||
import { AboutComponent } from './about.component';
|
import { AboutRoutingModule } from '@app/ui/about/about.routing';
|
||||||
import { AboutRoutingModule } from './about.routing';
|
import { CommonUiModule } from '@common/ui/common-ui.module';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { FormGroup, Validators } from '@angular/forms';
|
import { FormGroup, Validators } from '@angular/forms';
|
||||||
import { Page } from '../../../../core/model/admin/dataset-profile/dataset-profile';
|
import { Page } from '@app/core/model/admin/dataset-profile/dataset-profile';
|
||||||
import { BaseFormModel } from '../../../../core/model/base-form-model';
|
import { BaseFormModel } from '@app/core/model/base-form-model';
|
||||||
import { Guid } from '../../../../common/types/guid';
|
import { Guid } from '@common/types/guid';
|
||||||
|
|
||||||
export class PageEditorModel extends BaseFormModel {
|
export class PageEditorModel extends BaseFormModel {
|
||||||
public title: string;
|
public title: string;
|
||||||
|
|
|
@ -1,32 +1,32 @@
|
||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { CommonFormsModule } from '../../../common/forms/common-forms.module';
|
import { FormattingModule } from '@app/core/formatting.module';
|
||||||
import { CommonUiModule } from '../../../common/ui/common-ui.module';
|
import { ConfirmationDialogModule } from '@common/modules/confirmation-dialog/confirmation-dialog.module';
|
||||||
import { FormattingModule } from '../../../core/formatting.module';
|
import { DatasetProfileRoutingModule } from '@app/ui/admin/dataset-profile/dataset-profile.routing';
|
||||||
import { DatasetProfileRoutingModule } from './dataset-profile.routing';
|
import { DatasetProfileEditorCompositeFieldComponent } from '@app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component';
|
||||||
import { DatasetProfileEditorDefaultValueComponent } from './editor/components/composite-profile-editor-default-value/component-profile-editor-default-value.component';
|
import { DatasetProfileEditorDefaultValueComponent } from '@app/ui/admin/dataset-profile/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 '@app/ui/admin/dataset-profile/editor/components/field-type/auto-complete/dataset-profile-editor-auto-complete-field.component';
|
||||||
import { DatasetProfileEditorAutoCompleteFieldComponent } from './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 { DatasetProfileEditorBooleanDecisionFieldComponent } from './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 { DatasetProfileEditorCheckboxFieldComponent } from './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 { DatasetProfileEditorComboBoxFieldComponent } from './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 { DatasetProfileEditorFreeTextFieldComponent } from './editor/components/field-type/free-text/dataset-profile-editor-free-text-field.component';
|
import { DatasetProfileEditorDatePickerFieldComponent } from '@app/ui/admin/dataset-profile/editor/components/field-type/datepicker/dataset-profile-editor-date-picker-field.component';
|
||||||
import { DatasetProfileEditorRadioBoxFieldComponent } from './editor/components/field-type/radio-box/dataset-profile-editor-radio-box-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 { DatasetProfileEditorTextAreaFieldComponent } from './editor/components/field-type/textarea/dataset-profile-editor-text-area-field.component';
|
import { DatasetProfileEditorFreeTextFieldComponent } from '@app/ui/admin/dataset-profile/editor/components/field-type/free-text/dataset-profile-editor-free-text-field.component';
|
||||||
import { DatasetProfileEditorWordListFieldComponent } from './editor/components/field-type/word-list/dataset-profile-editor-word-list-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 { DatasetProfileEditorFieldComponent } from './editor/components/field/dataset-profile-editor-field.component';
|
import { DatasetProfileEditorRadioBoxFieldComponent } from '@app/ui/admin/dataset-profile/editor/components/field-type/radio-box/dataset-profile-editor-radio-box-field.component';
|
||||||
import { DatasetProfileEditorPageComponent } from './editor/components/page/dataset-profile-editor-page.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 { DatasetProfileEditorRuleComponent } from './editor/components/rule/dataset-profile-editor-rule.component';
|
import { DatasetProfileEditorTextAreaFieldComponent } from '@app/ui/admin/dataset-profile/editor/components/field-type/textarea/dataset-profile-editor-text-area-field.component';
|
||||||
import { DatasetProfileEditorSectionComponent } from './editor/components/section/dataset-profile-editor-section.component';
|
import { DatasetProfileEditorWordListFieldComponent } from '@app/ui/admin/dataset-profile/editor/components/field-type/word-list/dataset-profile-editor-word-list-field.component';
|
||||||
import { DatasetProfileEditorComponent } from './editor/dataset-profile-editor.component';
|
import { DatasetProfileEditorFieldComponent } from '@app/ui/admin/dataset-profile/editor/components/field/dataset-profile-editor-field.component';
|
||||||
import { DatasetProfileCriteriaComponent } from './listing/criteria/dataset-profile.component';
|
import { DatasetProfileEditorPageComponent } from '@app/ui/admin/dataset-profile/editor/components/page/dataset-profile-editor-page.component';
|
||||||
import { DatasetProfileListingComponent } from './listing/dataset-profile-listing.component';
|
import { DatasetProfileEditorRuleComponent } from '@app/ui/admin/dataset-profile/editor/components/rule/dataset-profile-editor-rule.component';
|
||||||
import { ConfirmationDialogModule } from '../../../library/confirmation-dialog/confirmation-dialog.module';
|
import { DatasetProfileEditorSectionComponent } from '@app/ui/admin/dataset-profile/editor/components/section/dataset-profile-editor-section.component';
|
||||||
import { DatasetProfileEditorDatePickerFieldComponent } from './editor/components/field-type/datepicker/dataset-profile-editor-date-picker-field.component';
|
import { DatasetProfileEditorComponent } from '@app/ui/admin/dataset-profile/editor/dataset-profile-editor.component';
|
||||||
import { DialodConfirmationUploadDatasetProfiles } from './listing/criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component';
|
import { DatasetProfileCriteriaComponent } from '@app/ui/admin/dataset-profile/listing/criteria/dataset-profile.component';
|
||||||
import { DatasetProfileEditorInternalDmpEntitiesFieldComponent } from './editor/components/field-type/internal-dmp-entities/dataset-profile-editor-internal-dmp-entities-field.component';
|
import { DialodConfirmationUploadDatasetProfiles } from '@app/ui/admin/dataset-profile/listing/criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component';
|
||||||
import { DatasetProfileEditorResearchersAutoCompleteFieldComponent } from './editor/components/field-type/researchers-auto-complete/dataset-profile-editor-researchers-auto-complete-field.component';
|
import { DatasetProfileListingComponent } from '@app/ui/admin/dataset-profile/listing/dataset-profile-listing.component';
|
||||||
import { DatasetProfileEditorDatasetsAutoCompleteFieldComponent } from './editor/components/field-type/datasets-auto-complete/dataset-profile-editor-datasets-autocomplete-field.component';
|
import { CommonFormsModule } from '@common/forms/common-forms.module';
|
||||||
import { DatasetProfileEditorDmpsAutoCompleteFieldComponent } from './editor/components/field-type/dmps-auto-complete/dataset-profile-editor-dmps-autocomplete-field.component';
|
import { CommonUiModule } from '@common/ui/common-ui.module';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { Component, Input, OnInit } from '@angular/core';
|
import { Component, Input, OnInit } from '@angular/core';
|
||||||
import { FormArray, FormControl, FormGroup } from '@angular/forms';
|
import { FormArray, FormControl, FormGroup } from '@angular/forms';
|
||||||
import { FieldEditorModel } from '../../../admin/field-editor-model';
|
import { FieldEditorModel } from '../../../admin/field-editor-model';
|
||||||
import { Guid } from '../../../../../../common/types/guid';
|
import { Guid } from '@common/types/guid';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-dataset-profile-editor-composite-field-component',
|
selector: 'app-dataset-profile-editor-composite-field-component',
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import { Component, Input, OnInit } from '@angular/core';
|
import { Component, Input, OnInit } from '@angular/core';
|
||||||
import { FormGroup } from '@angular/forms';
|
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 { 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({
|
@Component({
|
||||||
selector: 'app-dataset-profile-editor-combo-box-field-component',
|
selector: 'app-dataset-profile-editor-combo-box-field-component',
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
import { DatasetProfileInternalDmpEntitiesType } from "../../../../../../../core/common/enum/dataset-profile-internal-dmp-entities-type";
|
import { Component, Input, OnInit } from '@angular/core';
|
||||||
import { EnumUtils } from "../../../../../../../core/services/utilities/enum-utils.service";
|
import { FormGroup } from '@angular/forms';
|
||||||
import { Component, Input, OnInit } from "@angular/core";
|
import { DatasetProfileInternalDmpEntitiesType } from '@app/core/common/enum/dataset-profile-internal-dmp-entities-type';
|
||||||
import { FormGroup } from "@angular/forms";
|
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||||
import { BaseComponent } from "../../../../../../../core/common/base/base.component";
|
import { DatasetsAutoCompleteFieldDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/datasets-autocomplete-field-data-editor-mode';
|
||||||
import { takeUntil } from "rxjs/operators";
|
import { DmpsAutoCompleteFieldDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/dmps-autocomplete-field-data-editor-model';
|
||||||
import { ResearchersAutoCompleteFieldDataEditorModel } from "../../../../admin/field-data/researchers-auto-complete-field-data-editor-model";
|
import { ResearchersAutoCompleteFieldDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/researchers-auto-complete-field-data-editor-model';
|
||||||
import { DatasetsAutoCompleteFieldDataEditorModel } from "../../../../admin/field-data/datasets-autocomplete-field-data-editor-mode";
|
import { BaseComponent } from '@common/base/base.component';
|
||||||
import { DmpsAutoCompleteFieldDataEditorModel } from "../../../../admin/field-data/dmps-autocomplete-field-data-editor-model";
|
import { takeUntil } from 'rxjs/operators';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-dataset-profile-internal-dmp-entities-field-component',
|
selector: 'app-dataset-profile-internal-dmp-entities-field-component',
|
||||||
|
|
|
@ -1,22 +1,21 @@
|
||||||
|
|
||||||
import { Component, Input, OnInit } from '@angular/core';
|
import { Component, Input, OnInit } from '@angular/core';
|
||||||
import { FormArray, FormControl, FormGroup } from '@angular/forms';
|
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 { 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({
|
@Component({
|
||||||
selector: 'app-dataset-profile-editor-field-component',
|
selector: 'app-dataset-profile-editor-field-component',
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import { Component, Input, OnInit } from '@angular/core';
|
import { Component, Input, OnInit } from '@angular/core';
|
||||||
import { FormArray, FormGroup } from '@angular/forms';
|
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 { 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({
|
@Component({
|
||||||
selector: 'app-dataset-profile-editor-section-component',
|
selector: 'app-dataset-profile-editor-section-component',
|
||||||
|
@ -32,10 +32,10 @@ export class DatasetProfileEditorSectionComponent extends BaseComponent implemen
|
||||||
addField() {
|
addField() {
|
||||||
const fieldSet: FieldSetEditorModel = new FieldSetEditorModel();
|
const fieldSet: FieldSetEditorModel = new FieldSetEditorModel();
|
||||||
const field: FieldEditorModel = new FieldEditorModel();
|
const field: FieldEditorModel = new FieldEditorModel();
|
||||||
field.id=Guid.create().toString();
|
field.id = Guid.create().toString();
|
||||||
fieldSet.fields.push(field);
|
fieldSet.fields.push(field);
|
||||||
if (this.dataModel.fieldSets) {
|
if (this.dataModel.fieldSets) {
|
||||||
fieldSet.id=Guid.create().toString();
|
fieldSet.id = Guid.create().toString();
|
||||||
this.dataModel.fieldSets.push(fieldSet);
|
this.dataModel.fieldSets.push(fieldSet);
|
||||||
}
|
}
|
||||||
(<FormArray>this.form.get('fieldSets')).push(fieldSet.buildForm());
|
(<FormArray>this.form.get('fieldSets')).push(fieldSet.buildForm());
|
||||||
|
@ -48,7 +48,7 @@ export class DatasetProfileEditorSectionComponent extends BaseComponent implemen
|
||||||
}
|
}
|
||||||
|
|
||||||
DeleteSectionInSection(index) {
|
DeleteSectionInSection(index) {
|
||||||
this.dataModel.sections.splice(index,1);
|
this.dataModel.sections.splice(index, 1);
|
||||||
(<FormArray>this.form.get('sections')).removeAt(index);
|
(<FormArray>this.form.get('sections')).removeAt(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,21 +8,20 @@ import { MatHorizontalStepper } from '@angular/material/stepper';
|
||||||
import { ActivatedRoute, ParamMap, Router } from '@angular/router';
|
import { ActivatedRoute, ParamMap, Router } from '@angular/router';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import { map, takeUntil } from 'rxjs/operators';
|
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 * as FileSaver from 'file-saver';
|
||||||
import { BreadcrumbItem } from '../../../misc/breadcrumb/definition/breadcrumb-item';
|
import { BaseComponent } from '@common/base/base.component';
|
||||||
import { DatasetStatus } from '../../../../core/common/enum/dataset-status';
|
import { DatasetProfileEditorModel } from '@app/ui/admin/dataset-profile/editor/dataset-profile-editor-model';
|
||||||
//import * as data from 'src/assets/resources/skipDisable.json';
|
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');
|
const skipDisable: any[] = require('../../../../../assets/resources/skipDisable.json');
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
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 { TranslateService } from '@ngx-translate/core';
|
||||||
import { takeUntil } from 'rxjs/operators';
|
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({
|
@Component({
|
||||||
selector: 'app-dataset-profile-criteria-component',
|
selector: 'app-dataset-profile-criteria-component',
|
||||||
|
|
|
@ -3,19 +3,19 @@ import { Component, OnInit, ViewChild } from '@angular/core';
|
||||||
import { MatPaginator, PageEvent } from '@angular/material/paginator';
|
import { MatPaginator, PageEvent } from '@angular/material/paginator';
|
||||||
import { MatSort } from '@angular/material/sort';
|
import { MatSort } from '@angular/material/sort';
|
||||||
import { ActivatedRoute, Params, Router } from '@angular/router';
|
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 { TranslateService } from '@ngx-translate/core';
|
||||||
import { merge as observableMerge, Observable, of as observableOf } from 'rxjs';
|
import { merge as observableMerge, Observable, of as observableOf } from 'rxjs';
|
||||||
import { map, startWith, switchMap, takeUntil } from 'rxjs/operators';
|
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({
|
@Component({
|
||||||
selector: 'app-dataset-profile-listing-component',
|
selector: 'app-dataset-profile-listing-component',
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import { Component, Inject, OnInit } from '@angular/core';
|
import { Inject, OnInit } from '@angular/core';
|
||||||
import { FormGroup } from '@angular/forms';
|
import { FormGroup } from '@angular/forms';
|
||||||
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
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 { 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({
|
// @Component({
|
||||||
// selector: 'app-dataset-profile-preview-component',
|
// selector: 'app-dataset-profile-preview-component',
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
import { NgModule } from "@angular/core";
|
import { NgModule } from "@angular/core";
|
||||||
import { CommonFormsModule } from "../../../common/forms/common-forms.module";
|
import { ConfirmationDialogModule } from '@common/modules/confirmation-dialog/confirmation-dialog.module';
|
||||||
import { CommonUiModule } from "../../../common/ui/common-ui.module";
|
import { UrlListingModule } from '@app/library/url-listing/url-listing.module';
|
||||||
import { ConfirmationDialogModule } from "../../../library/confirmation-dialog/confirmation-dialog.module";
|
import { CommonFormsModule } from '@common/forms/common-forms.module';
|
||||||
import { UrlListingModule } from "../../../library/url-listing/url-listing.module";
|
import { CommonUiModule } from '@common/ui/common-ui.module';
|
||||||
import { DmpProfileRoutingModule } from "./dmp-profile.routing";
|
import { DmpProfileRoutingModule } from './dmp-profile.routing';
|
||||||
import { DmpProfileEditorComponent } from "./editor/dmp-profile-editor.component";
|
import { DmpProfileEditorComponent } from './editor/dmp-profile-editor.component';
|
||||||
import { DmpProfileCriteriaComponent } from "./listing/criteria/dmp-profile-criteria.component";
|
import { DmpProfileExternalAutocompleteFieldEditorComponent } from './editor/external-autocomplete/dmp-profile-external-autocomplete-field-editor.component';
|
||||||
import { DmpProfileListingComponent } from "./listing/dmp-profile-listing.component";
|
import { DialodConfirmationUploadDmpProfiles } from './listing/criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.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 { DmpProfileExternalAutocompleteFieldEditorComponent } from "./editor/external-autocomplete/dmp-profile-external-autocomplete-field-editor.component";
|
import { DmpProfileListingComponent } from './listing/dmp-profile-listing.component';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
|
|
@ -1,25 +1,25 @@
|
||||||
|
|
||||||
import {of as observableOf, Observable } from 'rxjs';
|
import { AfterViewInit, Component } from '@angular/core';
|
||||||
|
|
||||||
import {map, takeUntil } from 'rxjs/operators';
|
|
||||||
import { AfterViewInit, Component, OnInit } from '@angular/core';
|
|
||||||
import { AbstractControl, FormArray, FormControl, FormGroup } from '@angular/forms';
|
import { AbstractControl, FormArray, FormControl, FormGroup } from '@angular/forms';
|
||||||
import { ActivatedRoute, Params, Router } from '@angular/router';
|
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 { TranslateService } from '@ngx-translate/core';
|
||||||
|
import { environment } from 'environments/environment';
|
||||||
import * as FileSaver from 'file-saver';
|
import * as FileSaver from 'file-saver';
|
||||||
import { environment } from '../../../../../environments/environment';
|
import { Observable, of as observableOf } from 'rxjs';
|
||||||
import { ValidationErrorModel } from '../../../../common/forms/validation/error-model/validation-error-model';
|
import { map, takeUntil } from 'rxjs/operators';
|
||||||
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';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-dmp-profile-editor-component',
|
selector: 'app-dmp-profile-editor-component',
|
||||||
|
@ -99,8 +99,8 @@ export class DmpProfileEditorComponent extends BaseComponent implements AfterVie
|
||||||
this.dmpProfileService.createDmp(this.formGroup.value)
|
this.dmpProfileService.createDmp(this.formGroup.value)
|
||||||
.pipe(takeUntil(this._destroyed))
|
.pipe(takeUntil(this._destroyed))
|
||||||
.subscribe(
|
.subscribe(
|
||||||
complete => this.onCallbackSuccess(),
|
complete => this.onCallbackSuccess(),
|
||||||
error => this.onCallbackError(error)
|
error => this.onCallbackError(error)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -202,8 +202,8 @@ export class DmpProfileEditorComponent extends BaseComponent implements AfterVie
|
||||||
this.dmpProfileService.createDmp(this.formGroup.value)
|
this.dmpProfileService.createDmp(this.formGroup.value)
|
||||||
.pipe(takeUntil(this._destroyed))
|
.pipe(takeUntil(this._destroyed))
|
||||||
.subscribe(
|
.subscribe(
|
||||||
complete => this.onCallbackSuccess(),
|
complete => this.onCallbackSuccess(),
|
||||||
error => this.onCallbackError(error)
|
error => this.onCallbackError(error)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||||
import { ValidationErrorModel } from '../../../../common/forms/validation/error-model/validation-error-model';
|
import { DmpProfileFieldDataType } from '@app/core/common/enum/dmp-profile-field-type';
|
||||||
import { DmpProfileFieldDataType } from '../../../../core/common/enum/dmp-profile-field-type';
|
import { DmpProfileType } from '@app/core/common/enum/dmp-profile-type';
|
||||||
import { DmpProfileType } from '../../../../core/common/enum/dmp-profile-type';
|
import { DmpProfile, DmpProfileDefinition } from '@app/core/model/dmp-profile/dmp-profile';
|
||||||
import { DmpProfile, DmpProfileDefinition } from '../../../../core/model/dmp-profile/dmp-profile';
|
import { DmpProfileField } from '@app/core/model/dmp-profile/dmp-profile-field';
|
||||||
import { DmpProfileField } from '../../../../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 { DmpProfileExternalAutoCompleteFieldDataEditorModel } from './external-autocomplete/dmp-profile-external-autocomplete-field-editor.model';
|
import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model';
|
||||||
|
|
||||||
export class DmpProfileEditorModel {
|
export class DmpProfileEditorModel {
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
import { Component, Input, OnInit } from '@angular/core';
|
import { Component, Input, OnInit } from '@angular/core';
|
||||||
import { ValidationErrorModel } from '../../../../../common/forms/validation/error-model/validation-error-model';
|
import { MatDialog } from '@angular/material';
|
||||||
import { GrantListingModel } from '../../../../../core/model/grant/grant-listing';
|
import { GrantListingModel } from '@app/core/model/grant/grant-listing';
|
||||||
import { DmpCriteria } from '../../../../../core/query/dmp/dmp-criteria';
|
import { DmpCriteria } from '@app/core/query/dmp/dmp-criteria';
|
||||||
import { DmpProfileCriteria } from '../../../../../core/query/dmp/dmp-profile-criteria';
|
import { DmpProfileCriteria } from '@app/core/query/dmp/dmp-profile-criteria';
|
||||||
import { BaseCriteriaComponent } from '../../../../misc/criteria/base-criteria.component';
|
import { DmpProfileService } from '@app/core/services/dmp/dmp-profile.service';
|
||||||
import { DialodConfirmationUploadDmpProfiles } from './dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component';
|
import { DialodConfirmationUploadDmpProfiles } from '@app/ui/admin/dmp-profile/listing/criteria/dialog-confirmation-upload-profile/dialog-confirmation-upload-profiles.component';
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
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 { TranslateService } from '@ngx-translate/core';
|
||||||
import { takeUntil } from 'rxjs/operators';
|
import { takeUntil } from 'rxjs/operators';
|
||||||
import { DmpProfileService } from '../../../../../core/services/dmp/dmp-profile.service';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-dmp-profile-criteria-component',
|
selector: 'app-dmp-profile-criteria-component',
|
||||||
|
|
|
@ -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 { DataSource } from '@angular/cdk/table';
|
||||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||||
import { MatPaginator, PageEvent } from '@angular/material/paginator';
|
import { MatPaginator, PageEvent } from '@angular/material/paginator';
|
||||||
import { MatSnackBar } from '@angular/material/snack-bar';
|
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||||
import { MatSort } from '@angular/material/sort';
|
import { MatSort } from '@angular/material/sort';
|
||||||
import { ActivatedRoute, Params, Router } from '@angular/router';
|
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 { TranslateService } from '@ngx-translate/core';
|
||||||
import { BaseComponent } from '../../../../core/common/base/base.component';
|
import { merge as observableMerge, Observable, of as observableOf } from 'rxjs';
|
||||||
import { DmpProfileListing } from '../../../../core/model/dmp-profile/dmp-profile-listing';
|
import { map, startWith, switchMap, takeUntil } from 'rxjs/operators';
|
||||||
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';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-dmp-profile-listing-component',
|
selector: 'app-dmp-profile-listing-component',
|
||||||
|
@ -131,7 +131,7 @@ export class DatasetDataSource extends DataSource<DmpProfileListing> {
|
||||||
if (!result) { return []; }
|
if (!result) { return []; }
|
||||||
if (this._paginator.pageIndex === 0) { this.totalCount = result.totalCount; }
|
if (this._paginator.pageIndex === 0) { this.totalCount = result.totalCount; }
|
||||||
return result.data;
|
return result.data;
|
||||||
}),);
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
disconnect() {
|
disconnect() {
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
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 { 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({
|
@Component({
|
||||||
selector: 'app-user-criteria-component',
|
selector: 'app-user-criteria-component',
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
import { Component, Input, OnInit } from '@angular/core';
|
import { Component, Input, OnInit } from '@angular/core';
|
||||||
import { AbstractControl, FormArray, FormBuilder, FormControl, FormGroup } from '@angular/forms';
|
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 { TranslateService } from '@ngx-translate/core';
|
||||||
import { takeUntil } from 'rxjs/operators';
|
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({
|
@Component({
|
||||||
selector: 'app-user-role-editor-component',
|
selector: 'app-user-role-editor-component',
|
||||||
|
@ -26,7 +26,7 @@ export class UserRoleEditorComponent extends BaseComponent implements OnInit {
|
||||||
private userService: UserService,
|
private userService: UserService,
|
||||||
private formBuilder: FormBuilder,
|
private formBuilder: FormBuilder,
|
||||||
private enumUtils: EnumUtils,
|
private enumUtils: EnumUtils,
|
||||||
private uiNotificationService:UiNotificationService
|
private uiNotificationService: UiNotificationService
|
||||||
) { super(); }
|
) { super(); }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
@ -117,12 +117,12 @@ export class UserRoleEditorComponent extends BaseComponent implements OnInit {
|
||||||
onCallbackSuccess() {
|
onCallbackSuccess() {
|
||||||
this.nowEditing = false;
|
this.nowEditing = false;
|
||||||
this.formGroup.disable();
|
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) {
|
onCallbackError(error: any) {
|
||||||
this.validateAllFormFields(this.formGroup);
|
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[] {
|
getPrincipalAppRoleValues(): Number[] {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { CommonFormsModule } from '../../../common/forms/common-forms.module';
|
import { FormattingModule } from '@app/core/formatting.module';
|
||||||
import { CommonUiModule } from '../../../common/ui/common-ui.module';
|
import { CommonFormsModule } from '@common/forms/common-forms.module';
|
||||||
import { FormattingModule } from '../../../core/formatting.module';
|
import { CommonUiModule } from '@common/ui/common-ui.module';
|
||||||
import { UserCriteriaComponent } from './listing/criteria/user-criteria.component';
|
import { UserCriteriaComponent } from './listing/criteria/user-criteria.component';
|
||||||
import { UserRoleEditorComponent } from './listing/role-editor/user-role-editor.component';
|
import { UserRoleEditorComponent } from './listing/role-editor/user-role-editor.component';
|
||||||
import { UserListingComponent } from './listing/user-listing.component';
|
import { UserListingComponent } from './listing/user-listing.component';
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
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 { TranslateService } from '@ngx-translate/core';
|
||||||
import { takeUntil } from 'rxjs/operators';
|
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({
|
@Component({
|
||||||
selector: 'app-admin-login',
|
selector: 'app-admin-login',
|
||||||
templateUrl: './admin-login.component.html',
|
templateUrl: './admin-login.component.html',
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { CommonFormsModule } from '../../../common/forms/common-forms.module';
|
import { AdminLoginComponent } from '@app/ui/auth/admin-login/admin-login.component';
|
||||||
import { CommonUiModule } from '../../../common/ui/common-ui.module';
|
import { AdminLoginRoutingModule } from '@app/ui/auth/admin-login/admin-login.routing';
|
||||||
import { AdminLoginComponent } from './admin-login.component';
|
import { CommonFormsModule } from '@common/forms/common-forms.module';
|
||||||
import { AdminLoginRoutingModule } from './admin-login.routing';
|
import { CommonUiModule } from '@common/ui/common-ui.module';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { ActivatedRoute, Params } from '@angular/router';
|
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 { 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({
|
@Component({
|
||||||
selector: 'app-b2access-login',
|
selector: 'app-b2access-login',
|
||||||
|
@ -37,10 +37,10 @@ export class B2AccessLoginComponent extends BaseComponent implements OnInit {
|
||||||
|
|
||||||
public b2AccessGetAuthCode() {
|
public b2AccessGetAuthCode() {
|
||||||
window.location.href = environment.loginProviders.b2accessConfiguration.oauthUrl
|
window.location.href = environment.loginProviders.b2accessConfiguration.oauthUrl
|
||||||
+ '?response_type=code&client_id=' + environment.loginProviders.b2accessConfiguration.clientId
|
+ '?response_type=code&client_id=' + environment.loginProviders.b2accessConfiguration.clientId
|
||||||
+ '&redirect_uri=' + environment.loginProviders.b2accessConfiguration.redirectUri
|
+ '&redirect_uri=' + environment.loginProviders.b2accessConfiguration.redirectUri
|
||||||
+ '&state=' + environment.loginProviders.b2accessConfiguration.state
|
+ '&state=' + environment.loginProviders.b2accessConfiguration.state
|
||||||
+ '&scope=USER_PROFILE';
|
+ '&scope=USER_PROFILE';
|
||||||
}
|
}
|
||||||
|
|
||||||
public b2AccessLogin(code: String) {
|
public b2AccessLogin(code: String) {
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
import { Component, OnInit, Input } from "@angular/core";
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { BaseComponent } from "../../../../core/common/base/base.component";
|
import { Component, OnInit } from "@angular/core";
|
||||||
import { ActivatedRoute, Router, Params } from "@angular/router";
|
import { ActivatedRoute, Params, Router } from '@angular/router';
|
||||||
import { HttpClient } from "@angular/common/http";
|
import { AuthProvider } from '@app/core/common/enum/auth-provider';
|
||||||
import { LoginService } from "../utilities/login.service";
|
import { ConfigurableProvider } from '@app/core/model/configurable-provider/configurableProvider';
|
||||||
import { AuthService } from "../../../../core/services/auth/auth.service";
|
import { AuthService } from '@app/core/services/auth/auth.service';
|
||||||
import { takeUntil } from "rxjs/operators";
|
import { ConfigurableProvidersService } from '@app/ui/auth/login/utilities/configurableProviders.service';
|
||||||
import { environment } from "../../../../../environments/environment";
|
import { LoginService } from '@app/ui/auth/login/utilities/login.service';
|
||||||
import { AuthProvider } from "../../../../core/common/enum/auth-provider";
|
import { BaseComponent } from '@common/base/base.component';
|
||||||
import { ConfigurableProvider } from "../../../../core/model/configurable-provider/configurableProvider";
|
import { environment } from 'environments/environment';
|
||||||
import { ConfigurableProvidersService } from "../utilities/configurableProviders.service";
|
import { takeUntil } from 'rxjs/operators';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-configurable-login',
|
selector: 'app-configurable-login',
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import { Component, OnInit } from "@angular/core";
|
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 { 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({
|
@Component({
|
||||||
selector: 'app-email-confirmation-component',
|
selector: 'app-email-confirmation-component',
|
||||||
|
@ -35,8 +35,8 @@ export class EmailConfirmation extends BaseComponent implements OnInit {
|
||||||
this.emailConfirmationService.emailConfirmation(token)
|
this.emailConfirmationService.emailConfirmation(token)
|
||||||
.pipe(takeUntil(this._destroyed))
|
.pipe(takeUntil(this._destroyed))
|
||||||
.subscribe(
|
.subscribe(
|
||||||
result => this.onCallbackEmailConfirmationSuccess(),
|
result => this.onCallbackEmailConfirmationSuccess(),
|
||||||
error => this.onCallbackError(error)
|
error => this.onCallbackError(error)
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
this.showForm = true;
|
this.showForm = true;
|
||||||
|
@ -48,8 +48,8 @@ export class EmailConfirmation extends BaseComponent implements OnInit {
|
||||||
this.emailConfirmationService.sendConfirmationEmail(this.emailFormControl.value)
|
this.emailConfirmationService.sendConfirmationEmail(this.emailFormControl.value)
|
||||||
.pipe(takeUntil(this._destroyed))
|
.pipe(takeUntil(this._destroyed))
|
||||||
.subscribe(
|
.subscribe(
|
||||||
result => this.onCallbackSuccess(),
|
result => this.onCallbackSuccess(),
|
||||||
error => this.onCallbackError(error)
|
error => this.onCallbackError(error)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
|
import { HttpClient } from "@angular/common/http";
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { ActivatedRoute, Params, Router } from '@angular/router';
|
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 { 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({
|
@Component({
|
||||||
selector: 'app-linkedin-login',
|
selector: 'app-linkedin-login',
|
||||||
|
|
|
@ -1,13 +1,14 @@
|
||||||
import { AfterViewInit, Component, OnInit } from '@angular/core';
|
import { AfterViewInit, Component, OnInit } from '@angular/core';
|
||||||
import { ActivatedRoute, Params, Router } from '@angular/router';
|
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 { 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="gapi" />
|
||||||
/// <reference types="facebook-js-sdk" />
|
/// <reference types="facebook-js-sdk" />
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { CommonFormsModule } from '../../../common/forms/common-forms.module';
|
import { B2AccessLoginComponent } from '@app/ui/auth/login/b2access/b2access-login.component';
|
||||||
import { CommonUiModule } from '../../../common/ui/common-ui.module';
|
import { ConfigurableLoginComponent } from '@app/ui/auth/login/configurable-login/configurable-login.component';
|
||||||
import { LinkedInLoginComponent } from './linkedin-login/linkedin-login.component';
|
import { EmailConfirmation } from '@app/ui/auth/login/email-confirmation/email-confirmation.component';
|
||||||
import { LoginComponent } from './login.component';
|
import { LinkedInLoginComponent } from '@app/ui/auth/login/linkedin-login/linkedin-login.component';
|
||||||
import { LoginRoutingModule } from './login.routing';
|
import { LoginComponent } from '@app/ui/auth/login/login.component';
|
||||||
import { TwitterLoginComponent } from './twitter-login/twitter-login.component';
|
import { LoginRoutingModule } from '@app/ui/auth/login/login.routing';
|
||||||
import { LoginService } from './utilities/login.service';
|
import { OpenAireLoginComponent } from '@app/ui/auth/login/openaire-login/openaire-login.component';
|
||||||
import { B2AccessLoginComponent } from './b2access/b2access-login.component';
|
import { OrcidLoginComponent } from '@app/ui/auth/login/orcid-login/orcid-login.component';
|
||||||
import { OrcidLoginComponent } from './orcid-login/orcid-login.component';
|
import { TwitterLoginComponent } from '@app/ui/auth/login/twitter-login/twitter-login.component';
|
||||||
import { EmailConfirmation } from './email-confirmation/email-confirmation.component';
|
import { ConfigurableProvidersService } from '@app/ui/auth/login/utilities/configurableProviders.service';
|
||||||
import { OpenAireLoginComponent } from "./openaire-login/openaire-login.component";
|
import { LoginService } from '@app/ui/auth/login/utilities/login.service';
|
||||||
import { ConfigurableLoginComponent } from "./configurable-login/configurable-login.component";
|
import { CommonFormsModule } from '@common/forms/common-forms.module';
|
||||||
import { ConfigurableProvidersService } from "./utilities/configurableProviders.service";
|
import { CommonUiModule } from '@common/ui/common-ui.module';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { Component, OnInit } from "@angular/core";
|
import { Component, OnInit } from "@angular/core";
|
||||||
import { BaseComponent } from "../../../../core/common/base/base.component";
|
import { ActivatedRoute, Params, Router } from '@angular/router';
|
||||||
import { ActivatedRoute, Router, Params } from "@angular/router";
|
import { AuthProvider } from '@app/core/common/enum/auth-provider';
|
||||||
import { LoginService } from "../utilities/login.service";
|
import { AuthService } from '@app/core/services/auth/auth.service';
|
||||||
import { AuthService } from "../../../../core/services/auth/auth.service";
|
import { LoginService } from '@app/ui/auth/login/utilities/login.service';
|
||||||
import { HttpClient } from "@angular/common/http";
|
import { BaseComponent } from '@common/base/base.component';
|
||||||
import { takeUntil } from "rxjs/operators";
|
import { environment } from 'environments/environment';
|
||||||
import { environment } from "../../../../../environments/environment";
|
import { takeUntil } from 'rxjs/operators';
|
||||||
import { AuthProvider } from "../../../../core/common/enum/auth-provider";
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-openaire-login',
|
selector: 'app-openaire-login',
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
|
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||||
import { Component, OnInit } from '@angular/core';
|
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 { 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({
|
@Component({
|
||||||
selector: 'app-orcid-login',
|
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 })
|
this.authService.login({ ticket: this.accessToken, provider: AuthProvider.ORCID, data: this.orcidUser })
|
||||||
.pipe(takeUntil(this._destroyed))
|
.pipe(takeUntil(this._destroyed))
|
||||||
.subscribe(
|
.subscribe(
|
||||||
res => this.loginService.onLogInSuccess(res, this.returnUrl),
|
res => this.loginService.onLogInSuccess(res, this.returnUrl),
|
||||||
error => this.loginService.onLogInError(error)
|
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 })
|
this.authService.login({ ticket: this.accessToken, provider: AuthProvider.ORCID, data: this.orcidUser })
|
||||||
.pipe(takeUntil(this._destroyed))
|
.pipe(takeUntil(this._destroyed))
|
||||||
.subscribe(
|
.subscribe(
|
||||||
res => this.loginService.onLogInSuccess(res, this.returnUrl),
|
res => this.loginService.onLogInSuccess(res, this.returnUrl),
|
||||||
error => this.loginService.onLogInError(error)
|
error => this.loginService.onLogInError(error)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
import { HttpHeaders } from '@angular/common/http';
|
import { HttpHeaders } from '@angular/common/http';
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { ActivatedRoute, Params } from '@angular/router';
|
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 { 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({
|
@Component({
|
||||||
selector: 'app-twitter-login',
|
selector: 'app-twitter-login',
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Injectable } from "@angular/core";
|
import { Injectable } from "@angular/core";
|
||||||
import { BaseService } from "../../../../core/common/base/base.service";
|
import { BaseService } from '@common/base/base.service';
|
||||||
import { ConfigurableProvider } from "../../../../core/model/configurable-provider/configurableProvider";
|
import { ConfigurableProvider } from '@app/core/model/configurable-provider/configurableProvider';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class ConfigurableProvidersService extends BaseService {
|
export class ConfigurableProvidersService extends BaseService {
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import { Injectable, NgZone } from '@angular/core';
|
import { Injectable, NgZone } from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
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 { 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()
|
@Injectable()
|
||||||
export class LoginService extends BaseService {
|
export class LoginService extends BaseService {
|
||||||
|
|
|
@ -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 { 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 { TranslateService } from '@ngx-translate/core';
|
||||||
import { ContactEmailFormModel } from '../../../core/model/contact/contact-email-form-model';
|
import { takeUntil } from 'rxjs/operators';
|
||||||
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';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-contact-content',
|
selector: 'app-contact-content',
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { NgModule } from '@angular/core';
|
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 { 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({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
|
|
@ -1,33 +1,32 @@
|
||||||
|
|
||||||
import {of as observableOf, Observable } from 'rxjs';
|
|
||||||
|
|
||||||
import {mergeMap, takeUntil } from 'rxjs/operators';
|
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { FormControl } from '@angular/forms';
|
import { FormControl } from '@angular/forms';
|
||||||
import { Router, ActivatedRoute, Params } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { BaseComponent } from '../../core/common/base/base.component';
|
import { RecentActivityType } from '@app/core/common/enum/recent-activity-type';
|
||||||
import { RecentActivityType } from '../../core/common/enum/recent-activity-type';
|
import { DashboardStatisticsModel } from '@app/core/model/dashboard/dashboard-statistics-model';
|
||||||
import { DashboardStatisticsModel } from '../../core/model/dashboard/dashboard-statistics-model';
|
import { SearchBarItem } from '@app/core/model/dashboard/search-bar-item';
|
||||||
import { SearchBarItem } from '../../core/model/dashboard/search-bar-item';
|
import { DataTableRequest } from '@app/core/model/data-table/data-table-request';
|
||||||
import { GrantCriteria } from '../../core/query/grant/grant-criteria';
|
import { DatasetListingModel } from '@app/core/model/dataset/dataset-listing';
|
||||||
import { AuthService } from '../../core/services/auth/auth.service';
|
import { DmpListingModel } from '@app/core/model/dmp/dmp-listing';
|
||||||
import { DashboardService } from '../../core/services/dashboard/dashboard.service';
|
import { ExploreDatasetCriteriaModel } from '@app/core/query/explore-dataset/explore-dataset-criteria';
|
||||||
import { GrantService } from '../../core/services/grant/grant.service';
|
import { ExploreDmpCriteriaModel } from '@app/core/query/explore-dmp/explore-dmp-criteria';
|
||||||
import { SearchBarService } from '../../core/services/search-bar/search-bar.service';
|
import { GrantCriteria } from '@app/core/query/grant/grant-criteria';
|
||||||
import { UserService } from '../../core/services/user/user.service';
|
import { RequestItem } from '@app/core/query/request-item';
|
||||||
import { SingleAutoCompleteConfiguration } from '../../library/auto-complete/single/single-auto-complete-configuration';
|
import { AuthService } from '@app/core/services/auth/auth.service';
|
||||||
import { RequestItem } from '../../core/query/request-item';
|
import { DashboardService } from '@app/core/services/dashboard/dashboard.service';
|
||||||
import { DmpListingModel } from '../../core/model/dmp/dmp-listing';
|
import { DatasetService } from '@app/core/services/dataset/dataset.service';
|
||||||
import { DmpService } from '../../core/services/dmp/dmp.service';
|
import { DmpService } from '@app/core/services/dmp/dmp.service';
|
||||||
import { DataTableRequest } from '../../core/model/data-table/data-table-request';
|
import { GrantService } from '@app/core/services/grant/grant.service';
|
||||||
import { DmpCriteria } from '../../core/query/dmp/dmp-criteria';
|
import { SearchBarService } from '@app/core/services/search-bar/search-bar.service';
|
||||||
import { ExploreDmpCriteriaModel } from '../../core/query/explore-dmp/explore-dmp-criteria';
|
import { UserService } from '@app/core/services/user/user.service';
|
||||||
import { DatasetListingModel } from '../../core/model/dataset/dataset-listing';
|
import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration';
|
||||||
import { DatasetService } from '../../core/services/dataset/dataset.service';
|
import { BaseComponent } from '@common/base/base.component';
|
||||||
import { ExploreDatasetCriteriaModel } from '../../core/query/explore-dataset/explore-dataset-criteria';
|
import { Observable, of as observableOf } from 'rxjs';
|
||||||
|
import { mergeMap, takeUntil } from 'rxjs/operators';
|
||||||
import { BreadcrumbItem } from '../misc/breadcrumb/definition/breadcrumb-item';
|
import { BreadcrumbItem } from '../misc/breadcrumb/definition/breadcrumb-item';
|
||||||
import { IBreadCrumbComponent } from '../misc/breadcrumb/definition/IBreadCrumbComponent';
|
import { IBreadCrumbComponent } from '../misc/breadcrumb/definition/IBreadCrumbComponent';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-dashboard',
|
selector: 'app-dashboard',
|
||||||
templateUrl: './dashboard.component.html',
|
templateUrl: './dashboard.component.html',
|
||||||
|
|
|
@ -1,25 +1,26 @@
|
||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { CommonUiModule } from '../../common/ui/common-ui.module';
|
import { ExportMethodDialogModule } from '@app/library/export-method-dialog/export-method-dialog.module';
|
||||||
import { CardComponent } from './card/card.component';
|
import { CardComponent } from '@app/ui/dashboard/card/card.component';
|
||||||
import { DashboardComponent } from './dashboard.component';
|
import { DashboardComponent } from '@app/ui/dashboard/dashboard.component';
|
||||||
import { DashboardRoutingModule } from './dashboard.routing';
|
import { DashboardRoutingModule } from '@app/ui/dashboard/dashboard.routing';
|
||||||
import { DraftsComponent } from './drafts/drafts.component';
|
import { DatasetInfoCounterComponent } from '@app/ui/dashboard/dataset-info-counter/dataset-info-counter.component';
|
||||||
import { InfoCounterComponent } from './info-counter/info-counter.component';
|
import { DmpInfoCounterComponent } from '@app/ui/dashboard/dmp-info-counter/dmp-info-counter.component';
|
||||||
import { QuickWizardCreateAdd } from './quick-wizard-create-add/quick-wizard-create-add.component';
|
import { DraftsComponent } from '@app/ui/dashboard/drafts/drafts.component';
|
||||||
import { RecentActivityComponent } from './recent-activity/recent-activity.component';
|
import { InfoCounterComponent } from '@app/ui/dashboard/info-counter/info-counter.component';
|
||||||
import { RecentEditedActivityComponent } from './recent-edited-activity/recent-edited-activity.component';
|
import { QuickWizardCreateAdd } from '@app/ui/dashboard/quick-wizard-create-add/quick-wizard-create-add.component';
|
||||||
import { RecentVisitedActivityComponent } from './recent-visited-activity/recent-visited-activity.component';
|
import { RecentActivityComponent } from '@app/ui/dashboard/recent-activity/recent-activity.component';
|
||||||
import { WizardComponent } from './wizard/wizard.component';
|
import { RecentEditedActivityComponent } from '@app/ui/dashboard/recent-edited-activity/recent-edited-activity.component';
|
||||||
import { DmpInfoCounterComponent } from './dmp-info-counter/dmp-info-counter.component';
|
import { RecentVisitedActivityComponent } from '@app/ui/dashboard/recent-visited-activity/recent-visited-activity.component';
|
||||||
import { DatasetInfoCounterComponent } from './dataset-info-counter/dataset-info-counter.component';
|
import { WizardComponent } from '@app/ui/dashboard/wizard/wizard.component';
|
||||||
import { ExportMethodDialogModule } from '../../library/export-method-dialog/export-method-dialog.module';
|
import { CommonUiModule } from '@common/ui/common-ui.module';
|
||||||
|
import { ConfirmationDialogModule } from '@common/modules/confirmation-dialog/confirmation-dialog.module';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonUiModule,
|
CommonUiModule,
|
||||||
DashboardRoutingModule,
|
DashboardRoutingModule,
|
||||||
ExportMethodDialogModule
|
ExportMethodDialogModule,
|
||||||
|
ConfirmationDialogModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
DashboardComponent,
|
DashboardComponent,
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { BaseComponent } from "../../../core/common/base/base.component";
|
import { Component, OnInit } from "@angular/core";
|
||||||
import { OnInit, Component } from "@angular/core";
|
|
||||||
import { Router, ActivatedRoute } from "@angular/router";
|
|
||||||
import { TranslateService } from "@ngx-translate/core";
|
|
||||||
import { MatSnackBar } from "@angular/material/snack-bar";
|
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({
|
@Component({
|
||||||
selector: 'app-quick-wizard-create-add-component',
|
selector: 'app-quick-wizard-create-add-component',
|
||||||
|
@ -25,12 +25,12 @@ export class QuickWizardCreateAdd extends BaseComponent implements OnInit {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
navigateToCreate(){
|
navigateToCreate() {
|
||||||
this.router.navigate(["/quick-wizard"]);
|
this.router.navigate(["/quick-wizard"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
navigateToAdd(){
|
navigateToAdd() {
|
||||||
this.router.navigate(["/datasetcreatewizard"]);
|
this.router.navigate(["/datasetcreatewizard"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
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 { 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({
|
@Component({
|
||||||
selector: 'app-recent-activity',
|
selector: 'app-recent-activity',
|
||||||
|
|
|
@ -1,19 +1,18 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { DmpListingModel } from '../../../core/model/dmp/dmp-listing';
|
import { MatDialog } from '@angular/material';
|
||||||
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 { Router } from '@angular/router';
|
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 { 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 * as FileSaver from 'file-saver';
|
||||||
import { takeUntil } from 'rxjs/operators';
|
import { takeUntil } from 'rxjs/operators';
|
||||||
|
|
||||||
|
@ -80,8 +79,8 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn
|
||||||
this.dmpService.delete(dmp.id)
|
this.dmpService.delete(dmp.id)
|
||||||
.pipe(takeUntil(this._destroyed))
|
.pipe(takeUntil(this._destroyed))
|
||||||
.subscribe(
|
.subscribe(
|
||||||
complete => { this.onCallbackSuccess() },
|
complete => { this.onCallbackSuccess() },
|
||||||
error => this.onDeleteCallbackError(error)
|
error => this.onDeleteCallbackError(error)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,15 +1,13 @@
|
||||||
import { Component, OnInit } from "@angular/core";
|
import { Component, OnInit } from "@angular/core";
|
||||||
import { RecentActivityType } from "../../../core/common/enum/recent-activity-type";
|
import { Router } from '@angular/router';
|
||||||
import { BaseComponent } from "../../../core/common/base/base.component";
|
import { RecentActivityType } from '@app/core/common/enum/recent-activity-type';
|
||||||
import { Router } from "@angular/router";
|
import { DataTableRequest } from '@app/core/model/data-table/data-table-request';
|
||||||
import { AuthService } from "../../../core/services/auth/auth.service";
|
import { DmpListingModel } from '@app/core/model/dmp/dmp-listing';
|
||||||
import { UserService } from "../../../core/services/user/user.service";
|
import { DmpCriteria } from '@app/core/query/dmp/dmp-criteria';
|
||||||
import { takeUntil } from "rxjs/operators";
|
import { AuthService } from '@app/core/services/auth/auth.service';
|
||||||
import { DmpService } from "../../../core/services/dmp/dmp.service";
|
import { DmpService } from '@app/core/services/dmp/dmp.service';
|
||||||
import { DataTableRequest } from "../../../core/model/data-table/data-table-request";
|
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||||
import { DmpCriteria } from "../../../core/query/dmp/dmp-criteria";
|
import { BaseComponent } from '@common/base/base.component';
|
||||||
import { DmpListingModel } from "../../../core/model/dmp/dmp-listing";
|
|
||||||
import { EnumUtils } from "../../../core/services/utilities/enum-utils.service";
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: "app-recent-visited-activity",
|
selector: "app-recent-visited-activity",
|
||||||
|
|
|
@ -1,22 +1,21 @@
|
||||||
|
|
||||||
import { of as observableOf, Observable } from 'rxjs';
|
|
||||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
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 { MatDialog } from '@angular/material/dialog';
|
||||||
import { MatStepper } from '@angular/material/stepper';
|
import { MatStepper } from '@angular/material/stepper';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { BaseComponent } from '../../core/common/base/base.component';
|
import { DatasetStatus } from '@app/core/common/enum/dataset-status';
|
||||||
import { QuickWizardService } from '../../core/services/quick-wizard/quick-wizard.service';
|
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||||
import { DatasetCreateWizardModel } from './dataset-create-wizard.model';
|
import { QuickWizardService } from '@app/core/services/quick-wizard/quick-wizard.service';
|
||||||
import { IBreadCrumbComponent } from '../misc/breadcrumb/definition/IBreadCrumbComponent';
|
import { CheckDeactivateBaseComponent } from '@app/library/deactivate/deactivate.component';
|
||||||
import { takeUntil } from 'rxjs/operators';
|
import { DatasetCreateWizardModel } from '@app/ui/dataset-create-wizard/dataset-create-wizard.model';
|
||||||
import { BreadcrumbItem } from '../misc/breadcrumb/definition/breadcrumb-item';
|
import { BreadcrumbItem } from '@app/ui/misc/breadcrumb/definition/breadcrumb-item';
|
||||||
import { SnackBarNotificationLevel, UiNotificationService } from '../../core/services/notification/ui-notification-service';
|
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 { TranslateService } from '@ngx-translate/core';
|
||||||
import { DatasetEditorWizardComponent } from '../quick-wizard/dataset-editor/dataset-editor-wizard.component';
|
import { Observable, of as observableOf } from 'rxjs';
|
||||||
import { DatasetStatus } from '../../core/common/enum/dataset-status';
|
import { takeUntil } from 'rxjs/operators';
|
||||||
import { ConfirmationDialogComponent } from '../../library/confirmation-dialog/confirmation-dialog.component';
|
|
||||||
import { CheckDeactivateBaseComponent } from '../../library/deactivate/deactivate.component';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'dataset-create-wizard.component',
|
selector: 'dataset-create-wizard.component',
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
|
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
|
||||||
import { BackendErrorValidator } from "../../common/forms/validation/custom-validator";
|
import { DmpCreateWizardFormModel } from '@app/core/model/dmp/dmp-create-wizard/dmp-create-wizard-form.model';
|
||||||
import { ValidationErrorModel } from "../../common/forms/validation/error-model/validation-error-model";
|
import { DatasetWizardEditorModel } from '@app/ui/dataset/dataset-wizard/dataset-wizard-editor.model';
|
||||||
import { ValidationContext } from "../../common/forms/validation/validation-context";
|
import { DatasetEditorWizardModel } from '@app/ui/quick-wizard/dataset-editor/dataset-editor-wizard-model';
|
||||||
import { DmpCreateWizardFormModel } from "../../core/model/dmp/dmp-create-wizard/dmp-create-wizard-form.model";
|
import { BackendErrorValidator } from '@common/forms/validation/custom-validator';
|
||||||
import { DatasetWizardEditorModel } from "../dataset/dataset-wizard/dataset-wizard-editor.model";
|
import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model';
|
||||||
import { DatasetEditorWizardModel } from "../quick-wizard/dataset-editor/dataset-editor-wizard-model";
|
import { ValidationContext } from '@common/forms/validation/validation-context';
|
||||||
|
|
||||||
|
|
||||||
export class DatasetCreateWizardModel {
|
export class DatasetCreateWizardModel {
|
||||||
|
|
|
@ -1,18 +1,17 @@
|
||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { CommonFormsModule } from '../../common/forms/common-forms.module';
|
import { FormattingModule } from '@app/core/formatting.module';
|
||||||
import { CommonUiModule } from '../../common/ui/common-ui.module';
|
import { AutoCompleteModule } from '@app/library/auto-complete/auto-complete.module';
|
||||||
import { FormattingModule } from '../../core/formatting.module';
|
import { ConfirmationDialogModule } from '@common/modules/confirmation-dialog/confirmation-dialog.module';
|
||||||
import { AutoCompleteModule } from '../../library/auto-complete/auto-complete.module';
|
import { CanDeactivateGuard } from '@app/library/deactivate/can-deactivate.guard';
|
||||||
import { ConfirmationDialogModule } from '../../library/confirmation-dialog/confirmation-dialog.module';
|
import { UrlListingModule } from '@app/library/url-listing/url-listing.module';
|
||||||
import { UrlListingModule } from '../../library/url-listing/url-listing.module';
|
import { DatasetCreateWizard } from '@app/ui/dataset-create-wizard/dataset-create-wizard.component';
|
||||||
import { DatasetDescriptionFormModule } from '../misc/dataset-description-form/dataset-description-form.module';
|
import { DatasetCreateWizardRoutingModule } from '@app/ui/dataset-create-wizard/dataset-create-wizard.routing';
|
||||||
import { OuickWizardModule } from '../quick-wizard/quick-wizard.module';
|
import { DatasetDmpSelector } from '@app/ui/dataset-create-wizard/dmp-selector/dataset-dmp-selector.component';
|
||||||
import { DatasetCreateWizard } from './dataset-create-wizard.component';
|
import { DatasetDescriptionFormModule } from '@app/ui/misc/dataset-description-form/dataset-description-form.module';
|
||||||
import { DatasetCreateWizardRoutingModule } from './dataset-create-wizard.routing';
|
import { OuickWizardModule } from '@app/ui/quick-wizard/quick-wizard.module';
|
||||||
import { DatasetDmpSelector } from './dmp-selector/dataset-dmp-selector.component';
|
import { QuickWizardRoutingModule } from '@app/ui/quick-wizard/quick-wizard.routing';
|
||||||
import { QuickWizardRoutingModule } from '../quick-wizard/quick-wizard.routing';
|
import { CommonFormsModule } from '@common/forms/common-forms.module';
|
||||||
import { CanDeactivateGuard } from '../../library/deactivate/can-deactivate.guard';
|
import { CommonUiModule } from '@common/ui/common-ui.module';
|
||||||
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
|
|
@ -3,21 +3,21 @@ import { Component, Input, OnInit } from '@angular/core';
|
||||||
import { FormArray, FormControl, FormGroup } from '@angular/forms';
|
import { FormArray, FormControl, FormGroup } from '@angular/forms';
|
||||||
import { MatStepper } from '@angular/material/stepper';
|
import { MatStepper } from '@angular/material/stepper';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
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 { Observable } from 'rxjs';
|
||||||
import { map, takeUntil } from 'rxjs/operators';
|
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({
|
@Component({
|
||||||
selector: 'dataset-dmp-selector-component',
|
selector: 'dataset-dmp-selector-component',
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
import {map} from 'rxjs/operators';
|
import { map, filter } from 'rxjs/operators';
|
||||||
import { Component } from "@angular/core";
|
import { Component } from "@angular/core";
|
||||||
import { MatDialogRef, MAT_DIALOG_DATA } from "@angular/material/dialog";
|
import { MatDialogRef, MAT_DIALOG_DATA } from "@angular/material/dialog";
|
||||||
import { SingleAutoCompleteConfiguration } from "../../../../library/auto-complete/single/single-auto-complete-configuration";
|
import { SingleAutoCompleteConfiguration } from "../../../../library/auto-complete/single/single-auto-complete-configuration";
|
||||||
|
@ -37,8 +37,6 @@ export class DatasetCopyDialogueComponent {
|
||||||
initialItems: (extraData) => this.searchDmp(''),
|
initialItems: (extraData) => this.searchDmp(''),
|
||||||
displayFn: (item) => item['label'],
|
displayFn: (item) => item['label'],
|
||||||
titleFn: (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);
|
this.dialogRef.close(this.data);
|
||||||
}
|
}
|
||||||
else if (!this.data.datasetProfileExist) {
|
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 });
|
const dmpDataTableRequest: DataTableRequest<DmpCriteria> = new DataTableRequest(0, null, { fields: fields });
|
||||||
dmpDataTableRequest.criteria = new DmpCriteria();
|
dmpDataTableRequest.criteria = new DmpCriteria();
|
||||||
dmpDataTableRequest.criteria.like = query;
|
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 {
|
existsDatasetDescriptionTemplate(associatedProfiles: DmpAssociatedProfileModel[]): boolean {
|
||||||
|
@ -79,7 +77,7 @@ export class DatasetCopyDialogueComponent {
|
||||||
this.data.datasetProfileExist = true;
|
this.data.datasetProfileExist = true;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}),);
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
getErrorMessage() {
|
getErrorMessage() {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { Component, Input } from '@angular/core';
|
import { Component, Input } from '@angular/core';
|
||||||
import { FormGroup } from '@angular/forms';
|
import { FormGroup } from '@angular/forms';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { BaseComponent } from '../../../../core/common/base/base.component';
|
import { BaseComponent } from '@common/base/base.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-dataset-editor-component',
|
selector: 'app-dataset-editor-component',
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
|
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
|
||||||
import { BackendErrorValidator } from "../../../common/forms/validation/custom-validator";
|
import { ExternalDatasetType } from '@app/core/common/enum/external-dataset-type';
|
||||||
import { ValidationErrorModel } from "../../../common/forms/validation/error-model/validation-error-model";
|
import { DataRepositoryModel } from '@app/core/model/data-repository/data-repository';
|
||||||
import { ValidationContext } from "../../../common/forms/validation/validation-context";
|
import { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile';
|
||||||
import { ExternalDatasetType } from "../../../core/common/enum/external-dataset-type";
|
import { DatasetWizardModel } from '@app/core/model/dataset/dataset-wizard';
|
||||||
import { DataRepositoryModel } from "../../../core/model/data-repository/data-repository";
|
import { DmpModel } from '@app/core/model/dmp/dmp';
|
||||||
import { DatasetProfileModel } from "../../../core/model/dataset/dataset-profile";
|
import { ExternalDatasetModel } from '@app/core/model/external-dataset/external-dataset';
|
||||||
import { DatasetWizardModel } from "../../../core/model/dataset/dataset-wizard";
|
import { RegistryModel } from '@app/core/model/registry/registry';
|
||||||
import { DmpModel } from "../../../core/model/dmp/dmp";
|
import { ServiceModel } from '@app/core/model/service/service';
|
||||||
import { ExternalDatasetModel } from "../../../core/model/external-dataset/external-dataset";
|
import { TagModel } from '@app/core/model/tag/tag';
|
||||||
import { RegistryModel } from "../../../core/model/registry/registry";
|
import { DatasetDescriptionFormEditorModel } from '@app/ui/misc/dataset-description-form/dataset-description-form.model';
|
||||||
import { ServiceModel } from "../../../core/model/service/service";
|
import { BackendErrorValidator } from '@common/forms/validation/custom-validator';
|
||||||
import { TagModel } from "../../../core/model/tag/tag";
|
import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model';
|
||||||
import { DatasetDescriptionFormEditorModel } from "../../misc/dataset-description-form/dataset-description-form.model";
|
import { ValidationContext } from '@common/forms/validation/validation-context';
|
||||||
|
|
||||||
export class DatasetWizardEditorModel {
|
export class DatasetWizardEditorModel {
|
||||||
public id: string;
|
public id: string;
|
||||||
|
|
|
@ -1,37 +1,36 @@
|
||||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { FormControl, FormGroup } from '@angular/forms';
|
import { FormControl, FormGroup } from '@angular/forms';
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import { MatSnackBar } from '@angular/material/snack-bar';
|
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||||
import { MatStepper } from '@angular/material/stepper';
|
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
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 { TranslateService } from '@ngx-translate/core';
|
||||||
import * as FileSaver from 'file-saver';
|
import * as FileSaver from 'file-saver';
|
||||||
import { Observable, of as observableOf } from 'rxjs';
|
import { Observable, of as observableOf } from 'rxjs';
|
||||||
import { catchError, map, takeUntil } from 'rxjs/operators';
|
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({
|
@Component({
|
||||||
selector: 'app-dataset-wizard-component',
|
selector: 'app-dataset-wizard-component',
|
||||||
|
@ -397,7 +396,7 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr
|
||||||
public isSemiFormValid(formGroup: FormGroup): boolean {
|
public isSemiFormValid(formGroup: FormGroup): boolean {
|
||||||
var isValid: boolean = true;
|
var isValid: boolean = true;
|
||||||
Object.keys(formGroup.controls).forEach(controlName => {
|
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;
|
isValid = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -2,26 +2,26 @@ import { Component, Input, OnInit } from '@angular/core';
|
||||||
import { FormArray, FormGroup } from '@angular/forms';
|
import { FormArray, FormGroup } from '@angular/forms';
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import { Router } from '@angular/router';
|
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 { Observable } from 'rxjs';
|
||||||
import { takeUntil } from 'rxjs/operators';
|
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({
|
@Component({
|
||||||
selector: 'app-dataset-external-references-editor-component',
|
selector: 'app-dataset-external-references-editor-component',
|
||||||
|
@ -33,11 +33,45 @@ export class DatasetExternalReferencesEditorComponent extends BaseComponent impl
|
||||||
@Input() formGroup: FormGroup = null;
|
@Input() formGroup: FormGroup = null;
|
||||||
@Input() viewOnly = false;
|
@Input() viewOnly = false;
|
||||||
|
|
||||||
externalDatasetAutoCompleteConfiguration: SingleAutoCompleteConfiguration;
|
externalDatasetAutoCompleteConfiguration: SingleAutoCompleteConfiguration = {
|
||||||
registriesAutoCompleteConfiguration: SingleAutoCompleteConfiguration;
|
filterFn: this.searchDatasetExternalDatasets.bind(this),
|
||||||
dataRepositoriesAutoCompleteConfiguration: SingleAutoCompleteConfiguration;
|
initialItems: (type) => this.searchDatasetExternalDatasets('', type),//.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1),
|
||||||
servicesAutoCompleteConfiguration: SingleAutoCompleteConfiguration;
|
displayFn: (item) => item ? item.name : null,
|
||||||
tagsAutoCompleteConfiguration: SingleAutoCompleteConfiguration;
|
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;
|
externalSourcesConfiguration: ExternalSourcesConfiguration;
|
||||||
|
|
||||||
|
@ -63,51 +97,6 @@ export class DatasetExternalReferencesEditorComponent extends BaseComponent impl
|
||||||
this.externalSourcesConfiguration.services.push({ key: '', label: 'All' });
|
this.externalSourcesConfiguration.services.push({ key: '', label: 'All' });
|
||||||
this.externalSourcesConfiguration.tags.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 {
|
public cancel(): void {
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import { Component, Inject, OnInit } from '@angular/core';
|
import { Component, Inject, OnInit } from '@angular/core';
|
||||||
import { FormGroup } from '@angular/forms';
|
import { FormGroup } from '@angular/forms';
|
||||||
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
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 { 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({
|
@Component({
|
||||||
templateUrl: 'dataset-external-data-repository-dialog-editor.component.html',
|
templateUrl: 'dataset-external-data-repository-dialog-editor.component.html',
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import { Component, Inject, OnInit } from '@angular/core';
|
import { Component, Inject, OnInit } from '@angular/core';
|
||||||
import { FormGroup } from '@angular/forms';
|
import { FormGroup } from '@angular/forms';
|
||||||
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
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 { 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({
|
@Component({
|
||||||
templateUrl: 'dataset-external-dataset-dialog-editor.component.html',
|
templateUrl: 'dataset-external-dataset-dialog-editor.component.html',
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import { Component, Inject, OnInit } from '@angular/core';
|
import { Component, Inject, OnInit } from '@angular/core';
|
||||||
import { FormGroup } from '@angular/forms';
|
import { FormGroup } from '@angular/forms';
|
||||||
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
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 { 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({
|
@Component({
|
||||||
templateUrl: 'dataset-external-registry-dialog-editor.component.html',
|
templateUrl: 'dataset-external-registry-dialog-editor.component.html',
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import { Component, Inject, OnInit } from '@angular/core';
|
import { Component, Inject, OnInit } from '@angular/core';
|
||||||
import { FormGroup } from '@angular/forms';
|
import { FormGroup } from '@angular/forms';
|
||||||
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
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 { 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({
|
@Component({
|
||||||
templateUrl: 'dataset-external-service-dialog-editor.component.html',
|
templateUrl: 'dataset-external-service-dialog-editor.component.html',
|
||||||
|
|
|
@ -1,27 +1,27 @@
|
||||||
import { NgModule } from '@angular/core';
|
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 { 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({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
|
|
@ -4,35 +4,35 @@ import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import { MatSnackBar } from '@angular/material/snack-bar';
|
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||||
import { Router } from '@angular/router';
|
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 { TranslateService } from '@ngx-translate/core';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { map, takeUntil } from 'rxjs/operators';
|
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({
|
@Component({
|
||||||
selector: 'app-dataset-criteria-component',
|
selector: 'app-dataset-criteria-component',
|
||||||
|
@ -64,14 +64,14 @@ export class DatasetCriteriaComponent extends BaseCriteriaComponent implements O
|
||||||
|
|
||||||
tagsAutoCompleteConfiguration = {
|
tagsAutoCompleteConfiguration = {
|
||||||
filterFn: this.filterTags.bind(this),
|
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'],
|
displayFn: (item) => item['name'],
|
||||||
titleFn: (item) => item['name']
|
titleFn: (item) => item['name']
|
||||||
};
|
};
|
||||||
|
|
||||||
datasetTemplateAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = {
|
datasetTemplateAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = {
|
||||||
filterFn: this.filterDatasetTemplate.bind(this),
|
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'],
|
displayFn: (item) => item['label'],
|
||||||
titleFn: (item) => item['label'],
|
titleFn: (item) => item['label'],
|
||||||
subtitleFn: (item) => item['description']
|
subtitleFn: (item) => item['description']
|
||||||
|
@ -86,21 +86,21 @@ export class DatasetCriteriaComponent extends BaseCriteriaComponent implements O
|
||||||
|
|
||||||
collaboratorsAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = {
|
collaboratorsAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = {
|
||||||
filterFn: this.filterCollaborators.bind(this),
|
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'],
|
displayFn: (item) => item['name'],
|
||||||
titleFn: (item) => item['name']
|
titleFn: (item) => item['name']
|
||||||
};
|
};
|
||||||
|
|
||||||
grantAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = {
|
grantAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = {
|
||||||
filterFn: this.filterGrant.bind(this),
|
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'],
|
displayFn: (item) => item['label'],
|
||||||
titleFn: (item) => item['label']
|
titleFn: (item) => item['label']
|
||||||
};
|
};
|
||||||
|
|
||||||
organisationAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = {
|
organisationAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = {
|
||||||
filterFn: this.filterOrganisations.bind(this),
|
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'],
|
displayFn: (item) => item['name'],
|
||||||
titleFn: (item) => item['name']
|
titleFn: (item) => item['name']
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,22 +1,21 @@
|
||||||
|
|
||||||
import {map, takeUntil } from 'rxjs/operators';
|
|
||||||
import { Component, Inject, OnInit } from '@angular/core';
|
import { Component, Inject, OnInit } from '@angular/core';
|
||||||
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
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 { Observable } from 'rxjs';
|
||||||
import { DataTableData } from '../../../../../core/model/data-table/data-table-data';
|
import { map, takeUntil } from 'rxjs/operators';
|
||||||
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';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'dataset-upload-dialogue',
|
selector: 'dataset-upload-dialogue',
|
||||||
|
|
|
@ -1,21 +1,21 @@
|
||||||
|
|
||||||
import { of as observableOf, Observable } from 'rxjs';
|
|
||||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
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 { MatSort } from '@angular/material/sort';
|
||||||
import { ActivatedRoute, Params, Router } from '@angular/router';
|
import { ActivatedRoute, Params, Router } from '@angular/router';
|
||||||
import { takeUntil } from 'rxjs/operators';
|
import { DatasetStatus } from '@app/core/common/enum/dataset-status';
|
||||||
import { BaseComponent } from '../../../core/common/base/base.component';
|
import { DataTableRequest } from '@app/core/model/data-table/data-table-request';
|
||||||
import { DataTableRequest } from '../../../core/model/data-table/data-table-request';
|
import { DatasetListingModel } from '@app/core/model/dataset/dataset-listing';
|
||||||
import { DatasetListingModel } from '../../../core/model/dataset/dataset-listing';
|
import { DatasetCriteria } from '@app/core/query/dataset/dataset-criteria';
|
||||||
import { DatasetCriteria } from '../../../core/query/dataset/dataset-criteria';
|
import { DatasetService } from '@app/core/services/dataset/dataset.service';
|
||||||
import { DatasetService } from '../../../core/services/dataset/dataset.service';
|
import { DmpService } from '@app/core/services/dmp/dmp.service';
|
||||||
import { DmpService } from '../../../core/services/dmp/dmp.service';
|
import { DatasetCriteriaComponent } from '@app/ui/dataset/listing/criteria/dataset-criteria.component';
|
||||||
import { BreadcrumbItem } from '../../misc/breadcrumb/definition/breadcrumb-item';
|
import { BreadcrumbItem } from '@app/ui/misc/breadcrumb/definition/breadcrumb-item';
|
||||||
import { IBreadCrumbComponent } from '../../misc/breadcrumb/definition/IBreadCrumbComponent';
|
import { IBreadCrumbComponent } from '@app/ui/misc/breadcrumb/definition/IBreadCrumbComponent';
|
||||||
import { DatasetCriteriaComponent } from './criteria/dataset-criteria.component';
|
import { BaseComponent } from '@common/base/base.component';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
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({
|
@Component({
|
||||||
selector: 'app-dataset-listing-component',
|
selector: 'app-dataset-listing-component',
|
||||||
|
|
|
@ -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 { 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({
|
@Component({
|
||||||
selector: 'app-dmp-clone',
|
selector: 'app-dmp-clone',
|
||||||
|
|
|
@ -1,34 +1,35 @@
|
||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { CommonFormsModule } from '../../common/forms/common-forms.module';
|
import { FormattingModule } from '@app/core/formatting.module';
|
||||||
import { CommonUiModule } from '../../common/ui/common-ui.module';
|
import { AutoCompleteModule } from '@app/library/auto-complete/auto-complete.module';
|
||||||
import { FormattingModule } from '../../core/formatting.module';
|
import { ConfirmationDialogModule } from '@common/modules/confirmation-dialog/confirmation-dialog.module';
|
||||||
import { AutoCompleteModule } from '../../library/auto-complete/auto-complete.module';
|
import { ExportMethodDialogModule } from '@app/library/export-method-dialog/export-method-dialog.module';
|
||||||
import { ConfirmationDialogModule } from '../../library/confirmation-dialog/confirmation-dialog.module';
|
import { UrlListingModule } from '@app/library/url-listing/url-listing.module';
|
||||||
import { UrlListingModule } from '../../library/url-listing/url-listing.module';
|
import { DmpCloneComponent } from '@app/ui/dmp/clone/dmp-clone.component';
|
||||||
import { DmpRoutingModule } from './dmp.routing';
|
import { DmpRoutingModule } from '@app/ui/dmp/dmp.routing';
|
||||||
import { AddResearcherComponent } from './editor/add-researcher/add-researcher.component';
|
import { AddResearcherComponent } from '@app/ui/dmp/editor/add-researcher/add-researcher.component';
|
||||||
import { AvailableProfilesComponent } from './editor/available-profiles/available-profiles.component';
|
import { AvailableProfilesComponent } from '@app/ui/dmp/editor/available-profiles/available-profiles.component';
|
||||||
import { DmpEditorComponent } from './editor/dmp-editor.component';
|
import { DatasetsTabComponent } from '@app/ui/dmp/editor/datasets-tab/datasets-tab.component';
|
||||||
import { DmpFinalizeDialogComponent } from './editor/dmp-finalize-dialog/dmp-finalize-dialog.component';
|
import { DmpEditorComponent } from '@app/ui/dmp/editor/dmp-editor.component';
|
||||||
import { DynamicDmpFieldResolverComponent } from './editor/dynamic-field-resolver/dynamic-dmp-field-resolver.component';
|
import { DmpFinalizeDialogComponent } from '@app/ui/dmp/editor/dmp-finalize-dialog/dmp-finalize-dialog.component';
|
||||||
import { DynamicFieldGrantComponent } from './editor/dynamic-fields-grant/dynamic-field-grant/dynamic-field-grant.component';
|
import { DynamicDmpFieldResolverComponent } from '@app/ui/dmp/editor/dynamic-field-resolver/dynamic-dmp-field-resolver.component';
|
||||||
import { DynamicFieldsGrantComponent } from './editor/dynamic-fields-grant/dynamic-fields-grant.component';
|
import { DynamicFieldGrantComponent } from '@app/ui/dmp/editor/dynamic-fields-grant/dynamic-field-grant/dynamic-field-grant.component';
|
||||||
import { InvitationAcceptedComponent } from './invitation/accepted/dmp-invitation-accepted.component';
|
import { DynamicFieldsGrantComponent } from '@app/ui/dmp/editor/dynamic-fields-grant/dynamic-fields-grant.component';
|
||||||
import { DmpInvitationDialogComponent } from './invitation/dmp-invitation.component';
|
import { GeneralTabComponent } from '@app/ui/dmp/editor/general-tab/general-tab.component';
|
||||||
import { DmpCriteriaComponent } from './listing/criteria/dmp-criteria.component';
|
import { GrantTabComponent } from '@app/ui/dmp/editor/grant-tab/grant-tab.component';
|
||||||
import { DmpUploadDialogue } from './listing/criteria/upload-dialogue/dmp-upload-dialogue.component';
|
import { PeopleTabComponent } from '@app/ui/dmp/editor/people-tab/people-tab.component';
|
||||||
import { DmpListingComponent } from './listing/dmp-listing.component';
|
import { InvitationAcceptedComponent } from '@app/ui/dmp/invitation/accepted/dmp-invitation-accepted.component';
|
||||||
import { DmpListingItemComponent } from './listing/listing-item/dmp-listing-item.component';
|
import { DmpInvitationDialogComponent } from '@app/ui/dmp/invitation/dmp-invitation.component';
|
||||||
import { DmpWizardComponent } from './wizard/dmp-wizard.component';
|
import { DmpCriteriaComponent } from '@app/ui/dmp/listing/criteria/dmp-criteria.component';
|
||||||
import { DmpWizardEditorComponent } from './wizard/editor/dmp-wizard-editor.component';
|
import { DmpUploadDialogue } from '@app/ui/dmp/listing/criteria/upload-dialogue/dmp-upload-dialogue.component';
|
||||||
import { DmpWizardDatasetListingComponent } from './wizard/listing/dmp-wizard-dataset-listing.component';
|
import { DmpListingComponent } from '@app/ui/dmp/listing/dmp-listing.component';
|
||||||
import { ExportMethodDialogModule } from '../../library/export-method-dialog/export-method-dialog.module';
|
import { DmpListingItemComponent } from '@app/ui/dmp/listing/listing-item/dmp-listing-item.component';
|
||||||
import { GeneralTabComponent } from './editor/general-tab/general-tab.component';
|
import { DmpOverviewModule } from '@app/ui/dmp/overview/dmp-overview.module';
|
||||||
import { PeopleTabComponent } from './editor/people-tab/people-tab.component';
|
import { DmpWizardComponent } from '@app/ui/dmp/wizard/dmp-wizard.component';
|
||||||
import { GrantTabComponent } from './editor/grant-tab/grant-tab.component';
|
import { DmpWizardEditorComponent } from '@app/ui/dmp/wizard/editor/dmp-wizard-editor.component';
|
||||||
import { DatasetsTabComponent } from './editor/datasets-tab/datasets-tab.component';
|
import { DmpWizardDatasetListingComponent } from '@app/ui/dmp/wizard/listing/dmp-wizard-dataset-listing.component';
|
||||||
import { DmpOverviewModule } from './overview/dmp-overview.module';
|
import { CommonFormsModule } from '@common/forms/common-forms.module';
|
||||||
import { DmpCloneComponent } from './clone/dmp-clone.component';
|
import { FormValidationErrorsDialogModule } from '@common/forms/form-validation-errors-dialog/form-validation-errors-dialog.module';
|
||||||
|
import { CommonUiModule } from '@common/ui/common-ui.module';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
@ -40,7 +41,8 @@ import { DmpCloneComponent } from './clone/dmp-clone.component';
|
||||||
FormattingModule,
|
FormattingModule,
|
||||||
AutoCompleteModule,
|
AutoCompleteModule,
|
||||||
DmpRoutingModule,
|
DmpRoutingModule,
|
||||||
DmpOverviewModule
|
DmpOverviewModule,
|
||||||
|
FormValidationErrorsDialogModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
DmpListingComponent,
|
DmpListingComponent,
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
import { Component, Inject, OnInit } from '@angular/core';
|
import { Component, Inject, OnInit } from '@angular/core';
|
||||||
import { FormGroup } from '@angular/forms';
|
import { FormGroup } from '@angular/forms';
|
||||||
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
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 { 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({
|
@Component({
|
||||||
selector: 'app-add-researcher-component',
|
selector: 'app-add-researcher-component',
|
||||||
|
@ -30,7 +29,7 @@ export class AddResearcherComponent extends BaseComponent implements OnInit {
|
||||||
this.externalResearcherService.createResearcher(this.formGroup.value)
|
this.externalResearcherService.createResearcher(this.formGroup.value)
|
||||||
.pipe(takeUntil(this._destroyed))
|
.pipe(takeUntil(this._destroyed))
|
||||||
.subscribe(
|
.subscribe(
|
||||||
null, null, () => this.dialogRef.close()
|
null, null, () => this.dialogRef.close()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||||
import { ResearcherModel } from '../../../../core/model/researcher/researcher';
|
import { ResearcherModel } from '@app/core/model/researcher/researcher';
|
||||||
import { ValidationContext } from "../../../../common/forms/validation/validation-context";
|
import { BackendErrorValidator } from '@common/forms/validation/custom-validator';
|
||||||
import { BackendErrorValidator } from "../../../../common/forms/validation/custom-validator";
|
import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model';
|
||||||
import { ValidationErrorModel } from "../../../../common/forms/validation/error-model/validation-error-model";
|
import { ValidationContext } from '@common/forms/validation/validation-context';
|
||||||
|
|
||||||
export class ResearcherEditorModel {
|
export class ResearcherEditorModel {
|
||||||
public id: String;
|
public id: String;
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
import { Component, Inject, OnInit } from '@angular/core';
|
import { Component, Inject, OnInit } from '@angular/core';
|
||||||
import { FormGroup } from '@angular/forms';
|
import { FormGroup } from '@angular/forms';
|
||||||
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
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 { 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({
|
@Component({
|
||||||
selector: 'app-available-profiles-component',
|
selector: 'app-available-profiles-component',
|
||||||
|
|
|
@ -107,15 +107,15 @@
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="formGroup.enabled">
|
<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}}
|
{{'DMP-EDITOR.ACTIONS.SAVE-CHANGES' | translate}}
|
||||||
</button>
|
</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}}
|
{{'DMP-EDITOR.ACTIONS.SAVE' | translate}}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="formGroup.enabled && !isNew">
|
<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>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,39 +1,41 @@
|
||||||
|
|
||||||
import { of as observableOf, Observable } from 'rxjs';
|
|
||||||
|
|
||||||
import { map, takeUntil } from 'rxjs/operators';
|
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { FormGroup } from '@angular/forms';
|
import { FormGroup } from '@angular/forms';
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import { ActivatedRoute, Params, Router } from '@angular/router';
|
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 { TranslateService } from '@ngx-translate/core';
|
||||||
import * as FileSaver from 'file-saver';
|
import * as FileSaver from 'file-saver';
|
||||||
import { ValidationErrorModel } from '../../../common/forms/validation/error-model/validation-error-model';
|
import { Observable, of as observableOf } from 'rxjs';
|
||||||
import { BaseComponent } from '../../../core/common/base/base.component';
|
import { map, takeUntil } from 'rxjs/operators';
|
||||||
import { DmpStatus } from '../../../core/common/enum/dmp-status';
|
import { Guid } from '@common/types/guid';
|
||||||
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';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-dmp-editor-component',
|
selector: 'app-dmp-editor-component',
|
||||||
|
@ -69,6 +71,7 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
|
||||||
private dialog: MatDialog,
|
private dialog: MatDialog,
|
||||||
private uiNotificationService: UiNotificationService,
|
private uiNotificationService: UiNotificationService,
|
||||||
private authService: AuthService,
|
private authService: AuthService,
|
||||||
|
private formService: FormService
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
@ -223,15 +226,29 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
|
||||||
// }
|
// }
|
||||||
|
|
||||||
formSubmit(showAddDatasetDialog?: boolean): void {
|
formSubmit(showAddDatasetDialog?: boolean): void {
|
||||||
//this.touchAllFormFields(this.formGroup);
|
this.formService.touchAllFormFields(this.formGroup);
|
||||||
if (!this.isFormValid()) { return; }
|
if (!this.isFormValid()) {
|
||||||
|
this.showValidationErrorsDialog();
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.onSubmit(showAddDatasetDialog);
|
this.onSubmit(showAddDatasetDialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
public isFormValid() {
|
public isFormValid() {
|
||||||
return this.formGroup.get('label').valid && this.formGroup.get('profiles').valid &&
|
return this.formGroup.valid;
|
||||||
(this.formGroup.get('funder').get('label').valid || this.formGroup.get('funder').get('existFunder').valid) &&
|
// return this.formGroup.get('label').valid && this.formGroup.get('profiles').valid &&
|
||||||
(this.formGroup.get('grant').get('label').valid || this.formGroup.get('grant').get('existGrant').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 {
|
onSubmit(showAddDatasetDialog?: boolean): void {
|
||||||
|
@ -242,7 +259,7 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
|
||||||
if (showAddDatasetDialog) {
|
if (showAddDatasetDialog) {
|
||||||
this.addDatasetOpenDialog(complete);
|
this.addDatasetOpenDialog(complete);
|
||||||
}
|
}
|
||||||
else { this.onCallbackSuccess() }
|
else { this.onCallbackSuccess(complete) }
|
||||||
},
|
},
|
||||||
error => {
|
error => {
|
||||||
this.formGroup.get('status').setValue(DmpStatus.Draft);
|
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.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) {
|
onCallbackError(error: any) {
|
||||||
|
@ -430,7 +447,7 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
|
||||||
if (result) {
|
if (result) {
|
||||||
this.router.navigate(['datasets/new/' + id]);
|
this.router.navigate(['datasets/new/' + id]);
|
||||||
} else {
|
} else {
|
||||||
this.router.navigate(['/plans']);
|
id != null ? this.router.navigate(['/plans', 'edit', id]) : this.router.navigate(['/plans']);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,25 +1,25 @@
|
||||||
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
|
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
|
||||||
import { BackendErrorValidator } from "../../../common/forms/validation/custom-validator";
|
import { DmpProfileFieldDataType } from '@app/core/common/enum/dmp-profile-field-type';
|
||||||
import { ValidationErrorModel } from "../../../common/forms/validation/error-model/validation-error-model";
|
import { DmpProfileType } from '@app/core/common/enum/dmp-profile-type';
|
||||||
import { ValidationContext } from "../../../common/forms/validation/validation-context";
|
import { Status } from '@app/core/common/enum/Status';
|
||||||
import { Status } from "../../../core/common/enum/Status";
|
import { DatasetModel } from '@app/core/model/dataset/dataset';
|
||||||
import { DmpProfile, DmpProfileDefinition } from "../../../core/model/dmp-profile/dmp-profile";
|
import { DmpProfile, DmpProfileDefinition } from '@app/core/model/dmp-profile/dmp-profile';
|
||||||
import { DmpModel } from "../../../core/model/dmp/dmp";
|
import { DmpProfileField } from '@app/core/model/dmp-profile/dmp-profile-field';
|
||||||
import { DmpDynamicField } from "../../../core/model/dmp/dmp-dynamic-field";
|
import { DmpModel } from '@app/core/model/dmp/dmp';
|
||||||
import { DmpDynamicFieldDependency } from "../../../core/model/dmp/dmp-dynamic-field-dependency";
|
import { DmpDynamicField } from '@app/core/model/dmp/dmp-dynamic-field';
|
||||||
import { OrganizationModel } from "../../../core/model/organisation/organization";
|
import { DmpDynamicFieldDependency } from '@app/core/model/dmp/dmp-dynamic-field-dependency';
|
||||||
import { ResearcherModel } from "../../../core/model/researcher/researcher";
|
import { OrganizationModel } from '@app/core/model/organisation/organization';
|
||||||
import { UserModel } from "../../../core/model/user/user";
|
import { ResearcherModel } from '@app/core/model/researcher/researcher';
|
||||||
import { ValidJsonValidator } from "../../../library/auto-complete/auto-complete-custom-validator";
|
import { UserModel } from '@app/core/model/user/user';
|
||||||
import { UserInfoListingModel } from "../../../core/model/user/user-info-listing";
|
import { UserInfoListingModel } from '@app/core/model/user/user-info-listing';
|
||||||
import { DatasetModel } from "../../../core/model/dataset/dataset";
|
import { ValidJsonValidator } from '@app/library/auto-complete/auto-complete-custom-validator';
|
||||||
import { GrantTabModel } from "./grant-tab/grant-tab-model";
|
import { DmpProfileExternalAutoCompleteFieldDataEditorModel } from '@app/ui/admin/dmp-profile/editor/external-autocomplete/dmp-profile-external-autocomplete-field-editor.model';
|
||||||
import { DmpProfileExternalAutoCompleteFieldDataEditorModel } from "../../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 { DmpProfileType } from "../../../core/common/enum/dmp-profile-type";
|
import { GrantTabModel } from '@app/ui/dmp/editor/grant-tab/grant-tab-model';
|
||||||
import { DmpProfileFieldDataType } from "../../../core/common/enum/dmp-profile-field-type";
|
import { ProjectFormModel } from '@app/ui/dmp/editor/grant-tab/project-form-model';
|
||||||
import { DmpProfileField } from "../../../core/model/dmp-profile/dmp-profile-field";
|
import { BackendErrorValidator } from '@common/forms/validation/custom-validator';
|
||||||
import { ProjectFormModel } from "./grant-tab/project-form-model";
|
import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model';
|
||||||
import { FunderFormModel } from "./grant-tab/funder-form-model";
|
import { ValidationContext } from '@common/forms/validation/validation-context';
|
||||||
|
|
||||||
export class DmpEditorModel {
|
export class DmpEditorModel {
|
||||||
public id: string;
|
public id: string;
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { Component, Inject, OnInit } from '@angular/core';
|
import { Component, Inject, OnInit } from '@angular/core';
|
||||||
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { BaseComponent } from '../../../../core/common/base/base.component';
|
import { DatasetStatus } from '@app/core/common/enum/dataset-status';
|
||||||
import { DatasetStatus } from '../../../../core/common/enum/dataset-status';
|
import { DatasetService } from '@app/core/services/dataset/dataset.service';
|
||||||
import { DatasetService } from '../../../../core/services/dataset/dataset.service';
|
import { BaseComponent } from '@common/base/base.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-dmp-finalize-dialog-component',
|
selector: 'app-dmp-finalize-dialog-component',
|
||||||
|
|
|
@ -2,24 +2,24 @@
|
||||||
import { Component, Input, OnInit } from '@angular/core';
|
import { Component, Input, OnInit } from '@angular/core';
|
||||||
import { FormGroup } from '@angular/forms';
|
import { FormGroup } from '@angular/forms';
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
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 { TranslateService } from '@ngx-translate/core';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { map, takeUntil } from 'rxjs/operators';
|
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({
|
@Component({
|
||||||
selector: 'app-general-tab',
|
selector: 'app-general-tab',
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
import { Status } from "../../../../core/common/enum/Status";
|
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||||
import { FunderModel } from "../../../../core/model/funder/funder";
|
import { Status } from '@app/core/common/enum/Status';
|
||||||
import { ValidationErrorModel } from "../../../../common/forms/validation/error-model/validation-error-model";
|
import { FunderModel } from '@app/core/model/funder/funder';
|
||||||
import { ValidationContext } from "../../../../common/forms/validation/validation-context";
|
import { BackendErrorValidator } from '@common/forms/validation/custom-validator';
|
||||||
import { FormGroup, FormBuilder, Validators } from "@angular/forms";
|
import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model';
|
||||||
import { BackendErrorValidator } from "../../../../common/forms/validation/custom-validator";
|
import { ValidationContext } from '@common/forms/validation/validation-context';
|
||||||
|
|
||||||
|
|
||||||
export class FunderFormModel {
|
export class FunderFormModel {
|
||||||
public id: string;
|
public id: string;
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
import { Status } from "../../../../core/common/enum/Status";
|
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||||
import { GrantListingModel } from "../../../../core/model/grant/grant-listing";
|
import { Status } from '@app/core/common/enum/Status';
|
||||||
import { ValidationErrorModel } from "../../../../common/forms/validation/error-model/validation-error-model";
|
import { GrantListingModel } from '@app/core/model/grant/grant-listing';
|
||||||
import { ValidationContext } from "../../../../common/forms/validation/validation-context";
|
import { ValidJsonValidator } from '@app/library/auto-complete/auto-complete-custom-validator';
|
||||||
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
|
import { BackendErrorValidator } from '@common/forms/validation/custom-validator';
|
||||||
import { BackendErrorValidator } from "../../../../common/forms/validation/custom-validator";
|
import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model';
|
||||||
import { ValidJsonValidator } from "../../../../library/auto-complete/auto-complete-custom-validator";
|
import { ValidationContext } from '@common/forms/validation/validation-context';
|
||||||
|
|
||||||
|
|
||||||
export class GrantTabModel {
|
export class GrantTabModel {
|
||||||
public id: string;
|
public id: string;
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
import { Component, OnInit, Input } from '@angular/core';
|
import { Component, Input, OnInit } from '@angular/core';
|
||||||
import { FormGroup } from '@angular/forms';
|
import { FormGroup } from '@angular/forms';
|
||||||
import { SingleAutoCompleteConfiguration } from '../../../../library/auto-complete/single/single-auto-complete-configuration';
|
import { FunderCriteria } from '@app/core/query/funder/funder-criteria';
|
||||||
import { RequestItem } from '../../../../core/query/request-item';
|
import { GrantCriteria } from '@app/core/query/grant/grant-criteria';
|
||||||
import { GrantCriteria } from '../../../../core/query/grant/grant-criteria';
|
import { ProjectCriteria } from '@app/core/query/project/project-criteria';
|
||||||
import { GrantService } from '../../../../core/services/grant/grant.service';
|
import { RequestItem } from '@app/core/query/request-item';
|
||||||
import { GrantTabModel } from './grant-tab-model';
|
import { FunderService } from '@app/core/services/funder/funder.service';
|
||||||
import { ProjectService } from '../../../../core/services/project/project.service';
|
import { GrantService } from '@app/core/services/grant/grant.service';
|
||||||
import { FunderService } from '../../../../core/services/funder/funder.service';
|
import { ProjectService } from '@app/core/services/project/project.service';
|
||||||
import { FunderCriteria } from '../../../../core/query/funder/funder-criteria';
|
import { SingleAutoCompleteConfiguration } from '@app/library/auto-complete/single/single-auto-complete-configuration';
|
||||||
import { ProjectCriteria } from '../../../../core/query/project/project-criteria';
|
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 { TranslateService } from '@ngx-translate/core';
|
||||||
import { takeUntil } from "rxjs/operators";
|
import { takeUntil } from 'rxjs/operators';
|
||||||
import { BaseComponent } from "../../../../core/common/base/base.component";
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-grant-tab',
|
selector: 'app-grant-tab',
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue