From c2d5a5a2a5c05097a7f3b48eae22ad93b7ccd989 Mon Sep 17 00:00:00 2001 From: sercan Date: Fri, 21 Sep 2018 11:38:11 +0300 Subject: [PATCH] (Scrumboard) Fixed: Undefined matDialogRef (Calendar) Fixed: Undefined matDialogRef (Calendar) Updated angular-calendar --- .../components/theme-options/theme-options.component.ts | 1 - src/app/fake-db/calendar.ts | 2 +- src/app/main/apps/calendar/calendar.module.ts | 8 ++++++-- .../apps/calendar/event-form/event-form.component.html | 6 +++--- .../scrumboard/board/dialogs/card/card.component.html | 2 +- .../apps/scrumboard/board/dialogs/card/card.component.ts | 6 +++--- 6 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/@fuse/components/theme-options/theme-options.component.ts b/src/@fuse/components/theme-options/theme-options.component.ts index 4c5adffd..c5c9a042 100644 --- a/src/@fuse/components/theme-options/theme-options.component.ts +++ b/src/@fuse/components/theme-options/theme-options.component.ts @@ -118,7 +118,6 @@ export class FuseThemeOptionsComponent implements OnInit, OnDestroy // Reset the form values based on the // selected layout style this._resetFormValues(value); - }); // Subscribe to the form value changes diff --git a/src/app/fake-db/calendar.ts b/src/app/fake-db/calendar.ts index fab7bc83..9eef3f3b 100644 --- a/src/app/fake-db/calendar.ts +++ b/src/app/fake-db/calendar.ts @@ -20,7 +20,7 @@ export class CalendarFakeDb start : subDays(startOfDay(new Date()), 1), end : addDays(new Date(), 1), title : 'A 3 day event', - allDay : false, + allDay : true, color : { primary : '#ad2121', secondary: '#FAE3E3' diff --git a/src/app/main/apps/calendar/calendar.module.ts b/src/app/main/apps/calendar/calendar.module.ts index 87be314e..2b10588c 100644 --- a/src/app/main/apps/calendar/calendar.module.ts +++ b/src/app/main/apps/calendar/calendar.module.ts @@ -4,7 +4,8 @@ import { MatButtonModule, MatDatepickerModule, MatDialogModule, MatFormFieldModule, MatIconModule, MatInputModule, MatSlideToggleModule, MatToolbarModule, MatTooltipModule } from '@angular/material'; import { ColorPickerModule } from 'ngx-color-picker'; -import { CalendarModule as AngularCalendarModule } from 'angular-calendar'; +import { CalendarModule as AngularCalendarModule, DateAdapter } from 'angular-calendar'; +import { adapterFactory } from 'angular-calendar/date-adapters/date-fns'; import { FuseSharedModule } from '@fuse/shared.module'; import { FuseConfirmDialogModule } from '@fuse/components'; @@ -42,7 +43,10 @@ const routes: Routes = [ MatToolbarModule, MatTooltipModule, - AngularCalendarModule.forRoot(), + AngularCalendarModule.forRoot({ + provide : DateAdapter, + useFactory: adapterFactory + }), ColorPickerModule, FuseSharedModule, diff --git a/src/app/main/apps/calendar/event-form/event-form.component.html b/src/app/main/apps/calendar/event-form/event-form.component.html index 2937cf67..33b0e7d1 100644 --- a/src/app/main/apps/calendar/event-form/event-form.component.html +++ b/src/app/main/apps/calendar/event-form/event-form.component.html @@ -117,7 +117,7 @@ diff --git a/src/app/main/apps/scrumboard/board/dialogs/card/card.component.ts b/src/app/main/apps/scrumboard/board/dialogs/card/card.component.ts index 4bc04c73..b1067922 100644 --- a/src/app/main/apps/scrumboard/board/dialogs/card/card.component.ts +++ b/src/app/main/apps/scrumboard/board/dialogs/card/card.component.ts @@ -36,13 +36,13 @@ export class ScrumboardCardDialogComponent implements OnInit, OnDestroy /** * Constructor * - * @param {MatDialogRef} _matDialogRef + * @param {MatDialogRef} matDialogRef * @param _data * @param {MatDialog} _matDialog * @param {ScrumboardService} _scrumboardService */ constructor( - private _matDialogRef: MatDialogRef, + public matDialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) private _data: any, private _matDialog: MatDialog, private _scrumboardService: ScrumboardService @@ -301,7 +301,7 @@ export class ScrumboardCardDialogComponent implements OnInit, OnDestroy this.confirmDialogRef.afterClosed().subscribe(result => { if ( result ) { - this._matDialogRef.close(); + this.matDialogRef.close(); this._scrumboardService.removeCard(this.card.id, this.list.id); } });