From 31bb29984cdcbcf87830f480b47e00401d0cb855 Mon Sep 17 00:00:00 2001 From: Olivia Guyot Date: Tue, 19 Nov 2024 11:22:53 +0100 Subject: [PATCH 1/3] feat(datahub): better language-switcher style & position --- .../home-header/home-header.component.html | 14 +++++--- .../home/home-header/home-header.component.ts | 1 + .../header-record.component.html | 2 ++ .../language-switcher.component.html | 2 +- .../language-switcher.component.ts | 33 +++++++------------ 5 files changed, 25 insertions(+), 27 deletions(-) diff --git a/apps/datahub/src/app/home/home-header/home-header.component.html b/apps/datahub/src/app/home/home-header/home-header.component.html index 270e43834c..9591fa2da6 100644 --- a/apps/datahub/src/app/home/home-header/home-header.component.html +++ b/apps/datahub/src/app/home/home-header/home-header.component.html @@ -1,6 +1,6 @@
+
-
diff --git a/apps/datahub/src/app/home/home-header/home-header.component.ts b/apps/datahub/src/app/home/home-header/home-header.component.ts index 959596af08..e7dd6780b5 100644 --- a/apps/datahub/src/app/home/home-header/home-header.component.ts +++ b/apps/datahub/src/app/home/home-header/home-header.component.ts @@ -48,6 +48,7 @@ export class HomeHeaderComponent { SORT_BY_PARAMS = SortByEnum searchConfig: SearchConfig = getOptionalSearchConfig() showLanguageSwitcher = getGlobalConfig().LANGUAGES?.length > 0 + foregroundColor = getThemeConfig().HEADER_FOREGROUND_COLOR || '#ffffff' constructor( public routerFacade: RouterFacade, diff --git a/apps/datahub/src/app/record/header-record/header-record.component.html b/apps/datahub/src/app/record/header-record/header-record.component.html index 0533c1bbac..b4ceefb0ac 100644 --- a/apps/datahub/src/app/record/header-record/header-record.component.html +++ b/apps/datahub/src/app/record/header-record/header-record.component.html @@ -27,6 +27,8 @@ class="language-switcher text-[13px] mt-0.5" [style.--color-main]="foregroundColor" [style.--color-gray-300]="foregroundColor" + [style.--color-primary-darker]="foregroundColor" + [style.--color-primary-black]="foregroundColor" > diff --git a/libs/ui/catalog/src/lib/language-switcher/language-switcher.component.html b/libs/ui/catalog/src/lib/language-switcher/language-switcher.component.html index ea68c4e4df..11b357951d 100644 --- a/libs/ui/catalog/src/lib/language-switcher/language-switcher.component.html +++ b/libs/ui/catalog/src/lib/language-switcher/language-switcher.component.html @@ -1,6 +1,6 @@ ({ + label: `${language}`.toUpperCase(), + value: language, + }) + ) constructor( @Optional() @Inject(LANGUAGES_LIST) - private languagePlaceholder, + private languagesList: string[], private translate: TranslateService ) {} @@ -31,22 +30,14 @@ export class LanguageSwitcherComponent implements OnInit { return this.translate.currentLang } - ngOnInit(): void { - const languages = this.languagePlaceholder || DEFAULT_LANGUAGES - this.languageList = languages.map((language) => ({ - label: `${language}`.toUpperCase(), - value: language, - })) - } - - changeLanguage(value) { + changeLanguage(value: unknown) { try { - localStorage.setItem(LANGUAGE_STORAGE_KEY, value) + localStorage.setItem(LANGUAGE_STORAGE_KEY, value as string) location.reload() } catch (error) { console.warn(`Language choice could not be persisted`, error) } - this.translate.use(value) + this.translate.use(value as string) } } From 1230d6f6c8c5a0316b2bf9c150a8e90c3da62d2d Mon Sep 17 00:00:00 2001 From: Olivia Guyot Date: Tue, 19 Nov 2024 11:34:49 +0100 Subject: [PATCH 2/3] feat(datahub): better layout in search-filters block --- .../home/search/search-filters/search-filters.component.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/datahub/src/app/home/search/search-filters/search-filters.component.html b/apps/datahub/src/app/home/search/search-filters/search-filters.component.html index 8d463930f5..07ad432a4f 100644 --- a/apps/datahub/src/app/home/search/search-filters/search-filters.component.html +++ b/apps/datahub/src/app/home/search/search-filters/search-filters.component.html @@ -91,7 +91,7 @@

[ngClass]="{ 'sm:col-span-3 lg:col-span-2': !isOpen }" >
> From 1abd2ec22c087fef3196566f9413395ca8105b88 Mon Sep 17 00:00:00 2001 From: Olivia Guyot Date: Tue, 19 Nov 2024 11:45:07 +0100 Subject: [PATCH 3/3] feat(datahub): better layout for preview tabs --- .../record/record-metadata/record-metadata.component.css | 8 ++++++++ .../record/record-metadata/record-metadata.component.html | 4 +--- .../record/src/lib/data-view/data-view.component.html | 2 +- .../record/src/lib/map-view/map-view.component.html | 4 ++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/apps/datahub/src/app/record/record-metadata/record-metadata.component.css b/apps/datahub/src/app/record/record-metadata/record-metadata.component.css index e3a0105a26..55d8c876f6 100644 --- a/apps/datahub/src/app/record/record-metadata/record-metadata.component.css +++ b/apps/datahub/src/app/record/record-metadata/record-metadata.component.css @@ -1,3 +1,8 @@ +/* TODO(mdc-migration): The following rule targets internal classes of tabs that may no longer apply for the MDC version. */ +::ng-deep .mat-mdc-tab-labels { + /* move tabs on the right to let the title show */ + margin-left: 140px; +} ::ng-deep .mat-mdc-tab.mdc-tab { letter-spacing: 0.88px; } @@ -16,6 +21,9 @@ } @media only screen and (max-width: 639px) { /* TODO(mdc-migration): The following rule targets internal classes of tabs that may no longer apply for the MDC version. */ + ::ng-deep .mat-mdc-tab-labels { + margin-left: 0px; + } ::ng-deep .mat-mdc-tab.mdc-tab { padding: 0px !important; margin-right: 24px; diff --git a/apps/datahub/src/app/record/record-metadata/record-metadata.component.html b/apps/datahub/src/app/record/record-metadata/record-metadata.component.html index 12a73987d8..62a7e5abab 100644 --- a/apps/datahub/src/app/record/record-metadata/record-metadata.component.html +++ b/apps/datahub/src/app/record/record-metadata/record-metadata.component.html @@ -79,9 +79,7 @@ > - record.tab.map + record.tab.map
-
+