[NO ISSUE][DASHBOARD] Fix for visual deselect of dataverses on refresh
click
-user model changes: no
-storage format changes: no
-interface changes: yes
Details:
-Implements a fix that remembers the selection of dataverses when user
clicks the Refresh button
Change-Id: I7d65996fb09f2c14668f13f880960000a27f12af
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/11783
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Ian Maxon <imaxon@uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
diff --git a/asterixdb/asterix-dashboard/src/node/src/app/dashboard/query/metadata.component.ts b/asterixdb/asterix-dashboard/src/node/src/app/dashboard/query/metadata.component.ts
index 835eeb8..3de1555 100755
--- a/asterixdb/asterix-dashboard/src/node/src/app/dashboard/query/metadata.component.ts
+++ b/asterixdb/asterix-dashboard/src/node/src/app/dashboard/query/metadata.component.ts
@@ -83,9 +83,7 @@
sampleDataset$: Observable<any>;
sampleDataset: any;
- //variables for counting
- countDataset$:Observable<any>;
- countDataset: number;
+ checkedDataverses: any = {};
//added variables for flattening
datatypesDict: Object;
@@ -104,6 +102,16 @@
this.dataverses$ = this.store.select(s => s.dataverse.dataverses.results);
this.dataverses$.subscribe((data: any[]) => {
this.dataverses = data;
+
+ if (Object.keys(this.checkedDataverses).length > 0) {
+ for (let dataverse of this.dataverses) {
+ if (this.checkedDataverses[dataverse.DataverseName]) {
+ dataverse.active = true;
+ }
+ }
+
+ this.checkedDataverses = {};
+ }
});
// Watching for Datasets
@@ -140,6 +148,14 @@
}
refreshMetadata() {
+ if (this.dataverses) {
+ for (let dataverse of this.dataverses) {
+ if (dataverse.active) {
+ this.checkedDataverses[dataverse.DataverseName] = true;
+ }
+ }
+ }
+
this.store.dispatch(new dataverseActions.SelectDataverses('-'));
this.store.dispatch(new datasetActions.SelectDatasets('-'));
this.store.dispatch(new datatypesActions.SelectDatatypes('-'));
@@ -183,7 +199,6 @@
checkStatus = [];
generateFilter(dataverse, event, i) {
-
if (this.checkStatus[i] == undefined) {
this.checkStatus.push(event.checked);
} else {