diff --git a/dmp-frontend/src/app/app-routing.module.ts b/dmp-frontend/src/app/app-routing.module.ts index a49c429a5..708befe87 100644 --- a/dmp-frontend/src/app/app-routing.module.ts +++ b/dmp-frontend/src/app/app-routing.module.ts @@ -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 } diff --git a/dmp-frontend/src/app/app.component.ts b/dmp-frontend/src/app/app.component.ts index 691f7651a..43529279e 100644 --- a/dmp-frontend/src/app/app.component.ts +++ b/dmp-frontend/src/app/app.component.ts @@ -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() { diff --git a/dmp-frontend/src/app/core/common/enum/grant-state-type.ts b/dmp-frontend/src/app/core/common/enum/grant-state-type.ts new file mode 100644 index 000000000..0f2a392f7 --- /dev/null +++ b/dmp-frontend/src/app/core/common/enum/grant-state-type.ts @@ -0,0 +1,4 @@ +export enum GrantStateType { + OnGoing = 0, + Finished = 1 +} diff --git a/dmp-frontend/src/app/core/common/enum/project-type.ts b/dmp-frontend/src/app/core/common/enum/grant-type.ts similarity index 51% rename from dmp-frontend/src/app/core/common/enum/project-type.ts rename to dmp-frontend/src/app/core/common/enum/grant-type.ts index 4f26ba5dc..a61bb1d61 100644 --- a/dmp-frontend/src/app/core/common/enum/project-type.ts +++ b/dmp-frontend/src/app/core/common/enum/grant-type.ts @@ -1,4 +1,4 @@ -export enum ProjectType { +export enum GrantType { External = 0, Internal = 1 -} \ No newline at end of file +} diff --git a/dmp-frontend/src/app/core/common/enum/project-state-type.ts b/dmp-frontend/src/app/core/common/enum/project-state-type.ts deleted file mode 100644 index 4c210bfb6..000000000 --- a/dmp-frontend/src/app/core/common/enum/project-state-type.ts +++ /dev/null @@ -1,4 +0,0 @@ -export enum ProjectStateType { - OnGoing = 0, - Finished = 1 -} diff --git a/dmp-frontend/src/app/core/common/enum/recent-activity-type.ts b/dmp-frontend/src/app/core/common/enum/recent-activity-type.ts index 30914a9e5..34ddb808e 100644 --- a/dmp-frontend/src/app/core/common/enum/recent-activity-type.ts +++ b/dmp-frontend/src/app/core/common/enum/recent-activity-type.ts @@ -1,5 +1,5 @@ export enum RecentActivityType { - Project = 0, + Grant = 0, Dataset = 1, Dmp = 2 } diff --git a/dmp-frontend/src/app/core/core-service.module.ts b/dmp-frontend/src/app/core/core-service.module.ts index 10237931d..6b923628c 100644 --- a/dmp-frontend/src/app/core/core-service.module.ts +++ b/dmp-frontend/src/app/core/core-service.module.ts @@ -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, diff --git a/dmp-frontend/src/app/core/model/dashboard/dashboard-statistics-model.ts b/dmp-frontend/src/app/core/model/dashboard/dashboard-statistics-model.ts index 251c7aabb..4a83f56cc 100644 --- a/dmp-frontend/src/app/core/model/dashboard/dashboard-statistics-model.ts +++ b/dmp-frontend/src/app/core/model/dashboard/dashboard-statistics-model.ts @@ -2,7 +2,7 @@ import { Serializable } from "../../../common/types/json/serializable"; export interface DashboardStatisticsModel { totalDataManagementPlanCount: number; - totalProjectCount: number; + totalGrantCount: number; totalDataSetCount: number; totalOrganisationCount: number; } diff --git a/dmp-frontend/src/app/core/model/dataset/dataset-listing.ts b/dmp-frontend/src/app/core/model/dataset/dataset-listing.ts index 928161ccc..80e0f931e 100644 --- a/dmp-frontend/src/app/core/model/dataset/dataset-listing.ts +++ b/dmp-frontend/src/app/core/model/dataset/dataset-listing.ts @@ -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; diff --git a/dmp-frontend/src/app/core/model/dmp/dmp-listing.ts b/dmp-frontend/src/app/core/model/dmp/dmp-listing.ts index 9a400f1fd..93b02558d 100644 --- a/dmp-frontend/src/app/core/model/dmp/dmp-listing.ts +++ b/dmp-frontend/src/app/core/model/dmp/dmp-listing.ts @@ -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; diff --git a/dmp-frontend/src/app/core/model/dmp/dmp-overview.ts b/dmp-frontend/src/app/core/model/dmp/dmp-overview.ts index 644d85c7b..d6ac742cf 100644 --- a/dmp-frontend/src/app/core/model/dmp/dmp-overview.ts +++ b/dmp-frontend/src/app/core/model/dmp/dmp-overview.ts @@ -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[]; diff --git a/dmp-frontend/src/app/core/model/dmp/dmp.ts b/dmp-frontend/src/app/core/model/dmp/dmp.ts index 72343cc85..ee0a894e3 100644 --- a/dmp-frontend/src/app/core/model/dmp/dmp.ts +++ b/dmp-frontend/src/app/core/model/dmp/dmp.ts @@ -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[]; diff --git a/dmp-frontend/src/app/core/model/project/project-listing.ts b/dmp-frontend/src/app/core/model/grant/grant-listing.ts similarity index 79% rename from dmp-frontend/src/app/core/model/project/project-listing.ts rename to dmp-frontend/src/app/core/model/grant/grant-listing.ts index 823326dfd..f4657d28e 100644 --- a/dmp-frontend/src/app/core/model/project/project-listing.ts +++ b/dmp-frontend/src/app/core/model/grant/grant-listing.ts @@ -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; diff --git a/dmp-frontend/src/app/core/model/project/project-overview.ts b/dmp-frontend/src/app/core/model/grant/grant-overview.ts similarity index 75% rename from dmp-frontend/src/app/core/model/project/project-overview.ts rename to dmp-frontend/src/app/core/model/grant/grant-overview.ts index d11d5e633..94b507aa2 100644 --- a/dmp-frontend/src/app/core/model/project/project-overview.ts +++ b/dmp-frontend/src/app/core/model/grant/grant-overview.ts @@ -1,4 +1,4 @@ -export interface ProjectOverviewModel { +export interface GrantOverviewModel { id: String; label: String; uri: String; diff --git a/dmp-frontend/src/app/core/query/dataset/dataset-criteria.ts b/dmp-frontend/src/app/core/query/dataset/dataset-criteria.ts index 4893b34a9..8d876e9b0 100644 --- a/dmp-frontend/src/app/core/query/dataset/dataset-criteria.ts +++ b/dmp-frontend/src/app/core/query/dataset/dataset-criteria.ts @@ -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[] = []; diff --git a/dmp-frontend/src/app/core/query/dmp/dmp-criteria.ts b/dmp-frontend/src/app/core/query/dmp/dmp-criteria.ts index a329d2041..793c46815 100644 --- a/dmp-frontend/src/app/core/query/dmp/dmp-criteria.ts +++ b/dmp-frontend/src/app/core/query/dmp/dmp-criteria.ts @@ -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; diff --git a/dmp-frontend/src/app/core/query/explore-dataset/explore-dataset-criteria.ts b/dmp-frontend/src/app/core/query/explore-dataset/explore-dataset-criteria.ts index 0eb4bc607..65d03f029 100644 --- a/dmp-frontend/src/app/core/query/explore-dataset/explore-dataset-criteria.ts +++ b/dmp-frontend/src/app/core/query/explore-dataset/explore-dataset-criteria.ts @@ -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 = []; diff --git a/dmp-frontend/src/app/core/query/explore-dmp/explore-dmp-criteria.ts b/dmp-frontend/src/app/core/query/explore-dmp/explore-dmp-criteria.ts index 42eb5324a..cfd2ea409 100644 --- a/dmp-frontend/src/app/core/query/explore-dmp/explore-dmp-criteria.ts +++ b/dmp-frontend/src/app/core/query/explore-dmp/explore-dmp-criteria.ts @@ -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[] = []; } diff --git a/dmp-frontend/src/app/core/query/grant/grant-criteria.ts b/dmp-frontend/src/app/core/query/grant/grant-criteria.ts new file mode 100644 index 000000000..e84802ac2 --- /dev/null +++ b/dmp-frontend/src/app/core/query/grant/grant-criteria.ts @@ -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; +} diff --git a/dmp-frontend/src/app/core/query/project/project-criteria.ts b/dmp-frontend/src/app/core/query/project/project-criteria.ts deleted file mode 100644 index bf8c8e795..000000000 --- a/dmp-frontend/src/app/core/query/project/project-criteria.ts +++ /dev/null @@ -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; -} diff --git a/dmp-frontend/src/app/core/services/dmp/dmp.service.ts b/dmp-frontend/src/app/core/services/dmp/dmp.service.ts index 289a824d8..4cb45c308 100644 --- a/dmp-frontend/src/app/core/services/dmp/dmp.service.ts +++ b/dmp-frontend/src/app/core/services/dmp/dmp.service.ts @@ -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(this.actionUrl + 'createZenodoDoi/' + id, {headers: this.headers}); } - getDynamicField(requestItem: RequestItem): any { + getDynamicField(requestItem: RequestItem): any { return this.http.post(this.actionUrl + 'dynamic', requestItem, { headers: this.headers }); } diff --git a/dmp-frontend/src/app/core/services/project/project-file-upload.service.ts b/dmp-frontend/src/app/core/services/grant/grant-file-upload.service.ts similarity index 89% rename from dmp-frontend/src/app/core/services/project/project-file-upload.service.ts rename to dmp-frontend/src/app/core/services/grant/grant-file-upload.service.ts index 21ff51f53..094f4bdef 100644 --- a/dmp-frontend/src/app/core/services/project/project-file-upload.service.ts +++ b/dmp-frontend/src/app/core/services/grant/grant-file-upload.service.ts @@ -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; diff --git a/dmp-frontend/src/app/core/services/grant/grant.service.ts b/dmp-frontend/src/app/core/services/grant/grant.service.ts new file mode 100644 index 000000000..4da0cd913 --- /dev/null +++ b/dmp-frontend/src/app/core/services/grant/grant.service.ts @@ -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, fieldsGroup?: string): Observable> { + if (fieldsGroup) { + return this.http.post>(this.actionUrl + 'paged?fieldsGroup=' + fieldsGroup, dataTableRequest, { headers: this.headers }); + } + else { + return this.http.post>(this.actionUrl + 'paged?fieldsGroup=' + 'autocomplete', dataTableRequest, { headers: this.headers }); + } + } + + getPublicPaged(dataTableRequest: DataTableRequest): Observable> { + return this.http.post>(this.actionUrl + 'public/paged', dataTableRequest, { headers: this.headers }); + } + + getWithExternal(requestItem: RequestItem): Observable { + return this.http.post(this.actionUrl + 'external', requestItem, { headers: this.headers }); + } + + getSingle(id: string): Observable { + return this.http.get(this.actionUrl + id, { headers: this.headers }); + } + + createGrant(grantModel: GrantListingModel): Observable { + return this.http.post(this.actionUrl, grantModel, { headers: this.headers }); + } + + // Actually sets it inactive. + delete(id: String): Observable { + return this.http.delete(this.actionUrl + id, { headers: this.headers }); + } +} diff --git a/dmp-frontend/src/app/core/services/project/project.service.ts b/dmp-frontend/src/app/core/services/project/project.service.ts deleted file mode 100644 index d7af200d7..000000000 --- a/dmp-frontend/src/app/core/services/project/project.service.ts +++ /dev/null @@ -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, fieldsGroup?: string): Observable> { - if (fieldsGroup) { - return this.http.post>(this.actionUrl + 'paged?fieldsGroup=' + fieldsGroup, dataTableRequest, { headers: this.headers }); - } - else { - return this.http.post>(this.actionUrl + 'paged?fieldsGroup=' + 'autocomplete', dataTableRequest, { headers: this.headers }); - } - } - - getPublicPaged(dataTableRequest: DataTableRequest): Observable> { - return this.http.post>(this.actionUrl + 'public/paged', dataTableRequest, { headers: this.headers }); - } - - getWithExternal(requestItem: RequestItem): Observable { - return this.http.post(this.actionUrl + 'external', requestItem, { headers: this.headers }); - } - - getSingle(id: string): Observable { - return this.http.get(this.actionUrl + id, { headers: this.headers }); - } - - createProject(projectModel: ProjectListingModel): Observable { - return this.http.post(this.actionUrl, projectModel, { headers: this.headers }); - } - - // Actually sets it inactive. - delete(id: String): Observable { - return this.http.delete(this.actionUrl + id, { headers: this.headers }); - } -} diff --git a/dmp-frontend/src/app/models/dynamic-field-grant/DynamicFieldGrantCriteria.ts b/dmp-frontend/src/app/models/dynamic-field-grant/DynamicFieldGrantCriteria.ts new file mode 100644 index 000000000..e82f095f5 --- /dev/null +++ b/dmp-frontend/src/app/models/dynamic-field-grant/DynamicFieldGrantCriteria.ts @@ -0,0 +1,9 @@ +export class DynamicFieldGrantCriteria { + public id: string; + public dynamicFields: DynamicFieldGrantCriteriaDependencies[]; +} + +export class DynamicFieldGrantCriteriaDependencies { + public value; + public property; +} diff --git a/dmp-frontend/src/app/models/dynamic-field-project/DynamicFieldProjectCriteria.ts b/dmp-frontend/src/app/models/dynamic-field-project/DynamicFieldProjectCriteria.ts deleted file mode 100644 index f0334ff85..000000000 --- a/dmp-frontend/src/app/models/dynamic-field-project/DynamicFieldProjectCriteria.ts +++ /dev/null @@ -1,9 +0,0 @@ -export class DynamicFieldProjectCriteria { - public id: string; - public dynamicFields: DynamicFieldProjectCriteriaDependencies[]; -} - -export class DynamicFieldProjectCriteriaDependencies { - public value; - public property; -} diff --git a/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dmp-profile-criteria.component.html b/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dmp-profile-criteria.component.html index 3e496f325..5ed6cc96b 100644 --- a/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dmp-profile-criteria.component.html +++ b/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dmp-profile-criteria.component.html @@ -3,7 +3,7 @@
- @@ -15,4 +15,4 @@
- \ No newline at end of file + diff --git a/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dmp-profile-criteria.component.ts b/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dmp-profile-criteria.component.ts index 2e309a1a1..466097b9e 100644 --- a/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dmp-profile-criteria.component.ts +++ b/dmp-frontend/src/app/ui/admin/dmp-profile/listing/criteria/dmp-profile-criteria.component.ts @@ -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, diff --git a/dmp-frontend/src/app/ui/dashboard/dashboard.component.html b/dmp-frontend/src/app/ui/dashboard/dashboard.component.html index 593aa9449..de1c123b3 100644 --- a/dmp-frontend/src/app/ui/dashboard/dashboard.component.html +++ b/dmp-frontend/src/app/ui/dashboard/dashboard.component.html @@ -32,9 +32,9 @@ buttonRedirectLink="/datasets/new" icon="library_books">
- +
- +
; 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 = new RequestItem(); - projectRequestItem.criteria = new ProjectCriteria(); - projectRequestItem.criteria.like = query; - return this.projectService.getWithExternal(projectRequestItem); + searchGrant(query: string) { + const grantRequestItem: RequestItem = 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: { diff --git a/dmp-frontend/src/app/ui/dashboard/dataset-info-counter/dataset-info-counter.component.html b/dmp-frontend/src/app/ui/dashboard/dataset-info-counter/dataset-info-counter.component.html index 5ccfea931..417abce37 100644 --- a/dmp-frontend/src/app/ui/dashboard/dataset-info-counter/dataset-info-counter.component.html +++ b/dmp-frontend/src/app/ui/dashboard/dataset-info-counter/dataset-info-counter.component.html @@ -2,7 +2,7 @@
-

{{ dataset.projectAbbreviation }}

+

{{ dataset.grantAbbreviation }}

diff --git a/dmp-frontend/src/app/ui/dashboard/dmp-info-counter/dmp-info-counter.component.html b/dmp-frontend/src/app/ui/dashboard/dmp-info-counter/dmp-info-counter.component.html index f9d129690..a7ea65a4e 100644 --- a/dmp-frontend/src/app/ui/dashboard/dmp-info-counter/dmp-info-counter.component.html +++ b/dmp-frontend/src/app/ui/dashboard/dmp-info-counter/dmp-info-counter.component.html @@ -2,8 +2,8 @@
-

- {{dmp.projectAbbreviation}}

+

+ {{dmp.grantAbbreviation}}

diff --git a/dmp-frontend/src/app/ui/dashboard/dmp-info-counter/dmp-info-counter.component.ts b/dmp-frontend/src/app/ui/dashboard/dmp-info-counter/dmp-info-counter.component.ts index c293ec0d0..f83c724c4 100644 --- a/dmp-frontend/src/app/ui/dashboard/dmp-info-counter/dmp-info-counter.component.ts +++ b/dmp-frontend/src/app/ui/dashboard/dmp-info-counter/dmp-info-counter.component.ts @@ -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]); } } diff --git a/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.css b/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.css index 2afdbadb5..7b3b12d9a 100644 --- a/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.css +++ b/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.css @@ -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); diff --git a/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.html b/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.html index 3a89167f8..aca1ec484 100644 --- a/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.html +++ b/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.html @@ -20,11 +20,11 @@ more_horiz
-->
- {{'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 }}
{{ dataset.created | date: "shortDate"}}
{{ dataset.description }}
-
{{ dataset.profile }}
+
{{ dataset.profile }}
diff --git a/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.ts b/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.ts index cf24263a8..b2fc93e2d 100644 --- a/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.ts +++ b/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.ts @@ -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: { diff --git a/dmp-frontend/src/app/ui/dashboard/info-counter/info-counter.component.ts b/dmp-frontend/src/app/ui/dashboard/info-counter/info-counter.component.ts index c0f84ae45..355d9eed8 100644 --- a/dmp-frontend/src/app/ui/dashboard/info-counter/info-counter.component.ts +++ b/dmp-frontend/src/app/ui/dashboard/info-counter/info-counter.component.ts @@ -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' } // ]; diff --git a/dmp-frontend/src/app/ui/dashboard/recent-activity/recent-activity.component.html b/dmp-frontend/src/app/ui/dashboard/recent-activity/recent-activity.component.html index 489f31cbb..e5c31fcf8 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-activity/recent-activity.component.html +++ b/dmp-frontend/src/app/ui/dashboard/recent-activity/recent-activity.component.html @@ -24,12 +24,12 @@ - {{'RECENT-ACTIVITY.MY-TITLE-PROJECT' | translate}} + {{'RECENT-ACTIVITY.MY-TITLE-GRANT' | translate}} - - + +

{{activity.label}}

diff --git a/dmp-frontend/src/app/ui/dashboard/recent-activity/recent-activity.component.ts b/dmp-frontend/src/app/ui/dashboard/recent-activity/recent-activity.component.ts index 6ca7fc0fe..31d188f9a 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-activity/recent-activity.component.ts +++ b/dmp-frontend/src/app/ui/dashboard/recent-activity/recent-activity.component.ts @@ -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: { diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.html b/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.html index d2d70dead..fbadad74e 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.html +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.html @@ -16,7 +16,7 @@ {{ 'DATASET-PROFILE-LISTING.COLUMNS.NAME' | translate}} {{ 'DATASET-PROFILE-LISTING.COLUMNS.TEMPLATE' | translate }} - {{ 'DATASET-PROFILE-LISTING.COLUMNS.PROJECT' | translate }} + {{ 'DATASET-PROFILE-LISTING.COLUMNS.GRANT' | translate }} {{ 'DATASET-PROFILE-LISTING.COLUMNS.ROLE' | translate }} {{ 'DATASET-PROFILE-LISTING.COLUMNS.ORGANIZATION' | translate }} {{ 'DATASET-PROFILE-LISTING.COLUMNS.STATUS' | translate }} @@ -32,7 +32,7 @@ {{ dmpProfileDisplay(activity.profile) }}
- {{ activity.project }} + {{ activity.grant }} {{roleDisplay(activity.users)}} {{ activity.organisations }} diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.ts b/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.ts index 37cb2954e..b0c2f0250 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.ts +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-activity/recent-edited-activity.component.ts @@ -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: { diff --git a/dmp-frontend/src/app/ui/dashboard/recent-visited-activity/recent-visited-activity.component.html b/dmp-frontend/src/app/ui/dashboard/recent-visited-activity/recent-visited-activity.component.html index 5ea9c1bbd..f42df0a1e 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-visited-activity/recent-visited-activity.component.html +++ b/dmp-frontend/src/app/ui/dashboard/recent-visited-activity/recent-visited-activity.component.html @@ -16,7 +16,7 @@ {{ 'DATASET-PROFILE-LISTING.COLUMNS.NAME' | translate }} {{ 'DATASET-PROFILE-LISTING.COLUMNS.TEMPLATE' | translate }} - {{ 'DATASET-PROFILE-LISTING.COLUMNS.PROJECT' | translate }} + {{ 'DATASET-PROFILE-LISTING.COLUMNS.GRANT' | translate }} {{ 'DATASET-PROFILE-LISTING.COLUMNS.ROLE' | translate }} {{ 'DATASET-PROFILE-LISTING.COLUMNS.ORGANIZATION' | translate }} {{ 'DATASET-PROFILE-LISTING.COLUMNS.STATUS' | translate }} @@ -31,7 +31,7 @@ --
- {{ activity.project }} + {{ activity.grant }} Role Name {{ activity.organisations }} diff --git a/dmp-frontend/src/app/ui/dashboard/recent-visited-activity/recent-visited-activity.component.ts b/dmp-frontend/src/app/ui/dashboard/recent-visited-activity/recent-visited-activity.component.ts index 562634d40..ddae74f9e 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-visited-activity/recent-visited-activity.component.ts +++ b/dmp-frontend/src/app/ui/dashboard/recent-visited-activity/recent-visited-activity.component.ts @@ -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: { diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts index 9c0ba6aab..de0c9e68d 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts @@ -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() { diff --git a/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-criteria.component.html b/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-criteria.component.html index 44285c893..5c3839e8b 100644 --- a/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-criteria.component.html +++ b/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-criteria.component.html @@ -4,7 +4,7 @@
- {{formGroup.get('like').getError('backendError').message}} @@ -49,18 +49,18 @@
- +
-
{{'CRITERIA.DATA-SETS.RELATED-PROJECT' | translate}}
+
{{'CRITERIA.DATA-SETS.RELATED-GRANT' | translate}}
- + arrow_drop_down
- +
diff --git a/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-criteria.component.ts b/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-criteria.component.ts index 43efbe454..708c4c574 100644 --- a/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-criteria.component.ts +++ b/dmp-frontend/src/app/ui/dataset/listing/criteria/dataset-criteria.component.ts @@ -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 = new Array(); fields.push('asc'); - const projectRequestItem: DataTableRequest = 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 = 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) { diff --git a/dmp-frontend/src/app/ui/dataset/listing/dataset-listing.component.ts b/dmp-frontend/src/app/ui/dataset/listing/dataset-listing.component.ts index 6402ebb52..705f03cf3 100644 --- a/dmp-frontend/src/app/ui/dataset/listing/dataset-listing.component.ts +++ b/dmp-frontend/src/app/ui/dataset/listing/dataset-listing.component.ts @@ -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); diff --git a/dmp-frontend/src/app/ui/dataset/listing/listing-item/dataset-listing-item.component.html b/dmp-frontend/src/app/ui/dataset/listing/listing-item/dataset-listing-item.component.html index 09e3da5ba..f750d5108 100644 --- a/dmp-frontend/src/app/ui/dataset/listing/listing-item/dataset-listing-item.component.html +++ b/dmp-frontend/src/app/ui/dataset/listing/listing-item/dataset-listing-item.component.html @@ -2,7 +2,7 @@
-

{{ dataset.projectAbbreviation }}

+

{{ dataset.grantAbbreviation }}

+
-
+
keyboard_backspace {{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.ACTIONS.EXIST' | translate}}
-
+
add {{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.ACTIONS.CREATE-NEW' | translate}}
@@ -17,16 +17,16 @@
- + [configuration]="grantAutoCompleteConfiguration">
- + - +
diff --git a/dmp-frontend/src/app/ui/dmp/editor/project-tab/project-tab.component.scss b/dmp-frontend/src/app/ui/dmp/editor/grant-tab/grant-tab.component.scss similarity index 89% rename from dmp-frontend/src/app/ui/dmp/editor/project-tab/project-tab.component.scss rename to dmp-frontend/src/app/ui/dmp/editor/grant-tab/grant-tab.component.scss index ffaa9f882..502365566 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/project-tab/project-tab.component.scss +++ b/dmp-frontend/src/app/ui/dmp/editor/grant-tab/grant-tab.component.scss @@ -1,4 +1,4 @@ -.add-project { +.add-grant { display: flex; justify-content: flex-end; margin-top: 1.5em; diff --git a/dmp-frontend/src/app/ui/dmp/editor/project-tab/project-tab.component.ts b/dmp-frontend/src/app/ui/dmp/editor/grant-tab/grant-tab.component.ts similarity index 53% rename from dmp-frontend/src/app/ui/dmp/editor/project-tab/project-tab.component.ts rename to dmp-frontend/src/app/ui/dmp/editor/grant-tab/grant-tab.component.ts index b020d101a..44f98ed51 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/project-tab/project-tab.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/grant-tab/grant-tab.component.ts @@ -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 = new RequestItem(); - projectRequestItem.criteria = new ProjectCriteria(); + const grantRequestItem: RequestItem = 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 = new RequestItem(); - projectRequestItem.criteria = new ProjectCriteria(); - projectRequestItem.criteria.like = query; - return this.projectService.getWithExternal(projectRequestItem); + searchGrant(query: string) { + const grantRequestItem: RequestItem = 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(); diff --git a/dmp-frontend/src/app/ui/dmp/listing/criteria/dmp-criteria.component.html b/dmp-frontend/src/app/ui/dmp/listing/criteria/dmp-criteria.component.html index 2b97784fd..6c2320f51 100644 --- a/dmp-frontend/src/app/ui/dmp/listing/criteria/dmp-criteria.component.html +++ b/dmp-frontend/src/app/ui/dmp/listing/criteria/dmp-criteria.component.html @@ -13,7 +13,7 @@ -
+
{{ 'TYPES.DMP-VISIBILITY.VISIBILITY' | translate }}
{{ 'TYPES.DMP-VISIBILITY.ANY' | translate }} @@ -25,7 +25,7 @@ -
+
{{ 'CRITERIA.DMP.RELATED-DATASET-TEMPLATES' | translate}}
- -
-
{{ 'DMP-RELATED-PROJECT.RELATED-PROJECT' | translate}}
+ +
+
{{ 'DMP-RELATED-GRANT.RELATED-GRANT' | translate}}
- + arrow_drop_down
- + -
+
{{ 'CRITERIA.DMP.RELATED-COLLABORATORS' | translate}}
-
+
{{ 'DATASET-PROFILE-LISTING.COLUMNS.ROLE' | translate }}
{{ 'TYPES.DATASET-ROLE.ANY' | translate }} @@ -75,7 +75,7 @@ -
+
{{ 'DMP-RELATED-ORGANIZATION.RELATED-ORGANIZATION' | translate }}
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 = new Array(); fields.push('asc'); - const projectRequestItem: DataTableRequest = 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 = 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) { diff --git a/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.html b/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.html index fce1ed467..5793ec346 100644 --- a/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.html +++ b/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.html @@ -7,7 +7,7 @@
- diff --git a/dmp-frontend/src/app/ui/dmp/listing/listing-item/dmp-listing-item.component.ts b/dmp-frontend/src/app/ui/dmp/listing/listing-item/dmp-listing-item.component.ts index 21a349f45..e1069718b 100644 --- a/dmp-frontend/src/app/ui/dmp/listing/listing-item/dmp-listing-item.component.ts +++ b/dmp-frontend/src/app/ui/dmp/listing/listing-item/dmp-listing-item.component.ts @@ -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) { diff --git a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.html b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.html index 92d380926..26a71ecfd 100644 --- a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.html +++ b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.html @@ -110,23 +110,23 @@
-
+
- {{ dmp.project.abbreviation }} + {{ dmp.grant.abbreviation }}
-

{{ dmp.project.label }}

-

{{ dmp.project.startDate | date: "shortDate" }} - {{ dmp.project.endDate | date: "shortDate" }}

+

{{ dmp.grant.label }}

+

{{ dmp.grant.startDate | date: "shortDate" }} - {{ dmp.grant.endDate | date: "shortDate" }}

-

{{ dmp.project.description }}

- - + open_in_new - {{ 'PROJECT-EDITOR.ACTIONS.VISIT-WEBSITE' | translate }} + {{ 'GRANT-EDITOR.ACTIONS.VISIT-WEBSITE' | translate }}
diff --git a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.scss b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.scss index e9a91e539..324ddea63 100644 --- a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.scss +++ b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.scss @@ -42,7 +42,7 @@ color: #aaaaaa; } -.project-item, +.grant-item, .researchers { display: flex; flex-direction: column; diff --git a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts index 330db2ea0..ab265daba 100644 --- a/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts +++ b/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts @@ -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) { diff --git a/dmp-frontend/src/app/ui/dmp/wizard/dmp-wizard-editor.model.ts b/dmp-frontend/src/app/ui/dmp/wizard/dmp-wizard-editor.model.ts index 91c1b7d90..abb226430 100644 --- a/dmp-frontend/src/app/ui/dmp/wizard/dmp-wizard-editor.model.ts +++ b/dmp-frontend/src/app/ui/dmp/wizard/dmp-wizard-editor.model.ts @@ -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')] }); diff --git a/dmp-frontend/src/app/ui/dmp/wizard/dmp-wizard.component.ts b/dmp-frontend/src/app/ui/dmp/wizard/dmp-wizard.component.ts index acfc7d692..95d0b5eb6 100644 --- a/dmp-frontend/src/app/ui/dmp/wizard/dmp-wizard.component.ts +++ b/dmp-frontend/src/app/ui/dmp/wizard/dmp-wizard.component.ts @@ -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"); diff --git a/dmp-frontend/src/app/ui/dmp/wizard/editor/dmp-wizard-editor.component.html b/dmp-frontend/src/app/ui/dmp/wizard/editor/dmp-wizard-editor.component.html index d9b2f2918..fc3400a05 100644 --- a/dmp-frontend/src/app/ui/dmp/wizard/editor/dmp-wizard-editor.component.html +++ b/dmp-frontend/src/app/ui/dmp/wizard/editor/dmp-wizard-editor.component.html @@ -12,13 +12,13 @@ {{'GENERAL.VALIDATION.REQUIRED' | translate}} - + [configuration]="grantAutoCompleteConfiguration"> - - {{formGroup.get('project').getError('backendError').message}} - + + {{formGroup.get('grant').getError('backendError').message}} + {{'GENERAL.VALIDATION.REQUIRED' | translate}} diff --git a/dmp-frontend/src/app/ui/dmp/wizard/editor/dmp-wizard-editor.component.ts b/dmp-frontend/src/app/ui/dmp/wizard/editor/dmp-wizard-editor.component.ts index d4f323c8b..e8f662ebb 100644 --- a/dmp-frontend/src/app/ui/dmp/wizard/editor/dmp-wizard-editor.component.ts +++ b/dmp-frontend/src/app/ui/dmp/wizard/editor/dmp-wizard-editor.component.ts @@ -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 = new RequestItem(); - projectRequestItem.criteria = new ProjectCriteria(); - this.projectAutoCompleteConfiguration = { - filterFn: this.searchProject.bind(this.projectService), - initialItems: () => this.searchProject(''), + const grantRequestItem: RequestItem = 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 = new RequestItem(); - projectRequestItem.criteria = new ProjectCriteria(); - projectRequestItem.criteria.like = query; - return this.projectService.getWithExternal(projectRequestItem); + searchGrant(query: string) { + const grantRequestItem: RequestItem = new RequestItem(); + grantRequestItem.criteria = new GrantCriteria(); + grantRequestItem.criteria.like = query; + return this.grantService.getWithExternal(grantRequestItem); } formSubmit(): void { diff --git a/dmp-frontend/src/app/ui/explore-dataset/explore-dataset-listing.component.html b/dmp-frontend/src/app/ui/explore-dataset/explore-dataset-listing.component.html index 6667b56a6..a5ecda48c 100644 --- a/dmp-frontend/src/app/ui/explore-dataset/explore-dataset-listing.component.html +++ b/dmp-frontend/src/app/ui/explore-dataset/explore-dataset-listing.component.html @@ -45,10 +45,10 @@ {{'DATASET-LISTING.COLUMNS.NAME' | translate}} {{row.label}} - - {{'DATASET-LISTING.COLUMNS.PROJECT' | + + {{'DATASET-LISTING.COLUMNS.GRANT' | translate}} - {{row.project}} + {{row.grant}} {{'DATASET-LISTING.COLUMNS.PROFILE' diff --git a/dmp-frontend/src/app/ui/explore-dataset/filters/explore-dataset-filter-item/explore-dataset-filter-item.component.ts b/dmp-frontend/src/app/ui/explore-dataset/filters/explore-dataset-filter-item/explore-dataset-filter-item.component.ts index 3490914bb..d50a69234 100644 --- a/dmp-frontend/src/app/ui/explore-dataset/filters/explore-dataset-filter-item/explore-dataset-filter-item.component.ts +++ b/dmp-frontend/src/app/ui/explore-dataset/filters/explore-dataset-filter-item/explore-dataset-filter-item.component.ts @@ -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) { diff --git a/dmp-frontend/src/app/ui/explore-dataset/filters/explore-dataset-filters.component.html b/dmp-frontend/src/app/ui/explore-dataset/filters/explore-dataset-filters.component.html index 3153cbd84..9a38cf264 100644 --- a/dmp-frontend/src/app/ui/explore-dataset/filters/explore-dataset-filters.component.html +++ b/dmp-frontend/src/app/ui/explore-dataset/filters/explore-dataset-filters.component.html @@ -3,7 +3,7 @@
- search
-
{{ 'FACET-SEARCH.PROJECT-STATUS.TITLE' | translate }}
+
{{ 'FACET-SEARCH.GRANT-STATUS.TITLE' | translate }}
- - {{ 'FACET-SEARCH.PROJECT-STATUS.OPTIONS.ACTIVE' | translate }} + + {{ 'FACET-SEARCH.GRANT-STATUS.OPTIONS.ACTIVE' | translate }} - - {{ 'FACET-SEARCH.PROJECT-STATUS.OPTIONS.INACTIVE' | translate }} + + {{ 'FACET-SEARCH.GRANT-STATUS.OPTIONS.INACTIVE' | translate }}
@@ -36,11 +36,11 @@
-
{{ 'FACET-SEARCH.PROJECT.TITLE' | translate }}
+
{{ 'FACET-SEARCH.GRANT.TITLE' | translate }}
- + arrow_drop_down @@ -81,7 +81,7 @@
-
@@ -96,22 +96,22 @@ - {{ 'FACET-SEARCH.PROJECT-STATUS.TITLE' | translate }} + {{ 'FACET-SEARCH.GRANT-STATUS.TITLE' | translate }} - + - + - {{ 'FACET-SEARCH.PROJECT.TITLE' | translate }} + {{ 'FACET-SEARCH.GRANT.TITLE' | translate }} - + diff --git a/dmp-frontend/src/app/ui/explore-dataset/filters/explore-dataset-filters.component.ts b/dmp-frontend/src/app/ui/explore-dataset/filters/explore-dataset-filters.component.ts index bb7f9380a..d7703250e 100644 --- a/dmp-frontend/src/app/ui/explore-dataset/filters/explore-dataset-filters.component.ts +++ b/dmp-frontend/src/app/ui/explore-dataset/filters/explore-dataset-filters.component.ts @@ -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; + GrantStateType = GrantStateType; + grants: Observable; profiles: Observable; dmpOrganisations: Observable; dmpIds: Observable>; - projectOptions: Observable; - projectStateOptions: Observable; + grantOptions: Observable; + grantStateOptions: Observable; 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 = new Array(); fields.push('asc'); - const dataTableRequest: DataTableRequest = new DataTableRequest(0, null, { fields: fields }); - dataTableRequest.criteria = new ProjectCriteria(); - dataTableRequest.criteria.projectStateType = this.facetCriteria.projectStatus; + const dataTableRequest: DataTableRequest = 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 { + public grantSearch(value: string): Observable { - 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 = new Array(); fields.push('asc'); - const dataTableRequest: DataTableRequest = new DataTableRequest(0, null, { fields: fields }); - dataTableRequest.criteria = projectCriteria; - //const dataTableRequest: RequestItem = { criteria: projectCriteria }; - //return this.projectService.getPaged(dataTableRequest, "autocomplete").map(x => x.data); - return this.projectService.getPublicPaged(dataTableRequest).map(x => x.data); + const dataTableRequest: DataTableRequest = new DataTableRequest(0, null, { fields: fields }); + dataTableRequest.criteria = grantCriteria; + //const dataTableRequest: RequestItem = { 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 { @@ -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 = new Array(); fields.push('asc'); - const projectRequestItem: DataTableRequest = 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 = 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) { diff --git a/dmp-frontend/src/app/ui/explore-dataset/listing-item/explore-dataset-listing-item.component.html b/dmp-frontend/src/app/ui/explore-dataset/listing-item/explore-dataset-listing-item.component.html index 27a0b1641..1c8b1ac04 100644 --- a/dmp-frontend/src/app/ui/explore-dataset/listing-item/explore-dataset-listing-item.component.html +++ b/dmp-frontend/src/app/ui/explore-dataset/listing-item/explore-dataset-listing-item.component.html @@ -2,7 +2,7 @@
-

{{ dataset.projectAbbreviation }}

+

{{ dataset.grantAbbreviation }}

+
diff --git a/dmp-frontend/src/app/ui/explore-dmp/explore-dmp-listing.component.ts b/dmp-frontend/src/app/ui/explore-dmp/explore-dmp-listing.component.ts index 8c7fad438..1e32b2e17 100644 --- a/dmp-frontend/src/app/ui/explore-dmp/explore-dmp-listing.component.ts +++ b/dmp-frontend/src/app/ui/explore-dmp/explore-dmp-listing.component.ts @@ -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; diff --git a/dmp-frontend/src/app/ui/explore-dmp/listing-item/explore-dmp-listing-item.component.html b/dmp-frontend/src/app/ui/explore-dmp/listing-item/explore-dmp-listing-item.component.html index f2b46debe..09001a03f 100644 --- a/dmp-frontend/src/app/ui/explore-dmp/listing-item/explore-dmp-listing-item.component.html +++ b/dmp-frontend/src/app/ui/explore-dmp/listing-item/explore-dmp-listing-item.component.html @@ -2,7 +2,7 @@
- {{dmp.projectAbbreviation}} + {{dmp.grantAbbreviation}}
@@ -42,7 +42,7 @@

{{dmp.label}}

-

{{dmp.project}}

+

{{dmp.grant}}

storage diff --git a/dmp-frontend/src/app/ui/explore-dmp/listing-item/explore-dmp-listing-item.component.scss b/dmp-frontend/src/app/ui/explore-dmp/listing-item/explore-dmp-listing-item.component.scss index b7f62992f..0476c1cea 100644 --- a/dmp-frontend/src/app/ui/explore-dmp/listing-item/explore-dmp-listing-item.component.scss +++ b/dmp-frontend/src/app/ui/explore-dmp/listing-item/explore-dmp-listing-item.component.scss @@ -59,7 +59,7 @@ // color: black; // } -// .project-title { +// .grant-title { // color: rgb(93, 125, 173); // } diff --git a/dmp-frontend/src/app/ui/project/editor/project-editor.component.html b/dmp-frontend/src/app/ui/grant/editor/grant-editor.component.html similarity index 76% rename from dmp-frontend/src/app/ui/project/editor/project-editor.component.html rename to dmp-frontend/src/app/ui/grant/editor/grant-editor.component.html index 08346b3ac..bc971b44d 100644 --- a/dmp-frontend/src/app/ui/project/editor/project-editor.component.html +++ b/dmp-frontend/src/app/ui/grant/editor/grant-editor.component.html @@ -1,7 +1,7 @@
-
- {{'PROJECT-EDITOR.TITLE.NEW' | translate}} +
+ {{'GRANT-EDITOR.TITLE.NEW' | translate}} {{formGroup?.get('label')?.value}}
@@ -22,22 +22,22 @@
-
+
-
+
-
+
-
@@ -47,24 +47,24 @@
- + {{formGroup.get('label').getError('backendError').message}} {{'GENERAL.VALIDATION.REQUIRED' | translate}} - + {{formGroup.get('abbreviation').getError('backendError').message}} - + {{formGroup.get('uri').getError('backendError').message}} {{'GENERAL.VALIDATION.REQUIRED' | translate}} - + {{formGroup.get('startDate').getError('backendError').message}} @@ -72,16 +72,16 @@ - + {{formGroup.get('endDate').getError('backendError').message}} {{'GENERAL.VALIDATION.REQUIRED' | translate}} - {{'GENERAL.VALIDATION.PROJECT-START-AFTER-END' | translate}} + {{'GENERAL.VALIDATION.GRANT-START-AFTER-END' | translate}} - + {{formGroup.get('description').getError('backendError').message}} {{'GENERAL.VALIDATION.REQUIRED' | translate}} @@ -89,16 +89,16 @@
-
-
-
diff --git a/dmp-frontend/src/app/ui/project/editor/project-editor.component.scss b/dmp-frontend/src/app/ui/grant/editor/grant-editor.component.scss similarity index 76% rename from dmp-frontend/src/app/ui/project/editor/project-editor.component.scss rename to dmp-frontend/src/app/ui/grant/editor/grant-editor.component.scss index 9c5228133..b5ca3188c 100644 --- a/dmp-frontend/src/app/ui/project/editor/project-editor.component.scss +++ b/dmp-frontend/src/app/ui/grant/editor/grant-editor.component.scss @@ -1,6 +1,6 @@ -.project-editor { +.grant-editor { - .project-editor-header-actions { + .grant-editor-header-actions { display: flex; align-items: center; } diff --git a/dmp-frontend/src/app/ui/project/editor/project-editor.component.ts b/dmp-frontend/src/app/ui/grant/editor/grant-editor.component.ts similarity index 73% rename from dmp-frontend/src/app/ui/project/editor/project-editor.component.ts rename to dmp-frontend/src/app/ui/grant/editor/grant-editor.component.ts index 765a9b399..9aca12d53 100644 --- a/dmp-frontend/src/app/ui/project/editor/project-editor.component.ts +++ b/dmp-frontend/src/app/ui/grant/editor/grant-editor.component.ts @@ -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 = 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 => { - (this.project.validationErrorModel)[item] = (validationErrorModel)[item]; + (this.grant.validationErrorModel)[item] = (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)); } diff --git a/dmp-frontend/src/app/ui/project/editor/project-editor.model.ts b/dmp-frontend/src/app/ui/grant/editor/grant-editor.model.ts similarity index 93% rename from dmp-frontend/src/app/ui/project/editor/project-editor.model.ts rename to dmp-frontend/src/app/ui/grant/editor/grant-editor.model.ts index eea42c273..13128fb8f 100644 --- a/dmp-frontend/src/app/ui/project/editor/project-editor.model.ts +++ b/dmp-frontend/src/app/ui/grant/editor/grant-editor.model.ts @@ -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; diff --git a/dmp-frontend/src/app/ui/grant/grant.module.ts b/dmp-frontend/src/app/ui/grant/grant.module.ts new file mode 100644 index 000000000..7bd0dc7d7 --- /dev/null +++ b/dmp-frontend/src/app/ui/grant/grant.module.ts @@ -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 { } diff --git a/dmp-frontend/src/app/ui/project/project.routing.ts b/dmp-frontend/src/app/ui/grant/grant.routing.ts similarity index 55% rename from dmp-frontend/src/app/ui/project/project.routing.ts rename to dmp-frontend/src/app/ui/grant/grant.routing.ts index 54d255a6b..8817762bc 100644 --- a/dmp-frontend/src/app/ui/project/project.routing.ts +++ b/dmp-frontend/src/app/ui/grant/grant.routing.ts @@ -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 { } \ No newline at end of file +export class GrantRoutingModule { } diff --git a/dmp-frontend/src/app/ui/project/listing/criteria/project-criteria.component.html b/dmp-frontend/src/app/ui/grant/listing/criteria/grant-criteria.component.html similarity index 50% rename from dmp-frontend/src/app/ui/project/listing/criteria/project-criteria.component.html rename to dmp-frontend/src/app/ui/grant/listing/criteria/grant-criteria.component.html index 0c210a148..9c24bfe7f 100644 --- a/dmp-frontend/src/app/ui/project/listing/criteria/project-criteria.component.html +++ b/dmp-frontend/src/app/ui/grant/listing/criteria/grant-criteria.component.html @@ -1,37 +1,37 @@ -
+
{{'CRITERIA.FILTERS'| translate}}
- + search - + - {{'GENERAL.VALIDATION.PROJECT-START-AFTER-END' | translate}} + {{'GENERAL.VALIDATION.GRANT-START-AFTER-END' | translate}} - + - {{'GENERAL.VALIDATION.PROJECT-START-AFTER-END' | translate}} + {{'GENERAL.VALIDATION.GRANT-START-AFTER-END' | translate}} - + - {{ 'CRITERIA.PROJECTS.TYPES.NONE' | translate}} + {{ 'CRITERIA.GRANTS.TYPES.NONE' | translate}} - - {{ 'CRITERIA.PROJECTS.TYPES.ON-GOING' | translate}} + + {{ 'CRITERIA.GRANTS.TYPES.ON-GOING' | translate}} - - {{ 'CRITERIA.PROJECTS.TYPES.FINISHED' | translate}} + + {{ 'CRITERIA.GRANTS.TYPES.FINISHED' | translate}} diff --git a/dmp-frontend/src/app/ui/project/listing/criteria/project-criteria.component.scss b/dmp-frontend/src/app/ui/grant/listing/criteria/grant-criteria.component.scss similarity index 100% rename from dmp-frontend/src/app/ui/project/listing/criteria/project-criteria.component.scss rename to dmp-frontend/src/app/ui/grant/listing/criteria/grant-criteria.component.scss diff --git a/dmp-frontend/src/app/ui/project/listing/criteria/project-criteria.component.ts b/dmp-frontend/src/app/ui/grant/listing/criteria/grant-criteria.component.ts similarity index 70% rename from dmp-frontend/src/app/ui/project/listing/criteria/project-criteria.component.ts rename to dmp-frontend/src/app/ui/grant/listing/criteria/grant-criteria.component.ts index 55b1019ab..eae7c3145 100644 --- a/dmp-frontend/src/app/ui/project/listing/criteria/project-criteria.component.ts +++ b/dmp-frontend/src/app/ui/grant/listing/criteria/grant-criteria.component.ts @@ -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; } diff --git a/dmp-frontend/src/app/ui/project/listing/project-listing.component.html b/dmp-frontend/src/app/ui/grant/listing/grant-listing.component.html similarity index 75% rename from dmp-frontend/src/app/ui/project/listing/project-listing.component.html rename to dmp-frontend/src/app/ui/grant/listing/grant-listing.component.html index 1d3bf4620..54019523f 100644 --- a/dmp-frontend/src/app/ui/project/listing/project-listing.component.html +++ b/dmp-frontend/src/app/ui/grant/listing/grant-listing.component.html @@ -4,22 +4,22 @@

{{languageResolverService.getBy('listingTitle') | translate}}

- +
-
+
- +
- +
@@ -32,39 +32,39 @@

{{languageResolverService.getBy('listingTitle') | translate}}

- +
- {{'PROJECT-LISTING.COLUMNS.AVATAR' | translate}} + {{'GRANT-LISTING.COLUMNS.AVATAR' | translate}} - {{'PROJECT-LISTING.COLUMNS.NAME' | translate}} + {{'GRANT-LISTING.COLUMNS.NAME' | translate}} {{row.label}} - {{'PROJECT-LISTING.COLUMNS.ABBREVIATION' | + {{'GRANT-LISTING.COLUMNS.ABBREVIATION' | translate}} {{row.abbreviation}} - {{'PROJECT-LISTING.COLUMNS.START' | translate}} + {{'GRANT-LISTING.COLUMNS.START' | translate}} {{row.startDate | date:'shortDate'}} - {{'PROJECT-LISTING.COLUMNS.END' | translate}} + {{'GRANT-LISTING.COLUMNS.END' | translate}} {{row.endDate | date:'shortDate'}} - {{'PROJECT-LISTING.COLUMNS.DMPS' | translate}} + {{'GRANT-LISTING.COLUMNS.DMPS' | translate}} - + diff --git a/dmp-frontend/src/app/ui/project/listing/project-listing.component.scss b/dmp-frontend/src/app/ui/grant/listing/grant-listing.component.scss similarity index 97% rename from dmp-frontend/src/app/ui/project/listing/project-listing.component.scss rename to dmp-frontend/src/app/ui/grant/listing/grant-listing.component.scss index 8d075edf1..1d4bd5726 100644 --- a/dmp-frontend/src/app/ui/project/listing/project-listing.component.scss +++ b/dmp-frontend/src/app/ui/grant/listing/grant-listing.component.scss @@ -1,4 +1,4 @@ -.project-listing { +.grant-listing { .mat-card { margin: 1em 0; } diff --git a/dmp-frontend/src/app/ui/project/listing/project-listing.component.ts b/dmp-frontend/src/app/ui/grant/listing/grant-listing.component.ts similarity index 61% rename from dmp-frontend/src/app/ui/project/listing/project-listing.component.ts rename to dmp-frontend/src/app/ui/grant/listing/grant-listing.component.ts index 4c9f83db7..1546cec43 100644 --- a/dmp-frontend/src/app/ui/project/listing/project-listing.component.ts +++ b/dmp-frontend/src/app/ui/grant/listing/grant-listing.component.ts @@ -4,34 +4,34 @@ import { Router, ActivatedRoute, Params } from '@angular/router'; import { Observable } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; 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 { DataTableRequest } from '../../../core/model/data-table/data-table-request'; -import { ProjectListingModel } from '../../../core/model/project/project-listing'; -import { ProjectCriteria } from '../../../core/query/project/project-criteria'; -import { ProjectService } from '../../../core/services/project/project.service'; +import { GrantListingModel } from '../../../core/model/grant/grant-listing'; +import { GrantCriteria } from '../../../core/query/grant/grant-criteria'; +import { GrantService } from '../../../core/services/grant/grant.service'; import { BreadcrumbItem } from '../../misc/breadcrumb/definition/breadcrumb-item'; import { IBreadCrumbComponent } from '../../misc/breadcrumb/definition/IBreadCrumbComponent'; -import { ProjectCriteriaComponent } from './criteria/project-criteria.component'; +import { GrantCriteriaComponent } from './criteria/grant-criteria.component'; import { LanguageResolverService } from '../../../services/language-resolver/language-resolver.service'; import { TranslateService } from '@ngx-translate/core'; @Component({ - selector: 'app-project-listing-component', - templateUrl: 'project-listing.component.html', - styleUrls: ['./project-listing.component.scss'] + selector: 'app-grant-listing-component', + templateUrl: 'grant-listing.component.html', + styleUrls: ['./grant-listing.component.scss'] }) -export class ProjectListingComponent extends BaseComponent implements OnInit, IBreadCrumbComponent { +export class GrantListingComponent extends BaseComponent implements OnInit, IBreadCrumbComponent { @ViewChild(MatPaginator) _paginator: MatPaginator; @ViewChild(MatSort) sort: MatSort; - @ViewChild(ProjectCriteriaComponent) criteria: ProjectCriteriaComponent; + @ViewChild(GrantCriteriaComponent) criteria: GrantCriteriaComponent; breadCrumbs: Observable; totalCount: number; - listingItems: ProjectListingModel[] = []; + listingItems: GrantListingModel[] = []; constructor( - private projectService: ProjectService, + private grantService: GrantService, private router: Router, private route: ActivatedRoute, public language: TranslateService, @@ -48,8 +48,8 @@ export class ProjectListingComponent extends BaseComponent implements OnInit, IB this.breadCrumbs = Observable.of([{ parentComponentName: null, - label: this.language.instant('NAV-BAR.PROJECTS').toUpperCase(), - url: '/projects' + label: this.language.instant('NAV-BAR.GRANTS').toUpperCase(), + url: '/grants' }]); } @@ -60,21 +60,21 @@ export class ProjectListingComponent extends BaseComponent implements OnInit, IB const startIndex = this._paginator.pageIndex * this._paginator.pageSize; let fields: Array = new Array(); if (this.sort && this.sort.active) { fields = this.sort.direction === 'asc' ? ['+' + this.sort.active] : ['-' + this.sort.active]; } - const request = new DataTableRequest(startIndex, this._paginator.pageSize, { fields: fields }); + const request = new DataTableRequest(startIndex, this._paginator.pageSize, { fields: fields }); request.criteria = this.criteria.criteria; - this.projectService.getPaged(request, "listing").pipe(takeUntil(this._destroyed)).subscribe(result => { + this.grantService.getPaged(request, "listing").pipe(takeUntil(this._destroyed)).subscribe(result => { if (!result) { return []; } if (this._paginator.pageIndex === 0) { this.totalCount = result.totalCount; } this.listingItems = result.data; }); } - rowClicked(project: ProjectListingModel) { - this.router.navigate(['/projects/edit/' + project.id]); + rowClicked(grant: GrantListingModel) { + this.router.navigate(['/grants/edit/' + grant.id]); } - getDefaultCriteria(): ProjectCriteria { - const defaultCriteria = new ProjectCriteria(); + getDefaultCriteria(): GrantCriteria { + const defaultCriteria = new GrantCriteria(); return defaultCriteria; } diff --git a/dmp-frontend/src/app/ui/project/listing/listing-item/project-listing-item.component.html b/dmp-frontend/src/app/ui/grant/listing/listing-item/grant-listing-item.component.html similarity index 59% rename from dmp-frontend/src/app/ui/project/listing/listing-item/project-listing-item.component.html rename to dmp-frontend/src/app/ui/grant/listing/listing-item/grant-listing-item.component.html index 93a12e930..dbccdb070 100644 --- a/dmp-frontend/src/app/ui/project/listing/listing-item/project-listing-item.component.html +++ b/dmp-frontend/src/app/ui/grant/listing/listing-item/grant-listing-item.component.html @@ -2,24 +2,24 @@
-

{{project.abbreviation}}

+

{{grant.abbreviation}}

lock -

{{project.label}}

+

{{grant.label}}

-

{{project.description}}

+

{{grant.description}}

calendar_today -

{{project.startDate | date:'shortDate'}} - {{project.endDate | date:'shortDate'}}

+

{{grant.startDate | date:'shortDate'}} - {{grant.endDate | date:'shortDate'}}

@@ -28,22 +28,22 @@ -