From de45fe65d5baf151df6e7abd51eed8f425bc7c6f Mon Sep 17 00:00:00 2001 From: Verena Chung <9377970+vpchung@users.noreply.github.com> Date: Tue, 31 Oct 2023 11:03:13 -0700 Subject: [PATCH] fix(openchallenges): upgrade legacy components (#2290) * not-found page: upgrade MatCard * org-profile page: remove unused tabs component * github-button: upgrade MatButton * _app-theme: upgrade legacy; fix fonts * navbar: upgrade MatButton; fix colors and padding * fix typography for buttons * signup page: upgrade components * add required `mat-label` * update styles to account for changes * user-button: upgrade MatButton, MatMenu * update styles to account for changes * upgrade component in commented code * remove dependency on legacy-* in _app-theme * add typography to discord button; add discord theme * schematic: remove unused font; upgrade legacies --- apps/openchallenges/app/src/_app-theme.scss | 19 +++++------ apps/schematic/app/src/_app-theme.scss | 15 ++------- .../not-found/src/lib/not-found.component.ts | 2 +- .../src/lib/org-profile.component.ts | 3 -- .../signup/src/lib/signup.component.html | 3 ++ .../signup/src/lib/signup.component.scss | 7 ++-- .../signup/src/lib/signup.component.ts | 8 ++--- .../styles/src/lib/_general.scss | 2 +- libs/openchallenges/themes/src/_fonts.scss | 21 ++++++------ libs/openchallenges/ui/src/_lib-theme.scss | 2 ++ .../button-github/button-github.component.ts | 2 +- .../discord-button/_discord-button-theme.scss | 9 ++++-- .../discord-button.component.html | 32 ++++++++++--------- .../ui/src/lib/navbar/_navbar-theme.scss | 11 ++++++- .../ui/src/lib/navbar/navbar.component.scss | 4 ++- .../ui/src/lib/navbar/navbar.component.ts | 2 +- .../lib/user-button/_user-button-theme.scss | 20 ++++++------ .../user-button/user-button.component.scss | 8 ++--- .../lib/user-button/user-button.component.ts | 4 +-- .../src/lib/user-profile.component.ts | 2 +- 20 files changed, 91 insertions(+), 85 deletions(-) diff --git a/apps/openchallenges/app/src/_app-theme.scss b/apps/openchallenges/app/src/_app-theme.scss index ac62858f4b..5f61f101f7 100644 --- a/apps/openchallenges/app/src/_app-theme.scss +++ b/apps/openchallenges/app/src/_app-theme.scss @@ -4,8 +4,8 @@ @use 'libs/openchallenges/themes/src/palettes' as palettes; @use 'libs/openchallenges/themes/src/index' as openchallenges; -@include mat.legacy-typography-hierarchy(fonts.$lato); -@include mat.legacy-core(); +@include mat.typography-hierarchy(fonts.$lato); +@include mat.core(); $primary: mat.define-palette(palettes.$dark-blue-palette, 600); $accent: mat.define-palette(palettes.$accent-purple-palette, 400); @@ -16,9 +16,9 @@ $theme: mat.define-light-theme( primary: $primary, accent: $accent, ), - typography: ( - lato: fonts.$lato, - ), + typography: fonts.$lato, + density: 0, + is-dark: false, ) ); @@ -32,14 +32,11 @@ $theme: map.deep-merge( ) ); -// Emit theme-dependent styles for common features used across multiple -// components. -@include mat.legacy-core-theme($theme); +// Emit theme-dependent styles for common features used across multiple components. +@include mat.core-theme($theme); // Emit styles for MatButton based on `$theme`. -@include mat.legacy-button-theme($theme); -@include mat.legacy-progress-spinner-theme($theme); -@include mat.legacy-button-typography(fonts.$lato); +@include mat.button-theme($theme); // Include the theme mixins for other components you use here. @include openchallenges.theme($theme); diff --git a/apps/schematic/app/src/_app-theme.scss b/apps/schematic/app/src/_app-theme.scss index fe99140449..d589a8c004 100644 --- a/apps/schematic/app/src/_app-theme.scss +++ b/apps/schematic/app/src/_app-theme.scss @@ -1,11 +1,9 @@ @use 'sass:map'; @use '@angular/material' as mat; -@use 'libs/openchallenges/themes/src/fonts' as fonts; @use 'libs/openchallenges/themes/src/palettes' as palettes; @use 'libs/openchallenges/themes/src/index' as openchallenges; -@include mat.legacy-typography-hierarchy(fonts.$fira); -@include mat.legacy-core(); +@include mat.core(); $primary: mat.define-palette(palettes.$dark-blue-palette, 600); $accent: mat.define-palette(palettes.$accent-purple-palette, 400); @@ -16,9 +14,6 @@ $theme: mat.define-light-theme( primary: $primary, accent: $accent, ), - typography: ( - fira: fonts.$fira, - ), ) ); @@ -29,17 +24,13 @@ $theme: map.deep-merge( color: ( figma: palettes.$figma-collection, ), + density: 0, ) ); // Emit theme-dependent styles for common features used across multiple // components. -@include mat.legacy-core-theme($theme); - -// Emit styles for MatButton based on `$theme`. -// @include mat.legacy-button-theme($theme); -// @include mat.legacy-progress-spinner-theme($theme); -// @include mat.legacy-button-typography(fonts.$fira); +@include mat.core-theme($theme); // Include the theme mixins for other components you use here. // @include openchallenges.theme($theme); diff --git a/libs/openchallenges/not-found/src/lib/not-found.component.ts b/libs/openchallenges/not-found/src/lib/not-found.component.ts index 14ae0d625f..886048d683 100644 --- a/libs/openchallenges/not-found/src/lib/not-found.component.ts +++ b/libs/openchallenges/not-found/src/lib/not-found.component.ts @@ -2,7 +2,7 @@ import { CommonModule } from '@angular/common'; import { Component } from '@angular/core'; import { MatButtonModule } from '@angular/material/button'; import { RouterModule } from '@angular/router'; -import { MatLegacyCardModule as MatCardModule } from '@angular/material/legacy-card'; +import { MatCardModule } from '@angular/material/card'; import { ConfigService } from '@sagebionetworks/openchallenges/config'; import { FooterComponent } from '@sagebionetworks/openchallenges/ui'; diff --git a/libs/openchallenges/org-profile/src/lib/org-profile.component.ts b/libs/openchallenges/org-profile/src/lib/org-profile.component.ts index 0f71544a1f..d398a44495 100644 --- a/libs/openchallenges/org-profile/src/lib/org-profile.component.ts +++ b/libs/openchallenges/org-profile/src/lib/org-profile.component.ts @@ -40,8 +40,6 @@ import { } from '@sagebionetworks/openchallenges/util'; import { CommonModule } from '@angular/common'; import { MatIconModule } from '@angular/material/icon'; -// import { MatTabsModule } from '@angular/material/tabs'; -import { MatLegacyTabsModule as MatTabsModule } from '@angular/material/legacy-tabs'; import { OrgProfileChallengesComponent } from './org-profile-challenges/org-profile-challenges.component'; import { OrgProfileMembersComponent } from './org-profile-members/org-profile-members.component'; import { OrgProfileOverviewComponent } from './org-profile-overview/org-profile-overview.component'; @@ -55,7 +53,6 @@ import { getSeoData } from './org-profile-seo-data'; imports: [ CommonModule, RouterModule, - MatTabsModule, MatIconModule, OrgProfileOverviewComponent, OrgProfileChallengesComponent, diff --git a/libs/openchallenges/signup/src/lib/signup.component.html b/libs/openchallenges/signup/src/lib/signup.component.html index 479ea7ddb4..7793e8ec52 100644 --- a/libs/openchallenges/signup/src/lib/signup.component.html +++ b/libs/openchallenges/signup/src/lib/signup.component.html @@ -10,14 +10,17 @@