From 5571fb640233d4a4e8d54213d1824a85b23a7502 Mon Sep 17 00:00:00 2001 From: Maxime Robert Date: Wed, 16 Oct 2024 18:08:40 +0200 Subject: [PATCH] Fix #12348: fix display bugs in Collecte --- .../components/footer/footer.component.html | 2 +- .../components/stepper/stepper.component.ts | 29 +++++++- ui/ui-frontend-common/src/sass/_button.scss | 7 +- ui/ui-frontend-common/src/sass/_theme.scss | 2 + .../src/sass/base/_typography.scss | 64 +++++++++++++++-- .../src/sass/material/_modal.scss | 12 +++- .../src/sass/mixins/_fonts.scss | 4 -- .../sass/variables/_bootstrap-variables.scss | 11 +++ .../archive-search/src/sass/styles.scss | 1 - .../create-project.component.html | 70 ++++++++----------- .../create-project.component.scss | 24 +++---- .../projects/collect/src/sass/styles.scss | 1 - .../profiles-tab/profiles-tab.component.html | 2 +- .../user-group-tab.component.html | 8 +-- .../projects/identity/src/sass/styles.scss | 4 -- .../projects/ingest/src/sass/styles.scss | 4 -- .../projects/pastis/src/sass/styles.scss | 1 - .../projects/portal/src/sass/styles.scss | 1 - .../projects/referential/src/sass/styles.scss | 1 - 19 files changed, 156 insertions(+), 92 deletions(-) diff --git a/ui/ui-frontend-common/src/app/modules/components/footer/footer.component.html b/ui/ui-frontend-common/src/app/modules/components/footer/footer.component.html index 16c932fcdb2..54d9b39dca9 100644 --- a/ui/ui-frontend-common/src/app/modules/components/footer/footer.component.html +++ b/ui/ui-frontend-common/src/app/modules/components/footer/footer.component.html @@ -1,4 +1,4 @@
-
{{ version }}
+
{{ version }}
diff --git a/ui/ui-frontend-common/src/app/modules/components/stepper/stepper.component.ts b/ui/ui-frontend-common/src/app/modules/components/stepper/stepper.component.ts index 987bff7a0a5..2c216e4ff6a 100644 --- a/ui/ui-frontend-common/src/app/modules/components/stepper/stepper.component.ts +++ b/ui/ui-frontend-common/src/app/modules/components/stepper/stepper.component.ts @@ -34,8 +34,10 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ +import { Directionality } from '@angular/cdk/bidi'; import { CdkStepper } from '@angular/cdk/stepper'; -import { Component } from '@angular/core'; +import { DOCUMENT } from '@angular/common'; +import { ChangeDetectorRef, Component, ElementRef, HostListener, Inject, Injector, Input, Optional } from '@angular/core'; import { transitionAnimation } from '../../animations/vitamui-common-animations'; @Component({ @@ -47,4 +49,27 @@ import { transitionAnimation } from '../../animations/vitamui-common-animations' providers: [{ provide: CdkStepper, useExisting: StepperComponent }], animations: [transitionAnimation], }) -export class StepperComponent extends CdkStepper {} +export class StepperComponent extends CdkStepper { + @Input() disableScrollToTop = false; + + constructor( + @Optional() dir: Directionality, + changeDetectorRef: ChangeDetectorRef, + private elementRef: ElementRef, + @Inject(DOCUMENT) document?: any, + ) { + super(dir, changeDetectorRef, elementRef, document); + } + + // Automatically scroll to the top of the stepper after changing step (inspired by https://github.com/angular/components/issues/8881) + @HostListener('selectionChange') + selectionChanged() { + if (!this.disableScrollToTop) { + this.elementRef.nativeElement.scrollIntoView({ + block: 'start', + inline: 'nearest', + behavior: 'smooth', + }); + } + } +} diff --git a/ui/ui-frontend-common/src/sass/_button.scss b/ui/ui-frontend-common/src/sass/_button.scss index e06da0ff7b1..30333a1bad8 100644 --- a/ui/ui-frontend-common/src/sass/_button.scss +++ b/ui/ui-frontend-common/src/sass/_button.scss @@ -64,22 +64,17 @@ } .btn { + @extend .button-medium; cursor: pointer; display: flex; justify-content: center; align-items: center; height: 50px; - font-style: normal; - font-weight: bold; - line-height: 20px; border-radius: 50px; padding: 0 30px 0 30px; outline: none; white-space: nowrap; - font-size: 14px; - text-transform: uppercase; - letter-spacing: 0.8px; flex-shrink: 0; diff --git a/ui/ui-frontend-common/src/sass/_theme.scss b/ui/ui-frontend-common/src/sass/_theme.scss index 1424264ca6c..f8b00755d3c 100644 --- a/ui/ui-frontend-common/src/sass/_theme.scss +++ b/ui/ui-frontend-common/src/sass/_theme.scss @@ -30,3 +30,5 @@ @import 'base/base'; @import 'base/utilities'; + +@import 'bootstrap/scss/bootstrap-grid'; diff --git a/ui/ui-frontend-common/src/sass/base/_typography.scss b/ui/ui-frontend-common/src/sass/base/_typography.scss index e79bad47965..2695645c160 100644 --- a/ui/ui-frontend-common/src/sass/base/_typography.scss +++ b/ui/ui-frontend-common/src/sass/base/_typography.scss @@ -11,27 +11,36 @@ h5 { h1 { font-size: 96px; + line-height: 112px; font-weight: 800; + letter-spacing: -2.5px; } h2 { font-size: 60px; + line-height: 72px; font-weight: 900; + letter-spacing: -1px; } h3 { font-size: 42px; + line-height: 42px; font-weight: 800; + letter-spacing: -0.5px; } h4 { font-size: 30px; - font-weight: 600; + line-height: 36px; + font-weight: 700; } h5 { font-size: 24px; + line-height: 32px; font-weight: 800; + letter-spacing: -0.5px; } .text { @@ -41,18 +50,31 @@ h5 { &.large { font-size: 20px; + line-height: 28px; } &.medium { font-size: 16px; + line-height: 24px; } &.normal { font-size: 14px; + line-height: 22px; + letter-spacing: 0.1px; } &.caption { font-size: 12px; + line-height: 16px; + letter-spacing: -0.2px; + } + + &.subcaption { + font-size: 9px; + line-height: 13px; + letter-spacing: -0.2px; + font-weight: bold; // Subcaption only exists in bold } &.bold { @@ -64,10 +86,6 @@ h5 { cursor: pointer; } - &.spaced { - letter-spacing: 0.8px; - } - &.uppercase { text-transform: uppercase; } @@ -79,6 +97,42 @@ h5 { @include text-colors; } +@mixin button { + @extend .text; + @extend .bold; + text-transform: uppercase; + letter-spacing: 0.5px; +} + +.button { + &-large { + @include button; + @extend .medium; + line-height: 20px; + + &-under { + text-decoration-line: underline; + } + } + &-medium { + @include button; + @extend .normal; + line-height: 18px; + + &-under { + text-decoration-line: underline; + } + } + &-small { + @include button; + @extend .caption; + + &-under { + text-decoration-line: underline; + } + } +} + .no-wrap { white-space: nowrap; } diff --git a/ui/ui-frontend-common/src/sass/material/_modal.scss b/ui/ui-frontend-common/src/sass/material/_modal.scss index daa7982a8fc..456fd00d45b 100644 --- a/ui/ui-frontend-common/src/sass/material/_modal.scss +++ b/ui/ui-frontend-common/src/sass/material/_modal.scss @@ -1,3 +1,5 @@ +@use 'bootstrap/scss/bootstrap-grid'; + $arrow-size: 70px; $header-height: 72px !default; $footer-height: 100px !default; @@ -14,11 +16,14 @@ $footer-height: 100px !default; @extend %mat-dialog-container; .header { - padding: 30px 60px 20px 60px; + @extend .pt-5; + @extend .pb-4; + @extend .px-8; } .content { - padding: 0 60px 30px 60px; + @extend .px-6; + @extend .pb-6; // dialog title > .text.large:first-of-type { @@ -26,8 +31,8 @@ $footer-height: 100px !default; } .actions:last-of-type { + @extend .mt-6; display: flex; - margin-top: 35px; } .actions:last-of-type > button:not(:last-child) { @@ -35,6 +40,7 @@ $footer-height: 100px !default; } .main-content { + @extend .mt-5; min-height: 25vh; } } diff --git a/ui/ui-frontend-common/src/sass/mixins/_fonts.scss b/ui/ui-frontend-common/src/sass/mixins/_fonts.scss index 9ee1a9d5fed..b495bb6807f 100644 --- a/ui/ui-frontend-common/src/sass/mixins/_fonts.scss +++ b/ui/ui-frontend-common/src/sass/mixins/_fonts.scss @@ -19,10 +19,6 @@ color: var(--vitamui-primary); } - &.primary-300 { - color: var(--vitamui-primary-300); - } - &.secondary { color: var(--vitamui-secondary); } diff --git a/ui/ui-frontend-common/src/sass/variables/_bootstrap-variables.scss b/ui/ui-frontend-common/src/sass/variables/_bootstrap-variables.scss index d4bc29d519c..4bdc7ff32ee 100644 --- a/ui/ui-frontend-common/src/sass/variables/_bootstrap-variables.scss +++ b/ui/ui-frontend-common/src/sass/variables/_bootstrap-variables.scss @@ -1 +1,12 @@ $grid-gutter-width: 20px; +$spacers: ( + 0: 0, + 1: 5px, + 2: 10px, + 3: 15px, + 4: 20px, + 5: 30px, + 6: 40px, + 7: 50px, + 8: 60px, +); diff --git a/ui/ui-frontend/projects/archive-search/src/sass/styles.scss b/ui/ui-frontend/projects/archive-search/src/sass/styles.scss index d4a53755018..05695ffe629 100644 --- a/ui/ui-frontend/projects/archive-search/src/sass/styles.scss +++ b/ui/ui-frontend/projects/archive-search/src/sass/styles.scss @@ -1,6 +1,5 @@ @import '~ui-frontend-common/sass/icons/vitamui-icons.css'; @import '~ui-frontend-common/sass/theme'; -@import '~bootstrap/scss/bootstrap-grid'; @import '~ui-frontend-common/sass/fonts/font-styles.css'; diff --git a/ui/ui-frontend/projects/collect/src/app/collect/projects/create-project/create-project.component.html b/ui/ui-frontend/projects/collect/src/app/collect/projects/create-project/create-project.component.html index ffcd82f3ffe..944724358a3 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/projects/create-project/create-project.component.html +++ b/ui/ui-frontend/projects/collect/src/app/collect/projects/create-project/create-project.component.html @@ -11,8 +11,8 @@
-

{{ 'COLLECT.MODAL.TITLE' | translate }}

-

{{ 'COLLECT.MODAL.WORKFLOW_CHOICE' | translate }}

+
{{ 'COLLECT.MODAL.TITLE' | translate }}
+
{{ 'COLLECT.MODAL.WORKFLOW_CHOICE' | translate }}
@@ -39,8 +39,8 @@

{{ 'COLLECT.MODAL.WORKFLOW_CHOICE' | translate }}

-

{{ 'COLLECT.MODAL.TITLE' | translate }}

-

{{ 'COLLECT.PROJECT_DESCRIPTION_SUB_TITLE' | translate }}

+
{{ 'COLLECT.MODAL.TITLE' | translate }}
+
{{ 'COLLECT.PROJECT_DESCRIPTION_SUB_TITLE' | translate }}
{{ 'COLLECT.PROJECT_DESCRIPTION_SUB_TITLE' | translate }}
-

{{ 'COLLECT.PROJECT_DESCRIPTION_SERVICES' | translate }}

+
{{ 'COLLECT.PROJECT_DESCRIPTION_SERVICES' | translate }}
{{ 'COLLECT.PROJECT_DESCRIPTION_SERVICES' | translate }}
{{ 'COLLECT.PROJECT_DESCRIPTION_SERVICES' | translate }}
{{ 'COLLECT.PROJECT_DESCRIPTION_SERVICES' | translate }} @@ -127,10 +127,10 @@

{{ 'COLLECT.PROJECT_DESCRIPTION_SERVICES' | translate }}

-

{{ 'COLLECT.MODAL.TITLE' | translate }}

+
{{ 'COLLECT.MODAL.TITLE' | translate }}
-

{{ 'COLLECT.PROJECT_CONTEXT_SUB_TITLE' | translate }}

+
{{ 'COLLECT.PROJECT_CONTEXT_SUB_TITLE' | translate }}
{{ 'COLLECT.PROJECT_CONTEXT_SUB_TITLE' | translate }}
- +
{{ 'COLLECT.PROJECT_CONTEXT_SUB_TITLE' | translate }}
{{ 'COLLECT.PROJECT_CONTEXT_SUB_TITLE' | translate }}
- +
@@ -246,8 +238,8 @@

{{ 'COLLECT.PROJECT_CONTEXT_SUB_TITLE' | translate }}

-

{{ 'COLLECT.MODAL.TITLE' | translate }}

-

{{ 'COLLECT.MODAL.UPLOAD_SUB_TITLE' | translate }}

+
{{ 'COLLECT.MODAL.TITLE' | translate }}
+
{{ 'COLLECT.MODAL.UPLOAD_SUB_TITLE' | translate }}
{{ 'COLLECT.MODAL.UPLOAD_SUB_TITLE' | translate }}
-

{{ 'COLLECT.MODAL.TITLE' | translate }}

-

{{ 'COLLECT.MODAL.FLOW_WORKFLOW_TYPE_CHOICE' | translate }}

+
{{ 'COLLECT.MODAL.TITLE' | translate }}
+
{{ 'COLLECT.MODAL.FLOW_WORKFLOW_TYPE_CHOICE' | translate }}
@@ -345,8 +337,8 @@

{{ 'COLLECT.MODAL.FLOW_WORKFLOW_TYPE_CHOICE' | translate }}

-

{{ 'COLLECT.MODAL.TITLE' | translate }}

-

{{ 'COLLECT.MODAL.ARCHIVE_POSITION_SUB_TITLE' | translate }}

+
{{ 'COLLECT.MODAL.TITLE' | translate }}
+
{{ 'COLLECT.MODAL.ARCHIVE_POSITION_SUB_TITLE' | translate }}
{{ 'COLLECT.MODAL.ARCHIVE_POSITION_SUB_TITLE' | translate }}
-

{{ 'COLLECT.MODAL.TITLE' | translate }}

-

{{ 'COLLECT.MODAL.RULES_TITLE' | translate }}

+
{{ 'COLLECT.MODAL.TITLE' | translate }}
+
{{ 'COLLECT.MODAL.RULES_TITLE' | translate }}
@@ -508,8 +500,8 @@

{{ 'COLLECT.MODAL.RULES_TITLE' | translate }}

-

{{ 'COLLECT.MODAL.TITLE' | translate }}

-

{{ 'COLLECT.MODAL.UPLOAD_FILES' | translate }}

+
{{ 'COLLECT.MODAL.TITLE' | translate }}
+
{{ 'COLLECT.MODAL.UPLOAD_FILES' | translate }}
@@ -546,8 +538,8 @@

{{ 'COLLECT.MODAL.UPLOAD_FILES' | translate }}

-

{{ 'COLLECT.MODAL.TITLE' | translate }}

-

{{ 'COLLECT.MODAL.PROJECT_CREATED' | translate }}

+
{{ 'COLLECT.MODAL.TITLE' | translate }}
+
{{ 'COLLECT.MODAL.PROJECT_CREATED' | translate }}