feat(calendar): add boilerplate

This commit is contained in:
Johannes Millan 2020-12-17 20:56:31 +01:00
parent dc10de5559
commit 79fc1ffc43
15 changed files with 156 additions and 1 deletions

View File

@ -12,6 +12,7 @@ import { TagTaskPageComponent } from './pages/tag-task-page/tag-task-page.compon
import { ActiveWorkContextGuard, ValidProjectIdGuard, ValidTagIdGuard } from './app.guard';
import { TagSettingsPageComponent } from './pages/tag-settings-page/tag-settings-page.component';
import { TODAY_TAG } from './features/tag/tag.const';
import { CalendarPageComponent } from './pages/calendar-page/calendar-page.component';
export const APP_ROUTES: Routes = [
{path: 'config', component: ConfigPageComponent, data: {page: 'config'}},
@ -49,7 +50,12 @@ export const APP_ROUTES: Routes = [
data: {page: 'daily-summary'},
canActivate: [ValidTagIdGuard]
},
{
path: 'tag/:id/calendar',
component: CalendarPageComponent,
data: {page: 'calendar'},
canActivate: [ValidTagIdGuard]
},
{
path: 'project/:id/tasks',
component: ProjectTaskPageComponent,
@ -86,6 +92,12 @@ export const APP_ROUTES: Routes = [
data: {page: 'daily-summary'},
canActivate: [ValidProjectIdGuard]
},
{
path: 'project/:id/calendar',
component: CalendarPageComponent,
data: {page: 'calendar'},
canActivate: [ValidProjectIdGuard]
},
{path: 'project-overview', component: ProjectOverviewPageComponent, data: {page: 'project-overview'}},
{path: 'active/:subPageType', canActivate: [ActiveWorkContextGuard], component: ConfigPageComponent},

View File

@ -35,6 +35,15 @@
<mat-icon>access_alarms</mat-icon>
<span class="text">{{T.MH.SCHEDULED|translate}}</span>
</button>
<button class="route-link"
#menuEntry
mat-menu-item
routerLink="active/calendar"
routerLinkActive="isActiveRoute">
<mat-icon>date_range</mat-icon>
<span class="text">{{T.MH.CALENDAR|translate}}</span>
</button>
</section>
<section *ngIf="projectList$|async as projectList"

View File

@ -0,0 +1,16 @@
<p>calendar works!</p>
xxxxxxxxxx
<h1>JJJJJJJJJJJJJJJ</h1>
<h1>JJJJJJJJJJJJJJJ</h1>
<h1>JJJJJJJJJJJJJJJ</h1>
<h1>JJJJJJJJJJJJJJJ</h1>
<h1>JJJJJJJJJJJJJJJ</h1>
<h1>JJJJJJJJJJJJJJJ</h1>
<h1>JJJJJJJJJJJJJJJ</h1>
<h1>JJJJJJJJJJJJJJJ</h1>
<h1>JJJJJJJJJJJJJJJ</h1>
<h1>JJJJJJJJJJJJJJJ</h1>
<h1>JJJJJJJJJJJJJJJ</h1>
<h1>JJJJJJJJJJJJJJJ</h1>
<h1>JJJJJJJJJJJJJJJ</h1>
<h1>JJJJJJJJJJJJJJJ</h1>

View File

@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { CalendarComponent } from './calendar.component';
describe('CalendarComponent', () => {
let component: CalendarComponent;
let fixture: ComponentFixture<CalendarComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [CalendarComponent]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(CalendarComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,13 @@
import { ChangeDetectionStrategy, Component } from '@angular/core';
@Component({
// apparently calendar does not work, so we add a prefix
selector: 'sup-calendar',
templateUrl: './calendar.component.html',
styleUrls: ['./calendar.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class CalendarComponent {
constructor() {
}
}

View File

@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { CalendarComponent } from './calendar.component';
@NgModule({
declarations: [
CalendarComponent,
],
imports: [
CommonModule
],
exports: [
CalendarComponent,
],
})
export class CalendarModule {
}

View File

@ -0,0 +1 @@
<sup-calendar></sup-calendar>

View File

@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { CalendarPageComponent } from './calendar-page.component';
describe('CalendarPageComponent', () => {
let component: CalendarPageComponent;
let fixture: ComponentFixture<CalendarPageComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [CalendarPageComponent]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(CalendarPageComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,17 @@
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
@Component({
selector: 'calendar-page',
templateUrl: './calendar-page.component.html',
styleUrls: ['./calendar-page.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class CalendarPageComponent implements OnInit {
constructor() {
}
ngOnInit(): void {
}
}

View File

@ -0,0 +1,16 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { CalendarPageComponent } from './calendar-page.component';
import { CalendarModule } from '../../features/calendar/calendar.module';
@NgModule({
declarations: [
CalendarPageComponent
],
imports: [
CommonModule,
CalendarModule,
]
})
export class CalendarPageModule {
}

View File

@ -10,10 +10,12 @@ import { WorklogPageModule } from './worklog-page/worklog-page.module';
import { ProjectSettingsPageModule } from './project-settings-page/project-settings-page.module';
import { TagTaskPageModule } from './tag-task-page/tag-task-page.module';
import { TagSettingsPageModule } from './tag-settings-page/tag-settings-page.module';
import { CalendarPageModule } from './calendar-page/calendar-page.module';
@NgModule({
imports: [
CommonModule,
CalendarPageModule,
ConfigPageModule,
ProjectOverviewPageModule,
ProjectTaskPageModule,

View File

@ -1069,6 +1069,7 @@ const T = {
},
MH: {
ADD_NEW_TASK: 'MH.ADD_NEW_TASK',
CALENDAR: 'MH.CALENDAR',
CREATE_PROJECT: 'MH.CREATE_PROJECT',
CREATE_TAG: 'MH.CREATE_TAG',
DELETE_TAG: 'MH.DELETE_TAG',

View File

@ -1069,6 +1069,7 @@
},
"MH": {
"ADD_NEW_TASK": "Add new Task",
"CALENDAR": "Calendar",
"CREATE_PROJECT": "Create Project",
"CREATE_TAG": "Create Tag",
"DELETE_TAG": "Delete Tag",