From 5f8f11108f9130ebec1f7de617b81275fcf7091d Mon Sep 17 00:00:00 2001 From: Dan Percic Date: Fri, 23 Jul 2021 03:09:30 +0300 Subject: [PATCH] working entire platform search --- apps/red-ui/src/app/app.component.html | 4 +- apps/red-ui/src/app/app.module.ts | 11 +- .../base-screen/base-screen.component.html | 70 ++------ .../base-screen/base-screen.component.ts | 53 +++++- .../spotlight-search-action.ts | 6 + .../spotlight-search-dialog-data.ts | 6 + .../spotlight-search.component.html | 43 +++++ .../spotlight-search.component.scss | 51 ++++++ .../spotlight-search.component.ts | 68 ++++++++ .../src/app/modules/auth/red-role.guard.ts | 59 ++++--- .../file-actions/file-actions.component.scss | 4 - .../scroll-button.component.html | 12 +- .../scroll-button/scroll-button.component.ts | 24 +-- .../dossier/dossiers-routing.module.ts | 24 ++- .../app/modules/dossier/dossiers.module.ts | 3 +- .../search-screen.component.html | 98 +++++++++++ .../search-screen.component.scss | 38 +++++ .../search-screen/search-screen.component.ts | 155 ++++++++++++++++++ .../src/app/modules/icons/icons.module.ts | 6 +- .../shared/base/base-listing.component.ts | 2 +- .../input-with-action.component.html | 12 +- .../input-with-action.component.ts | 2 +- .../page-header/page-header.component.html | 3 +- .../page-header/page-header.component.ts | 9 +- .../shared/directives/sync-width.directive.ts | 4 +- .../shared/services/screen-state.service.ts | 2 +- .../modules/shared/services/search.service.ts | 16 +- .../src/app/services/loading.service.ts | 2 +- .../app/services/router-history.service.ts | 2 +- .../red-ui/src/app/state/app-state.service.ts | 11 +- apps/red-ui/src/assets/i18n/en.json | 19 +++ .../red-ui/src/assets/icons/general/enter.svg | 15 ++ .../src/assets/styles/red-page-layout.scss | 8 + libs/red-ui-http/src/lib/model/models.ts | 1 + 34 files changed, 688 insertions(+), 155 deletions(-) create mode 100644 apps/red-ui/src/app/components/spotlight-search/spotlight-search-action.ts create mode 100644 apps/red-ui/src/app/components/spotlight-search/spotlight-search-dialog-data.ts create mode 100644 apps/red-ui/src/app/components/spotlight-search/spotlight-search.component.html create mode 100644 apps/red-ui/src/app/components/spotlight-search/spotlight-search.component.scss create mode 100644 apps/red-ui/src/app/components/spotlight-search/spotlight-search.component.ts create mode 100644 apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.html create mode 100644 apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.scss create mode 100644 apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.ts create mode 100644 apps/red-ui/src/assets/icons/general/enter.svg diff --git a/apps/red-ui/src/app/app.component.html b/apps/red-ui/src/app/app.component.html index 3ac47a12a..dbdf8372d 100644 --- a/apps/red-ui/src/app/app.component.html +++ b/apps/red-ui/src/app/app.component.html @@ -1,4 +1,2 @@ - + diff --git a/apps/red-ui/src/app/app.module.ts b/apps/red-ui/src/app/app.module.ts index e6788e007..b61e28269 100644 --- a/apps/red-ui/src/app/app.module.ts +++ b/apps/red-ui/src/app/app.module.ts @@ -32,6 +32,7 @@ import { GlobalErrorHandler } from '@utils/global-error-handler.service'; import { REDMissingTranslationHandler } from '@utils/missing-translations-handler'; import { configurationInitializer } from '@app-config/configuration.initializer'; import { AppConfigService } from '@app-config/app-config.service'; +import { SpotlightSearchComponent } from '@components/spotlight-search/spotlight-search.component'; export function httpLoaderFactory(httpClient: HttpClient) { return new TranslateHttpLoader(httpClient, '/assets/i18n/', '.json'); @@ -49,7 +50,15 @@ function cleanupBaseUrl(baseUrl: string) { const screens = [BaseScreenComponent, DownloadsListScreenComponent, UserProfileScreenComponent]; -const components = [AppComponent, LogoComponent, AuthErrorComponent, ToastComponent, NotificationsComponent, ...screens]; +const components = [ + AppComponent, + LogoComponent, + AuthErrorComponent, + ToastComponent, + NotificationsComponent, + SpotlightSearchComponent, + ...screens +]; @NgModule({ declarations: [...components], diff --git a/apps/red-ui/src/app/components/base-screen/base-screen.component.html b/apps/red-ui/src/app/components/base-screen/base-screen.component.html index a4e3893fd..8a5dbedc2 100644 --- a/apps/red-ui/src/app/components/base-screen/base-screen.component.html +++ b/apps/red-ui/src/app/components/base-screen/base-screen.component.html @@ -6,11 +6,7 @@ - + - diff --git a/apps/red-ui/src/app/modules/shared/components/input-with-action/input-with-action.component.ts b/apps/red-ui/src/app/modules/shared/components/input-with-action/input-with-action.component.ts index 10e87ca2b..cc00278b3 100644 --- a/apps/red-ui/src/app/modules/shared/components/input-with-action/input-with-action.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/input-with-action/input-with-action.component.ts @@ -29,7 +29,7 @@ export class InputWithActionComponent { } clearContent() { - this.form.patchValue({ query: '' }); + this.form.patchValue({ query: '' }, { emitEvent: true }); } executeAction($event?: MouseEvent) { diff --git a/apps/red-ui/src/app/modules/shared/components/page-header/page-header.component.html b/apps/red-ui/src/app/modules/shared/components/page-header/page-header.component.html index 1c9ef9031..7f6fa8bb4 100644 --- a/apps/red-ui/src/app/modules/shared/components/page-header/page-header.component.html +++ b/apps/red-ui/src/app/modules/shared/components/page-header/page-header.component.html @@ -1,7 +1,7 @@