-
0" class="d-flex justify-content-center">
+
0 && datasetActivities.length >= startIndex + pageSize" class="d-flex justify-content-center">
-
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/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": {