Renames "Project" to "Grant on frontend. (Issue #145)
This commit is contained in:
parent
feaec87b82
commit
06b54ba8e6
|
@ -47,8 +47,8 @@ const appRoutes: Routes = [
|
|||
}
|
||||
},
|
||||
{
|
||||
path: 'projects',
|
||||
loadChildren: './ui/project/project.module#ProjectModule',
|
||||
path: 'grants',
|
||||
loadChildren: './ui/grant/grant.module#GrantModule',
|
||||
data: {
|
||||
breadcrumb: true
|
||||
}
|
||||
|
|
|
@ -67,8 +67,8 @@ export class AppComponent implements OnInit {
|
|||
this.router.navigate(['/plans'], { queryParams: { /*refresh : Math.random() ,returnUrl: this.state.url*/ } });
|
||||
}
|
||||
|
||||
goToProjects() {
|
||||
this.router.navigate(['/projects'], { queryParams: { /*refresh : Math.random() ,returnUrl: this.state.url*/ } });
|
||||
goToGrants() {
|
||||
this.router.navigate(['/grants'], { queryParams: { /*refresh : Math.random() ,returnUrl: this.state.url*/ } });
|
||||
}
|
||||
|
||||
initializeServices() {
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
export enum GrantStateType {
|
||||
OnGoing = 0,
|
||||
Finished = 1
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
export enum ProjectType {
|
||||
export enum GrantType {
|
||||
External = 0,
|
||||
Internal = 1
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
export enum ProjectStateType {
|
||||
OnGoing = 0,
|
||||
Finished = 1
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
export enum RecentActivityType {
|
||||
Project = 0,
|
||||
Grant = 0,
|
||||
Dataset = 1,
|
||||
Dmp = 2
|
||||
}
|
||||
|
|
|
@ -24,8 +24,8 @@ import { BaseHttpService } from './services/http/base-http.service';
|
|||
import { LoggingService } from './services/logging/logging-service';
|
||||
import { UiNotificationService } from './services/notification/ui-notification-service';
|
||||
import { ProgressIndicationService } from './services/progress-indication/progress-indication-service';
|
||||
import { ProjectFileUploadService } from './services/project/project-file-upload.service';
|
||||
import { ProjectService } from './services/project/project.service';
|
||||
import { GrantFileUploadService } from './services/grant/grant-file-upload.service';
|
||||
import { GrantService } from './services/grant/grant.service';
|
||||
import { SearchBarService } from './services/search-bar/search-bar.service';
|
||||
import { TimezoneService } from './services/timezone/timezone-service';
|
||||
import { UserService } from './services/user/user.service';
|
||||
|
@ -68,8 +68,8 @@ export class CoreServiceModule {
|
|||
SearchBarService,
|
||||
DashboardService,
|
||||
LanguageResolverService,
|
||||
ProjectService,
|
||||
ProjectFileUploadService,
|
||||
GrantService,
|
||||
GrantFileUploadService,
|
||||
DmpService,
|
||||
DmpProfileService,
|
||||
ExternalSourcesService,
|
||||
|
|
|
@ -2,7 +2,7 @@ import { Serializable } from "../../../common/types/json/serializable";
|
|||
|
||||
export interface DashboardStatisticsModel {
|
||||
totalDataManagementPlanCount: number;
|
||||
totalProjectCount: number;
|
||||
totalGrantCount: number;
|
||||
totalDataSetCount: number;
|
||||
totalOrganisationCount: number;
|
||||
}
|
||||
|
|
|
@ -3,9 +3,9 @@ export interface DatasetListingModel {
|
|||
label: String;
|
||||
dmp: String;
|
||||
dmpId: String;
|
||||
project: String;
|
||||
projectId: String;
|
||||
projectAbbreviation: String;
|
||||
grant: String;
|
||||
grantId: String;
|
||||
grantAbbreviation: String;
|
||||
profile: String;
|
||||
dataRepositories: String;
|
||||
registries: String;
|
||||
|
|
|
@ -5,9 +5,9 @@ export interface DmpListingModel {
|
|||
label: String;
|
||||
description: String;
|
||||
status: DmpStatus;
|
||||
project: String;
|
||||
projectId: String;
|
||||
projectAbbreviation: String;
|
||||
grant: String;
|
||||
grantId: String;
|
||||
grantAbbreviation: String;
|
||||
profile: String;
|
||||
creationTime: String;
|
||||
modifiedTime: String;
|
||||
|
|
|
@ -3,7 +3,7 @@ import { DatasetUrlListing } from "../dataset/dataset-url-listing";
|
|||
import { UserInfoListingModel } from "../user/user-info-listing";
|
||||
import { DmpAssociatedProfileModel } from "../dmp-profile/dmp-associated-profile";
|
||||
import { ResearcherModel } from "../researcher/researcher";
|
||||
import { ProjectOverviewModel } from "../project/project-overview";
|
||||
import { GrantOverviewModel } from "../grant/grant-overview";
|
||||
import { DatasetOverviewModel } from "../dataset/dataset-overview";
|
||||
|
||||
export interface DmpOverviewModel {
|
||||
|
@ -17,7 +17,7 @@ export interface DmpOverviewModel {
|
|||
isPublic: boolean;
|
||||
groupId: string;
|
||||
description: string;
|
||||
project: ProjectOverviewModel;
|
||||
grant: GrantOverviewModel;
|
||||
associatedProfiles: DmpAssociatedProfileModel[];
|
||||
users: UserInfoListingModel[];
|
||||
organisations: OrganizationModel[];
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { Status } from "../../common/enum/Status";
|
||||
import { DmpProfile, DmpProfileDefinition } from "../dmp-profile/dmp-profile";
|
||||
import { OrganizationModel } from "../organisation/organization";
|
||||
import { ProjectListingModel } from "../project/project-listing";
|
||||
import { GrantListingModel } from "../grant/grant-listing";
|
||||
import { ResearcherModel } from "../researcher/researcher";
|
||||
import { UserModel } from "../user/user";
|
||||
import { DmpDynamicField } from "./dmp-dynamic-field";
|
||||
|
@ -17,7 +17,7 @@ export interface DmpModel {
|
|||
status: Status;
|
||||
lockable: boolean;
|
||||
description: String;
|
||||
project: ProjectListingModel;
|
||||
grant: GrantListingModel;
|
||||
datasets: DatasetModel[];
|
||||
datasetsToBeFinalized: string[];
|
||||
profiles: DmpProfile[];
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import { UrlListingItem } from "../../../library/url-listing/url-listing-item";
|
||||
import { ProjectType } from '../../common/enum/project-type';
|
||||
import { GrantType } from '../../common/enum/grant-type';
|
||||
import { Status } from '../../common/enum/Status';
|
||||
|
||||
export interface ProjectListingModel {
|
||||
export interface GrantListingModel {
|
||||
id?: string;
|
||||
label?: string;
|
||||
abbreviation?: string;
|
||||
reference?: string;
|
||||
type?: ProjectType;
|
||||
type?: GrantType;
|
||||
uri?: String;
|
||||
status?: Status;
|
||||
startDate?: Date;
|
|
@ -1,4 +1,4 @@
|
|||
export interface ProjectOverviewModel {
|
||||
export interface GrantOverviewModel {
|
||||
id: String;
|
||||
label: String;
|
||||
uri: String;
|
|
@ -2,7 +2,7 @@ import { ExternalSourceItemModel } from "../../model/external-sources/external-s
|
|||
import { BaseCriteria } from "../base-criteria";
|
||||
|
||||
export class DatasetCriteria extends BaseCriteria {
|
||||
public projects?: string[] = [];
|
||||
public grants?: string[] = [];
|
||||
public status?: Number;
|
||||
public dmpIds?: string[] = [];
|
||||
public tags?: ExternalSourceItemModel[] = [];
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { ProjectListingModel } from "../../model/project/project-listing";
|
||||
import { GrantListingModel } from "../../model/grant/grant-listing";
|
||||
import { BaseCriteria } from "../base-criteria";
|
||||
import { OrganizationModel } from "../../model/organisation/organization";
|
||||
|
||||
export class DmpCriteria extends BaseCriteria {
|
||||
public organisations?: string[] = [];
|
||||
public projects?: ProjectListingModel[] = [];
|
||||
public grants?: GrantListingModel[] = [];
|
||||
public groupIds?: string[];
|
||||
public allVersions?: boolean;
|
||||
public status?: number;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { ProjectStateType } from "../../common/enum/project-state-type";
|
||||
import { GrantStateType } from "../../common/enum/grant-state-type";
|
||||
import { BaseCriteria } from "../base-criteria";
|
||||
|
||||
export class ExploreDatasetCriteriaModel extends BaseCriteria {
|
||||
public projectStatus: ProjectStateType;
|
||||
public grantStatus: GrantStateType;
|
||||
public dmpIds: string[] = [];
|
||||
public projects: string[] = [];
|
||||
public grants: string[] = [];
|
||||
public datasetProfile: string[] = [];
|
||||
public dmpOrganisations: string[] = [];
|
||||
public tags = [];
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { BaseCriteria } from "../base-criteria";
|
||||
import { ProjectStateType } from "../../common/enum/project-state-type";
|
||||
import { GrantStateType } from "../../common/enum/grant-state-type";
|
||||
|
||||
export class ExploreDmpCriteriaModel extends BaseCriteria {
|
||||
public projectStatus: ProjectStateType;
|
||||
public projects: string[] = [];
|
||||
public grantStatus: GrantStateType;
|
||||
public grants: string[] = [];
|
||||
public datasetProfile: string[] = [];
|
||||
public dmpOrganisations: string[] = [];
|
||||
}
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
import { GrantStateType } from "../../common/enum/grant-state-type";
|
||||
import { BaseCriteria } from "../base-criteria";
|
||||
|
||||
export class GrantCriteria extends BaseCriteria {
|
||||
public periodStart: Date;
|
||||
public periodEnd: Date;
|
||||
public grantStateType: GrantStateType;
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
import { ProjectStateType } from "../../common/enum/project-state-type";
|
||||
import { BaseCriteria } from "../base-criteria";
|
||||
|
||||
export class ProjectCriteria extends BaseCriteria {
|
||||
public periodStart: Date;
|
||||
public periodEnd: Date;
|
||||
public projectStateType: ProjectStateType;
|
||||
}
|
|
@ -2,7 +2,7 @@ import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http';
|
|||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { environment } from '../../../../environments/environment';
|
||||
import { DynamicFieldProjectCriteria } from '../../../models/dynamic-field-project/DynamicFieldProjectCriteria';
|
||||
import { DynamicFieldGrantCriteria } from '../../../models/dynamic-field-grant/DynamicFieldGrantCriteria';
|
||||
import { DataTableData } from '../../model/data-table/data-table-data';
|
||||
import { DataTableRequest } from '../../model/data-table/data-table-request';
|
||||
import { DatasetProfileModel } from '../../model/dataset/dataset-profile';
|
||||
|
@ -96,7 +96,7 @@ export class DmpService {
|
|||
return this.http.post<string>(this.actionUrl + 'createZenodoDoi/' + id, {headers: this.headers});
|
||||
}
|
||||
|
||||
getDynamicField(requestItem: RequestItem<DynamicFieldProjectCriteria>): any {
|
||||
getDynamicField(requestItem: RequestItem<DynamicFieldGrantCriteria>): any {
|
||||
return this.http.post<any>(this.actionUrl + 'dynamic', requestItem, { headers: this.headers });
|
||||
}
|
||||
|
||||
|
|
|
@ -2,13 +2,13 @@ import { HttpHeaders } from '@angular/common/http';
|
|||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { environment } from '../../../../environments/environment';
|
||||
import { ContentFile } from '../../model/project/project-listing';
|
||||
import { ContentFile } from '../../model/grant/grant-listing';
|
||||
import { BaseHttpService } from '../http/base-http.service';
|
||||
import { BaseHttpParams } from '../../../common/http/base-http-params';
|
||||
import { InterceptorType } from '../../../common/http/interceptors/interceptor-type';
|
||||
|
||||
@Injectable()
|
||||
export class ProjectFileUploadService {
|
||||
export class GrantFileUploadService {
|
||||
private actionUrl: string;
|
||||
private headers: HttpHeaders;
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
import { HttpHeaders } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { environment } from '../../../../environments/environment';
|
||||
import { DataTableData } from '../../model/data-table/data-table-data';
|
||||
import { DataTableRequest } from '../../model/data-table/data-table-request';
|
||||
import { GrantListingModel } from '../../model/grant/grant-listing';
|
||||
import { GrantCriteria } from '../../query/grant/grant-criteria';
|
||||
import { RequestItem } from '../../query/request-item';
|
||||
import { BaseHttpService } from '../http/base-http.service';
|
||||
|
||||
|
||||
@Injectable()
|
||||
export class GrantService {
|
||||
|
||||
private actionUrl: string;
|
||||
private headers: HttpHeaders;
|
||||
|
||||
constructor(private http: BaseHttpService) {
|
||||
this.actionUrl = environment.Server + 'grants/';
|
||||
}
|
||||
|
||||
getPaged(dataTableRequest: DataTableRequest<GrantCriteria>, fieldsGroup?: string): Observable<DataTableData<GrantListingModel>> {
|
||||
if (fieldsGroup) {
|
||||
return this.http.post<DataTableData<GrantListingModel>>(this.actionUrl + 'paged?fieldsGroup=' + fieldsGroup, dataTableRequest, { headers: this.headers });
|
||||
}
|
||||
else {
|
||||
return this.http.post<DataTableData<GrantListingModel>>(this.actionUrl + 'paged?fieldsGroup=' + 'autocomplete', dataTableRequest, { headers: this.headers });
|
||||
}
|
||||
}
|
||||
|
||||
getPublicPaged(dataTableRequest: DataTableRequest<GrantCriteria>): Observable<DataTableData<GrantListingModel>> {
|
||||
return this.http.post<DataTableData<GrantListingModel>>(this.actionUrl + 'public/paged', dataTableRequest, { headers: this.headers });
|
||||
}
|
||||
|
||||
getWithExternal(requestItem: RequestItem<GrantCriteria>): Observable<GrantListingModel[]> {
|
||||
return this.http.post<GrantListingModel[]>(this.actionUrl + 'external', requestItem, { headers: this.headers });
|
||||
}
|
||||
|
||||
getSingle(id: string): Observable<GrantListingModel> {
|
||||
return this.http.get<GrantListingModel>(this.actionUrl + id, { headers: this.headers });
|
||||
}
|
||||
|
||||
createGrant(grantModel: GrantListingModel): Observable<GrantListingModel> {
|
||||
return this.http.post<GrantListingModel>(this.actionUrl, grantModel, { headers: this.headers });
|
||||
}
|
||||
|
||||
// Actually sets it inactive.
|
||||
delete(id: String): Observable<GrantListingModel> {
|
||||
return this.http.delete<GrantListingModel>(this.actionUrl + id, { headers: this.headers });
|
||||
}
|
||||
}
|
|
@ -1,52 +0,0 @@
|
|||
import { HttpHeaders } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { environment } from '../../../../environments/environment';
|
||||
import { DataTableData } from '../../model/data-table/data-table-data';
|
||||
import { DataTableRequest } from '../../model/data-table/data-table-request';
|
||||
import { ProjectListingModel } from '../../model/project/project-listing';
|
||||
import { ProjectCriteria } from '../../query/project/project-criteria';
|
||||
import { RequestItem } from '../../query/request-item';
|
||||
import { BaseHttpService } from '../http/base-http.service';
|
||||
|
||||
|
||||
@Injectable()
|
||||
export class ProjectService {
|
||||
|
||||
private actionUrl: string;
|
||||
private headers: HttpHeaders;
|
||||
|
||||
constructor(private http: BaseHttpService) {
|
||||
this.actionUrl = environment.Server + 'projects/';
|
||||
}
|
||||
|
||||
getPaged(dataTableRequest: DataTableRequest<ProjectCriteria>, fieldsGroup?: string): Observable<DataTableData<ProjectListingModel>> {
|
||||
if (fieldsGroup) {
|
||||
return this.http.post<DataTableData<ProjectListingModel>>(this.actionUrl + 'paged?fieldsGroup=' + fieldsGroup, dataTableRequest, { headers: this.headers });
|
||||
}
|
||||
else {
|
||||
return this.http.post<DataTableData<ProjectListingModel>>(this.actionUrl + 'paged?fieldsGroup=' + 'autocomplete', dataTableRequest, { headers: this.headers });
|
||||
}
|
||||
}
|
||||
|
||||
getPublicPaged(dataTableRequest: DataTableRequest<ProjectCriteria>): Observable<DataTableData<ProjectListingModel>> {
|
||||
return this.http.post<DataTableData<ProjectListingModel>>(this.actionUrl + 'public/paged', dataTableRequest, { headers: this.headers });
|
||||
}
|
||||
|
||||
getWithExternal(requestItem: RequestItem<ProjectCriteria>): Observable<ProjectListingModel[]> {
|
||||
return this.http.post<ProjectListingModel[]>(this.actionUrl + 'external', requestItem, { headers: this.headers });
|
||||
}
|
||||
|
||||
getSingle(id: string): Observable<ProjectListingModel> {
|
||||
return this.http.get<ProjectListingModel>(this.actionUrl + id, { headers: this.headers });
|
||||
}
|
||||
|
||||
createProject(projectModel: ProjectListingModel): Observable<ProjectListingModel> {
|
||||
return this.http.post<ProjectListingModel>(this.actionUrl, projectModel, { headers: this.headers });
|
||||
}
|
||||
|
||||
// Actually sets it inactive.
|
||||
delete(id: String): Observable<ProjectListingModel> {
|
||||
return this.http.delete<ProjectListingModel>(this.actionUrl + id, { headers: this.headers });
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
export class DynamicFieldGrantCriteria {
|
||||
public id: string;
|
||||
public dynamicFields: DynamicFieldGrantCriteriaDependencies[];
|
||||
}
|
||||
|
||||
export class DynamicFieldGrantCriteriaDependencies {
|
||||
public value;
|
||||
public property;
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
export class DynamicFieldProjectCriteria {
|
||||
public id: string;
|
||||
public dynamicFields: DynamicFieldProjectCriteriaDependencies[];
|
||||
}
|
||||
|
||||
export class DynamicFieldProjectCriteriaDependencies {
|
||||
public value;
|
||||
public property;
|
||||
}
|
|
@ -3,7 +3,7 @@
|
|||
<div class="row">
|
||||
|
||||
<mat-form-field class="col-md-6">
|
||||
<input matInput placeholder=" {{'CRITERIA.DMP.LIKE'| translate}}" name="projectCriteriaLike"
|
||||
<input matInput placeholder=" {{'CRITERIA.DMP.LIKE'| translate}}" name="grantCriteriaLike"
|
||||
[(ngModel)]="criteria.like" (ngModelChange)="controlModified()">
|
||||
</mat-form-field>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { ValidationErrorModel } from '../../../../../common/forms/validation/error-model/validation-error-model';
|
||||
import { ProjectListingModel } from '../../../../../core/model/project/project-listing';
|
||||
import { GrantListingModel } from '../../../../../core/model/grant/grant-listing';
|
||||
import { DmpCriteria } from '../../../../../core/query/dmp/dmp-criteria';
|
||||
import { DmpProfileCriteria } from '../../../../../core/query/dmp/dmp-profile-criteria';
|
||||
import { BaseCriteriaComponent } from '../../../../misc/criteria/base-criteria.component';
|
||||
|
@ -18,10 +18,10 @@ import { DmpProfileService } from '../../../../../core/services/dmp/dmp-profile.
|
|||
export class DmpProfileCriteriaComponent extends BaseCriteriaComponent implements OnInit {
|
||||
|
||||
@Input()
|
||||
showProject: boolean;
|
||||
showGrant: boolean;
|
||||
public criteria: DmpProfileCriteria = new DmpProfileCriteria();
|
||||
filteringProjectsAsync = false;
|
||||
filteredProjects: ProjectListingModel[];
|
||||
filteringGrantsAsync = false;
|
||||
filteredGrants: GrantListingModel[];
|
||||
constructor(
|
||||
private dmpProfileService: DmpProfileService,
|
||||
private dialog: MatDialog,
|
||||
|
|
|
@ -32,9 +32,9 @@
|
|||
buttonRedirectLink="/datasets/new" icon="library_books"></app-info-counter>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-6 col-sm-6">
|
||||
<app-info-counter [title]="'DASHBOARD.MY-PROJECTS'"
|
||||
[subtitle]="dashboardStatisticsData?.totalProjectCount" routerLink='/projects'
|
||||
buttonRedirectLink="/projects/new" icon="work_outline"></app-info-counter>
|
||||
<app-info-counter [title]="'DASHBOARD.MY-GRANTS'"
|
||||
[subtitle]="dashboardStatisticsData?.totalGrantCount" routerLink='/grants'
|
||||
buttonRedirectLink="/grants/new" icon="work_outline"></app-info-counter>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-6 col-sm-6">
|
||||
<app-info-counter [title]="'DASHBOARD.ORGANIZATIONS'"
|
||||
|
@ -65,8 +65,8 @@
|
|||
routerLink='/datasets' buttonRedirectLink="/datasets/new" icon="library_books"></app-info-counter>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-6 col-sm-6">
|
||||
<app-info-counter [title]="'DASHBOARD.PROJECTS'" [subtitle]="dashboardStatisticsData?.totalProjectCount"
|
||||
routerLink='/projects' buttonRedirectLink="/projects/new" icon="work_outline"></app-info-counter>
|
||||
<app-info-counter [title]="'DASHBOARD.GRANTS'" [subtitle]="dashboardStatisticsData?.totalGrantCount"
|
||||
routerLink='/grants' buttonRedirectLink="/grants/new" icon="work_outline"></app-info-counter>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-6 col-sm-6">
|
||||
<app-info-counter title="Related Organizations"
|
||||
|
|
|
@ -6,10 +6,10 @@ import { BaseComponent } from '../../core/common/base/base.component';
|
|||
import { RecentActivityType } from '../../core/common/enum/recent-activity-type';
|
||||
import { DashboardStatisticsModel } from '../../core/model/dashboard/dashboard-statistics-model';
|
||||
import { SearchBarItem } from '../../core/model/dashboard/search-bar-item';
|
||||
import { ProjectCriteria } from '../../core/query/project/project-criteria';
|
||||
import { GrantCriteria } from '../../core/query/grant/grant-criteria';
|
||||
import { AuthService } from '../../core/services/auth/auth.service';
|
||||
import { DashboardService } from '../../core/services/dashboard/dashboard.service';
|
||||
import { ProjectService } from '../../core/services/project/project.service';
|
||||
import { GrantService } from '../../core/services/grant/grant.service';
|
||||
import { SearchBarService } from '../../core/services/search-bar/search-bar.service';
|
||||
import { UserService } from '../../core/services/user/user.service';
|
||||
import { SingleAutoCompleteConfiguration } from '../../library/auto-complete/single/single-auto-complete-configuration';
|
||||
|
@ -37,12 +37,12 @@ export class DashboardComponent extends BaseComponent implements OnInit, IBreadC
|
|||
|
||||
public userInfo: any;
|
||||
datasetActivities: any[];
|
||||
projectActivities: any[];
|
||||
grantActivities: any[];
|
||||
dmpActivities: any[];
|
||||
organisationActivities: any[];
|
||||
public dashboardStatisticsData: DashboardStatisticsModel;
|
||||
public formControl = new FormControl();
|
||||
projectAutoCompleteConfiguration: SingleAutoCompleteConfiguration;
|
||||
grantAutoCompleteConfiguration: SingleAutoCompleteConfiguration;
|
||||
public searchControl = new FormControl();
|
||||
filteredOptions: Observable<SearchBarItem[]>;
|
||||
recentActivityTypeEnum = RecentActivityType;
|
||||
|
@ -53,7 +53,7 @@ export class DashboardComponent extends BaseComponent implements OnInit, IBreadC
|
|||
constructor(
|
||||
private router: Router,
|
||||
private route: ActivatedRoute,
|
||||
private projectService: ProjectService,
|
||||
private grantService: GrantService,
|
||||
private dmpService: DmpService,
|
||||
private datasetService: DatasetService,
|
||||
private dashboardService: DashboardService,
|
||||
|
@ -65,7 +65,7 @@ export class DashboardComponent extends BaseComponent implements OnInit, IBreadC
|
|||
super();
|
||||
// this.dashboardStatisticsData.totalDataManagementPlanCount = 0;
|
||||
// this.dashboardStatisticsData.totalDataSetCount = 0;
|
||||
// this.dashboardStatisticsData.totalProjectCount = 0;
|
||||
// this.dashboardStatisticsData.totalGrantCount = 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -77,14 +77,14 @@ export class DashboardComponent extends BaseComponent implements OnInit, IBreadC
|
|||
// .subscribe(response => {
|
||||
// this.datasetActivities = response['recentDatasetActivities'];
|
||||
// this.dmpActivities = response['recentDmpActivities'];
|
||||
// this.projectActivities = response['recentProjectActivities'];
|
||||
// this.grantActivities = response['recentGrantActivities'];
|
||||
// this.organisationActivities = response['totalOrganisationCount'];
|
||||
// });
|
||||
// }
|
||||
|
||||
// this.projectAutoCompleteConfiguration = {
|
||||
// filterFn: this.searchProject.bind(this),
|
||||
// items: this.searchProject(''),
|
||||
// this.grantAutoCompleteConfiguration = {
|
||||
// filterFn: this.searchGrant.bind(this),
|
||||
// items: this.searchGrant(''),
|
||||
// displayFn: (item) => item['label'],
|
||||
// titleFn: (item) => item['label']
|
||||
// };
|
||||
|
@ -118,17 +118,17 @@ export class DashboardComponent extends BaseComponent implements OnInit, IBreadC
|
|||
return !(!this.authentication.current());
|
||||
}
|
||||
|
||||
searchProject(query: string) {
|
||||
const projectRequestItem: RequestItem<ProjectCriteria> = new RequestItem();
|
||||
projectRequestItem.criteria = new ProjectCriteria();
|
||||
projectRequestItem.criteria.like = query;
|
||||
return this.projectService.getWithExternal(projectRequestItem);
|
||||
searchGrant(query: string) {
|
||||
const grantRequestItem: RequestItem<GrantCriteria> = new RequestItem();
|
||||
grantRequestItem.criteria = new GrantCriteria();
|
||||
grantRequestItem.criteria.like = query;
|
||||
return this.grantService.getWithExternal(grantRequestItem);
|
||||
}
|
||||
|
||||
redirect(id: string, type: RecentActivityType) {
|
||||
switch (type) {
|
||||
case RecentActivityType.Project: {
|
||||
this.router.navigate(['projects/edit/' + id]);
|
||||
case RecentActivityType.Grant: {
|
||||
this.router.navigate(['grants/edit/' + id]);
|
||||
return;
|
||||
}
|
||||
case RecentActivityType.Dataset: {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div class="col-12">
|
||||
<div class="row">
|
||||
<div class="col-12 gray-container container-header">
|
||||
<p>{{ dataset.projectAbbreviation }}</p>
|
||||
<p>{{ dataset.grantAbbreviation }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
<div class="col" (click)="itemClicked()">
|
||||
<div class="row">
|
||||
<div class="col-12 gray-container container-header">
|
||||
<p (click)="$event.stopImmediatePropagation(); projectClicked(dmp.projectId)">
|
||||
{{dmp.projectAbbreviation}}</p>
|
||||
<p (click)="$event.stopImmediatePropagation(); grantClicked(dmp.grantId)">
|
||||
{{dmp.grantAbbreviation}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
|
|
@ -21,8 +21,8 @@ export class DmpInfoCounterComponent implements OnInit {
|
|||
this.onClick.emit(this.dmp);
|
||||
}
|
||||
|
||||
projectClicked(projectId: String) {
|
||||
// this.router.navigate(['/datasets/publicEdit/' + projectId]);
|
||||
grantClicked(grantId: String) {
|
||||
// this.router.navigate(['/datasets/publicEdit/' + grantId]);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ td:hover .draft-desc:after {
|
|||
text-align: right;
|
||||
}
|
||||
|
||||
.project-pill {
|
||||
.grant-pill {
|
||||
width: 80%;
|
||||
border: 1px solid rgb(231, 230, 230);
|
||||
color: rgb(145, 145, 145);
|
||||
|
|
|
@ -20,11 +20,11 @@
|
|||
<i class="material-icons more-icon">more_horiz</i>
|
||||
</div> -->
|
||||
<div class="draft-title">
|
||||
{{'GENERAL.NAMES.DATASET' | translate}}: {{ dataset.label }} {{'DRAFTS.FOR-DMP' | translate}} {{ dataset.dmp }} {{'DRAFTS.FOR-PROJECT' | translate}} {{ dataset.project }}
|
||||
{{'GENERAL.NAMES.DATASET' | translate}}: {{ dataset.label }} {{'DRAFTS.FOR-DMP' | translate}} {{ dataset.dmp }} {{'DRAFTS.FOR-GRANT' | translate}} {{ dataset.grant }}
|
||||
</div>
|
||||
<div class="draft-subtitle">{{ dataset.created | date: "shortDate"}}</div>
|
||||
<div class="draft-desc">{{ dataset.description }}</div>
|
||||
<div matTooltip="{{ dataset.profile }}" class="project-pill">{{ dataset.profile }}</div>
|
||||
<div matTooltip="{{ dataset.profile }}" class="grant-pill">{{ dataset.profile }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
|
|
@ -37,8 +37,8 @@ export class DraftsComponent implements OnInit {
|
|||
|
||||
redirect(id: string, type: RecentActivityType) {
|
||||
switch (type) {
|
||||
case RecentActivityType.Project: {
|
||||
this.router.navigate(["projects/edit/" + id]);
|
||||
case RecentActivityType.Grant: {
|
||||
this.router.navigate(["grants/edit/" + id]);
|
||||
return;
|
||||
}
|
||||
case RecentActivityType.Dataset: {
|
||||
|
|
|
@ -11,7 +11,7 @@ import { AuthService } from "../../../core/services/auth/auth.service";
|
|||
// export const INFO_COUNTER_ROUTES: RouteInfo[] = [
|
||||
// { path: '', title: 'DATA MANAGEMENT PLANS', subtitle: '4', icon: 'view_agenda' },
|
||||
// { path: '', title: 'RELATED DATA DESCRIPTIONS', subtitle: '20', icon: 'library_books' },
|
||||
// { path: '', title: 'RELATED PROJECTS', subtitle: '4', icon: 'work_outline' },
|
||||
// { path: '', title: 'RELATED GRANTS', subtitle: '4', icon: 'work_outline' },
|
||||
// { path: '', title: 'ORGANIZATIONS', subtitle: '20', icon: 'scatter_plot' }
|
||||
// ];
|
||||
|
||||
|
|
|
@ -24,12 +24,12 @@
|
|||
<mat-card class="example-card">
|
||||
<mat-card-header>
|
||||
<mat-card-title>
|
||||
{{'RECENT-ACTIVITY.MY-TITLE-PROJECT' | translate}}
|
||||
{{'RECENT-ACTIVITY.MY-TITLE-GRANT' | translate}}
|
||||
</mat-card-title>
|
||||
</mat-card-header>
|
||||
<mat-card-content>
|
||||
<mat-nav-list *ngIf="projectActivities!=null">
|
||||
<mat-list-item (click)="redirect(activity.id, recentActivityTypeEnum.Project)" *ngFor="let activity of projectActivities">
|
||||
<mat-nav-list *ngIf="grantActivities!=null">
|
||||
<mat-list-item (click)="redirect(activity.id, recentActivityTypeEnum.Grant)" *ngFor="let activity of grantActivities">
|
||||
<p mat-line>
|
||||
{{activity.label}}
|
||||
</p>
|
||||
|
|
|
@ -13,7 +13,7 @@ import { UserService } from '../../../core/services/user/user.service';
|
|||
export class RecentActivityComponent extends BaseComponent implements OnInit {
|
||||
|
||||
datasetActivities: any[];
|
||||
projectActivities: any[];
|
||||
grantActivities: any[];
|
||||
dmpActivities: any[];
|
||||
recentActivityTypeEnum = RecentActivityType;
|
||||
|
||||
|
@ -28,14 +28,14 @@ export class RecentActivityComponent extends BaseComponent implements OnInit {
|
|||
.subscribe(response => {
|
||||
this.datasetActivities = response['recentDatasetActivities'];
|
||||
this.dmpActivities = response['recentDmpActivities'];
|
||||
this.projectActivities = response['recentProjectActivities'];
|
||||
this.grantActivities = response['recentGrantActivities'];
|
||||
});
|
||||
}
|
||||
|
||||
redirect(id: string, type: RecentActivityType) {
|
||||
switch (type) {
|
||||
case RecentActivityType.Project: {
|
||||
this.router.navigate(['projects/edit/' + id]);
|
||||
case RecentActivityType.Grant: {
|
||||
this.router.navigate(['grants/edit/' + id]);
|
||||
return;
|
||||
}
|
||||
case RecentActivityType.Dataset: {
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<thead class="text-default">
|
||||
<th>{{ 'DATASET-PROFILE-LISTING.COLUMNS.NAME' | translate}}</th>
|
||||
<th>{{ 'DATASET-PROFILE-LISTING.COLUMNS.TEMPLATE' | translate }}</th>
|
||||
<th>{{ 'DATASET-PROFILE-LISTING.COLUMNS.PROJECT' | translate }}</th>
|
||||
<th>{{ 'DATASET-PROFILE-LISTING.COLUMNS.GRANT' | translate }}</th>
|
||||
<th>{{ 'DATASET-PROFILE-LISTING.COLUMNS.ROLE' | translate }}</th>
|
||||
<th>{{ 'DATASET-PROFILE-LISTING.COLUMNS.ORGANIZATION' | translate }}</th>
|
||||
<th>{{ 'DATASET-PROFILE-LISTING.COLUMNS.STATUS' | translate }}</th>
|
||||
|
@ -32,7 +32,7 @@
|
|||
{{ dmpProfileDisplay(activity.profile) }}
|
||||
</div>
|
||||
</td>
|
||||
<td>{{ activity.project }}</td>
|
||||
<td>{{ activity.grant }}</td>
|
||||
<td>{{roleDisplay(activity.users)}}</td>
|
||||
<td>{{ activity.organisations }}</td>
|
||||
<td *ngIf="activity.status === 1">
|
||||
|
|
|
@ -122,8 +122,8 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn
|
|||
|
||||
redirect(id: string, type: RecentActivityType) {
|
||||
switch (type) {
|
||||
case RecentActivityType.Project: {
|
||||
this.router.navigate(["projects/edit/" + id]);
|
||||
case RecentActivityType.Grant: {
|
||||
this.router.navigate(["grants/edit/" + id]);
|
||||
return;
|
||||
}
|
||||
case RecentActivityType.Dataset: {
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<thead class="text-default">
|
||||
<th>{{ 'DATASET-PROFILE-LISTING.COLUMNS.NAME' | translate }}</th>
|
||||
<th>{{ 'DATASET-PROFILE-LISTING.COLUMNS.TEMPLATE' | translate }}</th>
|
||||
<th>{{ 'DATASET-PROFILE-LISTING.COLUMNS.PROJECT' | translate }}</th>
|
||||
<th>{{ 'DATASET-PROFILE-LISTING.COLUMNS.GRANT' | translate }}</th>
|
||||
<th>{{ 'DATASET-PROFILE-LISTING.COLUMNS.ROLE' | translate }}</th>
|
||||
<th>{{ 'DATASET-PROFILE-LISTING.COLUMNS.ORGANIZATION' | translate }}</th>
|
||||
<th>{{ 'DATASET-PROFILE-LISTING.COLUMNS.STATUS' | translate }}</th>
|
||||
|
@ -31,7 +31,7 @@
|
|||
--
|
||||
</div>
|
||||
</td>
|
||||
<td>{{ activity.project }}</td>
|
||||
<td>{{ activity.grant }}</td>
|
||||
<td>Role Name</td>
|
||||
<td>{{ activity.organisations }}</td>
|
||||
<td *ngIf="activity.status === 1">
|
||||
|
|
|
@ -48,8 +48,8 @@ export class RecentVisitedActivityComponent extends BaseComponent
|
|||
|
||||
redirect(id: string, type: RecentActivityType) {
|
||||
switch (type) {
|
||||
case RecentActivityType.Project: {
|
||||
this.router.navigate(["projects/edit/" + id]);
|
||||
case RecentActivityType.Grant: {
|
||||
this.router.navigate(["grants/edit/" + id]);
|
||||
return;
|
||||
}
|
||||
case RecentActivityType.Dataset: {
|
||||
|
|
|
@ -164,8 +164,8 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr
|
|||
notFoundResolver: [
|
||||
{
|
||||
parentComponentName: null,
|
||||
label: this.datasetWizardModel.dmp.project.label,
|
||||
url: '/projects/edit/' + this.datasetWizardModel.dmp.project.id
|
||||
label: this.datasetWizardModel.dmp.grant.label,
|
||||
url: '/grants/edit/' + this.datasetWizardModel.dmp.grant.id
|
||||
},
|
||||
{
|
||||
parentComponentName: null,
|
||||
|
@ -200,8 +200,8 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr
|
|||
notFoundResolver: [
|
||||
{
|
||||
parentComponentName: null,
|
||||
label: this.datasetWizardModel.dmp.project.label,
|
||||
url: '/projects/edit/' + this.datasetWizardModel.dmp.project.id
|
||||
label: this.datasetWizardModel.dmp.grant.label,
|
||||
url: '/grants/edit/' + this.datasetWizardModel.dmp.grant.id
|
||||
},
|
||||
{
|
||||
parentComponentName: null,
|
||||
|
@ -261,8 +261,8 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr
|
|||
notFoundResolver: [
|
||||
{
|
||||
parentComponentName: null,
|
||||
label: this.datasetWizardModel.dmp.project.label,
|
||||
url: '/projects/edit/' + this.datasetWizardModel.dmp.project.id
|
||||
label: this.datasetWizardModel.dmp.grant.label,
|
||||
url: '/grants/edit/' + this.datasetWizardModel.dmp.grant.id
|
||||
},
|
||||
{
|
||||
parentComponentName: null,
|
||||
|
@ -542,8 +542,8 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr
|
|||
return filename;
|
||||
}
|
||||
|
||||
public redirectToProject() {
|
||||
this.router.navigate(['projects/edit/' + this.datasetWizardModel.dmp.project.id]);
|
||||
public redirectToGrant() {
|
||||
this.router.navigate(['grants/edit/' + this.datasetWizardModel.dmp.grant.id]);
|
||||
}
|
||||
|
||||
public redirectToDmp() {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<div class="row" style="justify-content: center;">
|
||||
<!-- Search Filter-->
|
||||
<mat-form-field class="col-11 search">
|
||||
<input matInput placeholder="{{'CRITERIA.PROJECTS.LIKE'| translate}}" name="projectCriteriaLike"
|
||||
<input matInput placeholder="{{'CRITERIA.GRANTS.LIKE'| translate}}" name="grantCriteriaLike"
|
||||
[formControl]="formGroup.get('like')">
|
||||
<mat-error *ngIf="formGroup.get('like').hasError('backendError')">
|
||||
{{formGroup.get('like').getError('backendError').message}}</mat-error>
|
||||
|
@ -49,18 +49,18 @@
|
|||
</div>
|
||||
<!-- End of Related DMP Filters -->
|
||||
|
||||
<!-- Related Project Filters -->
|
||||
<!-- Related Grant Filters -->
|
||||
<div class="col-10 gray-container">
|
||||
<h6 class="category-title">{{'CRITERIA.DATA-SETS.RELATED-PROJECT' | translate}}</h6>
|
||||
<h6 class="category-title">{{'CRITERIA.DATA-SETS.RELATED-GRANT' | translate}}</h6>
|
||||
<mat-form-field>
|
||||
<app-multiple-auto-complete [formControl]="formGroup.get('projects')"
|
||||
placeholder="{{'CRITERIA.DATA-SETS.SELECT-PROJECTS' | translate }}"
|
||||
[configuration]="projectAutoCompleteConfiguration">
|
||||
<app-multiple-auto-complete [formControl]="formGroup.get('grants')"
|
||||
placeholder="{{'CRITERIA.DATA-SETS.SELECT-GRANTS' | translate }}"
|
||||
[configuration]="grantAutoCompleteConfiguration">
|
||||
</app-multiple-auto-complete>
|
||||
<mat-icon matSuffix class="style-icon">arrow_drop_down</mat-icon>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<!-- End of Related Projects Filters -->
|
||||
<!-- End of Related Grants Filters -->
|
||||
|
||||
<!-- Related Collaborators Filters -->
|
||||
<div class="col-10 gray-container">
|
||||
|
|
|
@ -28,8 +28,8 @@ import { FormGroup, FormBuilder, FormControl } from '@angular/forms';
|
|||
import { MultipleAutoCompleteConfiguration } from '../../../../library/auto-complete/multiple/multiple-auto-complete-configuration';
|
||||
import { OrganisationCriteria } from '../../../../core/query/organisation/organisation-criteria';
|
||||
import { OrganisationService } from '../../../../core/services/organisation/organisation.service';
|
||||
import { ProjectCriteria } from '../../../../core/query/project/project-criteria';
|
||||
import { ProjectService } from '../../../../core/services/project/project.service';
|
||||
import { GrantCriteria } from '../../../../core/query/grant/grant-criteria';
|
||||
import { GrantService } from '../../../../core/services/grant/grant.service';
|
||||
import { UserCriteria } from '../../../../core/query/user/user-criteria';
|
||||
import { UserService } from '../../../../core/services/user/user.service';
|
||||
import { DatasetProfileCriteria } from '../../../../core/query/dataset-profile/dataset-profile-criteria';
|
||||
|
@ -53,7 +53,7 @@ export class DatasetCriteriaComponent extends BaseCriteriaComponent implements O
|
|||
public formGroup = new FormBuilder().group({
|
||||
like: new FormControl(),
|
||||
dmpIds: new FormControl(),
|
||||
projects: new FormControl(),
|
||||
grants: new FormControl(),
|
||||
status: new FormControl(),
|
||||
role: new FormControl(),
|
||||
organisations: new FormControl(),
|
||||
|
@ -91,9 +91,9 @@ export class DatasetCriteriaComponent extends BaseCriteriaComponent implements O
|
|||
titleFn: (item) => item['name']
|
||||
};
|
||||
|
||||
projectAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = {
|
||||
filterFn: this.filterProject.bind(this),
|
||||
initialItems: (excludedItems: any[]) => this.filterProject('').map(result => result.filter(resultItem => excludedItems.map(x => x.id).indexOf(resultItem.id) === -1)),
|
||||
grantAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = {
|
||||
filterFn: this.filterGrant.bind(this),
|
||||
initialItems: (excludedItems: any[]) => this.filterGrant('').map(result => result.filter(resultItem => excludedItems.map(x => x.id).indexOf(resultItem.id) === -1)),
|
||||
displayFn: (item) => item['label'],
|
||||
titleFn: (item) => item['label']
|
||||
};
|
||||
|
@ -115,7 +115,7 @@ export class DatasetCriteriaComponent extends BaseCriteriaComponent implements O
|
|||
private uiNotificationService: UiNotificationService,
|
||||
private router: Router,
|
||||
private language: TranslateService,
|
||||
public projectService: ProjectService,
|
||||
public grantService: GrantService,
|
||||
private organisationService: OrganisationService,
|
||||
private userService: UserService,
|
||||
private datasetService: DatasetService,
|
||||
|
@ -136,7 +136,7 @@ export class DatasetCriteriaComponent extends BaseCriteriaComponent implements O
|
|||
this.formGroup.get('dmpIds').valueChanges
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(x => this.controlModified());
|
||||
this.formGroup.get('projects').valueChanges
|
||||
this.formGroup.get('grants').valueChanges
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(x => this.controlModified());
|
||||
this.formGroup.get('status').valueChanges
|
||||
|
@ -160,7 +160,7 @@ export class DatasetCriteriaComponent extends BaseCriteriaComponent implements O
|
|||
setCriteria(criteria: DatasetCriteria): void {
|
||||
this.formGroup.get('like').patchValue(criteria.like);
|
||||
this.formGroup.get('dmpIds').patchValue(criteria.dmpIds);
|
||||
this.formGroup.get('projects').patchValue(criteria.projects);
|
||||
this.formGroup.get('grants').patchValue(criteria.grants);
|
||||
this.formGroup.get('status').patchValue(criteria.status);
|
||||
this.formGroup.get('role').patchValue(criteria.role);
|
||||
this.formGroup.get('collaborators').patchValue(criteria.collaborators);
|
||||
|
@ -211,13 +211,13 @@ export class DatasetCriteriaComponent extends BaseCriteriaComponent implements O
|
|||
return this.dmpService.getPaged(dmpDataTableRequest, "autocomplete");
|
||||
}
|
||||
|
||||
filterProject(query: string) {
|
||||
filterGrant(query: string) {
|
||||
const fields: Array<string> = new Array<string>();
|
||||
fields.push('asc');
|
||||
const projectRequestItem: DataTableRequest<ProjectCriteria> = new DataTableRequest(0, null, { fields: fields });
|
||||
projectRequestItem.criteria = new ProjectCriteria();
|
||||
projectRequestItem.criteria.like = query;
|
||||
return this.projectService.getPaged(projectRequestItem, "autocomplete").map(x => x.data);
|
||||
const grantRequestItem: DataTableRequest<GrantCriteria> = new DataTableRequest(0, null, { fields: fields });
|
||||
grantRequestItem.criteria = new GrantCriteria();
|
||||
grantRequestItem.criteria.like = query;
|
||||
return this.grantService.getPaged(grantRequestItem, "autocomplete").map(x => x.data);
|
||||
}
|
||||
|
||||
filterOrganisations(value: string) {
|
||||
|
|
|
@ -110,8 +110,8 @@ export class DatasetListingComponent extends BaseComponent implements OnInit, IB
|
|||
if (value.dmpIds) {
|
||||
request.criteria.dmpIds = value.dmpIds.map(x => x.id);
|
||||
}
|
||||
if (value.projects) {
|
||||
request.criteria.projects = value.projects.map(x => x.id);
|
||||
if (value.grants) {
|
||||
request.criteria.grants = value.grants.map(x => x.id);
|
||||
}
|
||||
if (value.organisations) {
|
||||
request.criteria.organisations = value.organisations.map(x => x.id);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col-12 gray-container container-header">
|
||||
<p (click)="$event.stopImmediatePropagation(); projectClicked(dataset)">{{ dataset.projectAbbreviation }}</p>
|
||||
<p (click)="$event.stopImmediatePropagation(); grantClicked(dataset)">{{ dataset.grantAbbreviation }}</p>
|
||||
<!-- <button mat-icon-button [matMenuTriggerFor]="actionsMenu" class="ml-auto"
|
||||
(click)="$event.stopImmediatePropagation();">
|
||||
<mat-icon class="more-horiz">more_horiz</mat-icon>
|
||||
|
@ -36,11 +36,11 @@
|
|||
</mat-icon>
|
||||
<h4 (click)="$event.stopImmediatePropagation(); datasetClicked(dataset)" class="mt-2 ml-1 mr-3 p-1">{{ dataset.dmp }}</h4>
|
||||
|
||||
<mat-icon (click)="$event.stopImmediatePropagation(); projectClicked(dataset)" matTooltip="{{'DATASET-LISTING.TOOLTIP.PROJECT' | translate}}"
|
||||
<mat-icon (click)="$event.stopImmediatePropagation(); grantClicked(dataset)" matTooltip="{{'DATASET-LISTING.TOOLTIP.GRANT' | translate}}"
|
||||
class="gray-icon pt-2">
|
||||
work_outline
|
||||
</mat-icon>
|
||||
<h4 (click)="$event.stopImmediatePropagation(); projectClicked(dataset)" class="mt-2 ml-1 mr-3 p-1">{{ dataset.project }}</h4>
|
||||
<h4 (click)="$event.stopImmediatePropagation(); grantClicked(dataset)" class="mt-2 ml-1 mr-3 p-1">{{ dataset.grant }}</h4>
|
||||
</div>
|
||||
<mat-icon matTooltip="{{'DATASET-LISTING.TOOLTIP.TEMPLATES-INVOLVED' | translate}}" class="gray-icon pt-2">
|
||||
assignment
|
||||
|
@ -54,7 +54,7 @@
|
|||
</div>
|
||||
<!-- <div class="info">
|
||||
<h6>{{ dataset.dmp }}</h6>
|
||||
<p>{{ dataset.project }}</p>
|
||||
<p>{{ dataset.grant }}</p>
|
||||
</div>
|
||||
<div class="row" style="margin-left: 0px !important">
|
||||
<div class="chip">
|
||||
|
|
|
@ -27,8 +27,8 @@ export class DatasetListingItemComponent implements OnInit {
|
|||
this.onClick.emit(this.dataset);
|
||||
}
|
||||
|
||||
projectClicked(dataset: DatasetListingModel) {
|
||||
this.router.navigate(['/projects/edit/' + dataset.projectId]);
|
||||
grantClicked(dataset: DatasetListingModel) {
|
||||
this.router.navigate(['/grants/edit/' + dataset.grantId]);
|
||||
}
|
||||
|
||||
datasetClicked(dataset: DatasetListingModel) {
|
||||
|
|
|
@ -11,8 +11,8 @@ import { AvailableProfilesComponent } from './editor/available-profiles/availabl
|
|||
import { DmpEditorComponent } from './editor/dmp-editor.component';
|
||||
import { DmpFinalizeDialogComponent } from './editor/dmp-finalize-dialog/dmp-finalize-dialog.component';
|
||||
import { DynamicDmpFieldResolverComponent } from './editor/dynamic-field-resolver/dynamic-dmp-field-resolver.component';
|
||||
import { DynamicFieldProjectComponent } from './editor/dynamic-fields-project/dynamic-field-project/dynamic-field-project.component';
|
||||
import { DynamicFieldsProjectComponent } from './editor/dynamic-fields-project/dynamic-fields-project.component';
|
||||
import { DynamicFieldGrantComponent } from './editor/dynamic-fields-grant/dynamic-field-grant/dynamic-field-grant.component';
|
||||
import { DynamicFieldsGrantComponent } from './editor/dynamic-fields-grant/dynamic-fields-grant.component';
|
||||
import { InvitationAcceptedComponent } from './invitation/accepted/dmp-invitation-accepted.component';
|
||||
import { DmpInvitationDialogComponent } from './invitation/dmp-invitation.component';
|
||||
import { DmpCriteriaComponent } from './listing/criteria/dmp-criteria.component';
|
||||
|
@ -25,7 +25,7 @@ import { DmpWizardDatasetListingComponent } from './wizard/listing/dmp-wizard-da
|
|||
import { ExportMethodDialogModule } from '../../library/export-method-dialog/export-method-dialog.module';
|
||||
import { GeneralTabComponent } from './editor/general-tab/general-tab.component';
|
||||
import { PeopleTabComponent } from './editor/people-tab/people-tab.component';
|
||||
import { ProjectTabComponent } from './editor/project-tab/project-tab.component';
|
||||
import { GrantTabComponent } from './editor/grant-tab/grant-tab.component';
|
||||
import { DatasetsTabComponent } from './editor/datasets-tab/datasets-tab.component';
|
||||
import { DmpOverviewModule } from './overview/dmp-overview.module';
|
||||
|
||||
|
@ -54,13 +54,13 @@ import { DmpOverviewModule } from './overview/dmp-overview.module';
|
|||
AvailableProfilesComponent,
|
||||
DmpFinalizeDialogComponent,
|
||||
DynamicDmpFieldResolverComponent,
|
||||
DynamicFieldsProjectComponent,
|
||||
DynamicFieldProjectComponent,
|
||||
DynamicFieldsGrantComponent,
|
||||
DynamicFieldGrantComponent,
|
||||
DmpUploadDialogue,
|
||||
DmpListingItemComponent,
|
||||
GeneralTabComponent,
|
||||
PeopleTabComponent,
|
||||
ProjectTabComponent,
|
||||
GrantTabComponent,
|
||||
DatasetsTabComponent
|
||||
],
|
||||
entryComponents: [
|
||||
|
|
|
@ -22,7 +22,7 @@ const routes: Routes = [
|
|||
},
|
||||
},
|
||||
{
|
||||
path: 'project/:projectId',
|
||||
path: 'grant/:grantId',
|
||||
component: DmpListingComponent,
|
||||
data: {
|
||||
breadcrumb: true
|
||||
|
@ -50,7 +50,7 @@ const routes: Routes = [
|
|||
},
|
||||
},
|
||||
{
|
||||
path: 'new/project/:projectId',
|
||||
path: 'new/grant/:grantId',
|
||||
component: DmpEditorComponent,
|
||||
data: {
|
||||
breadcrumbs: 'new'
|
||||
|
|
|
@ -49,9 +49,9 @@
|
|||
<mat-tab>
|
||||
<ng-template mat-tab-label>
|
||||
<mat-icon class="mr-2">work_outline</mat-icon>
|
||||
{{ 'DMP-LISTING.COLUMNS.PROJECT' | translate }}
|
||||
{{ 'DMP-LISTING.COLUMNS.GRANT' | translate }}
|
||||
</ng-template>
|
||||
<app-project-tab [formGroup]="formGroup.get('project')" [isNew]="isNew" [isFinalized]="isFinalized"></app-project-tab>
|
||||
<app-grant-tab [formGroup]="formGroup.get('grant')" [isNew]="isNew" [isFinalized]="isFinalized"></app-grant-tab>
|
||||
</mat-tab>
|
||||
<mat-tab *ngIf="!isNew">
|
||||
<ng-template mat-tab-label>
|
||||
|
|
|
@ -17,13 +17,13 @@ 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 { ProjectCriteria } from '../../../core/query/project/project-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 { ExternalSourcesService } from '../../../core/services/external-sources/external-sources.service';
|
||||
import { SnackBarNotificationLevel, UiNotificationService } from '../../../core/services/notification/ui-notification-service';
|
||||
import { ProjectService } from '../../../core/services/project/project.service';
|
||||
import { GrantService } from '../../../core/services/grant/grant.service';
|
||||
import { ConfirmationDialogComponent } from '../../../library/confirmation-dialog/confirmation-dialog.component';
|
||||
import { LanguageResolverService } from '../../../services/language-resolver/language-resolver.service';
|
||||
import { BreadcrumbItem } from '../../misc/breadcrumb/definition/breadcrumb-item';
|
||||
|
@ -33,7 +33,7 @@ import { DmpFinalizeDialogComponent, DmpFinalizeDialogInput } from './dmp-finali
|
|||
import { AuthService } from '../../../core/services/auth/auth.service';
|
||||
import { ExportMethodDialogComponent } from '../../../library/export-method-dialog/export-method-dialog.component';
|
||||
import { UserInfoListingModel } from '../../../core/model/user/user-info-listing';
|
||||
import { ProjectTabModel } from './project-tab/project-tab-model';
|
||||
import { GrantTabModel } from './grant-tab/grant-tab-model';
|
||||
|
||||
@Component({
|
||||
selector: 'app-dmp-editor-component',
|
||||
|
@ -63,7 +63,7 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
|
|||
constructor(
|
||||
private dmpProfileService: DmpProfileService,
|
||||
private dmpService: DmpService,
|
||||
private projectService: ProjectService,
|
||||
private grantService: GrantService,
|
||||
private externalSourcesService: ExternalSourcesService,
|
||||
private route: ActivatedRoute,
|
||||
private snackBar: MatSnackBar,
|
||||
|
@ -84,19 +84,19 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
|
|||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe((params: Params) => {
|
||||
const itemId = params['id'];
|
||||
const projectId = params['projectId'];
|
||||
const grantId = params['grantId'];
|
||||
const publicId = params['publicId'];
|
||||
const queryParams = this.route.snapshot.queryParams;
|
||||
const tabToNav = queryParams['tab'];
|
||||
|
||||
const projectRequestItem: RequestItem<ProjectCriteria> = new RequestItem();
|
||||
projectRequestItem.criteria = new ProjectCriteria();
|
||||
const grantRequestItem: RequestItem<GrantCriteria> = new RequestItem();
|
||||
grantRequestItem.criteria = new GrantCriteria();
|
||||
const organisationRequestItem: RequestItem<BaseCriteria> = new RequestItem();
|
||||
organisationRequestItem.criteria = new BaseCriteria();
|
||||
|
||||
// this.projectAutoCompleteConfiguration = {
|
||||
// filterFn: this.searchProject.bind(this),
|
||||
// initialItems: (extraData) => this.searchProject(''),
|
||||
// this.grantAutoCompleteConfiguration = {
|
||||
// filterFn: this.searchGrant.bind(this),
|
||||
// initialItems: (extraData) => this.searchGrant(''),
|
||||
// displayFn: (item) => item['label'],
|
||||
// titleFn: (item) => item['label']
|
||||
// };
|
||||
|
@ -107,7 +107,7 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
|
|||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(async data => {
|
||||
this.dmp = new DmpEditorModel();
|
||||
this.dmp.project = new ProjectTabModel();
|
||||
this.dmp.grant = new GrantTabModel();
|
||||
this.dmp.fromModel(data);
|
||||
this.formGroup = this.dmp.buildForm();
|
||||
//this.registerFormEventsForDmpProfile(this.dmp.definition);
|
||||
|
@ -127,7 +127,7 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
|
|||
parentComponentName: 'DmpListingComponent',
|
||||
label: this.dmp.label,
|
||||
url: '/plans/edit/' + this.dmp.id,
|
||||
// notFoundResolver: [await this.projectService.getSingle(this.dmp.project.id).map(x => ({ label: x.label, url: '/projects/edit/' + x.id }) as BreadcrumbItem).toPromise()]
|
||||
// notFoundResolver: [await this.grantService.getSingle(this.dmp.grant.id).map(x => ({ label: x.label, url: '/grants/edit/' + x.id }) as BreadcrumbItem).toPromise()]
|
||||
}
|
||||
);
|
||||
this.breadCrumbs = Observable.of(breadCrumbs);
|
||||
|
@ -135,17 +135,17 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
|
|||
this.associatedUsers = data.associatedUsers;
|
||||
this.people = data.users;
|
||||
});
|
||||
} else if (projectId != null) {
|
||||
} else if (grantId != null) {
|
||||
this.isNew = true;
|
||||
this.projectService.getSingle(projectId).map(data => data as ProjectTabModel)
|
||||
this.grantService.getSingle(grantId).map(data => data as GrantTabModel)
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(data => {
|
||||
this.dmp = new DmpEditorModel();
|
||||
this.dmp.project = new ProjectTabModel();
|
||||
this.dmp.project = data;
|
||||
this.dmp.grant = new GrantTabModel();
|
||||
this.dmp.grant = data;
|
||||
this.formGroup = this.dmp.buildForm();
|
||||
//this.registerFormEventsForDmpProfile();
|
||||
this.formGroup.get('project').disable();
|
||||
this.formGroup.get('grant').disable();
|
||||
this.registerFormEventsForNewItem();
|
||||
});
|
||||
} else if (publicId != null) {
|
||||
|
@ -155,7 +155,7 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
|
|||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(async data => {
|
||||
this.dmp = new DmpEditorModel();
|
||||
this.dmp.project = new ProjectTabModel();
|
||||
this.dmp.grant = new GrantTabModel();
|
||||
this.dmp.fromModel(data);
|
||||
this.formGroup = this.dmp.buildForm();
|
||||
//this.registerFormEventsForDmpProfile(this.dmp.definition);
|
||||
|
@ -170,7 +170,7 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
|
|||
// parentComponentName: 'DmpListingComponent',
|
||||
// label: this.language.instant('NAV-BAR.MY-DMPS'),
|
||||
// url: 'plans',
|
||||
// notFoundResolver: [await this.projectService.getSingle(this.dmp.project.id).map(x => ({ label: x.label, url: '/projects/edit/' + x.id }) as BreadcrumbItem).toPromise()]
|
||||
// notFoundResolver: [await this.grantService.getSingle(this.dmp.grant.id).map(x => ({ label: x.label, url: '/grants/edit/' + x.id }) as BreadcrumbItem).toPromise()]
|
||||
// }]
|
||||
// );
|
||||
this.associatedUsers = data.associatedUsers;
|
||||
|
@ -178,7 +178,7 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
|
|||
});
|
||||
} else {
|
||||
this.dmp = new DmpEditorModel();
|
||||
this.dmp.project = new ProjectTabModel();
|
||||
this.dmp.grant = new GrantTabModel();
|
||||
this.formGroup = this.dmp.buildForm();
|
||||
this.registerFormEventsForNewItem();
|
||||
if (this.isAuthenticated) {
|
||||
|
@ -229,11 +229,11 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
|
|||
return this.dmpProfileService.getPaged(request).map(x => x.data);
|
||||
}
|
||||
|
||||
// searchProject(query: string) {
|
||||
// const projectRequestItem: RequestItem<ProjectCriteria> = new RequestItem();
|
||||
// projectRequestItem.criteria = new ProjectCriteria();
|
||||
// projectRequestItem.criteria.like = query;
|
||||
// return this.projectService.getWithExternal(projectRequestItem);
|
||||
// searchGrant(query: string) {
|
||||
// const grantRequestItem: RequestItem<GrantCriteria> = new RequestItem();
|
||||
// grantRequestItem.criteria = new GrantCriteria();
|
||||
// grantRequestItem.criteria.like = query;
|
||||
// return this.grantService.getWithExternal(grantRequestItem);
|
||||
// }
|
||||
|
||||
formSubmit(showAddDatasetDialog?: boolean): void {
|
||||
|
@ -319,8 +319,8 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
|
|||
return item['label'];
|
||||
}
|
||||
|
||||
redirectToProject() {
|
||||
this.router.navigate(['projects/edit/' + this.dmp.project.id]);
|
||||
redirectToGrant() {
|
||||
this.router.navigate(['grants/edit/' + this.dmp.grant.id]);
|
||||
}
|
||||
|
||||
redirectToDatasets() {
|
||||
|
|
|
@ -8,13 +8,13 @@ import { DmpModel } from "../../../core/model/dmp/dmp";
|
|||
import { DmpDynamicField } from "../../../core/model/dmp/dmp-dynamic-field";
|
||||
import { DmpDynamicFieldDependency } from "../../../core/model/dmp/dmp-dynamic-field-dependency";
|
||||
import { OrganizationModel } from "../../../core/model/organisation/organization";
|
||||
import { ProjectListingModel } from "../../../core/model/project/project-listing";
|
||||
import { GrantListingModel } from "../../../core/model/grant/grant-listing";
|
||||
import { ResearcherModel } from "../../../core/model/researcher/researcher";
|
||||
import { UserModel } from "../../../core/model/user/user";
|
||||
import { ValidJsonValidator } from "../../../library/auto-complete/auto-complete-custom-validator";
|
||||
import { UserInfoListingModel } from "../../../core/model/user/user-info-listing";
|
||||
import { DatasetModel } from "../../../core/model/dataset/dataset";
|
||||
import { ProjectTabModel } from "./project-tab/project-tab-model";
|
||||
import { GrantTabModel } from "./grant-tab/grant-tab-model";
|
||||
import { DmpProfileExternalAutoCompleteFieldDataEditorModel } from "../../admin/dmp-profile/editor/external-autocomplete/dmp-profile-external-autocomplete-field-editor.model";
|
||||
import { DmpProfileType } from "../../../core/common/enum/dmp-profile-type";
|
||||
import { DmpProfileFieldDataType } from "../../../core/common/enum/dmp-profile-field-type";
|
||||
|
@ -30,7 +30,7 @@ export class DmpEditorModel {
|
|||
public creator: UserModel;
|
||||
public status: Status = Status.Active;
|
||||
public description: String;
|
||||
public project: ProjectTabModel;
|
||||
public grant: GrantTabModel;
|
||||
public organisations: OrganizationModel[] = [];
|
||||
public researchers: ResearcherModel[] = [];
|
||||
public profiles: DmpProfile[] = [];
|
||||
|
@ -51,7 +51,7 @@ export class DmpEditorModel {
|
|||
this.status = item.status;
|
||||
this.lockable = item.lockable;
|
||||
this.description = item.description;
|
||||
this.project.fromModel(item.project);
|
||||
this.grant.fromModel(item.grant);
|
||||
this.organisations = item.organisations;
|
||||
this.researchers = item.researchers;
|
||||
this.profiles = item.profiles;
|
||||
|
@ -76,7 +76,7 @@ export class DmpEditorModel {
|
|||
version: [{ value: this.version, disabled: disabled }, context.getValidation('version').validators],
|
||||
status: [{ value: this.status, disabled: disabled }, context.getValidation('status').validators],
|
||||
description: [{ value: this.description, disabled: disabled }],
|
||||
project: this.project.buildForm(),
|
||||
grant: this.grant.buildForm(),
|
||||
organisations: [{ value: this.organisations, disabled: disabled }, context.getValidation('organisations').validators],
|
||||
researchers: [{ value: this.researchers, disabled: disabled }, context.getValidation('researchers').validators],
|
||||
profiles: [{ value: this.profiles, disabled: disabled }, context.getValidation('profiles').validators],
|
||||
|
@ -111,7 +111,7 @@ export class DmpEditorModel {
|
|||
baseContext.validation.push({ key: 'version', validators: [BackendErrorValidator(this.validationErrorModel, 'version')] });
|
||||
baseContext.validation.push({ key: 'status', validators: [Validators.required, BackendErrorValidator(this.validationErrorModel, 'status')] });
|
||||
baseContext.validation.push({ key: 'description', validators: [Validators.required, BackendErrorValidator(this.validationErrorModel, 'description')] });
|
||||
baseContext.validation.push({ key: 'project', validators: [Validators.required, BackendErrorValidator(this.validationErrorModel, 'project')] });
|
||||
baseContext.validation.push({ key: 'grant', validators: [Validators.required, BackendErrorValidator(this.validationErrorModel, 'grant')] });
|
||||
baseContext.validation.push({ key: 'organisations', validators: [BackendErrorValidator(this.validationErrorModel, 'organisations')] });
|
||||
baseContext.validation.push({ key: 'researchers', validators: [BackendErrorValidator(this.validationErrorModel, 'researchers')] });
|
||||
baseContext.validation.push({ key: 'profiles', validators: [Validators.required, ValidJsonValidator, BackendErrorValidator(this.validationErrorModel, 'profiles')] });
|
||||
|
|
|
@ -3,14 +3,14 @@ import { FormGroup } from '@angular/forms';
|
|||
import { RequestItem } from '../../../../../core/query/request-item';
|
||||
import { DmpService } from '../../../../../core/services/dmp/dmp.service';
|
||||
import { SingleAutoCompleteConfiguration } from '../../../../../library/auto-complete/single/single-auto-complete-configuration';
|
||||
import { DynamicFieldProjectCriteria, DynamicFieldProjectCriteriaDependencies } from '../../../../../models/dynamic-field-project/DynamicFieldProjectCriteria';
|
||||
import { DynamicFieldGrantCriteria, DynamicFieldGrantCriteriaDependencies } from '../../../../../models/dynamic-field-grant/DynamicFieldGrantCriteria';
|
||||
|
||||
@Component({
|
||||
selector: 'app-dynamic-field-project',
|
||||
templateUrl: 'dynamic-field-project.component.html',
|
||||
styleUrls: ['./dynamic-field-project.component.scss']
|
||||
selector: 'app-dynamic-field-grant',
|
||||
templateUrl: 'dynamic-field-grant.component.html',
|
||||
styleUrls: ['./dynamic-field-grant.component.scss']
|
||||
})
|
||||
export class DynamicFieldProjectComponent implements OnInit {
|
||||
export class DynamicFieldGrantComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private dmpService: DmpService
|
||||
|
@ -34,7 +34,7 @@ export class DynamicFieldProjectComponent implements OnInit {
|
|||
}
|
||||
|
||||
searchDynamicField(query: string) {
|
||||
const requestItem = new RequestItem<DynamicFieldProjectCriteria>();
|
||||
const requestItem = new RequestItem<DynamicFieldGrantCriteria>();
|
||||
requestItem.criteria = { id: this.formGroup.get('id').value, dynamicFields: this.buildDependencies() };
|
||||
return this.dmpService.getDynamicField(requestItem);
|
||||
}
|
||||
|
@ -61,15 +61,15 @@ export class DynamicFieldProjectComponent implements OnInit {
|
|||
}
|
||||
|
||||
updateConfiguration() {
|
||||
// const requestItem = new RequestItem<DynamicFieldProjectCriteria>();
|
||||
// const requestItem = new RequestItem<DynamicFieldGrantCriteria>();
|
||||
// requestItem.criteria = { id: this.formGroup.get('id').value, dynamicFields: this.buildDependencies() };
|
||||
// this.autoCompleteConfiguration = new AutoCompleteConfiguration(this.dmpService.getDynamicField.bind(this.dmpService), requestItem);
|
||||
// this.autocomplete.inputData = this.autoCompleteConfiguration;
|
||||
}
|
||||
|
||||
buildDependencies(): Array<DynamicFieldProjectCriteriaDependencies> {
|
||||
buildDependencies(): Array<DynamicFieldGrantCriteriaDependencies> {
|
||||
if (!this.dependencies || this.dependencies.length === 0) { return []; }
|
||||
const dependencies = new Array<DynamicFieldProjectCriteriaDependencies>();
|
||||
const dependencies = new Array<DynamicFieldGrantCriteriaDependencies>();
|
||||
for (let i = 0; i < this.dependencies.length; i++) {
|
||||
dependencies.push({ property: this.dependencies[i].get('id').value, value: this.assignFunction(this.dependencies[i].get('value').value) });
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
<div *ngIf="formGroup" [formGroup]="formGroup">
|
||||
<div formArrayName="dynamicFields">
|
||||
<div *ngFor="let control of formGroup.get('dynamicFields');let i = index;">
|
||||
<app-dynamic-field-project [formGroup]="control" [dependencies]="findDependencies(i)"></app-dynamic-field-project>
|
||||
<app-dynamic-field-grant [formGroup]="control" [dependencies]="findDependencies(i)"></app-dynamic-field-grant>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -3,11 +3,11 @@ import { FormArray, FormGroup } from '@angular/forms';
|
|||
import { DmpDynamicFieldDependency } from '../../../../core/model/dmp/dmp-dynamic-field-dependency';
|
||||
|
||||
@Component({
|
||||
selector: 'app-dynamic-fields-project',
|
||||
templateUrl: 'dynamic-fields-project.component.html',
|
||||
styleUrls: ['./dynamic-fields-project.component.scss']
|
||||
selector: 'app-dynamic-fields-grant',
|
||||
templateUrl: 'dynamic-fields-grant.component.html',
|
||||
styleUrls: ['./dynamic-fields-grant.component.scss']
|
||||
})
|
||||
export class DynamicFieldsProjectComponent implements OnInit {
|
||||
export class DynamicFieldsGrantComponent implements OnInit {
|
||||
|
||||
@Input()
|
||||
formGroup: FormGroup;
|
|
@ -1,23 +1,23 @@
|
|||
import { Status } from "../../../../core/common/enum/Status";
|
||||
import { ProjectListingModel } from "../../../../core/model/project/project-listing";
|
||||
import { GrantListingModel } from "../../../../core/model/grant/grant-listing";
|
||||
import { ValidationErrorModel } from "../../../../common/forms/validation/error-model/validation-error-model";
|
||||
import { ProjectEditorWizardModel } from "../../../quick-wizard/project-editor/project-editor-wizard-model";
|
||||
import { GrantEditorWizardModel } from "../../../quick-wizard/grant-editor/grant-editor-wizard-model";
|
||||
import { ValidationContext } from "../../../../common/forms/validation/validation-context";
|
||||
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
|
||||
import { BackendErrorValidator } from "../../../../common/forms/validation/custom-validator";
|
||||
import { ValidJsonValidator } from "../../../../library/auto-complete/auto-complete-custom-validator";
|
||||
|
||||
export class ProjectTabModel {
|
||||
export class GrantTabModel {
|
||||
public id: string;
|
||||
public label?: string;
|
||||
public status: Status = Status.Active;
|
||||
public description: String;
|
||||
public existProject: ProjectListingModel;
|
||||
public existGrant: GrantListingModel;
|
||||
public validationErrorModel: ValidationErrorModel = new ValidationErrorModel();
|
||||
|
||||
|
||||
fromModel(item: ProjectListingModel): ProjectTabModel {
|
||||
this.existProject = item;
|
||||
fromModel(item: GrantListingModel): GrantTabModel {
|
||||
this.existGrant = item;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ export class ProjectTabModel {
|
|||
label: [{ value: this.label, disabled: disabled }, context.getValidation('label').validators],
|
||||
status: [{ value: this.status, disabled: disabled }, context.getValidation('status').validators],
|
||||
description: [{ value: this.description, disabled: disabled }, context.getValidation('description').validators],
|
||||
existProject: [{ value: this.existProject, disabled: disabled }, context.getValidation('existProject').validators],
|
||||
existGrant: [{ value: this.existGrant, disabled: disabled }, context.getValidation('existGrant').validators],
|
||||
});
|
||||
return formGroup;
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ export class ProjectTabModel {
|
|||
baseContext.validation.push({ key: 'label', validators: [Validators.required, BackendErrorValidator(this.validationErrorModel, 'label')] });
|
||||
baseContext.validation.push({ key: 'status', validators: [] });
|
||||
baseContext.validation.push({ key: 'description', validators: [Validators.required, BackendErrorValidator(this.validationErrorModel, 'description')] });
|
||||
baseContext.validation.push({ key: 'existProject', validators: [Validators.required, ValidJsonValidator, BackendErrorValidator(this.validationErrorModel, 'existProject')] });
|
||||
baseContext.validation.push({ key: 'existGrant', validators: [Validators.required, ValidJsonValidator, BackendErrorValidator(this.validationErrorModel, 'existGrant')] });
|
||||
return baseContext;
|
||||
}
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
<div class="container-fluid">
|
||||
<form *ngIf="formGroup" [formGroup]="formGroup">
|
||||
|
||||
<!-- Toggle Between Add Project or Use Existing -->
|
||||
<!-- Toggle Between Add Grant or Use Existing -->
|
||||
<div class="row" *ngIf="!isFinalized">
|
||||
<div class="col-12 add-project" *ngIf="isCreateNew" (click)="create()">
|
||||
<div class="col-12 add-grant" *ngIf="isCreateNew" (click)="create()">
|
||||
<mat-icon>keyboard_backspace</mat-icon>
|
||||
<span>{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.ACTIONS.EXIST' | translate}}</span>
|
||||
</div>
|
||||
<div class="col-12 add-project" *ngIf="!isCreateNew" (click)="create()">
|
||||
<div class="col-12 add-grant" *ngIf="!isCreateNew" (click)="create()">
|
||||
<mat-icon>add</mat-icon>
|
||||
<span>{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.ACTIONS.CREATE-NEW' | translate}}</span>
|
||||
</div>
|
||||
|
@ -17,16 +17,16 @@
|
|||
<div class="row" *ngIf="!isCreateNew">
|
||||
<div class="col-6 pb-4 pl-4 pt-2">
|
||||
<mat-form-field>
|
||||
<app-single-auto-complete required='true' [formControl]="formGroup.get('existProject')"
|
||||
<app-single-auto-complete required='true' [formControl]="formGroup.get('existGrant')"
|
||||
placeholder="{{this.languageResolverService.getBy('dmpEditor') | translate}}"
|
||||
[configuration]="projectAutoCompleteConfiguration">
|
||||
[configuration]="grantAutoCompleteConfiguration">
|
||||
</app-single-auto-complete>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <app-dynamic-fields-project [formGroup]="formGroup"></app-dynamic-fields-project> -->
|
||||
<!-- <app-dynamic-fields-grant [formGroup]="formGroup"></app-dynamic-fields-grant> -->
|
||||
|
||||
<!-- Create New Project -->
|
||||
<!-- Create New Grant -->
|
||||
<div class="row" *ngIf="isCreateNew">
|
||||
<div class="col-6 pb-4 pl-4">
|
||||
<mat-form-field class="col-md-12">
|
|
@ -1,4 +1,4 @@
|
|||
.add-project {
|
||||
.add-grant {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 1.5em;
|
|
@ -2,39 +2,39 @@ import { Component, OnInit, Input } from '@angular/core';
|
|||
import { FormGroup } from '@angular/forms';
|
||||
import { SingleAutoCompleteConfiguration } from '../../../../library/auto-complete/single/single-auto-complete-configuration';
|
||||
import { RequestItem } from '../../../../core/query/request-item';
|
||||
import { ProjectCriteria } from '../../../../core/query/project/project-criteria';
|
||||
import { ProjectService } from '../../../../core/services/project/project.service';
|
||||
import { GrantCriteria } from '../../../../core/query/grant/grant-criteria';
|
||||
import { GrantService } from '../../../../core/services/grant/grant.service';
|
||||
import { LanguageResolverService } from '../../../../services/language-resolver/language-resolver.service';
|
||||
import { ProjectTabModel } from './project-tab-model';
|
||||
import { GrantTabModel } from './grant-tab-model';
|
||||
|
||||
@Component({
|
||||
selector: 'app-project-tab',
|
||||
templateUrl: './project-tab.component.html',
|
||||
styleUrls: ['./project-tab.component.scss']
|
||||
selector: 'app-grant-tab',
|
||||
templateUrl: './grant-tab.component.html',
|
||||
styleUrls: ['./grant-tab.component.scss']
|
||||
})
|
||||
export class ProjectTabComponent implements OnInit {
|
||||
export class GrantTabComponent implements OnInit {
|
||||
|
||||
@Input() formGroup: FormGroup;
|
||||
@Input() isNew: boolean;
|
||||
@Input() isFinalized: boolean;
|
||||
isCreateNew = false;
|
||||
project: ProjectTabModel;
|
||||
grant: GrantTabModel;
|
||||
|
||||
projectAutoCompleteConfiguration: SingleAutoCompleteConfiguration;
|
||||
grantAutoCompleteConfiguration: SingleAutoCompleteConfiguration;
|
||||
|
||||
constructor(
|
||||
private projectService: ProjectService,
|
||||
private grantService: GrantService,
|
||||
public languageResolverService: LanguageResolverService
|
||||
) { }
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
const projectRequestItem: RequestItem<ProjectCriteria> = new RequestItem();
|
||||
projectRequestItem.criteria = new ProjectCriteria();
|
||||
const grantRequestItem: RequestItem<GrantCriteria> = new RequestItem();
|
||||
grantRequestItem.criteria = new GrantCriteria();
|
||||
|
||||
this.projectAutoCompleteConfiguration = {
|
||||
filterFn: this.searchProject.bind(this),
|
||||
initialItems: (extraData) => this.searchProject(''),
|
||||
this.grantAutoCompleteConfiguration = {
|
||||
filterFn: this.searchGrant.bind(this),
|
||||
initialItems: (extraData) => this.searchGrant(''),
|
||||
displayFn: (item) => item['label'],
|
||||
titleFn: (item) => item['label']
|
||||
};
|
||||
|
@ -43,11 +43,11 @@ export class ProjectTabComponent implements OnInit {
|
|||
this.setValidators();
|
||||
}
|
||||
|
||||
searchProject(query: string) {
|
||||
const projectRequestItem: RequestItem<ProjectCriteria> = new RequestItem();
|
||||
projectRequestItem.criteria = new ProjectCriteria();
|
||||
projectRequestItem.criteria.like = query;
|
||||
return this.projectService.getWithExternal(projectRequestItem);
|
||||
searchGrant(query: string) {
|
||||
const grantRequestItem: RequestItem<GrantCriteria> = new RequestItem();
|
||||
grantRequestItem.criteria = new GrantCriteria();
|
||||
grantRequestItem.criteria.like = query;
|
||||
return this.grantService.getWithExternal(grantRequestItem);
|
||||
}
|
||||
|
||||
create() {
|
||||
|
@ -57,16 +57,16 @@ export class ProjectTabComponent implements OnInit {
|
|||
|
||||
setValidators() {
|
||||
if (this.isCreateNew) {
|
||||
this.formGroup.get('existProject').disable();
|
||||
this.formGroup.get('existGrant').disable();
|
||||
this.formGroup.get('label').enable();
|
||||
this.formGroup.get('description').enable();
|
||||
} else if (this.isFinalized) {
|
||||
this.formGroup.get('existProject').disable();
|
||||
this.formGroup.get('existGrant').disable();
|
||||
this.formGroup.get('label').disable();
|
||||
this.formGroup.get('description').disable();
|
||||
}
|
||||
else {
|
||||
this.formGroup.get('existProject').enable();
|
||||
this.formGroup.get('existGrant').enable();
|
||||
this.formGroup.get('label').disable();
|
||||
this.formGroup.get('label').reset();
|
||||
this.formGroup.get('description').disable();
|
|
@ -13,7 +13,7 @@
|
|||
<!-- End of Search Filter -->
|
||||
|
||||
<!-- Visibility Filter-->
|
||||
<div *ngIf="showProject" class="col-10 gray-container">
|
||||
<div *ngIf="showGrant" class="col-10 gray-container">
|
||||
<h6 class="category-title">{{ 'TYPES.DMP-VISIBILITY.VISIBILITY' | translate }}</h6>
|
||||
<mat-radio-group aria-label="Select an option" [formControl]="formGroup.get('status')">
|
||||
<mat-list-item><mat-radio-button value="null">{{ 'TYPES.DMP-VISIBILITY.ANY' | translate }}</mat-radio-button></mat-list-item>
|
||||
|
@ -25,7 +25,7 @@
|
|||
<!-- End of Visibility Filter-->
|
||||
|
||||
<!-- Related Dataset Templates Filter -->
|
||||
<div *ngIf="showProject" class="col-10 gray-container">
|
||||
<div *ngIf="showGrant" class="col-10 gray-container">
|
||||
<h6 class="category-title">{{ 'CRITERIA.DMP.RELATED-DATASET-TEMPLATES' | translate}}</h6>
|
||||
<mat-form-field>
|
||||
<app-multiple-auto-complete [formControl]="formGroup.get('datasetTemplates')"
|
||||
|
@ -37,21 +37,21 @@
|
|||
</div>
|
||||
<!-- End of Related Dataset Templates Filter -->
|
||||
|
||||
<!-- Related Project Filters -->
|
||||
<div *ngIf="showProject" class="col-10 gray-container">
|
||||
<h6 class="category-title">{{ 'DMP-RELATED-PROJECT.RELATED-PROJECT' | translate}}</h6>
|
||||
<!-- Related Grant Filters -->
|
||||
<div *ngIf="showGrant" class="col-10 gray-container">
|
||||
<h6 class="category-title">{{ 'DMP-RELATED-GRANT.RELATED-GRANT' | translate}}</h6>
|
||||
<mat-form-field>
|
||||
<app-multiple-auto-complete [formControl]="formGroup.get('projects')"
|
||||
placeholder="{{ 'CRITERIA.DMP.SELECT-PROJECTS' | translate }}"
|
||||
[configuration]="projectAutoCompleteConfiguration">
|
||||
<app-multiple-auto-complete [formControl]="formGroup.get('grants')"
|
||||
placeholder="{{ 'CRITERIA.DMP.SELECT-GRANTS' | translate }}"
|
||||
[configuration]="grantAutoCompleteConfiguration">
|
||||
</app-multiple-auto-complete>
|
||||
<mat-icon matSuffix class="style-icon">arrow_drop_down</mat-icon>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<!-- End of Related Projects Filters -->
|
||||
<!-- End of Related Grants Filters -->
|
||||
|
||||
<!-- Collaborators Filter -->
|
||||
<div *ngIf="showProject" class="col-10 gray-container">
|
||||
<div *ngIf="showGrant" class="col-10 gray-container">
|
||||
<h6 class="category-title">{{ 'CRITERIA.DMP.RELATED-COLLABORATORS' | translate}}</h6>
|
||||
<mat-form-field>
|
||||
<app-multiple-auto-complete [formControl]="formGroup.get('collaborators')"
|
||||
|
@ -64,7 +64,7 @@
|
|||
<!-- End of Collaborators Filter -->
|
||||
|
||||
<!-- Role Filter -->
|
||||
<div *ngIf="showProject" class="col-10 gray-container">
|
||||
<div *ngIf="showGrant" class="col-10 gray-container">
|
||||
<h6 class="category-title">{{ 'DATASET-PROFILE-LISTING.COLUMNS.ROLE' | translate }}</h6>
|
||||
<mat-radio-group aria-label="Select an option" [formControl]="formGroup.get('role')">
|
||||
<mat-list-item><mat-radio-button value="null">{{ 'TYPES.DATASET-ROLE.ANY' | translate }}</mat-radio-button></mat-list-item>
|
||||
|
@ -75,7 +75,7 @@
|
|||
<!-- End of Role Filter -->
|
||||
|
||||
<!-- Related Organization Filter -->
|
||||
<div *ngIf="showProject" class="col-10 gray-container">
|
||||
<div *ngIf="showGrant" class="col-10 gray-container">
|
||||
<h6 class="category-title">{{ 'DMP-RELATED-ORGANIZATION.RELATED-ORGANIZATION' | translate }}</h6>
|
||||
<mat-form-field>
|
||||
<app-multiple-auto-complete [formControl]="formGroup.get('organisations')"
|
||||
|
|
|
@ -5,14 +5,14 @@ import { TranslateService } from '@ngx-translate/core';
|
|||
import { takeUntil } from 'rxjs/operators';
|
||||
import { ValidationErrorModel } from '../../../../common/forms/validation/error-model/validation-error-model';
|
||||
import { DataTableRequest } from '../../../../core/model/data-table/data-table-request';
|
||||
import { ProjectListingModel } from '../../../../core/model/project/project-listing';
|
||||
import { GrantListingModel } from '../../../../core/model/grant/grant-listing';
|
||||
import { DmpCriteria } from '../../../../core/query/dmp/dmp-criteria';
|
||||
import { OrganisationCriteria } from '../../../../core/query/organisation/organisation-criteria';
|
||||
import { ProjectCriteria } from '../../../../core/query/project/project-criteria';
|
||||
import { GrantCriteria } from '../../../../core/query/grant/grant-criteria';
|
||||
import { UserCriteria } from '../../../../core/query/user/user-criteria';
|
||||
import { DmpService } from '../../../../core/services/dmp/dmp.service';
|
||||
import { OrganisationService } from '../../../../core/services/organisation/organisation.service';
|
||||
import { ProjectService } from '../../../../core/services/project/project.service';
|
||||
import { GrantService } from '../../../../core/services/grant/grant.service';
|
||||
import { UserService } from '../../../../core/services/user/user.service';
|
||||
import { MultipleAutoCompleteConfiguration } from '../../../../library/auto-complete/multiple/multiple-auto-complete-configuration';
|
||||
import { BaseCriteriaComponent } from '../../../misc/criteria/base-criteria.component';
|
||||
|
@ -27,16 +27,16 @@ import { DatasetProfileService } from '../../../../core/services/dataset-profile
|
|||
})
|
||||
export class DmpCriteriaComponent extends BaseCriteriaComponent implements OnInit {
|
||||
|
||||
@Input() showProject: boolean;
|
||||
filteringProjectsAsync = false;
|
||||
@Input() showGrant: boolean;
|
||||
filteringGrantsAsync = false;
|
||||
sizeError = false;
|
||||
maxFileSize: number = 1048576;
|
||||
filteringOrganisationsAsync = false;
|
||||
|
||||
filteredProjects: ProjectListingModel[];
|
||||
filteredGrants: GrantListingModel[];
|
||||
public formGroup = new FormBuilder().group({
|
||||
like: new FormControl(),
|
||||
projects: new FormControl(),
|
||||
grants: new FormControl(),
|
||||
status: new FormControl(),
|
||||
role: new FormControl,
|
||||
organisations: new FormControl(),
|
||||
|
@ -59,9 +59,9 @@ export class DmpCriteriaComponent extends BaseCriteriaComponent implements OnIni
|
|||
subtitleFn: (item) => item['description']
|
||||
};
|
||||
|
||||
projectAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = {
|
||||
filterFn: this.filterProject.bind(this),
|
||||
initialItems: (excludedItems: any[]) => this.filterProject('').map(result => result.filter(resultItem => excludedItems.map(x => x.id).indexOf(resultItem.id) === -1)),
|
||||
grantAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = {
|
||||
filterFn: this.filterGrant.bind(this),
|
||||
initialItems: (excludedItems: any[]) => this.filterGrant('').map(result => result.filter(resultItem => excludedItems.map(x => x.id).indexOf(resultItem.id) === -1)),
|
||||
displayFn: (item) => item['label'],
|
||||
titleFn: (item) => item['label']
|
||||
};
|
||||
|
@ -75,7 +75,7 @@ export class DmpCriteriaComponent extends BaseCriteriaComponent implements OnIni
|
|||
|
||||
constructor(
|
||||
public language: TranslateService,
|
||||
public projectService: ProjectService,
|
||||
public grantService: GrantService,
|
||||
private dmpService: DmpService,
|
||||
public formBuilder: FormBuilder,
|
||||
private dialog: MatDialog,
|
||||
|
@ -97,7 +97,7 @@ export class DmpCriteriaComponent extends BaseCriteriaComponent implements OnIni
|
|||
this.formGroup.get('status').valueChanges
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(x => this.controlModified());
|
||||
this.formGroup.get('projects').valueChanges
|
||||
this.formGroup.get('grants').valueChanges
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(x => this.controlModified());
|
||||
this.formGroup.get('like').valueChanges
|
||||
|
@ -114,7 +114,7 @@ export class DmpCriteriaComponent extends BaseCriteriaComponent implements OnIni
|
|||
|
||||
setCriteria(criteria: DmpCriteria): void {
|
||||
this.formGroup.get('like').patchValue(criteria.like);
|
||||
this.formGroup.get('projects').patchValue(criteria.projects);
|
||||
this.formGroup.get('grants').patchValue(criteria.grants);
|
||||
this.formGroup.get('status').patchValue(criteria.status);
|
||||
this.formGroup.get('role').patchValue(criteria.role);
|
||||
this.formGroup.get('collaborators').patchValue(criteria.collaborators);
|
||||
|
@ -134,13 +134,13 @@ export class DmpCriteriaComponent extends BaseCriteriaComponent implements OnIni
|
|||
}
|
||||
}
|
||||
|
||||
filterProject(query: string) {
|
||||
filterGrant(query: string) {
|
||||
const fields: Array<string> = new Array<string>();
|
||||
fields.push('asc');
|
||||
const projectRequestItem: DataTableRequest<ProjectCriteria> = new DataTableRequest(0, null, { fields: fields });
|
||||
projectRequestItem.criteria = new ProjectCriteria();
|
||||
projectRequestItem.criteria.like = query;
|
||||
return this.projectService.getPaged(projectRequestItem, "autocomplete").map(x => x.data);
|
||||
const grantRequestItem: DataTableRequest<GrantCriteria> = new DataTableRequest(0, null, { fields: fields });
|
||||
grantRequestItem.criteria = new GrantCriteria();
|
||||
grantRequestItem.criteria.like = query;
|
||||
return this.grantService.getPaged(grantRequestItem, "autocomplete").map(x => x.data);
|
||||
}
|
||||
|
||||
filterOrganisations(value: string) {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<!-- <p class="card-category">{{'DMP-LISTING.SUBTITLE' | translate}}</p> -->
|
||||
</div>
|
||||
<div class="d-flex align-items-center ml-auto p-2">
|
||||
<button mat-raised-button color="primary" class="text-uppercase lightblue-btn mr-2" [routerLink]="projectId ? ['/plans/new/project/', projectId] : ['./new']">
|
||||
<button mat-raised-button color="primary" class="text-uppercase lightblue-btn mr-2" [routerLink]="grantId ? ['/plans/new/grant/', grantId] : ['./new']">
|
||||
<mat-icon>add</mat-icon> {{'DMP-LISTING.ACTIONS.NEW' | translate}}
|
||||
</button>
|
||||
<button mat-raised-button color="primary" class="text-uppercase lightblue-btn" [routerLink]="['/quick-wizard']">
|
||||
|
@ -18,7 +18,7 @@
|
|||
<div class="card-body table-responsive">
|
||||
<div class="listing row">
|
||||
<div class="col-3">
|
||||
<app-dmp-criteria-component [showProject]="showProject" class="col-auto"></app-dmp-criteria-component>
|
||||
<app-dmp-criteria-component [showGrant]="showGrant" class="col-auto"></app-dmp-criteria-component>
|
||||
</div>
|
||||
<div class="col-9 pt-4">
|
||||
<!-- <mat-paginator #paginator [length]="totalCount" [pageSizeOptions]="[10, 25, 100]" (page)="pageThisEvent($event)" class="top-paginator"></mat-paginator> -->
|
||||
|
@ -41,10 +41,10 @@
|
|||
<mat-cell *matCellDef="let row">{{row.label}}</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container cdkColumnDef="project">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header="|join|project:label">{{'DMP-LISTING.COLUMNS.PROJECT' |
|
||||
<ng-container cdkColumnDef="grant">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header="|join|grant:label">{{'DMP-LISTING.COLUMNS.GRANT' |
|
||||
translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.project}} </mat-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.grant}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container cdkColumnDef="status">
|
||||
|
|
|
@ -6,7 +6,7 @@ import { takeUntil } from 'rxjs/operators';
|
|||
import { BaseComponent } from '../../../core/common/base/base.component';
|
||||
import { DataTableRequest } from '../../../core/model/data-table/data-table-request';
|
||||
import { DmpListingModel } from '../../../core/model/dmp/dmp-listing';
|
||||
import { ProjectListingModel } from '../../../core/model/project/project-listing';
|
||||
import { GrantListingModel } from '../../../core/model/grant/grant-listing';
|
||||
import { DmpCriteria } from '../../../core/query/dmp/dmp-criteria';
|
||||
import { DmpService } from '../../../core/services/dmp/dmp.service';
|
||||
import { EnumUtils } from '../../../core/services/utilities/enum-utils.service';
|
||||
|
@ -29,8 +29,8 @@ export class DmpListingComponent extends BaseComponent implements OnInit, IBread
|
|||
|
||||
breadCrumbs: Observable<BreadcrumbItem[]> = Observable.of([{ parentComponentName: null, label: 'DMPs', url: "/plans" }]);
|
||||
itemId: string;
|
||||
projectId: string;
|
||||
showProject: boolean;
|
||||
grantId: string;
|
||||
showGrant: boolean;
|
||||
titlePrefix: string;
|
||||
totalCount: number;
|
||||
listingItems: DmpListingModel[] = [];
|
||||
|
@ -50,21 +50,21 @@ export class DmpListingComponent extends BaseComponent implements OnInit, IBread
|
|||
this.route.params
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(async params => {
|
||||
let projectLabel;
|
||||
if (params['projectId']) {
|
||||
this.projectId = params['projectId'];
|
||||
this.showProject = false;
|
||||
const project: ProjectListingModel = {
|
||||
id: this.projectId
|
||||
let grantLabel;
|
||||
if (params['grantId']) {
|
||||
this.grantId = params['grantId'];
|
||||
this.showGrant = false;
|
||||
const grant: GrantListingModel = {
|
||||
id: this.grantId
|
||||
}
|
||||
this.criteria.setCriteria({ like: null, projects: [project], groupIds: null, allVersions: false });
|
||||
this.criteria.setCriteria({ like: null, grants: [grant], groupIds: null, allVersions: false });
|
||||
this.refresh();
|
||||
projectLabel = this.route.snapshot.queryParams.projectLabel;
|
||||
// this.breadCrumbs = Observable.of([{ parentComponentName: 'ProjectEditorComponent', label: projectLabel, url: '/projects/edit/' + this.projectId }]);
|
||||
grantLabel = this.route.snapshot.queryParams.grantLabel;
|
||||
// this.breadCrumbs = Observable.of([{ parentComponentName: 'GrantEditorComponent', label: grantLabel, url: '/grants/edit/' + this.grantId }]);
|
||||
this.criteria.setRefreshCallback((resetPages) => this.refresh(resetPages));
|
||||
} else {
|
||||
this.itemId = params['groupId'];
|
||||
this.showProject = true;
|
||||
this.showGrant = true;
|
||||
const breadCrumbs = [];
|
||||
|
||||
// if (this.itemId) {
|
||||
|
@ -91,9 +91,9 @@ export class DmpListingComponent extends BaseComponent implements OnInit, IBread
|
|||
this.criteria.setRefreshCallback((resetPages) => this.refresh(resetPages));
|
||||
}
|
||||
|
||||
if (this.projectId != null) {
|
||||
if (projectLabel !== undefined) {
|
||||
this.titlePrefix = 'for ' + projectLabel;
|
||||
if (this.grantId != null) {
|
||||
if (grantLabel !== undefined) {
|
||||
this.titlePrefix = 'for ' + grantLabel;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -110,7 +110,7 @@ export class DmpListingComponent extends BaseComponent implements OnInit, IBread
|
|||
let value = this.criteria.formGroup.value;
|
||||
request.criteria = {
|
||||
like: value.like,
|
||||
projects: value.projects,
|
||||
grants: value.grants,
|
||||
role: value.role
|
||||
}
|
||||
if (value.status == 2) {
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
<div class="col" (click)="itemClicked()">
|
||||
<div class="row">
|
||||
<div class="col-12 gray-container container-header">
|
||||
<p (click)="$event.stopImmediatePropagation(); projectClicked(dmp.projectId)">
|
||||
{{dmp.projectAbbreviation}}</p>
|
||||
<p (click)="$event.stopImmediatePropagation(); grantClicked(dmp.grantId)">
|
||||
{{dmp.grantAbbreviation}}</p>
|
||||
<button *ngIf="isDraft" mat-icon-button [matMenuTriggerFor]="actionsMenu" class="ml-auto" (click)="$event.stopImmediatePropagation();">
|
||||
<mat-icon class="more-horiz">more_horiz</mat-icon>
|
||||
</button>
|
||||
|
|
|
@ -3,7 +3,7 @@ import { DmpListingModel } from '../../../../core/model/dmp/dmp-listing';
|
|||
import { MatDialog } from '@angular/material';
|
||||
import { DmpInvitationDialogComponent } from '../../invitation/dmp-invitation.component';
|
||||
import { Router, ActivatedRoute } from '@angular/router';
|
||||
import { ProjectListingModel } from '../../../../core/model/project/project-listing';
|
||||
import { GrantListingModel } from '../../../../core/model/grant/grant-listing';
|
||||
import { RequestItem } from '../../../../core/query/request-item';
|
||||
import { TagCriteria } from '../../../../core/query/tag/tag-criteria';
|
||||
import { DmpCriteria } from '../../../../core/query/dmp/dmp-criteria';
|
||||
|
@ -84,8 +84,8 @@ export class DmpListingItemComponent implements OnInit {
|
|||
this.onClick.emit(this.dmp);
|
||||
}
|
||||
|
||||
projectClicked(projectId: String) {
|
||||
this.router.navigate(['/projects/edit/' + projectId]);
|
||||
grantClicked(grantId: String) {
|
||||
this.router.navigate(['/grants/edit/' + grantId]);
|
||||
}
|
||||
|
||||
datasetClicked(dmpId: string) {
|
||||
|
|
|
@ -110,23 +110,23 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 col-lg-3">
|
||||
<div class="project-item">
|
||||
<div class="grant-item">
|
||||
<div class="gray-container container-header">
|
||||
<span class="ml-2 pt-2" (click)="projectClicked(dmp.project.id)">{{ dmp.project.abbreviation }}</span>
|
||||
<span class="ml-2 pt-2" (click)="grantClicked(dmp.grant.id)">{{ dmp.grant.abbreviation }}</span>
|
||||
</div>
|
||||
<p class="card-subtitle mt-3 mb-1 ml-3 mr-3">{{ dmp.project.label }}</p>
|
||||
<p class="mb-1 ml-3 mr-3">{{ dmp.project.startDate | date: "shortDate" }} - {{ dmp.project.endDate | date: "shortDate" }}</p>
|
||||
<p class="card-subtitle mt-3 mb-1 ml-3 mr-3">{{ dmp.grant.label }}</p>
|
||||
<p class="mb-1 ml-3 mr-3">{{ dmp.grant.startDate | date: "shortDate" }} - {{ dmp.grant.endDate | date: "shortDate" }}</p>
|
||||
|
||||
|
||||
<p class="ml-3 mr-3 desc">{{ dmp.project.description }}</p>
|
||||
<button mat-flat-button class="show-more" (click)="projectClicked(dmp.project.id)">
|
||||
<p class="ml-3 mr-3 desc">{{ dmp.grant.description }}</p>
|
||||
<button mat-flat-button class="show-more" (click)="grantClicked(dmp.grant.id)">
|
||||
<!-- <mat-icon class="mr-2">expand_more</mat-icon> -->
|
||||
{{ 'GENERAL.ACTIONS.SHOW-MORE' | translate }}
|
||||
</button>
|
||||
|
||||
<a mat-raised-button class="visit-website" href="{{dmp.project.uri}}" target="_blank">
|
||||
<a mat-raised-button class="visit-website" href="{{dmp.grant.uri}}" target="_blank">
|
||||
<mat-icon class="mr-2">open_in_new</mat-icon>
|
||||
{{ 'PROJECT-EDITOR.ACTIONS.VISIT-WEBSITE' | translate }}
|
||||
{{ 'GRANT-EDITOR.ACTIONS.VISIT-WEBSITE' | translate }}
|
||||
</a>
|
||||
</div>
|
||||
<div class="researchers">
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
color: #aaaaaa;
|
||||
}
|
||||
|
||||
.project-item,
|
||||
.grant-item,
|
||||
.researchers {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
|
|
@ -95,8 +95,8 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
|
|||
this.router.navigate(['/plans/clone/' + dmp.id]);
|
||||
}
|
||||
|
||||
projectClicked(projectId: String) {
|
||||
this.router.navigate(['/projects/edit/' + projectId]);
|
||||
grantClicked(grantId: String) {
|
||||
this.router.navigate(['/grants/edit/' + grantId]);
|
||||
}
|
||||
|
||||
datasetClicked(datasetId: String) {
|
||||
|
|
|
@ -8,7 +8,7 @@ import { DmpModel } from "../../../core/model/dmp/dmp";
|
|||
import { DmpDynamicField } from "../../../core/model/dmp/dmp-dynamic-field";
|
||||
import { DmpDynamicFieldDependency } from "../../../core/model/dmp/dmp-dynamic-field-dependency";
|
||||
import { OrganizationModel } from "../../../core/model/organisation/organization";
|
||||
import { ProjectListingModel } from "../../../core/model/project/project-listing";
|
||||
import { GrantListingModel } from "../../../core/model/grant/grant-listing";
|
||||
import { ResearcherModel } from "../../../core/model/researcher/researcher";
|
||||
import { UserModel } from "../../../core/model/user/user";
|
||||
import { ValidJsonValidator } from "../../../library/auto-complete/auto-complete-custom-validator";
|
||||
|
@ -23,7 +23,7 @@ export class DmpWizardEditorModel {
|
|||
public creator: UserModel;
|
||||
public status: Status = Status.Active;
|
||||
public description: String;
|
||||
public project: ProjectListingModel;
|
||||
public grant: GrantListingModel;
|
||||
public organisations: OrganizationModel[] = [];
|
||||
public researchers: ResearcherModel[] = [];
|
||||
public profiles: DmpProfile[] = [];
|
||||
|
@ -41,7 +41,7 @@ export class DmpWizardEditorModel {
|
|||
this.status = item.status;
|
||||
this.lockable = item.lockable;
|
||||
this.description = item.description;
|
||||
this.project = item.project;
|
||||
this.grant = item.grant;
|
||||
this.organisations = item.organisations;
|
||||
this.researchers = item.researchers;
|
||||
this.profiles = item.profiles;
|
||||
|
@ -63,7 +63,7 @@ export class DmpWizardEditorModel {
|
|||
version: [{ value: this.version, disabled: disabled }, context.getValidation('version').validators],
|
||||
status: [{ value: this.status, disabled: disabled }, context.getValidation('status').validators],
|
||||
description: [{ value: this.description, disabled: disabled }],
|
||||
project: [{ value: this.project, disabled: disabled }, context.getValidation('project').validators],
|
||||
grant: [{ value: this.grant, disabled: disabled }, context.getValidation('grant').validators],
|
||||
organisations: [{ value: this.organisations, disabled: disabled }, context.getValidation('organisations').validators],
|
||||
researchers: [{ value: this.researchers, disabled: disabled }, context.getValidation('researchers').validators],
|
||||
profiles: [{ value: this.profiles, disabled: disabled }, context.getValidation('profiles').validators],
|
||||
|
@ -87,7 +87,7 @@ export class DmpWizardEditorModel {
|
|||
baseContext.validation.push({ key: 'version', validators: [BackendErrorValidator(this.validationErrorModel, 'version')] });
|
||||
baseContext.validation.push({ key: 'status', validators: [Validators.required, BackendErrorValidator(this.validationErrorModel, 'status')] });
|
||||
baseContext.validation.push({ key: 'description', validators: [Validators.required, BackendErrorValidator(this.validationErrorModel, 'description')] });
|
||||
baseContext.validation.push({ key: 'project', validators: [Validators.required, ValidJsonValidator, BackendErrorValidator(this.validationErrorModel, 'project')] });
|
||||
baseContext.validation.push({ key: 'grant', validators: [Validators.required, ValidJsonValidator, BackendErrorValidator(this.validationErrorModel, 'grant')] });
|
||||
baseContext.validation.push({ key: 'organisations', validators: [BackendErrorValidator(this.validationErrorModel, 'organisations')] });
|
||||
baseContext.validation.push({ key: 'researchers', validators: [BackendErrorValidator(this.validationErrorModel, 'researchers')] });
|
||||
baseContext.validation.push({ key: 'profiles', validators: [Validators.required, ValidJsonValidator, BackendErrorValidator(this.validationErrorModel, 'profiles')] });
|
||||
|
|
|
@ -52,7 +52,7 @@ export class DmpWizardComponent extends BaseComponent implements OnInit, IBreadC
|
|||
if (this.route.routeConfig.path.startsWith('new_version/')) {
|
||||
this.formGroup.get('version').setValue(this.formGroup.get('version').value + 1);
|
||||
this.formGroup.controls['label'].disable();
|
||||
this.formGroup.controls['project'].disable();
|
||||
this.formGroup.controls['grant'].disable();
|
||||
this.isClone = false;
|
||||
} else if (this.route.routeConfig.path.startsWith('clone/')) {
|
||||
this.formGroup.get('label').setValue(this.dmp.label + " New");
|
||||
|
|
|
@ -12,13 +12,13 @@
|
|||
{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||
</mat-form-field>
|
||||
<mat-form-field class="col-8">
|
||||
<app-single-auto-complete [formControl]="formGroup.get('project')"
|
||||
<app-single-auto-complete [formControl]="formGroup.get('grant')"
|
||||
placeholder="{{this.languageResolverService.getBy('dmpEditor') | translate}}"
|
||||
[configuration]="projectAutoCompleteConfiguration">
|
||||
[configuration]="grantAutoCompleteConfiguration">
|
||||
</app-single-auto-complete>
|
||||
<mat-error *ngIf="formGroup.get('project').hasError('backendError')">
|
||||
{{formGroup.get('project').getError('backendError').message}}</mat-error>
|
||||
<mat-error *ngIf="formGroup.get('project').hasError('required')">
|
||||
<mat-error *ngIf="formGroup.get('grant').hasError('backendError')">
|
||||
{{formGroup.get('grant').getError('backendError').message}}</mat-error>
|
||||
<mat-error *ngIf="formGroup.get('grant').hasError('required')">
|
||||
{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
|
|
|
@ -11,11 +11,11 @@ import { ExternalSourceItemModel } from '../../../../core/model/external-sources
|
|||
import { UserModel } from '../../../../core/model/user/user';
|
||||
import { BaseCriteria } from '../../../../core/query/base-criteria';
|
||||
import { DatasetProfileCriteria } from '../../../../core/query/dataset-profile/dataset-profile-criteria';
|
||||
import { ProjectCriteria } from '../../../../core/query/project/project-criteria';
|
||||
import { GrantCriteria } from '../../../../core/query/grant/grant-criteria';
|
||||
import { RequestItem } from '../../../../core/query/request-item';
|
||||
import { DmpService } from '../../../../core/services/dmp/dmp.service';
|
||||
import { ExternalSourcesService } from '../../../../core/services/external-sources/external-sources.service';
|
||||
import { ProjectService } from '../../../../core/services/project/project.service';
|
||||
import { GrantService } from '../../../../core/services/grant/grant.service';
|
||||
import { MultipleAutoCompleteConfiguration } from '../../../../library/auto-complete/multiple/multiple-auto-complete-configuration';
|
||||
import { SingleAutoCompleteConfiguration } from '../../../../library/auto-complete/single/single-auto-complete-configuration';
|
||||
import { LanguageResolverService } from '../../../../services/language-resolver/language-resolver.service';
|
||||
|
@ -38,7 +38,7 @@ export class DmpWizardEditorComponent extends BaseComponent implements OnInit {
|
|||
filteredResearchers: ExternalSourceItemModel[];
|
||||
filteredProfiles: DatasetProfileModel[];
|
||||
|
||||
projectAutoCompleteConfiguration: SingleAutoCompleteConfiguration;
|
||||
grantAutoCompleteConfiguration: SingleAutoCompleteConfiguration;
|
||||
profilesAutoCompleteConfiguration: MultipleAutoCompleteConfiguration;
|
||||
organisationsAutoCompleteConfiguration: MultipleAutoCompleteConfiguration;
|
||||
researchersAutoCompleteConfiguration: MultipleAutoCompleteConfiguration;
|
||||
|
@ -48,7 +48,7 @@ export class DmpWizardEditorComponent extends BaseComponent implements OnInit {
|
|||
|
||||
constructor(
|
||||
private dataManagementPlanService: DmpService,
|
||||
private projectService: ProjectService,
|
||||
private grantService: GrantService,
|
||||
private externalSourcesService: ExternalSourcesService,
|
||||
private route: ActivatedRoute,
|
||||
public snackBar: MatSnackBar,
|
||||
|
@ -63,11 +63,11 @@ export class DmpWizardEditorComponent extends BaseComponent implements OnInit {
|
|||
|
||||
ngOnInit() {
|
||||
|
||||
const projectRequestItem: RequestItem<ProjectCriteria> = new RequestItem();
|
||||
projectRequestItem.criteria = new ProjectCriteria();
|
||||
this.projectAutoCompleteConfiguration = {
|
||||
filterFn: this.searchProject.bind(this.projectService),
|
||||
initialItems: () => this.searchProject(''),
|
||||
const grantRequestItem: RequestItem<GrantCriteria> = new RequestItem();
|
||||
grantRequestItem.criteria = new GrantCriteria();
|
||||
this.grantAutoCompleteConfiguration = {
|
||||
filterFn: this.searchGrant.bind(this.grantService),
|
||||
initialItems: () => this.searchGrant(''),
|
||||
displayFn: (item) => item['label'],
|
||||
titleFn: (item) => item['label']
|
||||
};
|
||||
|
@ -103,11 +103,11 @@ export class DmpWizardEditorComponent extends BaseComponent implements OnInit {
|
|||
});
|
||||
}
|
||||
|
||||
searchProject(query: string) {
|
||||
const projectRequestItem: RequestItem<ProjectCriteria> = new RequestItem();
|
||||
projectRequestItem.criteria = new ProjectCriteria();
|
||||
projectRequestItem.criteria.like = query;
|
||||
return this.projectService.getWithExternal(projectRequestItem);
|
||||
searchGrant(query: string) {
|
||||
const grantRequestItem: RequestItem<GrantCriteria> = new RequestItem();
|
||||
grantRequestItem.criteria = new GrantCriteria();
|
||||
grantRequestItem.criteria.like = query;
|
||||
return this.grantService.getWithExternal(grantRequestItem);
|
||||
}
|
||||
|
||||
formSubmit(): void {
|
||||
|
|
|
@ -45,10 +45,10 @@
|
|||
<mat-header-cell *matHeaderCellDef mat-sort-header="label">{{'DATASET-LISTING.COLUMNS.NAME' | translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">{{row.label}}</mat-cell>
|
||||
</ng-container>
|
||||
<ng-container cdkColumnDef="project">
|
||||
<mat-header-cell *matHeaderCellDef>{{'DATASET-LISTING.COLUMNS.PROJECT' |
|
||||
<ng-container cdkColumnDef="grant">
|
||||
<mat-header-cell *matHeaderCellDef>{{'DATASET-LISTING.COLUMNS.GRANT' |
|
||||
translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.project}} </mat-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.grant}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container cdkColumnDef="profile">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header="|join|profile:label">{{'DATASET-LISTING.COLUMNS.PROFILE'
|
||||
|
|
|
@ -66,15 +66,15 @@ export class ExploreDatasetFilterItemComponent extends BaseComponent implements
|
|||
this.selectedChanged.emit(event);
|
||||
}
|
||||
|
||||
public removeOption(project) {
|
||||
public removeOption(grant) {
|
||||
const list = this.selectionList.selectedOptions.selected.map(x => x.value);
|
||||
const indexOfProject = list.indexOf(project);
|
||||
if (this.selectionList.selectedOptions.selected[indexOfProject]) {
|
||||
this.selectionList.selectedOptions.selected[indexOfProject].selected = false;
|
||||
this.selectionList.selectedOptions.selected.splice(indexOfProject, 1);
|
||||
const indexOfGrant = list.indexOf(grant);
|
||||
if (this.selectionList.selectedOptions.selected[indexOfGrant]) {
|
||||
this.selectionList.selectedOptions.selected[indexOfGrant].selected = false;
|
||||
this.selectionList.selectedOptions.selected.splice(indexOfGrant, 1);
|
||||
}
|
||||
this.selectedOptions.splice(this.selectedOptions.map(x => this.displayValue(x)).indexOf(this.displayValue(project)), 1);
|
||||
this.optionRemoved.emit(project);
|
||||
this.selectedOptions.splice(this.selectedOptions.map(x => this.displayValue(x)).indexOf(this.displayValue(grant)), 1);
|
||||
this.optionRemoved.emit(grant);
|
||||
}
|
||||
|
||||
public isOptionSelected(value) {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<div class="row" style="justify-content: center;">
|
||||
|
||||
<mat-form-field class="col-11 search">
|
||||
<input matInput placeholder="{{'CRITERIA.PROJECTS.LIKE'| translate}}" name="dmpCriteriaName"
|
||||
<input matInput placeholder="{{'CRITERIA.GRANTS.LIKE'| translate}}" name="dmpCriteriaName"
|
||||
[(ngModel)]="facetCriteria.like" (ngModelChange)="controlModified()">
|
||||
<mat-icon matSuffix class="style-icon">search</mat-icon>
|
||||
<app-multiple-auto-complete [(ngModel)]="facetCriteria.tags" (ngModelChange)="controlModified()"
|
||||
|
@ -12,14 +12,14 @@
|
|||
</mat-form-field>
|
||||
|
||||
<div class="col-10 gray-container">
|
||||
<h6 class="category-title">{{ 'FACET-SEARCH.PROJECT-STATUS.TITLE' | translate }}</h6>
|
||||
<h6 class="category-title">{{ 'FACET-SEARCH.GRANT-STATUS.TITLE' | translate }}</h6>
|
||||
<mat-list-item>
|
||||
<mat-radio-button value="0" (change)="projectStatusChanged($event)">
|
||||
{{ 'FACET-SEARCH.PROJECT-STATUS.OPTIONS.ACTIVE' | translate }}</mat-radio-button>
|
||||
<mat-radio-button value="0" (change)="grantStatusChanged($event)">
|
||||
{{ 'FACET-SEARCH.GRANT-STATUS.OPTIONS.ACTIVE' | translate }}</mat-radio-button>
|
||||
</mat-list-item>
|
||||
<mat-list-item>
|
||||
<mat-radio-button value="1" (change)="projectStatusChanged($event)">
|
||||
{{ 'FACET-SEARCH.PROJECT-STATUS.OPTIONS.INACTIVE' | translate }}</mat-radio-button>
|
||||
<mat-radio-button value="1" (change)="grantStatusChanged($event)">
|
||||
{{ 'FACET-SEARCH.GRANT-STATUS.OPTIONS.INACTIVE' | translate }}</mat-radio-button>
|
||||
</mat-list-item>
|
||||
</div>
|
||||
|
||||
|
@ -36,11 +36,11 @@
|
|||
</div>
|
||||
|
||||
<div class="col-10 gray-container">
|
||||
<h6 class="category-title">{{ 'FACET-SEARCH.PROJECT.TITLE' | translate }}</h6>
|
||||
<h6 class="category-title">{{ 'FACET-SEARCH.GRANT.TITLE' | translate }}</h6>
|
||||
<mat-form-field>
|
||||
<app-multiple-auto-complete placeholder="{{ 'CRITERIA.DATA-SETS.SELECT-PROJECTS' | translate }}"
|
||||
[configuration]="projectAutoCompleteConfiguration"
|
||||
(optionSelected)="onProjectOptionSelected($event)" (optionRemoved)="onProjectOptionRemoved($event)">
|
||||
<app-multiple-auto-complete placeholder="{{ 'CRITERIA.DATA-SETS.SELECT-GRANTS' | translate }}"
|
||||
[configuration]="grantAutoCompleteConfiguration"
|
||||
(optionSelected)="onGrantOptionSelected($event)" (optionRemoved)="onGrantOptionRemoved($event)">
|
||||
</app-multiple-auto-complete>
|
||||
<mat-icon matSuffix class="style-icon">arrow_drop_down</mat-icon>
|
||||
</mat-form-field>
|
||||
|
@ -81,7 +81,7 @@
|
|||
</mat-expansion-panel-header>
|
||||
<div>
|
||||
<mat-form-field>
|
||||
<input matInput placeholder="{{'CRITERIA.PROJECTS.LIKE'| translate}}" name="datasetCriteriaName" [(ngModel)]="facetCriteria.like"
|
||||
<input matInput placeholder="{{'CRITERIA.GRANTS.LIKE'| translate}}" name="datasetCriteriaName" [(ngModel)]="facetCriteria.like"
|
||||
(ngModelChange)="controlModified()">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
@ -96,22 +96,22 @@
|
|||
<mat-expansion-panel>
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title>
|
||||
{{ 'FACET-SEARCH.PROJECT-STATUS.TITLE' | translate }}
|
||||
{{ 'FACET-SEARCH.GRANT-STATUS.TITLE' | translate }}
|
||||
</mat-panel-title>
|
||||
</mat-expansion-panel-header>
|
||||
<app-explore-dataset-filter-item-component [multipleSelect]="false" [options]="this.projectStateOptions"
|
||||
(selectedChanged)="projectStatusChanged($event)" [displayTitleFunc]="displayProjectStateLabel" [displayValueFunc]="displayProjectStateValue">
|
||||
<app-explore-dataset-filter-item-component [multipleSelect]="false" [options]="this.grantStateOptions"
|
||||
(selectedChanged)="grantStatusChanged($event)" [displayTitleFunc]="displayGrantStateLabel" [displayValueFunc]="displayGrantStateValue">
|
||||
</app-explore-dataset-filter-item-component>
|
||||
</mat-expansion-panel>
|
||||
<mat-expansion-panel *ngIf="this.facetCriteria.projectStatus == ProjectStateType.OnGoing || this.facetCriteria.projectStatus == ProjectStateType.Finished">
|
||||
<mat-expansion-panel *ngIf="this.facetCriteria.grantStatus == GrantStateType.OnGoing || this.facetCriteria.grantStatus == GrantStateType.Finished">
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title>
|
||||
{{ 'FACET-SEARCH.PROJECT.TITLE' | translate }}
|
||||
{{ 'FACET-SEARCH.GRANT.TITLE' | translate }}
|
||||
</mat-panel-title>
|
||||
</mat-expansion-panel-header>
|
||||
<app-explore-dataset-filter-item-component [options]="this.projects" (selectedChanged)="projectChanged($event)"
|
||||
[filterOptions]="projectSearch.bind(this)" [searchEnabled]="true" (optionRemoved)="removeProject($event)"
|
||||
[displayTitleFunc]="displayProjectLabel" [displayValueFunc]="displayProjectValue">
|
||||
<app-explore-dataset-filter-item-component [options]="this.grants" (selectedChanged)="grantChanged($event)"
|
||||
[filterOptions]="grantSearch.bind(this)" [searchEnabled]="true" (optionRemoved)="removeGrant($event)"
|
||||
[displayTitleFunc]="displayGrantLabel" [displayValueFunc]="displayGrantValue">
|
||||
</app-explore-dataset-filter-item-component>
|
||||
</mat-expansion-panel>
|
||||
<mat-expansion-panel>
|
||||
|
|
|
@ -4,16 +4,16 @@ import { ActivatedRoute, Params } from '@angular/router';
|
|||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { BaseComponent } from '../../../core/common/base/base.component';
|
||||
import { ProjectStateType } from '../../../core/common/enum/project-state-type';
|
||||
import { GrantStateType } from '../../../core/common/enum/grant-state-type';
|
||||
import { DatasetProfileModel } from '../../../core/model/dataset/dataset-profile';
|
||||
import { ExternalSourceItemModel } from '../../../core/model/external-sources/external-source-item';
|
||||
import { ProjectListingModel } from '../../../core/model/project/project-listing';
|
||||
import { GrantListingModel } from '../../../core/model/grant/grant-listing';
|
||||
import { ExploreDatasetCriteriaModel } from '../../../core/query/explore-dataset/explore-dataset-criteria';
|
||||
import { ProjectCriteria } from '../../../core/query/project/project-criteria';
|
||||
import { GrantCriteria } from '../../../core/query/grant/grant-criteria';
|
||||
import { TagCriteria } from '../../../core/query/tag/tag-criteria';
|
||||
import { DatasetService } from '../../../core/services/dataset/dataset.service';
|
||||
import { ExternalSourcesService } from '../../../core/services/external-sources/external-sources.service';
|
||||
import { ProjectService } from '../../../core/services/project/project.service';
|
||||
import { GrantService } from '../../../core/services/grant/grant.service';
|
||||
import { RequestItem } from '../../../core/query/request-item';
|
||||
import { DataTableRequest } from '../../../core/model/data-table/data-table-request';
|
||||
import { AuthService } from '../../../core/services/auth/auth.service';
|
||||
|
@ -41,21 +41,21 @@ export class ExploreDatasetFiltersComponent extends BaseComponent implements OnI
|
|||
@Output() facetCriteriaChange = new EventEmitter();
|
||||
public filteringTagsAsync = false;
|
||||
public filteredTags: ExternalSourceItemModel[];
|
||||
ProjectStateType = ProjectStateType;
|
||||
projects: Observable<ProjectListingModel[]>;
|
||||
GrantStateType = GrantStateType;
|
||||
grants: Observable<GrantListingModel[]>;
|
||||
profiles: Observable<DatasetProfileModel[]>;
|
||||
dmpOrganisations: Observable<ExternalSourceItemModel[]>;
|
||||
dmpIds: Observable<DataTableData<DmpListingModel>>;
|
||||
projectOptions: Observable<ProjectListingModel[]>;
|
||||
projectStateOptions: Observable<any[]>;
|
||||
grantOptions: Observable<GrantListingModel[]>;
|
||||
grantStateOptions: Observable<any[]>;
|
||||
filteringOrganisationsAsync = false;
|
||||
@ViewChild('facetAccordion') accordion: MatAccordion;
|
||||
|
||||
displayProjectStateValue = (option) => option['value'];
|
||||
displayProjectStateLabel = (option) => option['label'];
|
||||
displayGrantStateValue = (option) => option['value'];
|
||||
displayGrantStateLabel = (option) => option['label'];
|
||||
|
||||
displayProjectValue = (option) => option['id'];
|
||||
displayProjectLabel = (option) => option['label'];
|
||||
displayGrantValue = (option) => option['id'];
|
||||
displayGrantLabel = (option) => option['label'];
|
||||
|
||||
displayProfileValue = (option) => option['id'];
|
||||
displayProfileLabel = (option) => option['label'];
|
||||
|
@ -77,10 +77,10 @@ export class ExploreDatasetFiltersComponent extends BaseComponent implements OnI
|
|||
titleFn: (item) => item['label']
|
||||
};
|
||||
|
||||
projectAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = {
|
||||
filterFn: this.filterProject.bind(this),
|
||||
grantAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = {
|
||||
filterFn: this.filterGrant.bind(this),
|
||||
initialItems: (excludedItems: any[]) =>
|
||||
this.filterProject('')
|
||||
this.filterGrant('')
|
||||
.map(result => result.filter(resultItem => excludedItems.map(x => x.id).indexOf(resultItem.id) === -1)),
|
||||
displayFn: (item) => item['label'],
|
||||
titleFn: (item) => item['label']
|
||||
|
@ -106,7 +106,7 @@ export class ExploreDatasetFiltersComponent extends BaseComponent implements OnI
|
|||
|
||||
constructor(
|
||||
public activatedRoute: ActivatedRoute,
|
||||
public projectService: ProjectService,
|
||||
public grantService: GrantService,
|
||||
public dmpService: DmpService,
|
||||
public organisationService: OrganisationService,
|
||||
public languageService: TranslateService,
|
||||
|
@ -117,10 +117,10 @@ export class ExploreDatasetFiltersComponent extends BaseComponent implements OnI
|
|||
|
||||
ngOnInit() {
|
||||
setTimeout(x => {
|
||||
this.projectStateOptions = Observable.of(
|
||||
this.grantStateOptions = Observable.of(
|
||||
[
|
||||
{ label: this.languageService.instant('FACET-SEARCH.PROJECT-STATUS.OPTIONS.INACTIVE'), value: ProjectStateType.Finished },
|
||||
{ label: this.languageService.instant('FACET-SEARCH.PROJECT-STATUS.OPTIONS.ACTIVE'), value: ProjectStateType.OnGoing },
|
||||
{ label: this.languageService.instant('FACET-SEARCH.GRANT-STATUS.OPTIONS.INACTIVE'), value: GrantStateType.Finished },
|
||||
{ label: this.languageService.instant('FACET-SEARCH.GRANT-STATUS.OPTIONS.ACTIVE'), value: GrantStateType.OnGoing },
|
||||
]);
|
||||
});
|
||||
this.profiles = this.datasetProfileService.getDatasetProfiles();
|
||||
|
@ -131,43 +131,43 @@ export class ExploreDatasetFiltersComponent extends BaseComponent implements OnI
|
|||
// this.accordion.openAll();
|
||||
}
|
||||
|
||||
public projectStatusChanged(event) {
|
||||
this.facetCriteria.projectStatus = event.value;
|
||||
public grantStatusChanged(event) {
|
||||
this.facetCriteria.grantStatus = event.value;
|
||||
if (!event.source.checked) {
|
||||
this.facetCriteria.projectStatus = null;
|
||||
this.projects = Observable.of([]);
|
||||
this.facetCriteria.projects = [];
|
||||
this.facetCriteria.grantStatus = null;
|
||||
this.grants = Observable.of([]);
|
||||
this.facetCriteria.grants = [];
|
||||
}
|
||||
// if (event.option.selected) {
|
||||
if (event.source.checked) {
|
||||
// const projectCriteria = new ProjectCriteria();
|
||||
// projectCriteria.projectStateType = this.facetCriteria.projectStatus;
|
||||
//projectCriteria['length'] = 10;
|
||||
// const grantCriteria = new GrantCriteria();
|
||||
// grantCriteria.grantStateType = this.facetCriteria.grantStatus;
|
||||
//grantCriteria['length'] = 10;
|
||||
const fields: Array<string> = new Array<string>();
|
||||
fields.push('asc');
|
||||
const dataTableRequest: DataTableRequest<ProjectCriteria> = new DataTableRequest(0, null, { fields: fields });
|
||||
dataTableRequest.criteria = new ProjectCriteria();
|
||||
dataTableRequest.criteria.projectStateType = this.facetCriteria.projectStatus;
|
||||
const dataTableRequest: DataTableRequest<GrantCriteria> = new DataTableRequest(0, null, { fields: fields });
|
||||
dataTableRequest.criteria = new GrantCriteria();
|
||||
dataTableRequest.criteria.grantStateType = this.facetCriteria.grantStatus;
|
||||
dataTableRequest.criteria['length'] = 10;
|
||||
|
||||
this.projects = this.projectService.getPublicPaged(dataTableRequest).map(x => x.data);
|
||||
this.facetCriteria.projects = [];
|
||||
this.grants = this.grantService.getPublicPaged(dataTableRequest).map(x => x.data);
|
||||
this.facetCriteria.grants = [];
|
||||
}
|
||||
this.facetCriteriaChange.emit(this.facetCriteria);
|
||||
}
|
||||
|
||||
public projectChanged(event: any) {
|
||||
public grantChanged(event: any) {
|
||||
const eventValue = event.option.value.id;
|
||||
if (event.option.selected) { this.facetCriteria.projects.push(eventValue); }
|
||||
if (event.option.selected) { this.facetCriteria.grants.push(eventValue); }
|
||||
if (!event.option.selected) {
|
||||
const index = this.facetCriteria.projects.indexOf(eventValue);
|
||||
this.facetCriteria.projects.splice(index, 1);
|
||||
const index = this.facetCriteria.grants.indexOf(eventValue);
|
||||
this.facetCriteria.grants.splice(index, 1);
|
||||
}
|
||||
this.facetCriteriaChange.emit(this.facetCriteria);
|
||||
}
|
||||
|
||||
removeProject(project) {
|
||||
this.facetCriteria.projects.splice(this.facetCriteria.projects.indexOf(project), 1);
|
||||
removeGrant(grant) {
|
||||
this.facetCriteria.grants.splice(this.facetCriteria.grants.indexOf(grant), 1);
|
||||
this.facetCriteriaChange.emit(this.facetCriteria);
|
||||
}
|
||||
|
||||
|
@ -211,21 +211,21 @@ export class ExploreDatasetFiltersComponent extends BaseComponent implements OnI
|
|||
this.facetCriteriaChange.emit(this.facetCriteria);
|
||||
}
|
||||
|
||||
public projectSearch(value: string): Observable<ProjectListingModel[]> {
|
||||
public grantSearch(value: string): Observable<GrantListingModel[]> {
|
||||
|
||||
const projectCriteria = new ProjectCriteria();
|
||||
projectCriteria.projectStateType = this.facetCriteria.projectStatus;
|
||||
projectCriteria['length'] = 10;
|
||||
projectCriteria.like = value;
|
||||
const grantCriteria = new GrantCriteria();
|
||||
grantCriteria.grantStateType = this.facetCriteria.grantStatus;
|
||||
grantCriteria['length'] = 10;
|
||||
grantCriteria.like = value;
|
||||
|
||||
const fields: Array<string> = new Array<string>();
|
||||
fields.push('asc');
|
||||
|
||||
const dataTableRequest: DataTableRequest<ProjectCriteria> = new DataTableRequest(0, null, { fields: fields });
|
||||
dataTableRequest.criteria = projectCriteria;
|
||||
//const dataTableRequest: RequestItem<ProjectCriteria> = { criteria: projectCriteria };
|
||||
//return this.projectService.getPaged(dataTableRequest, "autocomplete").map(x => x.data);
|
||||
return this.projectService.getPublicPaged(dataTableRequest).map(x => x.data);
|
||||
const dataTableRequest: DataTableRequest<GrantCriteria> = new DataTableRequest(0, null, { fields: fields });
|
||||
dataTableRequest.criteria = grantCriteria;
|
||||
//const dataTableRequest: RequestItem<GrantCriteria> = { criteria: grantCriteria };
|
||||
//return this.grantService.getPaged(dataTableRequest, "autocomplete").map(x => x.data);
|
||||
return this.grantService.getPublicPaged(dataTableRequest).map(x => x.data);
|
||||
}
|
||||
|
||||
public dmpOrganisationSearch(value: string): Observable<ExternalSourceItemModel[]> {
|
||||
|
@ -245,16 +245,16 @@ export class ExploreDatasetFiltersComponent extends BaseComponent implements OnI
|
|||
this.facetCriteriaChange.emit(this.facetCriteria);
|
||||
}
|
||||
|
||||
onProjectOptionSelected(items: ProjectListingModel[]) {
|
||||
this.facetCriteria.projects.splice(0);
|
||||
this.facetCriteria.projects.push(...items.map(x => x.id));
|
||||
onGrantOptionSelected(items: GrantListingModel[]) {
|
||||
this.facetCriteria.grants.splice(0);
|
||||
this.facetCriteria.grants.push(...items.map(x => x.id));
|
||||
this.facetCriteriaChange.emit(this.facetCriteria);
|
||||
}
|
||||
|
||||
onProjectOptionRemoved(item: ProjectListingModel) {
|
||||
const index = this.facetCriteria.projects.indexOf(item.id);
|
||||
onGrantOptionRemoved(item: GrantListingModel) {
|
||||
const index = this.facetCriteria.grants.indexOf(item.id);
|
||||
if (index >= 0) {
|
||||
this.facetCriteria.projects.splice(index, 1);
|
||||
this.facetCriteria.grants.splice(index, 1);
|
||||
this.facetCriteriaChange.emit(this.facetCriteria);
|
||||
}
|
||||
}
|
||||
|
@ -324,13 +324,13 @@ export class ExploreDatasetFiltersComponent extends BaseComponent implements OnI
|
|||
// });
|
||||
}
|
||||
|
||||
filterProject(query: string) {
|
||||
filterGrant(query: string) {
|
||||
const fields: Array<string> = new Array<string>();
|
||||
fields.push('asc');
|
||||
const projectRequestItem: DataTableRequest<ProjectCriteria> = new DataTableRequest(0, null, { fields: fields });
|
||||
projectRequestItem.criteria = new ProjectCriteria();
|
||||
projectRequestItem.criteria.like = query;
|
||||
return this.projectService.getPublicPaged(projectRequestItem).map(x => x.data);
|
||||
const grantRequestItem: DataTableRequest<GrantCriteria> = new DataTableRequest(0, null, { fields: fields });
|
||||
grantRequestItem.criteria = new GrantCriteria();
|
||||
grantRequestItem.criteria.like = query;
|
||||
return this.grantService.getPublicPaged(grantRequestItem).map(x => x.data);
|
||||
}
|
||||
|
||||
filterProfile(query: string) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col-12 gray-container container-header">
|
||||
<p>{{ dataset.projectAbbreviation }}</p>
|
||||
<p>{{ dataset.grantAbbreviation }}</p>
|
||||
<!-- <button mat-icon-button [matMenuTriggerFor]="actionsMenu" class="ml-auto"
|
||||
(click)="$event.stopImmediatePropagation();">
|
||||
<mat-icon class="more-horiz">more_horiz</mat-icon>
|
||||
|
@ -25,8 +25,8 @@
|
|||
<mat-icon matTooltip="{{'DATASET-PUBLIC-LISTING.TOOLTIP.DMP' | translate}}" class="gray-icon pt-2">storage</mat-icon>
|
||||
<h4 class="mt-2 ml-1 mr-3 p-1">{{ dataset.dmp }}</h4>
|
||||
|
||||
<mat-icon matTooltip="{{'DATASET-PUBLIC-LISTING.TOOLTIP.PROJECT' | translate}}" class="gray-icon pt-2">work_outline</mat-icon>
|
||||
<h4 class="mt-2 ml-1 mr-3 p-1">{{ dataset.project }}</h4>
|
||||
<mat-icon matTooltip="{{'DATASET-PUBLIC-LISTING.TOOLTIP.GRANT' | translate}}" class="gray-icon pt-2">work_outline</mat-icon>
|
||||
<h4 class="mt-2 ml-1 mr-3 p-1">{{ dataset.grant }}</h4>
|
||||
|
||||
<mat-icon matTooltip="{{'DATASET-PUBLIC-LISTING.TOOLTIP.TEMPLATES-INVOLVED' | translate}}" class="gray-icon pt-2">assignment</mat-icon>
|
||||
<div class="pt-1">
|
||||
|
@ -37,7 +37,7 @@
|
|||
</div>
|
||||
<!-- <div class="info">
|
||||
<h6>{{ dataset.dmp }}</h6>
|
||||
<p>{{ dataset.project }}</p>
|
||||
<p>{{ dataset.grant }}</p>
|
||||
</div>
|
||||
<div class="row" style="margin-left: 0px !important">
|
||||
<div class="chip">
|
||||
|
|
|
@ -57,15 +57,15 @@ export class ExploreDmpFilterItemComponent extends BaseComponent implements OnIn
|
|||
this.selectedChanged.emit(event);
|
||||
}
|
||||
|
||||
public removeOption(project) {
|
||||
public removeOption(grant) {
|
||||
const list = this.selectionList.selectedOptions.selected.map(x => x.value);
|
||||
const indexOfProject = list.indexOf(project);
|
||||
if (this.selectionList.selectedOptions.selected[indexOfProject]) {
|
||||
this.selectionList.selectedOptions.selected[indexOfProject].selected = false;
|
||||
this.selectionList.selectedOptions.selected.splice(indexOfProject, 1);
|
||||
const indexOfGrant = list.indexOf(grant);
|
||||
if (this.selectionList.selectedOptions.selected[indexOfGrant]) {
|
||||
this.selectionList.selectedOptions.selected[indexOfGrant].selected = false;
|
||||
this.selectionList.selectedOptions.selected.splice(indexOfGrant, 1);
|
||||
}
|
||||
this.selectedOptions.splice(this.selectedOptions.map(x => this.displayValue(x)).indexOf(this.displayValue(project)), 1);
|
||||
this.optionRemoved.emit(project);
|
||||
this.selectedOptions.splice(this.selectedOptions.map(x => this.displayValue(x)).indexOf(this.displayValue(grant)), 1);
|
||||
this.optionRemoved.emit(grant);
|
||||
}
|
||||
|
||||
public isOptionSelected(value) {
|
||||
|
|
|
@ -3,23 +3,23 @@
|
|||
<div class="row" style="justify-content: center;">
|
||||
|
||||
<mat-form-field class="col-11 search">
|
||||
<input matInput placeholder="{{'CRITERIA.PROJECTS.LIKE'| translate}}" name="dmpCriteriaName"
|
||||
<input matInput placeholder="{{'CRITERIA.GRANTS.LIKE'| translate}}" name="dmpCriteriaName"
|
||||
[(ngModel)]="facetCriteria.like" (ngModelChange)="controlModified()">
|
||||
<mat-icon matSuffix class="style-icon">search</mat-icon>
|
||||
</mat-form-field>
|
||||
|
||||
<div class="col-10 gray-container">
|
||||
<h6 class="category-title">{{ 'FACET-SEARCH.PROJECT-STATUS.TITLE' | translate }}</h6>
|
||||
<mat-list-item><mat-radio-button value="0" (change)="projectStatusChanged($event)">{{ 'FACET-SEARCH.PROJECT-STATUS.OPTIONS.ACTIVE' | translate }}</mat-radio-button></mat-list-item>
|
||||
<mat-list-item><mat-radio-button value="1" (change)="projectStatusChanged($event)">{{ 'FACET-SEARCH.PROJECT-STATUS.OPTIONS.INACTIVE' | translate }}</mat-radio-button></mat-list-item>
|
||||
<h6 class="category-title">{{ 'FACET-SEARCH.GRANT-STATUS.TITLE' | translate }}</h6>
|
||||
<mat-list-item><mat-radio-button value="0" (change)="grantStatusChanged($event)">{{ 'FACET-SEARCH.GRANT-STATUS.OPTIONS.ACTIVE' | translate }}</mat-radio-button></mat-list-item>
|
||||
<mat-list-item><mat-radio-button value="1" (change)="grantStatusChanged($event)">{{ 'FACET-SEARCH.GRANT-STATUS.OPTIONS.INACTIVE' | translate }}</mat-radio-button></mat-list-item>
|
||||
</div>
|
||||
|
||||
<div class="col-10 gray-container">
|
||||
<h6 class="category-title">{{ 'FACET-SEARCH.PROJECT.TITLE' | translate }}</h6>
|
||||
<h6 class="category-title">{{ 'FACET-SEARCH.GRANT.TITLE' | translate }}</h6>
|
||||
<mat-form-field>
|
||||
<app-multiple-auto-complete placeholder="{{ 'CRITERIA.DATA-SETS.SELECT-PROJECTS' | translate }}"
|
||||
[configuration]="projectAutoCompleteConfiguration"
|
||||
(optionSelected)="onProjectOptionSelected($event)" (optionRemoved)="onProjectOptionRemoved($event)">
|
||||
<app-multiple-auto-complete placeholder="{{ 'CRITERIA.DATA-SETS.SELECT-GRANTS' | translate }}"
|
||||
[configuration]="grantAutoCompleteConfiguration"
|
||||
(optionSelected)="onGrantOptionSelected($event)" (optionRemoved)="onGrantOptionRemoved($event)">
|
||||
</app-multiple-auto-complete>
|
||||
<mat-icon matSuffix class="style-icon">arrow_drop_down</mat-icon>
|
||||
</mat-form-field>
|
||||
|
@ -60,7 +60,7 @@
|
|||
</mat-expansion-panel-header>
|
||||
<div>
|
||||
<mat-form-field>
|
||||
<input matInput placeholder="{{'CRITERIA.PROJECTS.LIKE'| translate}}" name="dmpCriteriaName" [(ngModel)]="facetCriteria.like"
|
||||
<input matInput placeholder="{{'CRITERIA.GRANTS.LIKE'| translate}}" name="dmpCriteriaName" [(ngModel)]="facetCriteria.like"
|
||||
(ngModelChange)="controlModified()">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
@ -68,21 +68,21 @@
|
|||
<mat-expansion-panel>
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title>
|
||||
{{ 'FACET-SEARCH.PROJECT-STATUS.TITLE' | translate }}
|
||||
{{ 'FACET-SEARCH.GRANT-STATUS.TITLE' | translate }}
|
||||
</mat-panel-title>
|
||||
</mat-expansion-panel-header>
|
||||
<app-explore-dmp-filter-item-component [multipleSelect]="false" [options]="this.projectStateOptions" (selectedChanged)="projectStatusChanged($event)"
|
||||
[displayTitleFunc]="displayProjectStateLabel" [displayValueFunc]="displayProjectStateValue">
|
||||
<app-explore-dmp-filter-item-component [multipleSelect]="false" [options]="this.grantStateOptions" (selectedChanged)="grantStatusChanged($event)"
|
||||
[displayTitleFunc]="displayGrantStateLabel" [displayValueFunc]="displayGrantStateValue">
|
||||
</app-explore-dmp-filter-item-component>
|
||||
</mat-expansion-panel>
|
||||
<mat-expansion-panel *ngIf="this.facetCriteria.projectStatus == ProjectStateType.OnGoing || this.facetCriteria.projectStatus == ProjectStateType.Finished">
|
||||
<mat-expansion-panel *ngIf="this.facetCriteria.grantStatus == GrantStateType.OnGoing || this.facetCriteria.grantStatus == GrantStateType.Finished">
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title>
|
||||
{{ 'FACET-SEARCH.PROJECT.TITLE' | translate }}
|
||||
{{ 'FACET-SEARCH.GRANT.TITLE' | translate }}
|
||||
</mat-panel-title>
|
||||
</mat-expansion-panel-header>
|
||||
<app-explore-dmp-filter-item-component [options]="this.projects" (selectedChanged)="projectChanged($event)" [filterOptions]="projectSearch.bind(this)"
|
||||
[searchEnabled]="true" (optionRemoved)="removeProject($event)" [displayTitleFunc]="displayProjectLabel" [displayValueFunc]="displayProjectValue">
|
||||
<app-explore-dmp-filter-item-component [options]="this.grants" (selectedChanged)="grantChanged($event)" [filterOptions]="grantSearch.bind(this)"
|
||||
[searchEnabled]="true" (optionRemoved)="removeGrant($event)" [displayTitleFunc]="displayGrantLabel" [displayValueFunc]="displayGrantValue">
|
||||
</app-explore-dmp-filter-item-component>
|
||||
</mat-expansion-panel>
|
||||
<mat-expansion-panel>
|
||||
|
|
|
@ -6,18 +6,18 @@ import { TranslateService } from "@ngx-translate/core";
|
|||
import { Observable } from "rxjs";
|
||||
import { takeUntil } from "rxjs/operators";
|
||||
import { ValidationErrorModel } from "../../../common/forms/validation/error-model/validation-error-model";
|
||||
import { ProjectStateType } from '../../../core/common/enum/project-state-type';
|
||||
import { GrantStateType } from '../../../core/common/enum/grant-state-type';
|
||||
import { DataTableRequest } from "../../../core/model/data-table/data-table-request";
|
||||
import { DatasetProfileModel } from "../../../core/model/dataset/dataset-profile";
|
||||
import { ExternalSourceItemModel } from "../../../core/model/external-sources/external-source-item";
|
||||
import { ProjectListingModel } from "../../../core/model/project/project-listing";
|
||||
import { GrantListingModel } from "../../../core/model/grant/grant-listing";
|
||||
import { ExploreDatasetCriteriaModel } from "../../../core/query/explore-dataset/explore-dataset-criteria";
|
||||
import { ExploreDmpCriteriaModel } from "../../../core/query/explore-dmp/explore-dmp-criteria";
|
||||
import { ProjectCriteria } from "../../../core/query/project/project-criteria";
|
||||
import { GrantCriteria } from "../../../core/query/grant/grant-criteria";
|
||||
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 { ProjectService } from "../../../core/services/project/project.service";
|
||||
import { GrantService } from "../../../core/services/grant/grant.service";
|
||||
import { MultipleAutoCompleteConfiguration } from "../../../library/auto-complete/multiple/multiple-auto-complete-configuration";
|
||||
import { BaseCriteriaComponent } from "../../misc/criteria/base-criteria.component";
|
||||
import { OrganizationModel } from "../../../core/model/organisation/organization";
|
||||
|
@ -34,15 +34,15 @@ export class ExploreDmpFiltersComponent extends BaseCriteriaComponent implements
|
|||
@Input() facetCriteria = new ExploreDmpCriteriaModel();
|
||||
@Output() facetCriteriaChange = new EventEmitter();
|
||||
@Input() displayTitleFunc: (value) => string;
|
||||
ProjectStateType = ProjectStateType;
|
||||
projects: Observable<ProjectListingModel[]>;
|
||||
GrantStateType = GrantStateType;
|
||||
grants: Observable<GrantListingModel[]>;
|
||||
profiles: Observable<DatasetProfileModel[]>;
|
||||
dmpOrganisations: Observable<OrganizationModel[]>;
|
||||
projectOptions: Observable<ProjectListingModel[]>;
|
||||
projectStateOptions: Observable<any[]>;
|
||||
grantOptions: Observable<GrantListingModel[]>;
|
||||
grantStateOptions: Observable<any[]>;
|
||||
filteringOrganisationsAsync = false;
|
||||
filteredOrganisations: OrganizationModel[];
|
||||
status: ProjectStateType;
|
||||
status: GrantStateType;
|
||||
IsChecked: boolean;
|
||||
IsIndeterminate: boolean;
|
||||
LabelAlign: string;
|
||||
|
@ -52,11 +52,11 @@ export class ExploreDmpFiltersComponent extends BaseCriteriaComponent implements
|
|||
|
||||
@ViewChild('facetAccordion') accordion: MatAccordion;
|
||||
|
||||
displayProjectStateValue = (option) => option['value'];
|
||||
displayProjectStateLabel = (option) => option['label'];
|
||||
displayGrantStateValue = (option) => option['value'];
|
||||
displayGrantStateLabel = (option) => option['label'];
|
||||
|
||||
displayProjectValue = (option) => option['id'];
|
||||
displayProjectLabel = (option) => option['label'];
|
||||
displayGrantValue = (option) => option['id'];
|
||||
displayGrantLabel = (option) => option['label'];
|
||||
|
||||
displayProfileValue = (option) => option['id'];
|
||||
displayProfileLabel = (option) => option['label'];
|
||||
|
@ -82,10 +82,10 @@ export class ExploreDmpFiltersComponent extends BaseCriteriaComponent implements
|
|||
titleFn: (item) => item['name']
|
||||
}
|
||||
|
||||
projectAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = {
|
||||
filterFn: this.filterProject.bind(this),
|
||||
grantAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = {
|
||||
filterFn: this.filterGrant.bind(this),
|
||||
initialItems: (excludedItems: any[]) =>
|
||||
this.filterProject('')
|
||||
this.filterGrant('')
|
||||
.map(result => result.filter(resultItem => excludedItems.map(x => x.id).indexOf(resultItem.id) === -1)),
|
||||
displayFn: (item) => item['label'],
|
||||
titleFn: (item) => item['label']
|
||||
|
@ -94,7 +94,7 @@ export class ExploreDmpFiltersComponent extends BaseCriteriaComponent implements
|
|||
constructor(
|
||||
public activatedRoute: ActivatedRoute,
|
||||
public languageService: TranslateService,
|
||||
public projectService: ProjectService,
|
||||
public grantService: GrantService,
|
||||
public datasetProfileService: DatasetService,
|
||||
public organisationService: OrganisationService,
|
||||
public externalSourcesService: ExternalSourcesService,
|
||||
|
@ -111,10 +111,10 @@ export class ExploreDmpFiltersComponent extends BaseCriteriaComponent implements
|
|||
|
||||
ngOnInit() {
|
||||
setTimeout(x => {
|
||||
this.projectStateOptions = Observable.of(
|
||||
this.grantStateOptions = Observable.of(
|
||||
[
|
||||
{ label: this.languageService.instant('FACET-SEARCH.PROJECT-STATUS.OPTIONS.INACTIVE'), value: ProjectStateType.Finished },
|
||||
{ label: this.languageService.instant('FACET-SEARCH.PROJECT-STATUS.OPTIONS.ACTIVE'), value: ProjectStateType.OnGoing },
|
||||
{ label: this.languageService.instant('FACET-SEARCH.GRANT-STATUS.OPTIONS.INACTIVE'), value: GrantStateType.Finished },
|
||||
{ label: this.languageService.instant('FACET-SEARCH.GRANT-STATUS.OPTIONS.ACTIVE'), value: GrantStateType.OnGoing },
|
||||
]);
|
||||
});
|
||||
this.profiles = this.datasetProfileService.getDatasetProfiles();
|
||||
|
@ -139,57 +139,57 @@ export class ExploreDmpFiltersComponent extends BaseCriteriaComponent implements
|
|||
this.facetCriteriaChange.emit(this.facetCriteria);
|
||||
}
|
||||
|
||||
projectSearch(value: string): Observable<ProjectListingModel[]> {
|
||||
const projectCriteria = new ProjectCriteria();
|
||||
projectCriteria.projectStateType = this.facetCriteria.projectStatus;
|
||||
projectCriteria['length'] = 10;
|
||||
projectCriteria.like = value;
|
||||
grantSearch(value: string): Observable<GrantListingModel[]> {
|
||||
const grantCriteria = new GrantCriteria();
|
||||
grantCriteria.grantStateType = this.facetCriteria.grantStatus;
|
||||
grantCriteria['length'] = 10;
|
||||
grantCriteria.like = value;
|
||||
|
||||
const fields: Array<string> = new Array<string>();
|
||||
fields.push('asc');
|
||||
|
||||
const dataTableRequest: DataTableRequest<ProjectCriteria> = new DataTableRequest(0, null, { fields: fields });
|
||||
dataTableRequest.criteria = projectCriteria;
|
||||
return this.projectService.getPublicPaged(dataTableRequest).map(x => x.data);
|
||||
const dataTableRequest: DataTableRequest<GrantCriteria> = new DataTableRequest(0, null, { fields: fields });
|
||||
dataTableRequest.criteria = grantCriteria;
|
||||
return this.grantService.getPublicPaged(dataTableRequest).map(x => x.data);
|
||||
}
|
||||
|
||||
projectStatusChanged(event) {
|
||||
this.facetCriteria.projectStatus = event.value;
|
||||
// this.facetCriteria.projectStatus = +event.source.ariaLabel; // For checkboxes
|
||||
// this.facetCriteria.projectStatus = event.option.value.value; // For <app-explore-dmp-filter-item-component>
|
||||
grantStatusChanged(event) {
|
||||
this.facetCriteria.grantStatus = event.value;
|
||||
// this.facetCriteria.grantStatus = +event.source.ariaLabel; // For checkboxes
|
||||
// this.facetCriteria.grantStatus = event.option.value.value; // For <app-explore-dmp-filter-item-component>
|
||||
if (!event.source.checked) {
|
||||
this.facetCriteria.projectStatus = null;
|
||||
this.projects = Observable.of([]);
|
||||
this.facetCriteria.projects = [];
|
||||
this.facetCriteria.grantStatus = null;
|
||||
this.grants = Observable.of([]);
|
||||
this.facetCriteria.grants = [];
|
||||
}
|
||||
// if (event.checked) {
|
||||
// if (event.option.selected) {
|
||||
if (event.source.checked) {
|
||||
const fields: Array<string> = new Array<string>();
|
||||
fields.push('asc');
|
||||
const dataTableRequest: DataTableRequest<ProjectCriteria> = new DataTableRequest(0, null, { fields: fields });
|
||||
dataTableRequest.criteria = new ProjectCriteria();
|
||||
dataTableRequest.criteria.projectStateType = this.facetCriteria.projectStatus;
|
||||
const dataTableRequest: DataTableRequest<GrantCriteria> = new DataTableRequest(0, null, { fields: fields });
|
||||
dataTableRequest.criteria = new GrantCriteria();
|
||||
dataTableRequest.criteria.grantStateType = this.facetCriteria.grantStatus;
|
||||
dataTableRequest.criteria['length'] = 10;
|
||||
|
||||
this.projects = this.projectService.getPublicPaged(dataTableRequest).map(x => x.data);
|
||||
this.facetCriteria.projects = [];
|
||||
this.grants = this.grantService.getPublicPaged(dataTableRequest).map(x => x.data);
|
||||
this.facetCriteria.grants = [];
|
||||
}
|
||||
this.facetCriteriaChange.emit(this.facetCriteria);
|
||||
}
|
||||
|
||||
projectChanged(event: any) {
|
||||
grantChanged(event: any) {
|
||||
const eventValue = event.option.value.id;
|
||||
if (event.option.selected) { this.facetCriteria.projects.push(eventValue); }
|
||||
if (event.option.selected) { this.facetCriteria.grants.push(eventValue); }
|
||||
if (!event.option.selected) {
|
||||
const index = this.facetCriteria.projects.indexOf(eventValue);
|
||||
this.facetCriteria.projects.splice(index, 1);
|
||||
const index = this.facetCriteria.grants.indexOf(eventValue);
|
||||
this.facetCriteria.grants.splice(index, 1);
|
||||
}
|
||||
this.facetCriteriaChange.emit(this.facetCriteria);
|
||||
}
|
||||
|
||||
removeProject(project) {
|
||||
this.facetCriteria.projects.splice(this.facetCriteria.projects.indexOf(project), 1);
|
||||
removeGrant(grant) {
|
||||
this.facetCriteria.grants.splice(this.facetCriteria.grants.indexOf(grant), 1);
|
||||
this.facetCriteriaChange.emit(this.facetCriteria);
|
||||
}
|
||||
|
||||
|
@ -238,16 +238,16 @@ export class ExploreDmpFiltersComponent extends BaseCriteriaComponent implements
|
|||
}
|
||||
}
|
||||
|
||||
onProjectOptionSelected(items: ProjectListingModel[]) {
|
||||
this.facetCriteria.projects.splice(0);
|
||||
this.facetCriteria.projects.push(...items.map(x => x.id));
|
||||
onGrantOptionSelected(items: GrantListingModel[]) {
|
||||
this.facetCriteria.grants.splice(0);
|
||||
this.facetCriteria.grants.push(...items.map(x => x.id));
|
||||
this.facetCriteriaChange.emit(this.facetCriteria);
|
||||
}
|
||||
|
||||
onProjectOptionRemoved(item: ProjectListingModel) {
|
||||
const index = this.facetCriteria.projects.indexOf(item.id);
|
||||
onGrantOptionRemoved(item: GrantListingModel) {
|
||||
const index = this.facetCriteria.grants.indexOf(item.id);
|
||||
if (index >= 0) {
|
||||
this.facetCriteria.projects.splice(index, 1);
|
||||
this.facetCriteria.grants.splice(index, 1);
|
||||
this.facetCriteriaChange.emit(this.facetCriteria);
|
||||
}
|
||||
}
|
||||
|
@ -293,13 +293,13 @@ export class ExploreDmpFiltersComponent extends BaseCriteriaComponent implements
|
|||
return this.organisationService.searchPublicOrganisations(dataTableRequest).map(x => x.data);
|
||||
}
|
||||
|
||||
filterProject(query: string) {
|
||||
filterGrant(query: string) {
|
||||
const fields: Array<string> = new Array<string>();
|
||||
fields.push('asc');
|
||||
const projectRequestItem: DataTableRequest<ProjectCriteria> = new DataTableRequest(0, null, { fields: fields });
|
||||
projectRequestItem.criteria = new ProjectCriteria();
|
||||
projectRequestItem.criteria.like = query;
|
||||
return this.projectService.getPublicPaged(projectRequestItem).map(x => x.data);
|
||||
const grantRequestItem: DataTableRequest<GrantCriteria> = new DataTableRequest(0, null, { fields: fields });
|
||||
grantRequestItem.criteria = new GrantCriteria();
|
||||
grantRequestItem.criteria.like = query;
|
||||
return this.grantService.getPublicPaged(grantRequestItem).map(x => x.data);
|
||||
}
|
||||
|
||||
filterProfile(query: string) {
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<div class="explore-dmp-listing row">
|
||||
<div class="col-3">
|
||||
<app-explore-dmp-filters-component class="col-auto" (facetCriteriaChange)="onCriteriaChange($event)"></app-explore-dmp-filters-component>
|
||||
<!-- <app-explore-dmp-filters-component class="col-auto" [showProject]="showProject" (facetCriteriaChange)="onCriteriaChange($event)"></app-explore-dmp-filters-component> -->
|
||||
<!-- <app-explore-dmp-filters-component class="col-auto" [showGrant]="showGrant" (facetCriteriaChange)="onCriteriaChange($event)"></app-explore-dmp-filters-component> -->
|
||||
</div>
|
||||
<div class="col-9">
|
||||
<div class="row" *ngFor="let item of listingItems; let i = index">
|
||||
|
|
|
@ -87,7 +87,7 @@ export class ExploreDmpListingComponent extends BaseComponent implements OnInit,
|
|||
// criteria: ExploreDmpCriteriaModel = new ExploreDmpCriteriaModel();
|
||||
|
||||
// dataSource: DmpDataSource | null;
|
||||
// displayedColumns: String[] = ['name', 'project', 'organisations', 'created'];
|
||||
// displayedColumns: String[] = ['name', 'grant', 'organisations', 'created'];
|
||||
// pageEvent: PageEvent;
|
||||
// titlePrefix: String;
|
||||
// dmpId: string;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div class="col" (click)="itemClicked()">
|
||||
<div class="row">
|
||||
<div class="col-12 gray-container container-header">
|
||||
{{dmp.projectAbbreviation}}
|
||||
{{dmp.grantAbbreviation}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
@ -42,7 +42,7 @@
|
|||
<div class="col">
|
||||
<div class="row">
|
||||
<h4 class="col-12 title">{{dmp.label}}</h4>
|
||||
<h4 class="col-12 project-title">{{dmp.project}}</h4>
|
||||
<h4 class="col-12 grant-title">{{dmp.grant}}</h4>
|
||||
</div>
|
||||
<div class="row d-flex align-items-center my-1">
|
||||
<mat-icon class="col-auto gray-icon">storage</mat-icon>
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
// color: black;
|
||||
// }
|
||||
|
||||
// .project-title {
|
||||
// .grant-title {
|
||||
// color: rgb(93, 125, 173);
|
||||
// }
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<div class="main-content">
|
||||
<div class="container-fluid">
|
||||
<div class="project-editor">
|
||||
<mat-card-title *ngIf="isNew">{{'PROJECT-EDITOR.TITLE.NEW' | translate}}</mat-card-title>
|
||||
<div class="grant-editor">
|
||||
<mat-card-title *ngIf="isNew">{{'GRANT-EDITOR.TITLE.NEW' | translate}}</mat-card-title>
|
||||
<mat-card-title *ngIf="!isNew">{{formGroup?.get('label')?.value}}</mat-card-title>
|
||||
<form *ngIf="formGroup" (ngSubmit)="formSubmit()" [formGroup]="formGroup">
|
||||
<mat-card>
|
||||
|
@ -22,22 +22,22 @@
|
|||
</tr>
|
||||
</table>
|
||||
<div class="col"></div>
|
||||
<div *ngIf="!isNew" class="project-editor-header-actions col-auto">
|
||||
<div *ngIf="!isNew" class="grant-editor-header-actions col-auto">
|
||||
<div class="row actions-row">
|
||||
<div class="col-auto" *ngIf="!editMode && !isExternalProject()">
|
||||
<div class="col-auto" *ngIf="!editMode && !isExternalGrant()">
|
||||
<button mat-icon-button (click)="enableForm()">
|
||||
<mat-icon class="mat-24">edit</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-auto" *ngIf="editMode && !isExternalProject()">
|
||||
<div class="col-auto" *ngIf="editMode && !isExternalGrant()">
|
||||
<button mat-icon-button (click)="disableForm()">
|
||||
<mat-icon class="mat-24">lock</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<button mat-button (click)="goToProjectDmps()">
|
||||
<button mat-button (click)="goToGrantDmps()">
|
||||
<mat-icon class="mat-24">arrow_right_alt</mat-icon>
|
||||
<span>{{'PROJECT-EDITOR.ACTIONS.GO-TO-DMPS' | translate}}</span>
|
||||
<span>{{'GRANT-EDITOR.ACTIONS.GO-TO-DMPS' | translate}}</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -47,24 +47,24 @@
|
|||
<mat-card-content>
|
||||
<div class="row">
|
||||
<mat-form-field class="col-md-12">
|
||||
<input matInput placeholder="{{'PROJECT-EDITOR.FIELDS.LABEL' | translate}}" type="text" name="label" formControlName="label" required>
|
||||
<input matInput placeholder="{{'GRANT-EDITOR.FIELDS.LABEL' | translate}}" type="text" name="label" formControlName="label" required>
|
||||
<mat-error *ngIf="formGroup.get('label').hasError('backendError')">{{formGroup.get('label').getError('backendError').message}}</mat-error>
|
||||
<mat-error *ngIf="formGroup.get('label').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field class="col-md-6">
|
||||
<input matInput placeholder="{{'PROJECT-EDITOR.FIELDS.ABBREVIATION' | translate}}" type="text" name="abbreviation" formControlName="abbreviation">
|
||||
<input matInput placeholder="{{'GRANT-EDITOR.FIELDS.ABBREVIATION' | translate}}" type="text" name="abbreviation" formControlName="abbreviation">
|
||||
<mat-error *ngIf="formGroup.get('abbreviation').hasError('backendError')">{{formGroup.get('abbreviation').getError('backendError').message}}</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field class="col-md-6">
|
||||
<input matInput placeholder="{{'PROJECT-EDITOR.FIELDS.URI' | translate}}" type="text" name="uri" formControlName="uri">
|
||||
<input matInput placeholder="{{'GRANT-EDITOR.FIELDS.URI' | translate}}" type="text" name="uri" formControlName="uri">
|
||||
<mat-error *ngIf="formGroup.get('uri').hasError('backendError')">{{formGroup.get('uri').getError('backendError').message}}</mat-error>
|
||||
<mat-error *ngIf="formGroup.get('uri').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field class="col-md-6">
|
||||
<input matInput (focus)="startDate.open()" (click)="startDate.open()" placeholder="{{'PROJECT-EDITOR.FIELDS.START' | translate}}" class="table-input" [matDatepicker]="startDate" formControlName="startDate">
|
||||
<input matInput (focus)="startDate.open()" (click)="startDate.open()" placeholder="{{'GRANT-EDITOR.FIELDS.START' | translate}}" class="table-input" [matDatepicker]="startDate" formControlName="startDate">
|
||||
<mat-datepicker-toggle matSuffix [for]="startDate"></mat-datepicker-toggle>
|
||||
<mat-datepicker #startDate></mat-datepicker>
|
||||
<mat-error *ngIf="formGroup.get('startDate').hasError('backendError')">{{formGroup.get('startDate').getError('backendError').message}}</mat-error>
|
||||
|
@ -72,16 +72,16 @@
|
|||
</mat-form-field>
|
||||
|
||||
<mat-form-field class="col-md-6">
|
||||
<input matInput (focus)="endDate.open()" (click)="endDate.open()" placeholder="{{'PROJECT-EDITOR.FIELDS.END' | translate}}" class="table-input" [matDatepicker]="endDate" formControlName="endDate">
|
||||
<input matInput (focus)="endDate.open()" (click)="endDate.open()" placeholder="{{'GRANT-EDITOR.FIELDS.END' | translate}}" class="table-input" [matDatepicker]="endDate" formControlName="endDate">
|
||||
<mat-datepicker-toggle matSuffix [for]="endDate"></mat-datepicker-toggle>
|
||||
<mat-datepicker #endDate></mat-datepicker>
|
||||
<mat-error *ngIf="formGroup.get('endDate').hasError('backendError')">{{formGroup.get('endDate').getError('backendError').message}}</mat-error>
|
||||
<mat-error *ngIf="formGroup.get('endDate').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||
</mat-form-field>
|
||||
<mat-error *ngIf="formGroup.hasError('startAfterEndError')"class="col-md-12">{{'GENERAL.VALIDATION.PROJECT-START-AFTER-END' | translate}}</mat-error>
|
||||
<mat-error *ngIf="formGroup.hasError('startAfterEndError')"class="col-md-12">{{'GENERAL.VALIDATION.GRANT-START-AFTER-END' | translate}}</mat-error>
|
||||
|
||||
<mat-form-field class="col-md-12">
|
||||
<textarea matInput class="description-area" placeholder="{{'PROJECT-EDITOR.FIELDS.DESCRIPTION' | translate}}" formControlName="description" required></textarea>
|
||||
<textarea matInput class="description-area" placeholder="{{'GRANT-EDITOR.FIELDS.DESCRIPTION' | translate}}" formControlName="description" required></textarea>
|
||||
<mat-error *ngIf="formGroup.get('description').hasError('backendError')">{{formGroup.get('description').getError('backendError').message}}</mat-error>
|
||||
<mat-error *ngIf="formGroup.get('description').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||
</mat-form-field>
|
||||
|
@ -89,16 +89,16 @@
|
|||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<div class="col-auto right-button">
|
||||
<button mat-raised-button color="primary" (click)="cancel()" type="button">{{'PROJECT-EDITOR.ACTIONS.CANCEL' |
|
||||
<button mat-raised-button color="primary" (click)="cancel()" type="button">{{'GRANT-EDITOR.ACTIONS.CANCEL' |
|
||||
translate}}</button>
|
||||
</div>
|
||||
<div class="col"></div>
|
||||
<div class="col-auto right-button" *ngIf="!isNew && editMode">
|
||||
<button mat-raised-button color="primary" type="button" (click)="delete()">{{'PROJECT-EDITOR.ACTIONS.DELETE'
|
||||
<button mat-raised-button color="primary" type="button" (click)="delete()">{{'GRANT-EDITOR.ACTIONS.DELETE'
|
||||
| translate}}</button>
|
||||
</div>
|
||||
<div class="col-auto right-button" *ngIf="isNew || editMode">
|
||||
<button mat-raised-button color="primary" type="submit">{{'PROJECT-EDITOR.ACTIONS.SAVE'
|
||||
<button mat-raised-button color="primary" type="submit">{{'GRANT-EDITOR.ACTIONS.SAVE'
|
||||
| translate}}</button>
|
||||
</div>
|
||||
</div>
|
|
@ -1,6 +1,6 @@
|
|||
.project-editor {
|
||||
.grant-editor {
|
||||
|
||||
.project-editor-header-actions {
|
||||
.grant-editor-header-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
|
@ -8,40 +8,40 @@ import { takeUntil } from 'rxjs/operators';
|
|||
import { environment } from '../../../../environments/environment';
|
||||
import { ValidationErrorModel } from '../../../common/forms/validation/error-model/validation-error-model';
|
||||
import { BaseComponent } from '../../../core/common/base/base.component';
|
||||
import { ProjectType } from '../../../core/common/enum/project-type';
|
||||
import { ProjectListingModel } from '../../../core/model/project/project-listing';
|
||||
import { ProjectFileUploadService } from '../../../core/services/project/project-file-upload.service';
|
||||
import { ProjectService } from '../../../core/services/project/project.service';
|
||||
import { GrantType } from '../../../core/common/enum/grant-type';
|
||||
import { GrantListingModel } from '../../../core/model/grant/grant-listing';
|
||||
import { GrantFileUploadService } from '../../../core/services/grant/grant-file-upload.service';
|
||||
import { GrantService } from '../../../core/services/grant/grant.service';
|
||||
import { ConfirmationDialogComponent } from '../../../library/confirmation-dialog/confirmation-dialog.component';
|
||||
import { SnackBarNotificationComponent } from '../../../library/notification/snack-bar/snack-bar-notification.component';
|
||||
import { BreadcrumbItem } from '../../misc/breadcrumb/definition/breadcrumb-item';
|
||||
import { IBreadCrumbComponent } from '../../misc/breadcrumb/definition/IBreadCrumbComponent';
|
||||
import { ProjectEditorModel } from './project-editor.model';
|
||||
import { GrantEditorModel } from './grant-editor.model';
|
||||
import { SnackBarNotificationLevel, UiNotificationService } from '../../../core/services/notification/ui-notification-service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-project-editor-component',
|
||||
templateUrl: 'project-editor.component.html',
|
||||
styleUrls: ['./project-editor.component.scss']
|
||||
selector: 'app-grant-editor-component',
|
||||
templateUrl: 'grant-editor.component.html',
|
||||
styleUrls: ['./grant-editor.component.scss']
|
||||
})
|
||||
export class ProjectEditorComponent extends BaseComponent implements OnInit, IBreadCrumbComponent {
|
||||
export class GrantEditorComponent extends BaseComponent implements OnInit, IBreadCrumbComponent {
|
||||
|
||||
breadCrumbs: Observable<BreadcrumbItem[]> = Observable.of([]);
|
||||
isNew = true;
|
||||
project: ProjectEditorModel;
|
||||
grant: GrantEditorModel;
|
||||
formGroup: FormGroup = null;
|
||||
host = environment.Server;
|
||||
editMode = false;
|
||||
sizeError = false;
|
||||
maxFileSize: number = 1048576;
|
||||
constructor(
|
||||
private projectService: ProjectService,
|
||||
private grantService: GrantService,
|
||||
private route: ActivatedRoute,
|
||||
public snackBar: MatSnackBar,
|
||||
public router: Router,
|
||||
public language: TranslateService,
|
||||
private dialog: MatDialog,
|
||||
private projectFileUploadService: ProjectFileUploadService,
|
||||
private grantFileUploadService: GrantFileUploadService,
|
||||
private uiNotificationService: UiNotificationService
|
||||
) {
|
||||
super();
|
||||
|
@ -55,21 +55,21 @@ export class ProjectEditorComponent extends BaseComponent implements OnInit, IBr
|
|||
|
||||
if (itemId != null) {
|
||||
this.isNew = false;
|
||||
this.projectService.getSingle(itemId).map(data => data as ProjectListingModel)
|
||||
this.grantService.getSingle(itemId).map(data => data as GrantListingModel)
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(data => {
|
||||
this.project = new ProjectEditorModel().fromModel(data);
|
||||
this.formGroup = this.project.buildForm(null, this.project.type === ProjectType.External || !this.editMode);
|
||||
this.grant = new GrantEditorModel().fromModel(data);
|
||||
this.formGroup = this.grant.buildForm(null, this.grant.type === GrantType.External || !this.editMode);
|
||||
const breadCrumbs = [];
|
||||
breadCrumbs.push({
|
||||
parentComponentName: null,
|
||||
label: this.language.instant('NAV-BAR.PROJECTS').toUpperCase(),
|
||||
url: '/projects' + this.project.id
|
||||
label: this.language.instant('NAV-BAR.GRANTS').toUpperCase(),
|
||||
url: '/grants' + this.grant.id
|
||||
});
|
||||
breadCrumbs.push({
|
||||
parentComponentName: 'ProjectListingComponent',
|
||||
label: this.project.label,
|
||||
url: '/projects/edit/' + this.project.id
|
||||
parentComponentName: 'GrantListingComponent',
|
||||
label: this.grant.label,
|
||||
url: '/grants/edit/' + this.grant.id
|
||||
});
|
||||
this.breadCrumbs = Observable.of(breadCrumbs);
|
||||
});
|
||||
|
@ -77,19 +77,19 @@ export class ProjectEditorComponent extends BaseComponent implements OnInit, IBr
|
|||
const breadCrumbs = [];
|
||||
breadCrumbs.push({
|
||||
parentComponentName: null,
|
||||
label: this.language.instant('NAV-BAR.PROJECTS').toUpperCase(),
|
||||
url: '/projects'
|
||||
label: this.language.instant('NAV-BAR.GRANTS').toUpperCase(),
|
||||
url: '/grants'
|
||||
});
|
||||
breadCrumbs.push({
|
||||
parentComponentName: 'ProjectListingComponent',
|
||||
parentComponentName: 'GrantListingComponent',
|
||||
label: this.language.instant('QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.ACTIONS.CREATE-NEW').toUpperCase(),
|
||||
url: '/projects/new/'
|
||||
url: '/grants/new/'
|
||||
});
|
||||
this.breadCrumbs = Observable.of(breadCrumbs);
|
||||
|
||||
this.project = new ProjectEditorModel();
|
||||
this.grant = new GrantEditorModel();
|
||||
setTimeout(() => {
|
||||
this.formGroup = this.project.buildForm();
|
||||
this.formGroup = this.grant.buildForm();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@ -106,7 +106,7 @@ export class ProjectEditorComponent extends BaseComponent implements OnInit, IBr
|
|||
}
|
||||
|
||||
onSubmit(): void {
|
||||
this.projectService.createProject(this.formGroup.value)
|
||||
this.grantService.createGrant(this.formGroup.value)
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(
|
||||
complete => this.onCallbackSuccess(),
|
||||
|
@ -116,7 +116,7 @@ export class ProjectEditorComponent extends BaseComponent implements OnInit, IBr
|
|||
|
||||
onCallbackSuccess(): void {
|
||||
this.uiNotificationService.snackBarNotification(this.isNew ? this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-CREATION') : this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE'), SnackBarNotificationLevel.Success);
|
||||
this.router.navigate(['/projects']);
|
||||
this.router.navigate(['/grants']);
|
||||
}
|
||||
|
||||
onCallbackError(errorResponse: any) {
|
||||
|
@ -126,12 +126,12 @@ export class ProjectEditorComponent extends BaseComponent implements OnInit, IBr
|
|||
|
||||
public setErrorModel(validationErrorModel: ValidationErrorModel) {
|
||||
Object.keys(validationErrorModel).forEach(item => {
|
||||
(<any>this.project.validationErrorModel)[item] = (<any>validationErrorModel)[item];
|
||||
(<any>this.grant.validationErrorModel)[item] = (<any>validationErrorModel)[item];
|
||||
});
|
||||
}
|
||||
|
||||
public cancel(): void {
|
||||
this.router.navigate(['/projects']);
|
||||
this.router.navigate(['/grants']);
|
||||
}
|
||||
|
||||
public delete(): void {
|
||||
|
@ -146,7 +146,7 @@ export class ProjectEditorComponent extends BaseComponent implements OnInit, IBr
|
|||
});
|
||||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
|
||||
if (result) {
|
||||
this.projectService.delete(this.project.id)
|
||||
this.grantService.delete(this.grant.id)
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(
|
||||
complete => { this.onCallbackSuccess() },
|
||||
|
@ -187,7 +187,7 @@ export class ProjectEditorComponent extends BaseComponent implements OnInit, IBr
|
|||
}
|
||||
|
||||
public enableForm() {
|
||||
if (!this.isExternalProject()) {
|
||||
if (!this.isExternalGrant()) {
|
||||
this.editMode = true;
|
||||
this.formGroup.enable();
|
||||
}
|
||||
|
@ -205,12 +205,12 @@ export class ProjectEditorComponent extends BaseComponent implements OnInit, IBr
|
|||
return false;
|
||||
}
|
||||
|
||||
public goToProjectDmps() {
|
||||
this.router.navigate(['plans/project/' + this.project.id], { queryParams: { projectLabel: this.project.label } });
|
||||
public goToGrantDmps() {
|
||||
this.router.navigate(['plans/grant/' + this.grant.id], { queryParams: { grantLabel: this.grant.label } });
|
||||
}
|
||||
|
||||
public isExternalProject() {
|
||||
return this.project.type === ProjectType.External;
|
||||
public isExternalGrant() {
|
||||
return this.grant.type === GrantType.External;
|
||||
}
|
||||
|
||||
public previewImage(event): void {
|
||||
|
@ -226,7 +226,7 @@ export class ProjectEditorComponent extends BaseComponent implements OnInit, IBr
|
|||
} else {
|
||||
formdata.append('file', fileList);
|
||||
}
|
||||
this.projectFileUploadService.uploadFile(formdata)
|
||||
this.grantFileUploadService.uploadFile(formdata)
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(files => this.formGroup.get('files').patchValue(files));
|
||||
}
|
|
@ -2,16 +2,16 @@ import { FormBuilder, FormGroup, Validators, AbstractControl } from '@angular/fo
|
|||
import { BackendErrorValidator } from '../../../common/forms/validation/custom-validator';
|
||||
import { ValidationErrorModel } from '../../../common/forms/validation/error-model/validation-error-model';
|
||||
import { ValidationContext } from '../../../common/forms/validation/validation-context';
|
||||
import { ProjectType } from '../../../core/common/enum/project-type';
|
||||
import { GrantType } from '../../../core/common/enum/grant-type';
|
||||
import { Status } from '../../../core/common/enum/Status';
|
||||
import { ContentFile, ProjectListingModel } from '../../../core/model/project/project-listing';
|
||||
import { ContentFile, GrantListingModel } from '../../../core/model/grant/grant-listing';
|
||||
|
||||
export class ProjectEditorModel {
|
||||
export class GrantEditorModel {
|
||||
public id: string;
|
||||
public label: string;
|
||||
public abbreviation: string;
|
||||
public reference: string;
|
||||
public type: ProjectType = ProjectType.Internal;
|
||||
public type: GrantType = GrantType.Internal;
|
||||
public uri: String;
|
||||
public status: Status = Status.Active;
|
||||
public startDate: Date;
|
||||
|
@ -21,7 +21,7 @@ export class ProjectEditorModel {
|
|||
public files: ContentFile[];
|
||||
public validationErrorModel: ValidationErrorModel = new ValidationErrorModel();
|
||||
|
||||
fromModel(item: ProjectListingModel): ProjectEditorModel {
|
||||
fromModel(item: GrantListingModel): GrantEditorModel {
|
||||
this.id = item.id;
|
||||
this.label = item.label;
|
||||
this.type = item.type;
|
|
@ -0,0 +1,27 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { CommonFormsModule } from '../../common/forms/common-forms.module';
|
||||
import { CommonUiModule } from '../../common/ui/common-ui.module';
|
||||
import { ConfirmationDialogModule } from '../../library/confirmation-dialog/confirmation-dialog.module';
|
||||
import { UrlListingModule } from '../../library/url-listing/url-listing.module';
|
||||
import { GrantEditorComponent } from './editor/grant-editor.component';
|
||||
import { GrantCriteriaComponent } from './listing/criteria/grant-criteria.component';
|
||||
import { GrantListingItemComponent } from './listing/listing-item/grant-listing-item.component';
|
||||
import { GrantListingComponent } from './listing/grant-listing.component';
|
||||
import { GrantRoutingModule } from './grant.routing';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonUiModule,
|
||||
CommonFormsModule,
|
||||
UrlListingModule,
|
||||
ConfirmationDialogModule,
|
||||
GrantRoutingModule
|
||||
],
|
||||
declarations: [
|
||||
GrantListingComponent,
|
||||
GrantCriteriaComponent,
|
||||
GrantEditorComponent,
|
||||
GrantListingItemComponent
|
||||
]
|
||||
})
|
||||
export class GrantModule { }
|
|
@ -1,26 +1,26 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { ProjectEditorComponent } from './editor/project-editor.component';
|
||||
import { ProjectListingComponent } from './listing/project-listing.component';
|
||||
import { GrantEditorComponent } from './editor/grant-editor.component';
|
||||
import { GrantListingComponent } from './listing/grant-listing.component';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: ProjectListingComponent,
|
||||
component: GrantListingComponent,
|
||||
data: {
|
||||
breadcrumb: true
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'edit/:id',
|
||||
component: ProjectEditorComponent,
|
||||
component: GrantEditorComponent,
|
||||
data: {
|
||||
breadcrumb: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'new',
|
||||
component: ProjectEditorComponent,
|
||||
component: GrantEditorComponent,
|
||||
data: {
|
||||
breadcrumb: true
|
||||
},
|
||||
|
@ -31,4 +31,4 @@ const routes: Routes = [
|
|||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule]
|
||||
})
|
||||
export class ProjectRoutingModule { }
|
||||
export class GrantRoutingModule { }
|
|
@ -1,37 +1,37 @@
|
|||
<div class="project-criteria">
|
||||
<div class="grant-criteria">
|
||||
<div class="filters">
|
||||
<h6 class="filters-title">{{'CRITERIA.FILTERS'| translate}}</h6>
|
||||
<div class="row" style="justify-content: center;">
|
||||
<!-- <h4 class="col-md-12">{{'CRITERIA.FILTERS'| translate}}</h4> -->
|
||||
<mat-form-field class="col-11 search">
|
||||
<input matInput placeholder=" {{'CRITERIA.PROJECTS.LIKE'| translate}}" name="projectCriteriaLike" [(ngModel)]="criteria.like" (ngModelChange)="controlModified()">
|
||||
<input matInput placeholder=" {{'CRITERIA.GRANTS.LIKE'| translate}}" name="grantCriteriaLike" [(ngModel)]="criteria.like" (ngModelChange)="controlModified()">
|
||||
<mat-icon matSuffix class="style-icon">search</mat-icon>
|
||||
</mat-form-field>
|
||||
<mat-form-field class="col-10 filter-category">
|
||||
<input matInput (focus)="periodStartPicker.open()" (click)="periodStartPicker.open()" placeholder=" {{this.languageResolver.getBy('criteriaStart')| translate}}" [matDatepicker]="periodStartPicker" name="projectCriteriaPeriodStart" [(ngModel)]="criteria.periodStart" (ngModelChange)="controlModified()" [errorStateMatcher]="this">
|
||||
<input matInput (focus)="periodStartPicker.open()" (click)="periodStartPicker.open()" placeholder=" {{this.languageResolver.getBy('criteriaStart')| translate}}" [matDatepicker]="periodStartPicker" name="grantCriteriaPeriodStart" [(ngModel)]="criteria.periodStart" (ngModelChange)="controlModified()" [errorStateMatcher]="this">
|
||||
<mat-datepicker-toggle matSuffix [for]="periodStartPicker"></mat-datepicker-toggle>
|
||||
<mat-datepicker #periodStartPicker></mat-datepicker>
|
||||
<mat-error>{{'GENERAL.VALIDATION.PROJECT-START-AFTER-END' | translate}}</mat-error>
|
||||
<mat-error>{{'GENERAL.VALIDATION.GRANT-START-AFTER-END' | translate}}</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field class="col-10 filter-category">
|
||||
<input matInput (focus)="periodEndPicker.open()" (click)="periodEndPicker.open()" name="projectCriteriaPeriodEnd" placeholder=" {{this.languageResolver.getBy('criteriaEnd')| translate}}" [matDatepicker]="periodEndPicker" [(ngModel)]="criteria.periodEnd" (ngModelChange)="controlModified()" [errorStateMatcher]="this">
|
||||
<input matInput (focus)="periodEndPicker.open()" (click)="periodEndPicker.open()" name="grantCriteriaPeriodEnd" placeholder=" {{this.languageResolver.getBy('criteriaEnd')| translate}}" [matDatepicker]="periodEndPicker" [(ngModel)]="criteria.periodEnd" (ngModelChange)="controlModified()" [errorStateMatcher]="this">
|
||||
<mat-datepicker-toggle matSuffix [for]="periodEndPicker"></mat-datepicker-toggle>
|
||||
<mat-datepicker #periodEndPicker></mat-datepicker>
|
||||
<mat-error>{{'GENERAL.VALIDATION.PROJECT-START-AFTER-END' | translate}}</mat-error>
|
||||
<mat-error>{{'GENERAL.VALIDATION.GRANT-START-AFTER-END' | translate}}</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
|
||||
<mat-form-field class="col-10 filter-category">
|
||||
<mat-select placeholder=" {{ 'CRITERIA.PROJECTS.PROJECT-STATE-TYPE' | translate}}" [(ngModel)]="criteria.projectStateType" (ngModelChange)="controlModified()">
|
||||
<mat-select placeholder=" {{ 'CRITERIA.GRANTS.GRANT-STATE-TYPE' | translate}}" [(ngModel)]="criteria.grantStateType" (ngModelChange)="controlModified()">
|
||||
<mat-option [value]="null">
|
||||
{{ 'CRITERIA.PROJECTS.TYPES.NONE' | translate}}
|
||||
{{ 'CRITERIA.GRANTS.TYPES.NONE' | translate}}
|
||||
</mat-option>
|
||||
<mat-option [value]="ProjectStateType.OnGoing">
|
||||
{{ 'CRITERIA.PROJECTS.TYPES.ON-GOING' | translate}}
|
||||
<mat-option [value]="GrantStateType.OnGoing">
|
||||
{{ 'CRITERIA.GRANTS.TYPES.ON-GOING' | translate}}
|
||||
</mat-option>
|
||||
<mat-option [value]="ProjectStateType.Finished">
|
||||
{{ 'CRITERIA.PROJECTS.TYPES.FINISHED' | translate}}
|
||||
<mat-option [value]="GrantStateType.Finished">
|
||||
{{ 'CRITERIA.GRANTS.TYPES.FINISHED' | translate}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
|
@ -2,21 +2,21 @@ import { Component, OnInit } from '@angular/core';
|
|||
import { FormBuilder, FormControl, FormGroup, FormGroupDirective, NgForm } from '@angular/forms';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { ValidationErrorModel } from '../../../../common/forms/validation/error-model/validation-error-model';
|
||||
import { ProjectStateType } from '../../../../core/common/enum/project-state-type';
|
||||
import { ProjectCriteria } from '../../../../core/query/project/project-criteria';
|
||||
import { GrantStateType } from '../../../../core/common/enum/grant-state-type';
|
||||
import { GrantCriteria } from '../../../../core/query/grant/grant-criteria';
|
||||
import { LanguageResolverService } from '../../../../services/language-resolver/language-resolver.service';
|
||||
import { BaseCriteriaComponent } from '../../../misc/criteria/base-criteria.component';
|
||||
import { ErrorStateMatcher } from '@angular/material';
|
||||
|
||||
@Component({
|
||||
selector: 'app-project-criteria-component',
|
||||
templateUrl: './project-criteria.component.html',
|
||||
styleUrls: ['./project-criteria.component.scss']
|
||||
selector: 'app-grant-criteria-component',
|
||||
templateUrl: './grant-criteria.component.html',
|
||||
styleUrls: ['./grant-criteria.component.scss']
|
||||
})
|
||||
export class ProjectCriteriaComponent extends BaseCriteriaComponent implements OnInit, ErrorStateMatcher {
|
||||
export class GrantCriteriaComponent extends BaseCriteriaComponent implements OnInit, ErrorStateMatcher {
|
||||
|
||||
public ProjectStateType = ProjectStateType;
|
||||
public criteria: ProjectCriteria = new ProjectCriteria();
|
||||
public GrantStateType = GrantStateType;
|
||||
public criteria: GrantCriteria = new GrantCriteria();
|
||||
|
||||
constructor(
|
||||
public language: TranslateService,
|
||||
|
@ -29,12 +29,12 @@ export class ProjectCriteriaComponent extends BaseCriteriaComponent implements O
|
|||
ngOnInit() {
|
||||
super.ngOnInit();
|
||||
if (this.criteria == null) {
|
||||
this.criteria = new ProjectCriteria();
|
||||
this.criteria.projectStateType = ProjectStateType.OnGoing;
|
||||
this.criteria = new GrantCriteria();
|
||||
this.criteria.grantStateType = GrantStateType.OnGoing;
|
||||
}
|
||||
}
|
||||
|
||||
setCriteria(criteria: ProjectCriteria): void {
|
||||
setCriteria(criteria: GrantCriteria): void {
|
||||
this.criteria = criteria;
|
||||
}
|
||||
|
|
@ -4,22 +4,22 @@
|
|||
<div class="card-header card-header-plain d-flex">
|
||||
<div class="card-desc d-flex flex-column justify-content-center">
|
||||
<h4 class="card-title">{{languageResolverService.getBy('listingTitle') | translate}}</h4>
|
||||
<!-- <p class="card-category">{{'PROJECT-LISTING.SUBTITLE' | translate}}</p> -->
|
||||
<!-- <p class="card-category">{{'GRANT-LISTING.SUBTITLE' | translate}}</p> -->
|
||||
</div>
|
||||
<div class="d-flex align-items-center ml-auto p-2">
|
||||
<button mat-raised-button color="primary" class="text-uppercase lightblue-btn" [routerLink]="['./new']">
|
||||
<mat-icon>add</mat-icon> {{'PROJECT-LISTING.ACTIONS.NEW' | translate}}
|
||||
<mat-icon>add</mat-icon> {{'GRANT-LISTING.ACTIONS.NEW' | translate}}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body table-responsive">
|
||||
<div class="project-listing row">
|
||||
<div class="grant-listing row">
|
||||
<div class="col-3">
|
||||
<app-project-criteria-component class="col-auto"></app-project-criteria-component>
|
||||
<app-grant-criteria-component class="col-auto"></app-grant-criteria-component>
|
||||
</div>
|
||||
<div class="col-9">
|
||||
<div class="row" *ngFor="let item of listingItems; let i = index">
|
||||
<app-project-listing-item-component class="col-12" [showDivider]="i !== (listingItems.length - 1)" [project]="item" (onClick)="rowClicked($event)"></app-project-listing-item-component>
|
||||
<app-grant-listing-item-component class="col-12" [showDivider]="i !== (listingItems.length - 1)" [grant]="item" (onClick)="rowClicked($event)"></app-grant-listing-item-component>
|
||||
</div>
|
||||
<mat-paginator #paginator [length]="totalCount" [pageSizeOptions]="[10, 25, 100]" (page)="pageThisEvent($event)" class="mt-2"></mat-paginator>
|
||||
</div>
|
||||
|
@ -32,39 +32,39 @@
|
|||
<div class="main-content">
|
||||
<div class="container-fluid">
|
||||
<h3>{{languageResolverService.getBy('listingTitle') | translate}}</h3>
|
||||
<app-project-criteria-component></app-project-criteria-component>
|
||||
<app-grant-criteria-component></app-grant-criteria-component>
|
||||
<mat-card class="mat-card">
|
||||
<mat-card-content>
|
||||
<div class="row">
|
||||
<mat-table class="col-md-12" [dataSource]="dataSource" matSort (matSortChange)="refresh()">
|
||||
|
||||
<ng-container cdkColumnDef="avatar">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header="avatar">{{'PROJECT-LISTING.COLUMNS.AVATAR' | translate}}</mat-header-cell>
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header="avatar">{{'GRANT-LISTING.COLUMNS.AVATAR' | translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">
|
||||
<img mat-card-avatar [src]="host+'files/'+row.files[0].id+'?location='+row.files[0].location+'&type='+row.files[0].type">
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
<ng-container cdkColumnDef="name">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header="label">{{'PROJECT-LISTING.COLUMNS.NAME' | translate}}</mat-header-cell>
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header="label">{{'GRANT-LISTING.COLUMNS.NAME' | translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row">{{row.label}}</mat-cell>
|
||||
</ng-container>
|
||||
<ng-container cdkColumnDef="abbreviation">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header="abbreviation">{{'PROJECT-LISTING.COLUMNS.ABBREVIATION' |
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header="abbreviation">{{'GRANT-LISTING.COLUMNS.ABBREVIATION' |
|
||||
translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.abbreviation}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container cdkColumnDef="start">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header="startdate">{{'PROJECT-LISTING.COLUMNS.START' | translate}}</mat-header-cell>
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header="startdate">{{'GRANT-LISTING.COLUMNS.START' | translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.startDate | date:'shortDate'}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container cdkColumnDef="end">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header="enddate">{{'PROJECT-LISTING.COLUMNS.END' | translate}}</mat-header-cell>
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header="enddate">{{'GRANT-LISTING.COLUMNS.END' | translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"> {{row.endDate | date:'shortDate'}} </mat-cell>
|
||||
</ng-container>
|
||||
<ng-container cdkColumnDef="dmps">
|
||||
<mat-header-cell *matHeaderCellDef>{{'PROJECT-LISTING.COLUMNS.DMPS' | translate}}</mat-header-cell>
|
||||
<mat-header-cell *matHeaderCellDef>{{'GRANT-LISTING.COLUMNS.DMPS' | translate}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row" (click)="$event.stopPropagation()">
|
||||
<app-url-listing [items]="row.dmps" [urlLimit]="5" [parameters]="{ projectLabel: row.label }"></app-url-listing>
|
||||
<app-url-listing [items]="row.dmps" [urlLimit]="5" [parameters]="{ grantLabel: row.label }"></app-url-listing>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
.project-listing {
|
||||
.grant-listing {
|
||||
.mat-card {
|
||||
margin: 1em 0;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue