-
-
-
-

{{ dmp.label }}

-
-
- - - - - - - - - -
+
+
+

{{ dmp.label }}

+
+ + + + + + + + + +
+
+
@@ -48,25 +48,28 @@ work_outline {{ 'DMP-LISTING.COLUMNS.PROJECT' | translate }} + library_books {{ 'DMP-LISTING.COLUMNS.DATASETS' | translate }} + person {{ 'DMP-LISTING.COLUMNS.PEOPLE' | translate }} + - +
diff --git a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.ts b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.ts index 2ca42facc..73180b093 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.ts @@ -41,6 +41,7 @@ import { DmpEditorModel } from './dmp-editor.model'; import { DmpFinalizeDialogComponent } from './dmp-finalize-dialog/dmp-finalize-dialog.component'; import { AuthService } from '../../../core/services/auth/auth.service'; import { ExportMethodDialogComponent } from '../../../library/export-method-dialog/export-method-dialog.component'; +import { UserInfoListingModel } from '../../../core/model/user/user-info-listing'; @Component({ selector: 'app-dmp-editor-component', @@ -58,11 +59,9 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC dmp: DmpEditorModel; formGroup: FormGroup = null; - - projectAutoCompleteConfiguration: SingleAutoCompleteConfiguration; - createNewVersion; associatedUsers: Array; + people: Array; filteredOptions: DmpProfileListing[]; selectedDmpProfileDefinition: DmpProfileDefinition; DynamicDmpFieldResolverComponent: any; @@ -99,12 +98,12 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC const organisationRequestItem: RequestItem = new RequestItem(); organisationRequestItem.criteria = new BaseCriteria(); - this.projectAutoCompleteConfiguration = { - filterFn: this.searchProject.bind(this), - initialItems: (extraData) => this.searchProject(''), - displayFn: (item) => item['label'], - titleFn: (item) => item['label'] - }; + // this.projectAutoCompleteConfiguration = { + // filterFn: this.searchProject.bind(this), + // initialItems: (extraData) => this.searchProject(''), + // displayFn: (item) => item['label'], + // titleFn: (item) => item['label'] + // }; if (itemId != null) { this.isNew = false; @@ -131,6 +130,7 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC this.breadCrumbs = Observable.of(breadCrumbs); } this.associatedUsers = data.associatedUsers; + this.people = data.users; }); } else if (projectId != null) { this.isNew = true; @@ -203,12 +203,12 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC return this.dmpProfileService.getPaged(request).map(x => x.data); } - searchProject(query: string) { - const projectRequestItem: RequestItem = new RequestItem(); - projectRequestItem.criteria = new ProjectCriteria(); - projectRequestItem.criteria.like = query; - return this.projectService.getWithExternal(projectRequestItem); - } + // searchProject(query: string) { + // const projectRequestItem: RequestItem = new RequestItem(); + // projectRequestItem.criteria = new ProjectCriteria(); + // projectRequestItem.criteria.like = query; + // return this.projectService.getWithExternal(projectRequestItem); + // } formSubmit(): void { //this.touchAllFormFields(this.formGroup); diff --git a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.model.ts b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.model.ts index c366d5b17..8b441ed9f 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.model.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.model.ts @@ -12,6 +12,8 @@ import { ProjectListingModel } from "../../../core/model/project/project-listing import { ResearcherModel } from "../../../core/model/researcher/researcher"; import { UserModel } from "../../../core/model/user/user"; import { ValidJsonValidator } from "../../../library/auto-complete/auto-complete-custom-validator"; +import { DatasetOverviewModel } from "../../../core/model/dataset/dataset-overview"; +import { UserInfoListingModel } from "../../../core/model/user/user-info-listing"; export class DmpEditorModel { public id: string; @@ -27,7 +29,9 @@ export class DmpEditorModel { public organisations: OrganizationModel[] = []; public researchers: ResearcherModel[] = []; public profiles: DmpProfile[] = []; + public datasets: DatasetOverviewModel[] = []; public associatedUsers: UserModel[] = []; + public users: UserInfoListingModel[] = []; public definition: DmpProfileDefinition; public dynamicFields: Array = []; public validationErrorModel: ValidationErrorModel = new ValidationErrorModel(); @@ -45,7 +49,9 @@ export class DmpEditorModel { this.organisations = item.organisations; this.researchers = item.researchers; this.profiles = item.profiles; + this.datasets = item.datasets; this.associatedUsers = item.associatedUsers; + this.users = item.users; if (item.definition) { this.definition = item.definition; } if (item.dynamicFields) { item.dynamicFields.map(x => this.dynamicFields.push(new DmpDynamicFieldEditorModel().fromModel(x))); } this.creator = item.creator; diff --git a/dmp-frontend/src/app/ui/dmp/editor/general-tab/general-tab.component.html b/dmp-frontend/src/app/ui/dmp/editor/general-tab/general-tab.component.html index 1371cd9d7..97ee814ca 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/general-tab/general-tab.component.html +++ b/dmp-frontend/src/app/ui/dmp/editor/general-tab/general-tab.component.html @@ -22,19 +22,6 @@ translate}} -->
-
- - -
- - -
diff --git a/dmp-frontend/src/app/ui/dmp/editor/people-tab/people-tab.component.html b/dmp-frontend/src/app/ui/dmp/editor/people-tab/people-tab.component.html new file mode 100644 index 000000000..12a1b5d64 --- /dev/null +++ b/dmp-frontend/src/app/ui/dmp/editor/people-tab/people-tab.component.html @@ -0,0 +1,33 @@ +
+
+
+
+ Collaborators +
+ add{{'DMP-LISTING.ACTIONS.INVITE' | translate}} +
+
+
+ + + + + + + + + + + +
NAMEEMAILPERMISSIONS
{{user.name}}{{user.email}}{{roleDisplay(user)}}
+ +
+
+
+
diff --git a/dmp-frontend/src/app/ui/dmp/editor/people-tab/people-tab.component.scss b/dmp-frontend/src/app/ui/dmp/editor/people-tab/people-tab.component.scss new file mode 100644 index 000000000..880b6bb16 --- /dev/null +++ b/dmp-frontend/src/app/ui/dmp/editor/people-tab/people-tab.component.scss @@ -0,0 +1,44 @@ +.table-header { + background-color: #eeeeee; + color: #0070c0; + height: 2em; +} + +.table-title { + align-self: center; + cursor: default; +} + +.table-action { + display: flex; + margin-left: auto; + cursor: pointer; +} + +.table-action span { + align-self: center; +} + +.table-container { + border: 3px solid #f2f2f2; + margin-top: 0px; + padding: 0.5em; + cursor: default; +} + +table { + width: 100%; + border-collapse: collapse; + color: black; +} + +td { + padding: 8px; + text-align: left; +} + +th { + background: linear-gradient(180deg, #f6f6f6, #fff); + padding: 8px; + text-align: left; +} diff --git a/dmp-frontend/src/app/ui/dmp/editor/people-tab/people-tab.component.ts b/dmp-frontend/src/app/ui/dmp/editor/people-tab/people-tab.component.ts new file mode 100644 index 000000000..44d47389b --- /dev/null +++ b/dmp-frontend/src/app/ui/dmp/editor/people-tab/people-tab.component.ts @@ -0,0 +1,50 @@ +import { Component, OnInit, Input } from '@angular/core'; +import { UserModel } from '../../../../core/model/user/user'; +import { DmpEditorModel } from '../dmp-editor.model'; +import { MatDialog } from '@angular/material'; +import { DmpInvitationDialogComponent } from '../../invitation/dmp-invitation.component'; +import { UserInfoListingModel } from '../../../../core/model/user/user-info-listing'; +import { TranslateService } from '@ngx-translate/core'; + +@Component({ + selector: 'app-people-tab', + templateUrl: './people-tab.component.html', + styleUrls: ['./people-tab.component.scss'] +}) +export class PeopleTabComponent implements OnInit { + + @Input() associatedUsers: Array; + @Input() people: Array; + @Input() dmp: DmpEditorModel; + constructor( + private dialog: MatDialog, + private translate: TranslateService + ) { } + + ngOnInit() { + } + + openShareDialog(rowId: any, rowName: any) { + const dialogRef = this.dialog.open(DmpInvitationDialogComponent, { + // height: '250px', + // width: '700px', + data: { + dmpId: rowId, + dmpName: rowName + } + }); + } + + roleDisplay(user: UserInfoListingModel) { + if (user.role === 0) { + return this.translate.instant('DMP-LISTING.OWNER'); + } + else if (user.role === 1) { + return this.translate.instant('DMP-LISTING.MEMBER'); + } + else { + return this.translate.instant('DMP-LISTING.OWNER'); + } + } + +} diff --git a/dmp-frontend/src/app/ui/dmp/editor/project-tab/project-tab.component.html b/dmp-frontend/src/app/ui/dmp/editor/project-tab/project-tab.component.html new file mode 100644 index 000000000..1847da7f5 --- /dev/null +++ b/dmp-frontend/src/app/ui/dmp/editor/project-tab/project-tab.component.html @@ -0,0 +1,17 @@ +
+
+
+ + + + + {{formGroup.get('project').getError('backendError').message}} + + {{'GENERAL.VALIDATION.REQUIRED' | translate}} + +
+ +
+
diff --git a/dmp-frontend/src/app/ui/dmp/editor/project-tab/project-tab.component.scss b/dmp-frontend/src/app/ui/dmp/editor/project-tab/project-tab.component.scss new file mode 100644 index 000000000..e69de29bb diff --git a/dmp-frontend/src/app/ui/dmp/editor/project-tab/project-tab.component.ts b/dmp-frontend/src/app/ui/dmp/editor/project-tab/project-tab.component.ts new file mode 100644 index 000000000..268328045 --- /dev/null +++ b/dmp-frontend/src/app/ui/dmp/editor/project-tab/project-tab.component.ts @@ -0,0 +1,41 @@ +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 { LanguageResolverService } from '../../../../services/language-resolver/language-resolver.service'; + +@Component({ + selector: 'app-project-tab', + templateUrl: './project-tab.component.html', + styleUrls: ['./project-tab.component.scss'] +}) +export class ProjectTabComponent implements OnInit { + + @Input() formGroup: FormGroup = null; + + projectAutoCompleteConfiguration: SingleAutoCompleteConfiguration; + + constructor( + private projectService: ProjectService, + public languageResolverService: LanguageResolverService + ) { } + + ngOnInit() { + this.projectAutoCompleteConfiguration = { + filterFn: this.searchProject.bind(this), + initialItems: (extraData) => this.searchProject(''), + displayFn: (item) => item['label'], + titleFn: (item) => item['label'] + }; + } + + searchProject(query: string) { + const projectRequestItem: RequestItem = new RequestItem(); + projectRequestItem.criteria = new ProjectCriteria(); + projectRequestItem.criteria.like = query; + return this.projectService.getWithExternal(projectRequestItem); + } + +}