feat(calendar): add boilerplate
This commit is contained in:
parent
dc10de5559
commit
79fc1ffc43
|
@ -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},
|
||||
|
|
|
@ -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"
|
||||
|
|
16
src/app/features/calendar/calendar.component.html
Normal file
16
src/app/features/calendar/calendar.component.html
Normal 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>
|
0
src/app/features/calendar/calendar.component.scss
Normal file
0
src/app/features/calendar/calendar.component.scss
Normal file
25
src/app/features/calendar/calendar.component.spec.ts
Normal file
25
src/app/features/calendar/calendar.component.spec.ts
Normal 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();
|
||||
});
|
||||
});
|
13
src/app/features/calendar/calendar.component.ts
Normal file
13
src/app/features/calendar/calendar.component.ts
Normal 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() {
|
||||
}
|
||||
}
|
17
src/app/features/calendar/calendar.module.ts
Normal file
17
src/app/features/calendar/calendar.module.ts
Normal 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 {
|
||||
}
|
1
src/app/pages/calendar-page/calendar-page.component.html
Normal file
1
src/app/pages/calendar-page/calendar-page.component.html
Normal file
|
@ -0,0 +1 @@
|
|||
<sup-calendar></sup-calendar>
|
25
src/app/pages/calendar-page/calendar-page.component.spec.ts
Normal file
25
src/app/pages/calendar-page/calendar-page.component.spec.ts
Normal 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();
|
||||
});
|
||||
});
|
17
src/app/pages/calendar-page/calendar-page.component.ts
Normal file
17
src/app/pages/calendar-page/calendar-page.component.ts
Normal 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 {
|
||||
}
|
||||
|
||||
}
|
16
src/app/pages/calendar-page/calendar-page.module.ts
Normal file
16
src/app/pages/calendar-page/calendar-page.module.ts
Normal 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 {
|
||||
}
|
|
@ -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,
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue
Block a user