From dcf9651e73e1ab95a39b19408b3d2b76ac4fd0d0 Mon Sep 17 00:00:00 2001 From: Ajay Gandecha Date: Mon, 1 Jul 2024 20:58:35 -0400 Subject: [PATCH] Styling Changes and My Courses Hotfix (#508) * Attempt to Fix Profile Image Roundness * Revamp Community Agreement Dialog * Fix Office Hours Editor HTML Issue * Add Attributions for My Courses * Add a Few More Attributions --- frontend/src/app/app.module.ts | 2 + .../my-courses/catalog/catalog.component.ts | 6 + .../course-catalog.component.ts | 2 +- .../app/my-courses/course/course.component.ts | 8 + .../office-hours-editor.component.html | 4 +- .../office-hours-editor.component.ts | 8 + .../office-hours-get-help.component.ts | 8 + .../office-hours-page.component.ts | 8 + .../office-hours-queue.component.ts | 8 + .../course/roster/roster.component.ts | 8 + .../app/navigation/navigation.component.css | 4 + .../app/navigation/navigation.component.html | 2 +- .../profile-page/profile-page.component.ts | 3 +- .../community-agreement.widget.css | 32 +- .../community-agreement.widget.html | 587 +++++++++--------- .../community-agreement.widget.ts | 26 +- frontend/src/app/shared/shared.module.ts | 2 + frontend/src/styles/styles.scss | 14 + 18 files changed, 413 insertions(+), 319 deletions(-) diff --git a/frontend/src/app/app.module.ts b/frontend/src/app/app.module.ts index 21ff44020..2bae2ce3f 100644 --- a/frontend/src/app/app.module.ts +++ b/frontend/src/app/app.module.ts @@ -34,6 +34,7 @@ import { MatToolbarModule } from '@angular/material/toolbar'; import { MatStepperModule } from '@angular/material/stepper'; import { MatTooltipModule } from '@angular/material/tooltip'; import { MatCheckboxModule } from '@angular/material/checkbox'; +import { MatSlideToggleModule } from '@angular/material/slide-toggle'; /* Application Specific */ import { AppRoutingModule } from './app-routing.module'; @@ -84,6 +85,7 @@ import { MatChipsModule } from '@angular/material/chips'; MatToolbarModule, MatTooltipModule, MatCheckboxModule, + MatSlideToggleModule, FormsModule, RouterModule, SharedModule, diff --git a/frontend/src/app/my-courses/catalog/catalog.component.ts b/frontend/src/app/my-courses/catalog/catalog.component.ts index 67e78c132..bfd941bd2 100644 --- a/frontend/src/app/my-courses/catalog/catalog.component.ts +++ b/frontend/src/app/my-courses/catalog/catalog.component.ts @@ -1,3 +1,9 @@ +/** + * @author Ajay Gandecha + * @copyright 2023 + * @license MIT + */ + import { Component } from '@angular/core'; @Component({ diff --git a/frontend/src/app/my-courses/catalog/course-catalog/course-catalog.component.ts b/frontend/src/app/my-courses/catalog/course-catalog/course-catalog.component.ts index b08204981..50f467aab 100644 --- a/frontend/src/app/my-courses/catalog/course-catalog/course-catalog.component.ts +++ b/frontend/src/app/my-courses/catalog/course-catalog/course-catalog.component.ts @@ -2,7 +2,7 @@ * The Course Catalog enables users to view all COMP courses at UNC. * * @author Ajay Gandecha - * @copyright 2023 + * @copyright 2024 * @license MIT */ diff --git a/frontend/src/app/my-courses/course/course.component.ts b/frontend/src/app/my-courses/course/course.component.ts index 008ff71d9..0b331e92a 100644 --- a/frontend/src/app/my-courses/course/course.component.ts +++ b/frontend/src/app/my-courses/course/course.component.ts @@ -1,3 +1,11 @@ +/** + * Tab navigation controller for courses. + * + * @author Ajay Gandecha + * @copyright 2024 + * @license MIT + */ + import { Component } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; diff --git a/frontend/src/app/my-courses/course/office-hours/office-hours-editor/office-hours-editor.component.html b/frontend/src/app/my-courses/course/office-hours/office-hours-editor/office-hours-editor.component.html index 72aa86234..35edb43ca 100644 --- a/frontend/src/app/my-courses/course/office-hours/office-hours-editor/office-hours-editor.component.html +++ b/frontend/src/app/my-courses/course/office-hours/office-hours-editor/office-hours-editor.component.html @@ -66,8 +66,8 @@ matInput type="datetime-local" placeholder="Start Time" - formControlName="end_time" - name="end_time" + formControlName="start_time" + name="start_time" required /> diff --git a/frontend/src/app/my-courses/course/office-hours/office-hours-editor/office-hours-editor.component.ts b/frontend/src/app/my-courses/course/office-hours/office-hours-editor/office-hours-editor.component.ts index a884ded0e..27c8eefd1 100644 --- a/frontend/src/app/my-courses/course/office-hours/office-hours-editor/office-hours-editor.component.ts +++ b/frontend/src/app/my-courses/course/office-hours/office-hours-editor/office-hours-editor.component.ts @@ -1,3 +1,11 @@ +/** + * Component that enables the editing of office hours. + * + * @author Ajay Gandecha + * @copyright 2024 + * @license MIT + */ + import { Component } from '@angular/core'; import { courseSitePageGuard, diff --git a/frontend/src/app/my-courses/course/office-hours/office-hours-get-help/office-hours-get-help.component.ts b/frontend/src/app/my-courses/course/office-hours/office-hours-get-help/office-hours-get-help.component.ts index fe049ded4..cbfbe8d9a 100644 --- a/frontend/src/app/my-courses/course/office-hours/office-hours-get-help/office-hours-get-help.component.ts +++ b/frontend/src/app/my-courses/course/office-hours/office-hours-get-help/office-hours-get-help.component.ts @@ -1,3 +1,11 @@ +/** + * Office hours page for students that enables them to create tickets and get help. + * + * @author Ajay Gandecha + * @copyright 2024 + * @license MIT + */ + import { Component, OnDestroy, diff --git a/frontend/src/app/my-courses/course/office-hours/office-hours-page/office-hours-page.component.ts b/frontend/src/app/my-courses/course/office-hours/office-hours-page/office-hours-page.component.ts index 4f9c31431..414bc1060 100644 --- a/frontend/src/app/my-courses/course/office-hours/office-hours-page/office-hours-page.component.ts +++ b/frontend/src/app/my-courses/course/office-hours/office-hours-page/office-hours-page.component.ts @@ -1,3 +1,11 @@ +/** + * Office hours page that shows events. + * + * @author Ajay Gandecha + * @copyright 2024 + * @license MIT + */ + import { Component, WritableSignal, signal } from '@angular/core'; import { PageEvent } from '@angular/material/paginator'; import { MatSnackBar } from '@angular/material/snack-bar'; diff --git a/frontend/src/app/my-courses/course/office-hours/office-hours-queue/office-hours-queue.component.ts b/frontend/src/app/my-courses/course/office-hours/office-hours-queue/office-hours-queue.component.ts index cb1c0bd5b..ae488adb1 100644 --- a/frontend/src/app/my-courses/course/office-hours/office-hours-queue/office-hours-queue.component.ts +++ b/frontend/src/app/my-courses/course/office-hours/office-hours-queue/office-hours-queue.component.ts @@ -1,3 +1,11 @@ +/** + * Office hours queue for instructors. + * + * @author Ajay Gandecha + * @copyright 2024 + * @license MIT + */ + import { Component, OnDestroy, diff --git a/frontend/src/app/my-courses/course/roster/roster.component.ts b/frontend/src/app/my-courses/course/roster/roster.component.ts index f331ef9b6..cc3fb00a2 100644 --- a/frontend/src/app/my-courses/course/roster/roster.component.ts +++ b/frontend/src/app/my-courses/course/roster/roster.component.ts @@ -1,3 +1,11 @@ +/** + * The Roster Component enables instructors to view the roster of their courses. + * + * @author Ajay Gandecha + * @copyright 2024 + * @license MIT + */ + import { Component, Signal, diff --git a/frontend/src/app/navigation/navigation.component.css b/frontend/src/app/navigation/navigation.component.css index 63915375c..f9eb4dc92 100644 --- a/frontend/src/app/navigation/navigation.component.css +++ b/frontend/src/app/navigation/navigation.component.css @@ -115,4 +115,8 @@ a { /* Round the border for the profile image chip */ .mat-mdc-standard-chip { --mdc-chip-container-shape-radius: 16px; +} + +::ng-deep #profile-icon { + border-radius: 9px !important; } \ No newline at end of file diff --git a/frontend/src/app/navigation/navigation.component.html b/frontend/src/app/navigation/navigation.component.html index df4adcf7a..6cfca021e 100644 --- a/frontend/src/app/navigation/navigation.component.html +++ b/frontend/src/app/navigation/navigation.component.html @@ -134,7 +134,7 @@

Other

@if(profile$ | async; as profile) { @if(profile.github_avatar) { - GitHub Avatar + GitHub Avatar } @else { account_circle } diff --git a/frontend/src/app/profile/profile-page/profile-page.component.ts b/frontend/src/app/profile/profile-page/profile-page.component.ts index bd89251ad..625f9529a 100644 --- a/frontend/src/app/profile/profile-page/profile-page.component.ts +++ b/frontend/src/app/profile/profile-page/profile-page.component.ts @@ -89,7 +89,8 @@ export class ProfilePageComponent { /** Open Community Agreement Dialog */ openAgreementDialog(): void { const dialogRef = this.dialog.open(CommunityAgreement, { - autoFocus: 'dialog' + width: '1000px', + height: '800px' }); this.profileService.profile$.subscribe(); dialogRef.afterClosed().subscribe(); diff --git a/frontend/src/app/shared/community-agreement/community-agreement.widget.css b/frontend/src/app/shared/community-agreement/community-agreement.widget.css index 5d78ae512..1e01896b6 100644 --- a/frontend/src/app/shared/community-agreement/community-agreement.widget.css +++ b/frontend/src/app/shared/community-agreement/community-agreement.widget.css @@ -1,26 +1,20 @@ -.content-container { - max-width: 100%; - max-height: 90vh; - overflow: auto; - scroll-behavior: auto; - padding-bottom: env(safe-area-inset-bottom); +.mat-divider { + margin-top: 16px; + margin-bottom: 16px; } -::-webkit-scrollbar { - width: 5px; -} - -::-webkit-scrollbar-thumb { - background: #888; - border-radius: 10px; +.mat-mdc-dialog-content { + overflow-y: scroll; } -::-webkit-scrollbar-thumb:hover { - background: #555; +/* Always show scrollbar */ +::-webkit-scrollbar { + -webkit-appearance: none; + width: 7px; } -@media (prefers-color-scheme: dark) { - .content-container { - color: white; - } +::-webkit-scrollbar-thumb { + border-radius: 4px; + background-color: rgba(0, 0, 0, .5); + box-shadow: 0 0 1px rgba(255, 255, 255, .5); } \ No newline at end of file diff --git a/frontend/src/app/shared/community-agreement/community-agreement.widget.html b/frontend/src/app/shared/community-agreement/community-agreement.widget.html index d68098b3c..81e60acc6 100644 --- a/frontend/src/app/shared/community-agreement/community-agreement.widget.html +++ b/frontend/src/app/shared/community-agreement/community-agreement.widget.html @@ -1,284 +1,311 @@ - - - - Please read and accept the community agreement below to continue to the - CSXL web page. - - +@if(!hasUserAgreed) { + +} - -

- Undergraduate Computer Science Experience Labs (XL) Community Standards - Agreement -

-
- -

- The Undergraduate Experience Labs (XL) community serves the Computer - Science Undergraduate Community at UNC-Chapel Hill. -

-

- The XL is dedicated to providing a harassment-free and inclusive - experience for everyone regardless of gender identity and expression, - sexual orientation, disabilities, neurodiversity, physical appearance, - body size, ethnicity, nationality, race, religion, or other protected - category. These policies are inspired by and almost entirely replicate - Google's Developer Community Guidelines. -

-

- We do not tolerate harassment of XL community members in any form. We take - violations of our policy seriously and will respond appropriately. -

-

- All participants of the XL in-person and on-line communities, XL - ambassadors, XL staff, speakers, faculty, and participants otherwise, must - agree to and abide by the following policies in order to access XL's - events, online communities, and facilities. -

-

I agree to be respectful to everyone in the XL community.

-

- I agree to treat everyone with respect. I will participate while - acknowledging everyone deserves to be here - and every one has the right - to enjoy their experience without fear of harassment, discrimination, or - condescension, whether blatant or micro-aggressions. All forms of - communication should not demean others. Consider what you are saying and - how it would feel if it were said to you or about you. -

- -

I agree

-

I agree to speak up if I see or hear something amiss.

-

- Harassment is not tolerated, and you are empowered to politely engage when - you or others are disrespected. The person making you feel uncomfortable - may not be aware of what they are doing, and politely bringing their - behavior to their attention is encouraged. -

- -

I agree

-

- I agree to abide by the XL Community's ZERO TOLERANCE POLICY for in-person - or online harassment of any kind. -

-

Forms of potential harassment include, but are not limited to:

-
    -
  • Stalking / Following
  • -
  • Deliberate intimidation
  • -
  • Harassing photography or recording
  • -
  • Sustained disruption of talks or other events
  • -
  • Offensive verbal language
  • -
  • Verbal language that reinforces social structures of domination
  • -
  • Sexual imagery and language in public spaces
  • -
  • Inappropriate physical contact
  • -
  • Unwelcome sexual or physical attention
  • -
  • Physical or cyber threats
  • -
- -

I agree

-

- I understand the above policies are in relation to, but not limited to: -

-
    -
  • Neurodiversity
  • -
  • Race
  • -
  • Color
  • -
  • National origin
  • -
  • Gender identity
  • -
  • Gender expression
  • -
  • Sexual orientation
  • -
  • Age
  • -
  • Body size
  • -
  • Disabilities
  • -
  • Appearance
  • -
  • Religion
  • -
  • Pregnancy
  • -
  • Military status
  • -
  • Social demographic
  • -
- -

I agree

-

- When asked to stop any harassing behavior, I will comply immediately. -

-

- Participants asked to stop any harassing behavior are expected to comply - immediately. Our zero tolerance policy means that we will look into and - review every allegation of violation of our Event Community Guidelines and - Anti-Harassment Policy and respond appropriately. -

- -

I agree

-

- I will report any behavior that makes me or others feel uncomfortable. -

-

- To report any behavior that makes you or others feel uncomfortable, please - email - kris@cs.unc.edu - to file a report. -

- -

I agree

-

I understand this policy extends to all XL activities.

-

- This policy extends to talks, forums, workshops, codelabs, social media, - all attendees, partners, sponsors, volunteers, staff, etc. You catch our - drift. The XL reserves the right to refuse admittance to, or remove any - person from, any XL hosted event (including future XL events) at any time - in its sole discretion. -

-

- This includes, but is not limited to, attendees behaving in a disorderly - manner or failing to comply with this policy, and the terms and conditions - herein. If a participant engages in harassing or uncomfortable behavior, - the XL staff may take any action they deem appropriate, including warning - or expelling the offender from the event or space. -

- -

I agree

-

- I agree to take care of the XL spaces and equipment and to leave - everything as clean, or cleaner, as before my usage. -

-

- Our community expects a high degree of cleanliness and tidiness in its - spaces such that everyone in our community can expect a fresh, welcoming, - and productive environment at all times. -

-

This includes:

-
    -
  • Promptly and fully cleaning up any spills or accidents
  • -
  • Properly disposing of all trash and recyclables
  • -
  • Pushing chairs in after usage
  • -
  • - Resetting the room to its starting point after any temporary changes -
  • -
  • Erasing whiteboards
  • -
  • Not doing anything destructive
  • -
- -

I agree

-

- I understand for this space to remain open to undergraduate students, I - need to prove to faculty and administration I will take care of it. -

-

- Some faculty do not believe our undergraduate community is capable of - taking care of a space with top-of-the-line chairs, monitors, desks, and - so on. The XL staff, ambassadors, and Professor Jordan know our community - are capable, but it's on you and everyone to prove it. -

-

- Over $80,000 of furniture was bought new for the space this year, please - treat it like you bought it. -

- -

I agree

-

Eat in the Lounge Area (SN142 or SN Lobby)

-

- In order to keep the equipment and facilities of the XL as clean as - possible, and avoid the disruptive smells of delicious food while others - are working, if you bring food to eat in Sitterson please eat in the - lounge area just outside of the XL (SN142) or in the Sitterson Lobby. -

-

- Do not eat food or have open drinking containers in the workstation spaces - with 2nd monitors in the XL. -

- -

I agree

CSXL Community Standards Agreement + + +

+ The Undergraduate Experience Labs (XL) community serves the Computer Science + Undergraduate Community at UNC-Chapel Hill. +

+

+ The XL is dedicated to providing a harassment-free and inclusive experience + for everyone regardless of gender identity and expression, sexual + orientation, disabilities, neurodiversity, physical appearance, body size, + ethnicity, nationality, race, religion, or other protected category. These + policies are inspired by and almost entirely replicate + Google's Developer Community Guidelines. -

The XL is Not for Gaming - Please Use the Craige E-Sports Arena

-

- The purpose of the XL is to serve as a community coworking, productivity, - and professional development space for the CS Community. If you would like - to play games with groups of friends, please do so in the - Craige Gaming Arena - or elsewhere on campus. If you are playing games in the workstation - monitor space, you will be asked to stop and/or take the gameplay - elsewhere. -

- -

I agree

+

+ We do not tolerate harassment of XL community members in any form. We take + violations of our policy seriously and will respond appropriately. +

+

+ All participants of the XL in-person and on-line communities, XL + ambassadors, XL staff, speakers, faculty, and participants otherwise, must + agree to and abide by the following policies in order to access XL's events, + online communities, and facilities. +

+ + + I agree to be respectful to everyone in the XL community. + +

+ I agree to treat everyone with respect. I will participate while + acknowledging everyone deserves to be here - and every one has the right to + enjoy their experience without fear of harassment, discrimination, or + condescension, whether blatant or micro-aggressions. All forms of + communication should not demean others. Consider what you are saying and how + it would feel if it were said to you or about you. +

+ @if(!hasUserAgreed) { + + I agree + + } + + + I agree to speak up if I see or hear something amiss. + +

+ Harassment is not tolerated, and you are empowered to politely engage when + you or others are disrespected. The person making you feel uncomfortable may + not be aware of what they are doing, and politely bringing their behavior to + their attention is encouraged. +

+ @if(!hasUserAgreed) { + + I agree + + } + + + I agree to abide by the XL Community's ZERO TOLERANCE POLICY for in-person + or online harassment of any kind. + +

Forms of potential harassment include, but are not limited to:

+
    +
  • Stalking / Following
  • +
  • Deliberate intimidation
  • +
  • Harassing photography or recording
  • +
  • Sustained disruption of talks or other events
  • +
  • Offensive verbal language
  • +
  • Verbal language that reinforces social structures of domination
  • +
  • Sexual imagery and language in public spaces
  • +
  • Inappropriate physical contact
  • +
  • Unwelcome sexual or physical attention
  • +
  • Physical or cyber threats
  • +
+ + @if(!hasUserAgreed) { + + I agree + + } + + + I understand the above policies are in relation to, but not limited to: + +
    +
  • Neurodiversity
  • +
  • Race
  • +
  • Color
  • +
  • National origin
  • +
  • Gender identity
  • +
  • Gender expression
  • +
  • Sexual orientation
  • +
  • Age
  • +
  • Body size
  • +
  • Disabilities
  • +
  • Appearance
  • +
  • Religion
  • +
  • Pregnancy
  • +
  • Military status
  • +
  • Social demographic
  • +
+ + @if(!hasUserAgreed) { + + I agree + + } + + + When asked to stop any harassing behavior, I will comply immediately. + +

+ Participants asked to stop any harassing behavior are expected to comply + immediately. Our zero tolerance policy means that we will look into and + review every allegation of violation of our Event Community Guidelines and + Anti-Harassment Policy and respond appropriately. +

+ + @if(!hasUserAgreed) { + + I agree + + } + + + I will report any behavior that makes me or others feel uncomfortable. + +

+ To report any behavior that makes you or others feel uncomfortable, please + email + kris@cs.unc.edu -

- I understand my access to the XL will be suspended if I leave messes - behind, eat in the XL, fail to clean up after myself, destroy, damage - property of the XL, or otherwise act outside the community's standards. -

- -

I agree

+ @if(!hasUserAgreed) { + + I agree + + } + + + I understand this policy extends to all XL activities. + +

+ This policy extends to talks, forums, workshops, codelabs, social media, all + attendees, partners, sponsors, volunteers, staff, etc. You catch our drift. + The XL reserves the right to refuse admittance to, or remove any person + from, any XL hosted event (including future XL events) at any time in its + sole discretion. +

+

+ This includes, but is not limited to, attendees behaving in a disorderly + manner or failing to comply with this policy, and the terms and conditions + herein. If a participant engages in harassing or uncomfortable behavior, the + XL staff may take any action they deem appropriate, including warning or + expelling the offender from the event or space. +

+ @if(!hasUserAgreed) { + + I agree + + } + + + I agree to take care of the XL spaces and equipment and to leave everything + as clean, or cleaner, as before my usage. + +

+ Our community expects a high degree of cleanliness and tidiness in its + spaces such that everyone in our community can expect a fresh, welcoming, + and productive environment at all times. +

+

This includes:

+
    +
  • Promptly and fully cleaning up any spills or accidents
  • +
  • Properly disposing of all trash and recyclables
  • +
  • Pushing chairs in after usage
  • +
  • + Resetting the room to its starting point after any temporary changes +
  • +
  • Erasing whiteboards
  • +
  • Not doing anything destructive
  • +
+ @if(!hasUserAgreed) { + + I agree + + } + + + I understand for this space to remain open to undergraduate students, I need + to prove to faculty and administration I will take care of it. + +

+ Some faculty do not believe our undergraduate community is capable of taking + care of a space with top-of-the-line chairs, monitors, desks, and so on. The + XL staff, ambassadors, and Professor Jordan know our community are capable, + but it's on you and everyone to prove it. +

+

+ Over $80,000 of furniture was bought new for the space this year, please + treat it like you bought it. +

+ @if(!hasUserAgreed) { + + I agree + + } + + + Eat in the Lounge Area (SN142 or SN Lobby) + +

+ In order to keep the equipment and facilities of the XL as clean as + possible, and avoid the disruptive smells of delicious food while others are + working, if you bring food to eat in Sitterson please eat in the lounge area + just outside of the XL (SN142) or in the Sitterson Lobby. +

+

+ Do not eat food or have open drinking containers in the workstation spaces + with 2nd monitors in the XL. +

+ @if(!hasUserAgreed) { + + I agree + + } + + + The XL is Not for Gaming - Please Use the Craige E-Sports Arena + +

+ The purpose of the XL is to serve as a community coworking, productivity, + and professional development space for the CS Community. If you would like + to play games with groups of friends, please do so in the + Craige Gaming Arena - - - - - + or elsewhere on campus. If you are playing games in the workstation monitor + space, you will be asked to stop and/or take the gameplay elsewhere. +

+ @if(!hasUserAgreed) { + + I agree + + } + + + I understand my access to the XL will be suspended if I leave messes behind, + eat in the XL, fail to clean up after myself, destroy, damage property of + the XL, or otherwise act outside the community's standards. + + @if(!hasUserAgreed) { + + I agree + + } +
+ + + + diff --git a/frontend/src/app/shared/community-agreement/community-agreement.widget.ts b/frontend/src/app/shared/community-agreement/community-agreement.widget.ts index 95a1f4048..792fe7b61 100644 --- a/frontend/src/app/shared/community-agreement/community-agreement.widget.ts +++ b/frontend/src/app/shared/community-agreement/community-agreement.widget.ts @@ -3,7 +3,7 @@ * will have to sign. It is currently used on the coworking home page and the 'About the * XL' page. It also checks whether or not users have accepted. * - * @author Matt Vu + * @author Matt Vu, Ajay Gandecha * @copyright 2024 * @license MIT */ @@ -21,7 +21,7 @@ import { Subscription } from 'rxjs'; styleUrls: ['./community-agreement.widget.css'] }) export class CommunityAgreement { - public has_user_agreed: boolean | undefined = false; + public hasUserAgreed: boolean | undefined = false; public agreementSectionsAccepted: boolean[]; public loggedInUser: Profile | undefined; private subscription: Subscription; @@ -35,26 +35,22 @@ export class CommunityAgreement { this.agreementSectionsAccepted = new Array(12).fill(false); this.subscription = this.profileService.profile$.subscribe((profile) => { this.loggedInUser = profile; - this.has_user_agreed = this.loggedInUser?.accepted_community_agreement; + this.hasUserAgreed = this.loggedInUser?.accepted_community_agreement; }); } onButtonClick() { - if (this.has_user_agreed) { + if (this.hasUserAgreed) { this.onCloseClick(); } else { - if (this.allSectionsAccepted()) { - this.onAcceptClick(); - this.snackBar.open('Successfully Accepted Community Agreement', '', { + this.onAcceptClick(); + this.snackBar.open( + 'Thank you for accepting the CSXL Community Agreement!', + '', + { duration: 2000 - }); - } else { - this.snackBar.open( - 'Please Accept All Terms in the Community Agreement', - '', - { duration: 2000 } - ); - } + } + ); } } diff --git a/frontend/src/app/shared/shared.module.ts b/frontend/src/app/shared/shared.module.ts index d7de99003..8bb979f28 100644 --- a/frontend/src/app/shared/shared.module.ts +++ b/frontend/src/app/shared/shared.module.ts @@ -19,6 +19,7 @@ import { MatIconModule } from '@angular/material/icon'; import { MatTooltipModule } from '@angular/material/tooltip'; import { MatChipsModule } from '@angular/material/chips'; import { MatCheckboxModule } from '@angular/material/checkbox'; +import { MatSlideToggleModule } from '@angular/material/slide-toggle'; /* UI Widgets */ import { SocialMediaIcon } from '../shared/social-media-icon/social-media-icon.widget'; @@ -73,6 +74,7 @@ import { TabContainerWidget } from './tab-container/tab-container.widget'; ReactiveFormsModule, MatIconModule, MatTooltipModule, + MatSlideToggleModule, RouterModule ], exports: [ diff --git a/frontend/src/styles/styles.scss b/frontend/src/styles/styles.scss index e9c702362..fa2677174 100644 --- a/frontend/src/styles/styles.scss +++ b/frontend/src/styles/styles.scss @@ -226,6 +226,19 @@ html, body { } } +/// Defines a mixin that applies custom styles to material switch components +/// to better conform to Material 3 standards. +/// +/// @param {theme} $theme: Angular Material theme to apply styles with. +@mixin mat-switch-styles($theme) { + .mat-mdc-slide-toggle { + label { + padding-left: 8px; + color: mat.get-theme-color($theme, on-surface) !important; + } + } +} + /// Defines a mixin that applies custom styles to material text field components /// to betterĀ conform to Material 3 standards. /// @@ -359,6 +372,7 @@ html, body { @include mat-list-styles($theme); @include mat-header-styles($theme); @include mat-icon-styles($theme); + @include mat-switch-styles($theme); @include mat-text-field-styles($theme); @include font-styles($theme); @include widget-styles($theme);