-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #192 from gctools-outilsgc/calendar-poc
Calendar poc
- Loading branch information
Showing
47 changed files
with
2,924 additions
and
1,041 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 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 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 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 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,16 @@ | ||
import { TestBed } from '@angular/core/testing'; | ||
|
||
import { ResizeService } from './resize.service'; | ||
|
||
describe('ResizeService', () => { | ||
let service: ResizeService; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({}); | ||
service = TestBed.inject(ResizeService); | ||
}); | ||
|
||
it('should be created', () => { | ||
expect(service).toBeTruthy(); | ||
}); | ||
}); |
This file contains 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,19 @@ | ||
import { Injectable, EventEmitter } from '@angular/core'; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class ResizeService { | ||
|
||
resizeEvent: EventEmitter<Event> = new EventEmitter(); | ||
|
||
constructor() { | ||
this.setupResizeListener(); | ||
} | ||
|
||
private setupResizeListener(): void { | ||
window.addEventListener('resize', (event) => { | ||
this.resizeEvent.emit(event); | ||
}); | ||
} | ||
} |
This file contains 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,151 @@ | ||
<div class="gcc-calendar-wrapper" [ngClass]="{'loading': loading}"> | ||
|
||
<div class="header"> | ||
|
||
<!-- Left Actions--> | ||
<div class="left-actions"> | ||
|
||
<!-- Add Event --> | ||
<app-button theme="black" | ||
matButtonType="mat-icon-button" | ||
[tooltip]="'Add Event' | translate" | ||
[tooltipDirection]="TooltipDirection.Above" | ||
[ariaLabel]="'Add Event'" | ||
[disabled]="loading" | ||
[clickFunc]="toggleEventForm"> | ||
<i class="fa-solid fa-calendar-plus fa-lg"></i> | ||
</app-button> | ||
|
||
<!-- Search --> | ||
<app-button theme="black" | ||
matButtonType="mat-icon-button" | ||
[tooltip]="searchActive ? ('Close Search' | translate) : ('Search' | translate)" | ||
[tooltipDirection]="TooltipDirection.Above" | ||
[ariaLabel]="searchActive ? ('Close Search' | translate) : ('Search' | translate)" | ||
[disabled]="loading" | ||
[clickFunc]="toggleSearch"> | ||
<i [ngClass]="searchActive ? 'fa-xmark' : 'fa-magnifying-glass'" | ||
class="fa-solid fa-lg"> | ||
</i> | ||
</app-button> | ||
</div> | ||
|
||
<!-- Middle Actions--> | ||
<div class="middle-actions"> | ||
|
||
<!-- Nav Previous--> | ||
<app-button theme="black" | ||
matButtonType="mat-icon-button" | ||
[tooltip]="translations.calendar.controls.previous.title_month | translate" | ||
[tooltipDirection]="TooltipDirection.Left" | ||
[ariaLabel]="translations.calendar.controls.previous.aria_month | translate" | ||
[disabled]="loading" | ||
(click)="navigateCalendar(-1)"> | ||
<i class="fa-solid fa-angle-left fa-lg"></i> | ||
</app-button> | ||
|
||
<!-- Date --> | ||
<span>{{ date | localizedDate : 'MMMM YYYY' | titlecase }}</span> | ||
|
||
<!-- Nav Next --> | ||
<app-button theme="black" | ||
matButtonType="mat-icon-button" | ||
[tooltip]="translations.calendar.controls.next.title_month | translate" | ||
[tooltipDirection]="TooltipDirection.Right" | ||
[ariaLabel]="translations.calendar.controls.next.aria_month | translate" | ||
[disabled]="loading" | ||
(click)="navigateCalendar(1)"> | ||
<i class="fa-solid fa-angle-right fa-lg"></i> | ||
</app-button> | ||
</div> | ||
|
||
<!-- Right Actions --> | ||
<div class="right-actions"> | ||
|
||
<!-- Filter --> | ||
<!-- <app-button theme="black" | ||
matButtonType="mat-icon-button" | ||
[tooltip]="'TODO' | translate" | ||
[tooltipDirection]="TooltipDirection.Above" | ||
[ariaLabel]="'TODO' | translate" | ||
[disabled]="loading"> | ||
<i class="fa-solid fa-ellipsis-vertical fa-lg"></i> | ||
</app-button> --> | ||
</div> | ||
</div> | ||
|
||
<!-- Search --> | ||
<app-calendar-search *ngIf="searchActive" | ||
[date]="date" | ||
[events]="events"> | ||
</app-calendar-search> | ||
|
||
<div> | ||
<!-- Days of the Week --> | ||
<div class="weekdays"> | ||
@for (weekday of weekdays; track $index) { | ||
<div class="day" [class.today]="weekday.isToday"> | ||
{{ weekday.title | translate }} | ||
</div> | ||
} | ||
</div> | ||
|
||
<div class="calendar" [ngStyle]="calendarStyle"> | ||
<!-- Previous Month's Days --> | ||
@for (day of datesPaddingPre; track $index) { | ||
<app-calendar-day [calendarDate]="day" | ||
[outsideOfMonth]="true" | ||
[loading]="loading" | ||
(dayClick)="dayClick(day)"> | ||
</app-calendar-day> | ||
} | ||
<!-- Current Month's Days --> | ||
@for (day of dates; track $index) { | ||
<app-calendar-day [calendarDate]="day" | ||
[active]="$index === activeDayIndex" | ||
[loading]="loading" | ||
(dayClick)="dayClick(day)"> | ||
</app-calendar-day> | ||
} | ||
<!-- Next Month's Days --> | ||
@for (day of datesPaddingPost; track $index) { | ||
<app-calendar-day [calendarDate]="day" | ||
[outsideOfMonth]="true" | ||
[loading]="loading" | ||
(dayClick)="dayClick(day)"> | ||
</app-calendar-day> | ||
} | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<!-- Events --> | ||
<app-calendar-events *ngIf="activeDayIndex > -1 && !loading" | ||
[calendarDate]="dates[activeDayIndex]" | ||
(eventEdit)="editEvent($event)" | ||
(eventDelete)="deleteEvent($event)"> | ||
</app-calendar-events> | ||
|
||
<!-- Event Form --> | ||
<mat-card *ngIf="eventFormActive && !loading" class="event-form"> | ||
|
||
<app-event-form [form]="eventFormGroup" | ||
[model]="eventFormData"> | ||
</app-event-form> | ||
|
||
<div class="actions"> | ||
<!-- Save --> | ||
<app-button theme="secondary-2" | ||
[disabled]="loading || !eventFormValid()" | ||
[clickFunc]="saveEventForm"> | ||
{{ editEventId ? (translations.forms.save | translate) : (translations.forms.create | translate) }} | ||
</app-button> | ||
|
||
<!-- Cancel --> | ||
<app-button theme="secondary-2" | ||
[disabled]="loading" | ||
[clickFunc]="toggleEventForm"> | ||
Cancel | ||
</app-button> | ||
</div> | ||
</mat-card> |
Oops, something went wrong.