Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS Refactoring (Or: UI Redesign 2 ) #1402

Merged
merged 159 commits into from
Nov 8, 2022
Merged

CSS Refactoring (Or: UI Redesign 2 ) #1402

merged 159 commits into from
Nov 8, 2022

Conversation

Schottkyc137
Copy link
Contributor

@Schottkyc137 Schottkyc137 commented Aug 18, 2022

see issues: #1375, #1357

This PR includes several minor updates to

The UI as such

The main intent here is to iron out some rough edges that were left out by the UI Redesign. Examples include:

  • Limiting the width of long texts. This improves readability
  • Improving the general UI of the support component and the changelog component
  • Small improvements to the activity card component (subjective)
  • Small improvements to the whole UI component which makes position: absolute obsolete and fixes Menu width and margins #1375

The Architecture

  • Remove flex-layout. Since CSS flex is flexible enough (pun intended) this is no longer needed, messes with styles, and is an extra dependency.
  • Remove empty (and now empty) CSS Files – SonarCloud will complain otherwise
  • Remove many containers as they mainly pollute the DOM with divs that are mostly not necessary (the :host pseudo-selector can do magic here)
  • (Rarely) replace divs or other generic containers with more specific HTML elements
  • Refactoring of the AlertService so that there is no issue using Alerts and MatSnackBar together. Use the default styling so it is consistent

Creation of several Helper-Components

  • app-dialog-close is a generic close button used in pop-ups. Also added this helper to elements that didn't have it but should have
  • A utility to simplify highlighting the left border of an element (which is common throughout the app)
  • A pill element which simply places a pill-shaped background around an element. This replaces usages of mat-chips and mat-chip-lists

The handling of styles

This PR redefines how styles are used around the app. The following has been changed:

  • Removed a lot of common styles and made them global styles.
  • Used variables to make most magic numbers obsolete (but kept them where variables are too burdensome)
  • Replace the usage of @import with @use (@import is deprecated)
  • Fix the import of @angular/material and replace it with @use

# Conflicts:
#	angular.json
#	package-lock.json
#	package.json
#	src/app/child-dev-project/attendance/activity-card/activity-card.component.html
#	src/app/child-dev-project/attendance/add-day-attendance/add-day-attendance.component.html
#	src/app/child-dev-project/attendance/add-day-attendance/roll-call-setup/roll-call-setup.component.html
#	src/app/child-dev-project/attendance/attendance.module.ts
#	src/app/core/demo-data/faker.ts
#	src/app/core/entity-components/entity-details/entity-details.component.html
#	src/app/core/entity-components/entity-details/entity-details.component.scss
#	src/app/core/entity-components/entity-list/entity-list.component.html
#	src/app/core/entity-components/entity-list/entity-list.module.ts
#	src/app/core/entity-components/entity-subrecord/entity-subrecord.module.ts
# Conflicts:
#	angular.json
#	src/app/child-dev-project/attendance/add-day-attendance/roll-call/roll-call.component.html
#	src/app/child-dev-project/attendance/add-day-attendance/roll-call/roll-call.component.scss
#	src/app/child-dev-project/attendance/attendance-status-select/attendance-status-select.component.scss
#	src/app/child-dev-project/children/child-block/child-block.component.html
#	src/app/child-dev-project/children/children.module.ts
#	src/app/child-dev-project/children/demo-data-generators/demo-child-generator.service.ts
#	src/app/child-dev-project/notes/notes.module.ts
#	src/app/child-dev-project/schools/school-block/school-block.component.html
#	src/app/core/admin/user-list/user-list.component.html
#	src/app/core/admin/user-list/user-list.component.ts
#	src/app/core/entity-components/entity-details/entity-details.component.html
#	src/app/core/entity-components/entity-form/entity-form/entity-form.component.html
#	src/app/core/entity-components/entity-list/entity-list.component.html
#	src/app/core/entity-components/entity-list/entity-list.component.scss
#	src/app/core/entity-components/entity-subrecord/entity-subrecord/entity-subrecord.component.html
#	src/app/core/ui/ui/ui.component.html
#	src/app/core/user/user-account/user-account.component.html
#	src/app/core/user/user-account/user-account.component.scss
#	src/app/core/webdav/cloud-file-service-user-settings/cloud-file-service-user-settings.component.html
#	src/app/core/webdav/cloud-file-service-user-settings/cloud-file-service-user-settings.component.ts
#	src/ndb-theme.scss
#	src/styles.scss
sleidig and others added 8 commits October 26, 2022 18:25
according to the hierarchy of the "Record Attendance" screen the headline should also logically be a h3 (and it looks better with the font size proportions)
# Conflicts:
#	src/app/features/data-import/data-import.module.ts
#	src/app/features/data-import/data-import/data-import.component.html
@Schottkyc137 Schottkyc137 marked this pull request as ready for review October 27, 2022 19:24
# Conflicts:
#	src/app/core/entity-components/entity-form/entity-form/entity-form.component.html
Copy link
Collaborator

@TheSlimvReal TheSlimvReal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice changes. I went through the code now and I am impressed by all the generalisations that you achieved. Good job. I only have marked a few small issues, they are not too important.

Generally, you added some nice documentation to the global CSS classes which is very helpful, but I think it would be great if you could also give a little overview of the most relevant changes once this is merged. Important topics would be, what classes are very useful, where do we find them and what should we consider when designing/layouting a new component?

// There is no `ndb-alert--info` class since `info` has the default styling.

&--warning {
background-color: mat.get-color-from-palette(mat.$orange-palette, 800) !important;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The orange background with the blue dismiss button looks a bit difficult for me.

src/app/core/ui/ui/ui.component.html Show resolved Hide resolved

getGroupedByString = getGroupingInformationString;
treeFlattener = new MatTreeFlattener<ReportRow, FlattenedReportRow>(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice change. Looks much more the angular way now!

@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 8, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug B 1 Bug
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@TheSlimvReal TheSlimvReal merged commit 39339cd into master Nov 8, 2022
@TheSlimvReal TheSlimvReal deleted the flex-layout branch November 8, 2022 15:00
@aam-digital-ci
Copy link
Collaborator

🎉 This PR is included in version 3.14.0-master.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@aam-digital-ci
Copy link
Collaborator

🎉 This PR is included in version 3.14.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Menu width and margins
4 participants