-
Notifications
You must be signed in to change notification settings - Fork 0
refactor(meetings): reorganize module with unified dashboard #142
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
70 changes: 70 additions & 0 deletions
70
...s/meetings/meetings-dashboard/components/meetings-top-bar/meetings-top-bar.component.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| <!-- Copyright The Linux Foundation and each contributor to LFX. --> | ||
| <!-- SPDX-License-Identifier: MIT --> | ||
|
|
||
| <div class="flex flex-wrap items-center gap-4"> | ||
| <div class="flex-1 min-w-[300px]"> | ||
| <div class="bg-slate-50 relative rounded-[12px]"> | ||
| <div class="flex flex-row items-center overflow-clip rounded-[inherit] size-full"> | ||
| <div class="box-border content-stretch flex gap-[8px] items-center px-[12px] py-[8px] relative w-full"> | ||
| <i class="fa-light fa-magnifying-glass w-4 h-4 text-[#90a1b9] shrink-0"></i> | ||
| <input | ||
| type="text" | ||
| [value]="searchQuery()" | ||
| (input)="onSearchInput($event)" | ||
| placeholder="Search meetings..." | ||
| class="font-sans font-normal leading-[normal] not-italic flex-1 bg-transparent border-0 outline-none text-[#90a1b9] text-[14px] placeholder:text-[#90a1b9]" /> | ||
| </div> | ||
| </div> | ||
| <div aria-hidden="true" class="absolute border-[#cad5e2] border-[0.5px] border-solid inset-0 pointer-events-none rounded-[12px]"></div> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div [ngClass]="{ 'opacity-50': isCalendarView }" class="inline-flex items-center bg-slate-100 rounded-lg p-0.5 gap-0.5"> | ||
| <button | ||
| (click)="onTimeFilterClick('upcoming')" | ||
| [disabled]="isCalendarView" | ||
| [ngClass]="{ | ||
| 'bg-white text-slate-900 shadow-sm': timeFilter() === 'upcoming', | ||
| 'text-slate-600 hover:text-slate-900': timeFilter() !== 'upcoming', | ||
| 'cursor-not-allowed': isCalendarView, | ||
| }" | ||
| class="px-3 py-1.5 rounded-md text-[12.25px] transition-all duration-200"> | ||
| Upcoming ({{ upcomingCount() }}) | ||
| </button> | ||
| <button | ||
| (click)="onTimeFilterClick('past')" | ||
| [disabled]="isCalendarView" | ||
| [ngClass]="{ | ||
| 'bg-white text-slate-900 shadow-sm': timeFilter() === 'past', | ||
| 'text-slate-600 hover:text-slate-900': timeFilter() !== 'past', | ||
| 'cursor-not-allowed': isCalendarView, | ||
| }" | ||
| class="px-3 py-1.5 rounded-md text-[12.25px] transition-all duration-200"> | ||
| Past ({{ pastCount() }}) | ||
| </button> | ||
| </div> | ||
|
|
||
| <!-- TODO: Readd when in scope to filter by visibility --> | ||
| <!-- | ||
| <div class="inline-flex items-center bg-slate-100 rounded-lg p-0.5 gap-0.5"> | ||
| <button | ||
| (click)="onVisibilityFilterClick('mine')" | ||
| [ngClass]="{ | ||
| 'bg-white text-slate-900 shadow-sm': visibilityFilter() === 'mine', | ||
| 'text-slate-600 hover:text-slate-900': visibilityFilter() !== 'mine', | ||
| }" | ||
| class="px-3 py-1.5 rounded-md text-[12.25px] transition-all duration-200"> | ||
| Mine ({{ mineCount() }}) | ||
| </button> | ||
| <button | ||
| (click)="onVisibilityFilterClick('public')" | ||
| [ngClass]="{ | ||
| 'bg-white text-slate-900 shadow-sm': visibilityFilter() === 'public', | ||
| 'text-slate-600 hover:text-slate-900': visibilityFilter() !== 'public', | ||
| }" | ||
| class="px-3 py-1.5 rounded-md text-[12.25px] transition-all duration-200"> | ||
| Public ({{ publicCount() }}) | ||
| </button> | ||
| </div> | ||
| --> | ||
| </div> | ||
85 changes: 85 additions & 0 deletions
85
...les/meetings/meetings-dashboard/components/meetings-top-bar/meetings-top-bar.component.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| // Copyright The Linux Foundation and each contributor to LFX. | ||
| // SPDX-License-Identifier: MIT | ||
|
|
||
| import { CommonModule } from '@angular/common'; | ||
| import { Component, computed, input, model, Signal } from '@angular/core'; | ||
| import { Meeting } from '@lfx-one/shared/interfaces'; | ||
|
|
||
| @Component({ | ||
| selector: 'lfx-meetings-top-bar', | ||
| standalone: true, | ||
| imports: [CommonModule], | ||
| templateUrl: './meetings-top-bar.component.html', | ||
| }) | ||
| export class MeetingsTopBarComponent { | ||
| public searchQuery = model.required<string>(); | ||
| public timeFilter = model.required<'upcoming' | 'past'>(); | ||
| public visibilityFilter = model.required<'mine' | 'public'>(); | ||
| public meetings = input.required<Meeting[]>(); | ||
| public viewMode = input<'list' | 'calendar'>('list'); | ||
|
|
||
| public upcomingCount: Signal<number>; | ||
| public pastCount: Signal<number>; | ||
| public mineCount: Signal<number>; | ||
| public publicCount: Signal<number>; | ||
|
|
||
| public constructor() { | ||
| this.upcomingCount = this.initializeUpcomingCount(); | ||
| this.pastCount = this.initializePastCount(); | ||
| this.mineCount = this.initializeMineCount(); | ||
| this.publicCount = this.initializePublicCount(); | ||
| } | ||
|
|
||
| public onSearchInput(event: Event): void { | ||
| const value = (event.target as HTMLInputElement).value; | ||
| this.searchQuery.set(value); | ||
| } | ||
|
|
||
| public onTimeFilterClick(value: 'upcoming' | 'past'): void { | ||
| if (this.viewMode() !== 'calendar') { | ||
| this.timeFilter.set(value); | ||
| } | ||
| } | ||
|
|
||
| public onVisibilityFilterClick(value: 'mine' | 'public'): void { | ||
| this.visibilityFilter.set(value); | ||
| } | ||
|
|
||
| public get isCalendarView(): boolean { | ||
| return this.viewMode() === 'calendar'; | ||
| } | ||
|
|
||
| private initializeUpcomingCount(): Signal<number> { | ||
| return computed(() => { | ||
| const now = new Date(); | ||
| return this.meetings().filter((meeting) => { | ||
| const meetingEndTime = new Date(meeting.start_time); | ||
| meetingEndTime.setMinutes(meetingEndTime.getMinutes() + meeting.duration + 40); | ||
| return meetingEndTime >= now; | ||
| }).length; | ||
| }); | ||
| } | ||
|
|
||
| private initializePastCount(): Signal<number> { | ||
| return computed(() => { | ||
| const now = new Date(); | ||
| return this.meetings().filter((meeting) => { | ||
| const meetingEndTime = new Date(meeting.start_time); | ||
| meetingEndTime.setMinutes(meetingEndTime.getMinutes() + meeting.duration + 40); | ||
| return meetingEndTime < now; | ||
| }).length; | ||
| }); | ||
| } | ||
|
|
||
| private initializeMineCount(): Signal<number> { | ||
| return computed(() => { | ||
| return this.meetings().filter((meeting) => meeting.visibility?.toLowerCase() === 'private').length; | ||
| }); | ||
| } | ||
|
|
||
| private initializePublicCount(): Signal<number> { | ||
| return computed(() => { | ||
| return this.meetings().filter((meeting) => meeting.visibility?.toLowerCase() === 'public').length; | ||
| }); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.