Skip to content

Commit

Permalink
Code formatting ignore-deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
GCCollabBot committed Mar 15, 2024
1 parent 61256c1 commit a82b91c
Show file tree
Hide file tree
Showing 34 changed files with 1,426 additions and 1,474 deletions.
2 changes: 1 addition & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ registerLocaleData(localeFr);
deps: [HttpClient],
},
isolate: false,
extend: true
extend: true,
}),
NgxTranslateRoutesModule.forRoot({
enableRouteTranslate: true,
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/models/location.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ export class Location {
}

toString(): string {
return `${this.address}, ${this.city}, ${this.province}`
return `${this.address}, ${this.city}, ${this.province}`;
}
}
32 changes: 16 additions & 16 deletions src/app/core/services/resize.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,16 +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();
});
});
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();
});
});
7 changes: 3 additions & 4 deletions src/app/core/services/resize.service.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
import { Injectable, EventEmitter } from '@angular/core';
import { Injectable, EventEmitter } from '@angular/core';

@Injectable({
providedIn: 'root'
providedIn: 'root',
})
export class ResizeService {

resizeEvent: EventEmitter<Event> = new EventEmitter();

constructor() {
this.setupResizeListener();
}

private setupResizeListener(): void {
window.addEventListener('resize', (event) => {
window.addEventListener('resize', event => {
this.resizeEvent.emit(event);
});
}
Expand Down
233 changes: 103 additions & 130 deletions src/app/features/calendar/calendar.component.html
Original file line number Diff line number Diff line change
@@ -1,151 +1,124 @@
<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>
<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>

<!-- Right Actions -->
<div class="right-actions">
<!-- 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>

<!-- Filter -->
<!-- <app-button theme="black"
<!-- 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>
</div>

<!-- Search -->
<app-calendar-search *ngIf="searchActive"
[date]="date"
[events]="events">
</app-calendar-search>
<!-- 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>
<!-- 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 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>
<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>
<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>
Loading

0 comments on commit a82b91c

Please sign in to comment.