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

View File

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

View File

@ -1,5 +1,5 @@
import {FormContainerComponent} from '../form-container/form-container.component'; 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'; import {DatesComponent} from '../pages/dates/dates.component';
/** /**
@ -10,6 +10,6 @@ export const Routes =
{path: '', component: FormContainerComponent}, {path: '', component: FormContainerComponent},
{path: 'home', component: FormContainerComponent}, {path: 'home', component: FormContainerComponent},
{path: 'step/date', component: DatesComponent}, {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 { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { BasePageComponent } from './base-page.component'; import { BaseComponent } from './base.component';
describe('BasePageComponent', () => { describe('BaseComponent', () => {
let component: BasePageComponent; let component: BaseComponent;
let fixture: ComponentFixture<BasePageComponent>; let fixture: ComponentFixture<BaseComponent>;
beforeEach(async(() => { beforeEach(async(() => {
TestBed.configureTestingModule({ TestBed.configureTestingModule({
declarations: [ BasePageComponent ] declarations: [ BaseComponent ]
}) })
.compileComponents(); .compileComponents();
})); }));
beforeEach(() => { beforeEach(() => {
fixture = TestBed.createComponent(BasePageComponent); fixture = TestBed.createComponent(BaseComponent);
component = fixture.componentInstance; component = fixture.componentInstance;
fixture.detectChanges(); fixture.detectChanges();
}); });

View File

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

View File

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

View File

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

View File

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

View File

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