From 672ecdb7810287c7b4afe1eb144bb75794cd2247 Mon Sep 17 00:00:00 2001 From: Anna Lin Date: Tue, 18 May 2021 14:53:19 -0400 Subject: [PATCH 1/4] Adding sidebarContentType to data service, to change the content of the sidebar, depending on where it was clicked from --- nav-app/src/app/data.service.ts | 8 ++++++++ nav-app/src/app/datatable/data-table.component.html | 2 +- nav-app/src/app/sidebar/sidebar.component.html | 8 +++++++- nav-app/src/app/sidebar/sidebar.component.ts | 5 ++++- nav-app/src/app/tabs/tabs.component.ts | 1 + 5 files changed, 21 insertions(+), 3 deletions(-) diff --git a/nav-app/src/app/data.service.ts b/nav-app/src/app/data.service.ts index 4eeba5cca..fdd2acf1c 100755 --- a/nav-app/src/app/data.service.ts +++ b/nav-app/src/app/data.service.ts @@ -34,6 +34,14 @@ export class DataService { public get sidebarOpened(): boolean { return this._sidebarOpened; }; public set sidebarOpened(newVal: boolean) { this._sidebarOpened = newVal; }; + public readonly sidebarContentTypes = ['layerUpgrade', 'search']; + private _sidebarContentType: string; + public get sidebarContentType(): string { return this._sidebarContentType; }; + public set sidebarContentType(newVal: string) { + if (this.sidebarContentTypes.includes(newVal)) this._sidebarContentType = newVal; + else this._sidebarContentType = ''; + }; + /** * Callback functions passed to this function will be called after data is loaded * @param {*} callback callback function to call when data is done loading diff --git a/nav-app/src/app/datatable/data-table.component.html b/nav-app/src/app/datatable/data-table.component.html index aed4f8868..a9c1cb82f 100755 --- a/nav-app/src/app/datatable/data-table.component.html +++ b/nav-app/src/app/datatable/data-table.component.html @@ -41,7 +41,7 @@
From 8d3e8bff582dbead79a18599005d49b4ce117aca Mon Sep 17 00:00:00 2001 From: Anna Lin Date: Tue, 18 May 2021 16:56:02 -0400 Subject: [PATCH 3/4] Updated functionality of what search icon in toolbar does when clicked, and removed multiselect --- .../app/datatable/data-table.component.html | 21 +------------------ 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/nav-app/src/app/datatable/data-table.component.html b/nav-app/src/app/datatable/data-table.component.html index a063d1496..7fbbedaa0 100755 --- a/nav-app/src/app/datatable/data-table.component.html +++ b/nav-app/src/app/datatable/data-table.component.html @@ -41,32 +41,13 @@
- - -
- - - -
- -
-
Date: Tue, 18 May 2021 16:57:02 -0400 Subject: [PATCH 4/4] Added optional ? when looking for field in the search all techniques function, as it was throwing an error trying to convert undefined to lower case --- .../src/app/techniques-search/techniques-search.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nav-app/src/app/techniques-search/techniques-search.component.ts b/nav-app/src/app/techniques-search/techniques-search.component.ts index 9bd8722c2..fffb1d3cd 100644 --- a/nav-app/src/app/techniques-search/techniques-search.component.ts +++ b/nav-app/src/app/techniques-search/techniques-search.component.ts @@ -54,7 +54,7 @@ export class TechniquesSearchComponent implements OnInit { for (let field of self.fields) { if (field.enabled) { // query in this field - if (technique[field.field].toLowerCase().includes(self._query.trim().toLowerCase())) return true; + if (technique[field.field]?.toLowerCase().includes(self._query.trim().toLowerCase())) return true; } } return false;