rename components

This commit is contained in:
tykayn 2019-08-10 16:57:36 +02:00
parent 46cce96dab
commit e238b0aceb
17 changed files with 84 additions and 33 deletions

View File

@ -4,8 +4,8 @@ import {NgModule} from '@angular/core';
import {AppRoutingModule} from './app-routing.module';
import {AppComponent} from './app.component';
import {FormContainerComponent} from './form-container/form-container.component';
import {BasePageComponent} from './pages/base-page/base-page.component';
import {PageKindComponent} from './pages/page-kind/page-kind.component';
import {BaseComponent} from './pages/base-page/base.component';
import {KindComponent} from './pages/kind/kind.component';
import {HeaderComponent} from './header/header.component';
import {FormsModule} from '@angular/forms';
import {NavigationComponent} from './ui/navigation/navigation.component';
@ -14,18 +14,20 @@ import {Routes} from './config/Routes';
import {CommonModule} from '@angular/common';
import { DatesComponent } from './pages/dates/dates.component';
import { DebuggerComponent } from './debugger/debugger.component';
import { VisibilityComponent } from './pages/visibility/visibility.component';
@NgModule({
declarations: [
AppComponent,
FormContainerComponent,
BasePageComponent,
PageKindComponent,
BaseComponent,
KindComponent,
HeaderComponent,
NavigationComponent,
DatesComponent,
DebuggerComponent,
VisibilityComponent,
],
imports: [

View File

@ -21,7 +21,7 @@ export class ConfigService {
pollType = 'classic';
title = '';
description = '';
allowSeveralHours = true;
allowSeveralHours = false;
dateList: DateOption[] = [];
constructor() {

View File

@ -1,5 +1,5 @@
import {FormContainerComponent} from '../form-container/form-container.component';
import {PageKindComponent} from '../pages/page-kind/page-kind.component';
import {KindComponent} from '../pages/kind/kind.component';
import {DatesComponent} from '../pages/dates/dates.component';
/**
@ -10,6 +10,6 @@ export const Routes =
{path: '', component: FormContainerComponent},
{path: 'home', component: FormContainerComponent},
{path: 'step/date', component: DatesComponent},
{path: 'step/kind', component: PageKindComponent}
{path: 'step/kind', component: KindComponent}
]
;

View File

@ -1,20 +1,20 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { BasePageComponent } from './base-page.component';
import { BaseComponent } from './base.component';
describe('BasePageComponent', () => {
let component: BasePageComponent;
let fixture: ComponentFixture<BasePageComponent>;
describe('BaseComponent', () => {
let component: BaseComponent;
let fixture: ComponentFixture<BaseComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ BasePageComponent ]
declarations: [ BaseComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(BasePageComponent);
fixture = TestBed.createComponent(BaseComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

View File

@ -3,13 +3,13 @@ import {ConfigService} from '../../config.service';
@Component({
selector: 'framadate-base-page',
templateUrl: './base-page.component.html',
styleUrls: ['./base-page.component.scss']
templateUrl: './base.component.html',
styleUrls: ['./base.component.scss']
})
/**
* base page is aware of the state of the filling
*/
export class BasePageComponent implements OnInit {
export class BaseComponent implements OnInit {
constructor(private config: ConfigService) {
}

View File

@ -4,13 +4,17 @@
<div>
<select name="multi_hours" id="multi_hours"
[(ngModel)]="config.allowSeveralHours">
<option value="yes"></option>
<option value="no"></option>
<option value="yes">possiblement différents</option>
<option value="no">identiques</option>
</select>
<label for="multi_hours" i18n>
Je souhaite mettre des créneaux horaires différents pour chaque jour
<label for="multi_hours">
<span i18n>
Je souhaite mettre des créneaux horaires
</span>
<span i18n>
pour chaque journée
</span>
</label>
</div>
<button
(click)="addDate()"

View File

@ -1,13 +1,13 @@
import {Component, OnInit} from '@angular/core';
import {ConfigService} from '../../config.service';
import {BasePageComponent} from '../base-page/base-page.component';
import {BaseComponent} from '../base-page/base.component';
@Component({
selector: 'framadate-dates',
templateUrl: './dates.component.html',
styleUrls: ['./dates.component.scss']
})
export class DatesComponent extends BasePageComponent implements OnInit {
export class DatesComponent extends BaseComponent implements OnInit {
constructor(config: ConfigService) {
super(config);

View File

@ -1,20 +1,20 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { PageKindComponent } from './page-kind.component';
import { KindComponent } from './kind.component';
describe('PageKindComponent', () => {
let component: PageKindComponent;
let fixture: ComponentFixture<PageKindComponent>;
describe('KindComponent', () => {
let component: KindComponent;
let fixture: ComponentFixture<KindComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ PageKindComponent ]
declarations: [ KindComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(PageKindComponent);
fixture = TestBed.createComponent(KindComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

View File

@ -1,13 +1,13 @@
import {Component, OnInit} from '@angular/core';
import {BasePageComponent} from '../base-page/base-page.component';
import {BaseComponent} from '../base-page/base.component';
import {ConfigService} from '../../config.service';
@Component({
selector: 'framadate-page-kind',
templateUrl: './page-kind.component.html',
styleUrls: ['./page-kind.component.scss']
templateUrl: './kind.component.html',
styleUrls: ['./kind.component.scss']
})
export class PageKindComponent extends BasePageComponent implements OnInit {
export class KindComponent extends BaseComponent implements OnInit {
constructor(config: ConfigService) {
super(config);

View File

@ -0,0 +1 @@
<p>visibility works!</p>

View File

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

View File

@ -0,0 +1,19 @@
import { Component, OnInit } from '@angular/core';
import {BaseComponent} from '../base-page/base.component';
import {ConfigService} from '../../config.service';
@Component({
selector: 'framadate-visibility',
templateUrl: './visibility.component.html',
styleUrls: ['./visibility.component.scss']
})
export class VisibilityComponent extends BaseComponent implements OnInit {
constructor(config: ConfigService) {
super(config);
}
ngOnInit() {
}
}