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..04a539c84 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..4d1a59ed9 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, 5, { 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-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..d8e0e7ad2 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}}

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(); }