diff --git a/dmp-frontend/src/app/core/services/dashboard/dashboard.service.ts b/dmp-frontend/src/app/core/services/dashboard/dashboard.service.ts index 2fb3a672f..78baa5403 100644 --- a/dmp-frontend/src/app/core/services/dashboard/dashboard.service.ts +++ b/dmp-frontend/src/app/core/services/dashboard/dashboard.service.ts @@ -31,4 +31,8 @@ export class DashboardService { getRecentActivity(request: DataTableRequest): Observable { return this.http.post(this.actionUrl + 'recentActivity', request, {headers: this.headers}); } + + // getRecentActivity(request: DataTableRequest): Observable> { + // return this.http.post>(this.actionUrl + 'recentActivity', request, {headers: this.headers}); + // } } diff --git a/dmp-frontend/src/app/ui/dashboard/dashboard.component.html b/dmp-frontend/src/app/ui/dashboard/dashboard.component.html index 905003cd2..72930cbfa 100644 --- a/dmp-frontend/src/app/ui/dashboard/dashboard.component.html +++ b/dmp-frontend/src/app/ui/dashboard/dashboard.component.html @@ -51,22 +51,18 @@
{{'DASHBOARD.LATEST-ACTIVITY' | translate}}
-
{{'DASHBOARD.EMPTY-LIST' | translate}}
-
{{'DASHBOARD.EMPTY-LIST' | translate}}
-
{{'DASHBOARD.EMPTY-LIST' | translate}}
-
{{'DASHBOARD.EMPTY-LIST' | translate}}
diff --git a/dmp-frontend/src/app/ui/dashboard/dashboard.module.ts b/dmp-frontend/src/app/ui/dashboard/dashboard.module.ts index 0d5b845a2..23a6ca9a5 100644 --- a/dmp-frontend/src/app/ui/dashboard/dashboard.module.ts +++ b/dmp-frontend/src/app/ui/dashboard/dashboard.module.ts @@ -17,6 +17,7 @@ import { ConfirmationDialogModule } from '@common/modules/confirmation-dialog/co import { RecentEditedDatasetActivityComponent } from './recent-edited-dataset-activity/recent-edited-dataset-activity.component'; import { DatasetCopyDialogModule } from '../dataset/dataset-wizard/dataset-copy-dialogue/dataset-copy-dialogue.module'; import { RecentEditedDmpActivityComponent } from './recent-edited-dmp-activity/recent-edited-dmp-activity.component'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; @NgModule({ imports: [ @@ -24,7 +25,9 @@ import { RecentEditedDmpActivityComponent } from './recent-edited-dmp-activity/r DashboardRoutingModule, ExportMethodDialogModule, ConfirmationDialogModule, - DatasetCopyDialogModule + DatasetCopyDialogModule, + FormsModule, + ReactiveFormsModule ], declarations: [ DashboardComponent, 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 349ff9f54..52f28742f 100644 --- a/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.css +++ b/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.css @@ -176,6 +176,24 @@ input[type="text"] { cursor: pointer; } +.search-form { + text-align: left; + width: 20rem; +} + +.search-form mat-icon { + color: #129d99; +} + +::ng-deep .search-form .mat-form-field-wrapper { + background-color: white !important; + padding-bottom: 0 !important; +} + +::ng-deep .mat-form-field-appearance-outline .mat-form-field-infix { + padding: 0.3rem 0rem 0.6rem 0rem !important; +} + /* .grey { color: rgb(162, 162, 162); } 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 d62bb2fc2..7f646e612 100644 --- a/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.html +++ b/dmp-frontend/src/app/ui/dashboard/drafts/drafts.component.html @@ -1,67 +1,75 @@ -
-
-
-
-
{{'DATASET-LISTING.DATASET-DESCRIPTION' | translate}}
-
{{'DATASET-LISTING.STATES.EDITED' | translate}}: {{activity.modified | date:"longDate"}}
-
-
{{'DATASET-LISTING.DATASET-DESCRIPTION' | translate}}: {{activity.label}}
-
- {{ roleDisplay(activity.users) }} - . - public{{'DATASET-LISTING.STATES.PUBLIC' | translate}} - done{{ enumUtils.toDmpStatusString(activity.status) }} - create{{ enumUtils.toDmpStatusString(activity.status) }} - . - {{'DATASET-LISTING.COLUMNS.GRANT' | translate}}: {{activity.grant}} -
-
-
{{'DATASET-LISTING.TOOLTIP.PART-OF' | translate}} -
{{'DATASET-LISTING.TOOLTIP.DMP' | translate}}
+
+ + + search + + {{formGroup.get('like').getError('backendError').message}} + + +
+
+
+
+
{{'DATASET-LISTING.DATASET-DESCRIPTION' | translate}}
+
{{'DATASET-LISTING.STATES.EDITED' | translate}}: {{activity.modified | date:"longDate"}}
+
+
{{'DATASET-LISTING.DATASET-DESCRIPTION' | translate}}: {{activity.label}}
+
+ {{ roleDisplay(activity.users) }} + . + public{{'DATASET-LISTING.STATES.PUBLIC' | translate}} + done{{ enumUtils.toDmpStatusString(activity.status) }} + create{{ enumUtils.toDmpStatusString(activity.status) }} + . + {{'DATASET-LISTING.COLUMNS.GRANT' | translate}}: {{activity.grant}} +
+
+
{{'DATASET-LISTING.TOOLTIP.PART-OF' | translate}} +
{{'DATASET-LISTING.TOOLTIP.DMP' | translate}}
+
+ +
{{'DATASET-LISTING.TOOLTIP.DMP-FOR' | translate}}: {{activity.dmp}}
- -
{{'DATASET-LISTING.TOOLTIP.DMP-FOR' | translate}}: {{activity.dmp}}
-
- - - - - +
+ + + + - + - - - - - + + + + + +
+
+
+
-
- -
- + + search + + {{formGroup.get('like').getError('backendError').message}} + +
@@ -129,7 +136,7 @@
-
+
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 a6de9996b..a460e8abd 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 @@ -27,7 +27,7 @@ import { RecentDmpModel } from '@app/core/model/recent-activity/recent-dmp-activ import { RecentDatasetModel } from '@app/core/model/recent-activity/recent-dataset-activity.model'; import { UserInfoListingModel } from '@app/core/model/user/user-info-listing'; import { DatasetWizardService } from '@app/core/services/dataset-wizard/dataset-wizard.service'; -import { FormControl } from '@angular/forms'; +import { FormControl, FormBuilder } from '@angular/forms'; import { DatasetCopyDialogueComponent } from '@app/ui/dataset/dataset-wizard/dataset-copy-dialogue/dataset-copy-dialogue.component'; @Component({ @@ -39,12 +39,15 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn @Output() totalCountRecentEdited: EventEmitter = new EventEmitter(); - allRecentActivities:RecentActivityModel[]; + allRecentActivities: RecentActivityModel[]; recentActivityTypeEnum = RecentActivityType; isDraft: boolean; totalCount: number; - startIndex: number = 4; + startIndex: number = 0; pageSize: number = 5; + public formGroup = new FormBuilder().group({ + like: new FormControl() + }); constructor( private router: Router, @@ -72,7 +75,10 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn this.allRecentActivities = response; this.totalCountRecentEdited.emit(this.allRecentActivities.length); }); - } + this.formGroup.get('like').valueChanges + .pipe(takeUntil(this._destroyed)) + .subscribe(x => this.refresh()); + } } getDatasets(activity: RecentDmpModel): RecentDatasetModel[] { @@ -375,19 +381,33 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn }); } + refresh(): void { + const fields: Array = ["-modified"]; + this.startIndex = 0; + const allDataTableRequest: DataTableRequest = new DataTableRequest(0, this.pageSize, { fields: fields }); + allDataTableRequest.criteria = new RecentActivityCriteria(); + allDataTableRequest.criteria.like = this.formGroup.get("like").value; + this.dashboardService + .getRecentActivity(allDataTableRequest) + .subscribe(response => { + this.allRecentActivities = response; + this.totalCountRecentEdited.emit(this.allRecentActivities.length); + }); + } + public loadMore() { + this.startIndex = this.startIndex + this.pageSize; const fields: Array = ["-modified"]; const request = new DataTableRequest(this.startIndex, this.pageSize, { fields: fields }); request.criteria = new RecentActivityCriteria(); - request.criteria.like = ""; + request.criteria.like = this.formGroup.get("like").value ? this.formGroup.get("like").value : ""; this.dashboardService.getRecentActivity(request).pipe(takeUntil(this._destroyed)).subscribe(result => { if (!result) { return []; } this.allRecentActivities = this.allRecentActivities.concat(result); + this.totalCountRecentEdited.emit(this.allRecentActivities.length); }); - this.startIndex = this.startIndex + this.pageSize; - this.totalCountRecentEdited.emit(this.startIndex + 1); } // advancedClicked(dmp: DmpListingModel) { diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.html b/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.html index 89ab52de0..9cf42cbf8 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.html +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.html @@ -1,5 +1,11 @@ -
+ + + search + + {{formGroup.get('like').getError('backendError').message}} + +
@@ -60,8 +66,7 @@
-
+
- diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.scss b/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.scss index 63a38eb0c..7e6c2cd3e 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.scss +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.scss @@ -175,3 +175,21 @@ input[type="text"] { .pointer { cursor: pointer; } + +.search-form { + text-align: left; + width: 20rem; +} + +.search-form mat-icon { + color: #129d99; +} + +::ng-deep .search-form .mat-form-field-wrapper { + background-color: white !important; + padding-bottom: 0 !important; +} + +::ng-deep .mat-form-field-appearance-outline .mat-form-field-infix { + padding: 0.3rem 0rem 0.6rem 0rem !important; +} diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.ts b/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.ts index 16c3c9cd9..2aa02ea42 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.ts +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-dataset-activity/recent-edited-dataset-activity.component.ts @@ -8,7 +8,7 @@ import { BaseComponent } from '@common/base/base.component'; import { Principal } from '@app/core/model/auth/principal'; import { TranslateService } from '@ngx-translate/core'; import { EnumUtils } from '@app/core/services/utilities/enum-utils.service'; -import { FormControl } from '@angular/forms'; +import { FormControl, FormBuilder } from '@angular/forms'; import { DatasetCopyDialogueComponent } from '@app/ui/dataset/dataset-wizard/dataset-copy-dialogue/dataset-copy-dialogue.component'; import { MatDialog } from '@angular/material'; import { takeUntil } from 'rxjs/operators'; @@ -33,8 +33,11 @@ export class RecentEditedDatasetActivityComponent extends BaseComponent implemen datasetActivities: DatasetListingModel[]; totalCount: number; - startIndex: number = 4; + startIndex: number = 0; pageSize: number = 5; + public formGroup = new FormBuilder().group({ + like: new FormControl() + }); // publicMode = false; constructor( @@ -61,26 +64,42 @@ export class RecentEditedDatasetActivityComponent extends BaseComponent implemen .subscribe(response => { this.datasetActivities = response.data; this.totalCount = response.totalCount; - this.totalCountDatasets.emit(this.pageSize); - // this.totalCountDatasets.emit(this.totalCount); + this.totalCountDatasets.emit(this.datasetActivities.length); }); + this.formGroup.get('like').valueChanges + .pipe(takeUntil(this._destroyed)) + .subscribe(x => this.refresh()); } } + refresh(): void { + const fields: Array = ["-modified"]; + this.startIndex = 0; + const datasetDataTableRequest: DataTableRequest = new DataTableRequest(0, this.pageSize, { fields: fields }); + datasetDataTableRequest.criteria = new DatasetCriteria(); + datasetDataTableRequest.criteria.like = this.formGroup.get("like").value; + this.datasetService + .getPaged(datasetDataTableRequest) + .subscribe(response => { + this.datasetActivities = response.data; + this.totalCount = response.totalCount; + this.totalCountDatasets.emit(this.datasetActivities.length); + }); + } + public loadMore() { + this.startIndex = this.startIndex + this.pageSize; const fields: Array = ["-modified"]; const request = new DataTableRequest(this.startIndex, this.pageSize, { fields: fields }); request.criteria = new DatasetCriteria(); - request.criteria.like = ""; + request.criteria.like = this.formGroup.get("like").value ? this.formGroup.get("like").value : ""; this.datasetService.getPaged(request).pipe(takeUntil(this._destroyed)).subscribe(result => { if (!result) { return []; } this.datasetActivities = this.datasetActivities.concat(result.data); + this.totalCountDatasets.emit(this.datasetActivities.length); }); - this.startIndex = this.startIndex + this.pageSize; - - this.totalCountDatasets.emit(this.startIndex + 1); } public isAuthenticated(): boolean { diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.css b/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.css index c2ce5bb3c..e81c2750f 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.css +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.css @@ -9,8 +9,7 @@ padding-bottom: 1.2rem; } -.dmp-card, -.dataset-card { +.dmp-card, .dataset-card { min-width: 712px; /* min-height: 308px; */ background: #ffffff 0% 0% no-repeat padding-box; @@ -70,8 +69,7 @@ input[type="text"] { opacity: 0.75; } -.dmp-title, -.dataset-title { +.dmp-title, .dataset-title { text-align: left; font-weight: 500; font-family: "Roboto", sans-serif; @@ -82,8 +80,7 @@ input[type="text"] { color: #212121; } -.dataset-subtitle, -.dmp-subtitle { +.dataset-subtitle, .dmp-subtitle { display: flex; flex-direction: row; text-align: left; @@ -112,8 +109,7 @@ input[type="text"] { padding-bottom: 0.4rem; } -.dataset-card-actions, -.dmp-card-actions { +.dataset-card-actions, .dmp-card-actions { display: flex; flex-direction: row; border-top: 1px solid #dbdbdb; @@ -121,14 +117,12 @@ input[type="text"] { color: #848484; } -.dataset-card-actions a, -.dmp-card-actions a { +.dataset-card-actions a, .dmp-card-actions a { color: #848484 !important; text-decoration: none !important; } -.dataset-card-actions a:hover, -.dmp-card-actions a:hover { +.dataset-card-actions a:hover, .dmp-card-actions a:hover { color: #129d99 !important; } @@ -175,6 +169,24 @@ input[type="text"] { cursor: pointer; } +.search-form { + text-align: left; + width: 20rem; +} + +.search-form mat-icon { + color: #129d99; +} + +::ng-deep .search-form .mat-form-field-wrapper { + background-color: white !important; + padding-bottom: 0 !important; +} + +::ng-deep .mat-form-field-appearance-outline .mat-form-field-infix { + padding: 0.3rem 0rem 0.6rem 0rem !important; +} + /* th { text-transform: uppercase; } diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.html b/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.html index a495e9052..4ba44cac9 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.html +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.html @@ -1,4 +1,11 @@
+ + + search + + {{formGroup.get('like').getError('backendError').message}} + +
@@ -67,7 +74,7 @@
-
+
diff --git a/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.ts b/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.ts index 5d1299cac..df5a3c08f 100644 --- a/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.ts +++ b/dmp-frontend/src/app/ui/dashboard/recent-edited-dmp-activity/recent-edited-dmp-activity.component.ts @@ -20,6 +20,7 @@ import { DmpStatus } from '@app/core/common/enum/dmp-status'; import { DatasetService } from '@app/core/services/dataset/dataset.service'; import { DatasetListingModel } from '@app/core/model/dataset/dataset-listing'; import { Role } from '@app/core/common/enum/role'; +import { FormBuilder, FormControl } from '@angular/forms'; @Component({ selector: 'app-recent-edited-dmp-activity', @@ -32,13 +33,15 @@ export class RecentEditedDmpActivityComponent extends BaseComponent implements O dmpActivities: DmpListingModel[]; datasetActivities: DatasetListingModel[]; - // allRecentActivities: RecentActivity[] = []; recentActivityTypeEnum = RecentActivityType; isDraft: boolean; totalCount: number; - startIndex: number = 4; + startIndex: number = 0; pageSize: number = 5; + public formGroup = new FormBuilder().group({ + like: new FormControl() + }); constructor( private router: Router, @@ -64,7 +67,8 @@ export class RecentEditedDmpActivityComponent extends BaseComponent implements O .subscribe(response => { this.dmpActivities = response.data; this.totalCount = response.totalCount; - this.totalCountDmps.emit(this.pageSize); + this.totalCountDmps.emit(this.dmpActivities.length); + // this.totalCount < this.pageSize ? this.totalCountDmps.emit(response.totalCount) : this.totalCountDmps.emit(this.pageSize); // this.totalCountDmps.emit(this.totalCount); // this.dmpActivities.forEach(dmpActivity => { // const recentActivity: RecentActivity = { @@ -74,6 +78,9 @@ export class RecentEditedDmpActivityComponent extends BaseComponent implements O // this.allRecentActivities.push(recentActivity) // }) }); + this.formGroup.get('like').valueChanges + .pipe(takeUntil(this._destroyed)) + .subscribe(x => this.refresh()); // const datasetDataTableRequest: DataTableRequest = new DataTableRequest(0, 5, { fields: fields }); // datasetDataTableRequest.criteria = new DatasetCriteria(); @@ -90,7 +97,7 @@ export class RecentEditedDmpActivityComponent extends BaseComponent implements O // this.allRecentActivities.push(recentActivity) // }) // }); - } + } } public isAuthenticated(): boolean { @@ -288,20 +295,35 @@ export class RecentEditedDmpActivityComponent extends BaseComponent implements O } } + refresh(): void { + const fields: Array = ["-modified"]; + this.startIndex = 0; + const dmpDataTableRequest: DataTableRequest = new DataTableRequest(this.startIndex, this.pageSize, { fields: fields }); + dmpDataTableRequest.criteria = new DmpCriteria(); + dmpDataTableRequest.criteria.like = this.formGroup.get("like").value; + this.dmpService + .getPaged(dmpDataTableRequest, "listing") + .subscribe(response => { + this.dmpActivities = response.data; + this.totalCount = response.totalCount; + this.totalCountDmps.emit(this.dmpActivities.length); + }); + } + public loadMore() { + this.startIndex = this.startIndex + this.pageSize; const fields: Array = ["-modified"]; const request = new DataTableRequest(this.startIndex, this.pageSize, { fields: fields }); request.criteria = new DmpCriteria(); - request.criteria.like = ""; + request.criteria.like = this.formGroup.get("like").value ? this.formGroup.get("like").value : ""; this.dmpService.getPaged(request, "listing").pipe(takeUntil(this._destroyed)).subscribe(result => { if (!result) { return []; } this.dmpActivities = this.dmpActivities.concat(result.data); + this.totalCountDmps.emit(this.dmpActivities.length); }); - this.startIndex = this.startIndex + this.pageSize; - this.totalCountDmps.emit(this.startIndex + 1); } // advancedClicked(dmp: DmpListingModel) { diff --git a/dmp-frontend/src/app/ui/dataset/listing/dataset-listing.component.html b/dmp-frontend/src/app/ui/dataset/listing/dataset-listing.component.html index 913aed951..1147e4731 100644 --- a/dmp-frontend/src/app/ui/dataset/listing/dataset-listing.component.html +++ b/dmp-frontend/src/app/ui/dataset/listing/dataset-listing.component.html @@ -22,7 +22,7 @@
- + search {{formGroup.get('like').getError('backendError').message}} 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 fdc462469..10a7b6075 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 @@ -132,6 +132,7 @@ export class DatasetListingComponent extends BaseComponent implements OnInit, IB // setTimeout(() => this.refreshCallback(true)); // } this.criteria.like = this.formGroup.get("like").value; + this.startIndex = 0; this.refresh(); } diff --git a/dmp-frontend/src/app/ui/dataset/overview/dataset-overview.component.html b/dmp-frontend/src/app/ui/dataset/overview/dataset-overview.component.html index 7dea40018..26ed8b1a1 100644 --- a/dmp-frontend/src/app/ui/dataset/overview/dataset-overview.component.html +++ b/dmp-frontend/src/app/ui/dataset/overview/dataset-overview.component.html @@ -2,8 +2,8 @@
- chevron_left -

{{'DMP-WIZARD.ACTIONS.BACK' | translate}}

+ chevron_left +

{{'DMP-WIZARD.ACTIONS.BACK' | translate}}

@@ -76,7 +76,7 @@
{{'DMP-OVERVIEW.RESEARCHERS' | translate}}
- +
 
{{ researcher.name }},
{{ researcher.name }}
diff --git a/dmp-frontend/src/app/ui/dataset/overview/dataset-overview.component.ts b/dmp-frontend/src/app/ui/dataset/overview/dataset-overview.component.ts index 6e2d2d387..602fb0e0f 100644 --- a/dmp-frontend/src/app/ui/dataset/overview/dataset-overview.component.ts +++ b/dmp-frontend/src/app/ui/dataset/overview/dataset-overview.component.ts @@ -303,6 +303,12 @@ export class DatasetOverviewComponent extends BaseComponent implements OnInit { return this.configurationService.orcidPath; } + getOrcidPathForResearcher(reference: string): string { + const path = this.getOrcidPath(); + const userId = reference.split(':')[1]; + return path + userId; + } + downloadPDF(id: string) { this.datasetService.downloadPDF(id) .pipe(takeUntil(this._destroyed)) diff --git a/dmp-frontend/src/app/ui/dmp/invitation/dmp-invitation.component.html b/dmp-frontend/src/app/ui/dmp/invitation/dmp-invitation.component.html index e6b43c548..33a63c1b8 100644 --- a/dmp-frontend/src/app/ui/dmp/invitation/dmp-invitation.component.html +++ b/dmp-frontend/src/app/ui/dmp/invitation/dmp-invitation.component.html @@ -14,7 +14,15 @@ [configuration]="usersAutoCompleteConfiguration"> -
+
+ + {{'DMP-LISTING.MEMBER' | translate}} + + + {{ roleName.value }} + + +
diff --git a/dmp-frontend/src/app/ui/dmp/invitation/dmp-invitation.component.scss b/dmp-frontend/src/app/ui/dmp/invitation/dmp-invitation.component.scss index 996466d32..315ec3063 100644 --- a/dmp-frontend/src/app/ui/dmp/invitation/dmp-invitation.component.scss +++ b/dmp-frontend/src/app/ui/dmp/invitation/dmp-invitation.component.scss @@ -28,6 +28,10 @@ border-radius: 4px; } +::ng-deep .mat-dialog-container { + border-radius: 8px; +} + ::ng-deep .mat-form-field-underline { display: none; } @@ -56,3 +60,12 @@ margin-bottom: 0.25em; } +.select-role { + width: 16% !important; + font-size: 14px; + color: #848484; + height: min-content; + margin-right: 2.5rem; + border: none; + background-color: transparent; +} diff --git a/dmp-frontend/src/app/ui/dmp/invitation/dmp-invitation.component.ts b/dmp-frontend/src/app/ui/dmp/invitation/dmp-invitation.component.ts index ddce6723f..d8ad3c94e 100644 --- a/dmp-frontend/src/app/ui/dmp/invitation/dmp-invitation.component.ts +++ b/dmp-frontend/src/app/ui/dmp/invitation/dmp-invitation.component.ts @@ -14,6 +14,7 @@ import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/mu import { BaseComponent } from '@common/base/base.component'; import { Observable } from 'rxjs'; import { map, takeUntil } from 'rxjs/operators'; +import { Role } from '@app/core/common/enum/role'; @Component({ selector: 'app-invitation-component', @@ -26,6 +27,8 @@ export class DmpInvitationDialogComponent extends BaseComponent implements OnIni public filteredUsersAsync = false; public filteredUsers: DmpInvitationUser[]; public emails: string[] = []; + public roles = Role; + public roleNames: string[]; visible = true; selectable = true; @@ -33,13 +36,29 @@ export class DmpInvitationDialogComponent extends BaseComponent implements OnIni addOnBlur = true; readonly separatorKeysCodes: number[] = [ENTER, COMMA]; + constructor( + public invitationService: DmpInvitationService, + public route: ActivatedRoute, + public router: Router, + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any + ) { + super(); + this.roleNames = Object.keys(this.roles).filter(key => key.length > 1); + } + + ngOnInit(): void { + const invitation = new DmpInvitation(); + invitation.dataManagementPlan = this.data.dmpId; + this.formGroup = invitation.buildForm(); + } + usersAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = { filterFn: this.filterUsers.bind(this), initialItems: (excludedItems: any[]) => this.filterUsers('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))), displayFn: (item) => typeof(item) === 'string' ? item : item.name, titleFn: (item) => typeof(item) === 'string' ? item : item.name, valueAssign: (item) => { - const result = typeof(item) === 'string' ? item : item.email; console.log(result); return result; @@ -64,30 +83,13 @@ export class DmpInvitationDialogComponent extends BaseComponent implements OnIni } } - - constructor( - public invitationService: DmpInvitationService, - public route: ActivatedRoute, - public router: Router, - public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: any - ) { super(); } - - ngOnInit(): void { - const invitation = new DmpInvitation(); - invitation.dataManagementPlan = this.data.dmpId; - this.formGroup = invitation.buildForm(); - } - - send(value: any) { let invitationObject: any = {}; invitationObject.dataManagementPlan = this.data.dmpId; + invitationObject.role = this.formGroup.get('role').value; invitationObject.users = []; - console.log(this.formGroup.get('users').value); invitationObject.users.push(...(this.formGroup.get('users').value).filter(user => typeof(user) === 'string').map(email => ({ email: email, name: email }))); invitationObject.users.push(...(this.formGroup.get('users').value).filter(user => typeof(user) !== 'string')); - console.log(invitationObject.users); //invitationObject.users.push(...this.formGroup.get('users').value); this.emails.forEach(email => { invitationObject.users.push({ email: email, name: email }); 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 13bf9c279..370519786 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 @@ -17,7 +17,7 @@
- + search {{formGroup.get('like').getError('backendError').message}} diff --git a/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.ts b/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.ts index ed291b369..dab5e41c7 100644 --- a/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.ts +++ b/dmp-frontend/src/app/ui/dmp/listing/dmp-listing.component.ts @@ -231,6 +231,7 @@ export class DmpListingComponent extends BaseComponent implements OnInit, IBread // setTimeout(() => this.refreshCallback(true)); // } this.criteria.like = this.formGroup.get("like").value; + this.startIndex = 0; this.refresh(); } 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 0b442ae54..24337384c 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 @@ -63,7 +63,7 @@
{{'DMP-OVERVIEW.RESEARCHERS' | translate}}
- +
 
{{ researcher.name }},
{{ researcher.name }}
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 86202ab38..ab89088c8 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 @@ -584,9 +584,9 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit { reloadPage(): void { this.router.navigateByUrl('/plans', { skipLocationChange: true }).then(() => { - this.router.navigate([`/plans/overview/${this.dmp.id}`]); + this.router.navigate([`/plans/overview/${this.dmp.id}`]); }); - } + } updateUsers() { return this.dmpService.updateUsers(this.dmp.id, this.dmp.users).pipe(takeUntil(this._destroyed)) @@ -594,7 +594,7 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit { complete => { this.onCallbackSuccess(); this.reloadPage(); - }, + }, error => this.onDeleteCallbackError(error) ); } @@ -632,6 +632,12 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit { return this.configurationService.orcidPath; } + getOrcidPathForResearcher(reference: string): string { + const path = this.getOrcidPath(); + const userId = reference.split(':')[1]; + return path + userId; + } + checkLockStatus(id: string) { this.lockService.checkLockStatus(id).pipe(takeUntil(this._destroyed)) .subscribe(lockStatus => this.lockStatus = lockStatus); diff --git a/dmp-frontend/src/assets/i18n/en.json b/dmp-frontend/src/assets/i18n/en.json index a7ada16ae..9a2775a24 100644 --- a/dmp-frontend/src/assets/i18n/en.json +++ b/dmp-frontend/src/assets/i18n/en.json @@ -849,6 +849,7 @@ "TAGS": "Tags", "SELECT-TAGS": "Select Tags", "LIKE": "Search Dataset Descriptions", + "DRAFT-LIKE": "Search Draft Dataset Descriptions", "SELECT-GRANTS": "Select Grants", "ROLE": "Role", "ORGANIZATION": "Organization", @@ -876,7 +877,8 @@ "LABEL": "Search", "ROLE": "Role" }, - "SELECT": "Select an option" + "SELECT": "Select an option", + "LIKE": "Search" }, "DATASET-EDITOR": { "TITLE": { diff --git a/dmp-frontend/src/assets/i18n/es.json b/dmp-frontend/src/assets/i18n/es.json index a3d24bd4d..daa44f273 100644 --- a/dmp-frontend/src/assets/i18n/es.json +++ b/dmp-frontend/src/assets/i18n/es.json @@ -844,6 +844,7 @@ "TAGS": "Etiquetas", "SELECT-TAGS": "Etiquetas seleccionadas", "LIKE": "Busdar descripciones del Dataset", + "DRAFT-LIKE": "Search Draft Dataset Descriptions", "SELECT-GRANTS": "Seleccionar subvención", "ROLE": "Función", "ORGANIZATION": "Organización", @@ -871,7 +872,8 @@ "LABEL": "Búsqueda", "ROLE": "Función" }, - "SELECT": "Seleccionar una opción" + "SELECT": "Seleccionar una opción", + "LIKE": "Search" }, "DATASET-EDITOR": { "TITLE": { diff --git a/dmp-frontend/src/assets/i18n/gr.json b/dmp-frontend/src/assets/i18n/gr.json index 47a99f294..11fa6209a 100644 --- a/dmp-frontend/src/assets/i18n/gr.json +++ b/dmp-frontend/src/assets/i18n/gr.json @@ -845,6 +845,7 @@ "TAGS": "Ετικέτες", "SELECT-TAGS": "Επιλογή Ετικέτας", "LIKE": "Αναζήτηση Περιγραφών Συνόλου Δεδομένων", + "DRAFT-LIKE": "Αναζήτηση Προσχέδιων Περιγραφών Συνόλου Δεδομένων", "SELECT-GRANTS": "Επιλογή Επιχορηγήσεων", "ROLE": "Ρόλος", "ORGANIZATION": "Οργανισμός", @@ -872,7 +873,8 @@ "LABEL": "Αναζήτηση", "ROLE": "Ρόλος" }, - "SELECT": "Επιλογή" + "SELECT": "Επιλογή", + "LIKE": "Search" }, "DATASET-EDITOR": { "TITLE": {