23 changed files with 276 additions and 20 deletions
@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?> |
||||
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2"> |
||||
<file source-language="en" datatype="plaintext" original="ng2.template"> |
||||
<body> |
||||
<trans-unit id="a38ca9be0d4cc826d1962ced6959714844cd8b5f" datatype="html"> |
||||
<source> |
||||
Bienvenue sur Framadate |
||||
</source> |
||||
<context-group purpose="location"> |
||||
<context context-type="sourcefile">src/app/app.component.html</context> |
||||
<context context-type="linenumber">3</context> |
||||
</context-group> |
||||
</trans-unit> |
||||
<trans-unit id="9cc3aa4a9c50ffaaed035c7f7d1dbcefb54954ea" datatype="html"> |
||||
<source> |
||||
Ceci est une démo |
||||
</source> |
||||
<context-group purpose="location"> |
||||
<context context-type="sourcefile">src/app/app.component.html</context> |
||||
<context context-type="linenumber">6</context> |
||||
</context-group> |
||||
</trans-unit> |
||||
</body> |
||||
</file> |
||||
</xliff> |
@ -1,21 +1,11 @@
|
||||
<!--The content below is only a placeholder and can be replaced.--> |
||||
<div style="text-align:center"> |
||||
<h1> |
||||
Welcome to {{ title }}! |
||||
<h1 i18n> |
||||
Bienvenue sur Framadate |
||||
</h1> |
||||
<img alt="Angular Logo" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg==" width="300"> |
||||
<p i18n> |
||||
Ceci est une démo |
||||
</p> |
||||
</div> |
||||
<h2>Here are some links to help you start: </h2> |
||||
<ul> |
||||
<li> |
||||
<h2><a href="https://angular.io/tutorial" rel="noopener" target="_blank">Tour of Heroes</a></h2> |
||||
</li> |
||||
<li> |
||||
<h2><a href="https://angular.io/cli" rel="noopener" target="_blank">CLI Documentation</a></h2> |
||||
</li> |
||||
<li> |
||||
<h2><a href="https://blog.angular.io/" rel="noopener" target="_blank">Angular blog</a></h2> |
||||
</li> |
||||
</ul> |
||||
|
||||
<framadate-form-container></framadate-form-container> |
||||
<router-outlet></router-outlet> |
||||
|
@ -0,0 +1,19 @@
|
||||
<p>form-container works!</p> |
||||
<div class="description"> |
||||
|
||||
</div> |
||||
<div class="choices"> |
||||
<button *ngDisable="!formIsValid" class="btn btn-primary"> |
||||
suivant |
||||
</button> |
||||
</div> |
||||
<div class="well debug"> |
||||
<ul> |
||||
<li> |
||||
étape actuelle {{progressionStep}} / {{progressionStepMax}} |
||||
</li> |
||||
<li> |
||||
formulaire valide : {{formIsValid}} |
||||
</li> |
||||
</ul> |
||||
</div> |
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
||||
|
||||
import { FormContainerComponent } from './form-container.component'; |
||||
|
||||
describe('FormContainerComponent', () => { |
||||
let component: FormContainerComponent; |
||||
let fixture: ComponentFixture<FormContainerComponent>; |
||||
|
||||
beforeEach(async(() => { |
||||
TestBed.configureTestingModule({ |
||||
declarations: [ FormContainerComponent ] |
||||
}) |
||||
.compileComponents(); |
||||
})); |
||||
|
||||
beforeEach(() => { |
||||
fixture = TestBed.createComponent(FormContainerComponent); |
||||
component = fixture.componentInstance; |
||||
fixture.detectChanges(); |
||||
}); |
||||
|
||||
it('should create', () => { |
||||
expect(component).toBeTruthy(); |
||||
}); |
||||
}); |
@ -0,0 +1,41 @@
|
||||
import {Component, OnInit} from '@angular/core'; |
||||
import {ProgressionService} from '../progression.service'; |
||||
|
||||
@Component({ |
||||
selector: 'framadate-form-container', |
||||
templateUrl: './form-container.component.html', |
||||
styleUrls: ['./form-container.component.scss'] |
||||
}) |
||||
/** |
||||
* gestion de la progression dans le formulaire. |
||||
* à chaque étape correspond un composant de page |
||||
*/ |
||||
export class FormContainerComponent implements OnInit { |
||||
|
||||
private pollConfig: any; |
||||
private progressionStep = 0; |
||||
private progressionStepMax = 0; |
||||
private formIsValid = true; |
||||
|
||||
constructor(private progression: ProgressionService) { |
||||
} |
||||
|
||||
ngOnInit() { |
||||
} |
||||
|
||||
nextPage() { |
||||
if (this.checkValidity()) { |
||||
this.progressionStep++; |
||||
} else { |
||||
this.displayErrorMessage(); |
||||
} |
||||
} |
||||
|
||||
checkValidity() { |
||||
return true; |
||||
} |
||||
|
||||
displayErrorMessage() { |
||||
return true; |
||||
} |
||||
} |
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
||||
|
||||
import { HeaderComponent } from './header.component'; |
||||
|
||||
describe('HeaderComponent', () => { |
||||
let component: HeaderComponent; |
||||
let fixture: ComponentFixture<HeaderComponent>; |
||||
|
||||
beforeEach(async(() => { |
||||
TestBed.configureTestingModule({ |
||||
declarations: [ HeaderComponent ] |
||||
}) |
||||
.compileComponents(); |
||||
})); |
||||
|
||||
beforeEach(() => { |
||||
fixture = TestBed.createComponent(HeaderComponent); |
||||
component = fixture.componentInstance; |
||||
fixture.detectChanges(); |
||||
}); |
||||
|
||||
it('should create', () => { |
||||
expect(component).toBeTruthy(); |
||||
}); |
||||
}); |
@ -0,0 +1,15 @@
|
||||
import { Component, OnInit } from '@angular/core'; |
||||
|
||||
@Component({ |
||||
selector: 'framadate-header', |
||||
templateUrl: './header.component.html', |
||||
styleUrls: ['./header.component.scss'] |
||||
}) |
||||
export class HeaderComponent implements OnInit { |
||||
|
||||
constructor() { } |
||||
|
||||
ngOnInit() { |
||||
} |
||||
|
||||
} |
@ -0,0 +1 @@
|
||||
<p>base-page works!</p> |
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
||||
|
||||
import { BasePageComponent } from './base-page.component'; |
||||
|
||||
describe('BasePageComponent', () => { |
||||
let component: BasePageComponent; |
||||
let fixture: ComponentFixture<BasePageComponent>; |
||||
|
||||
beforeEach(async(() => { |
||||
TestBed.configureTestingModule({ |
||||
declarations: [ BasePageComponent ] |
||||
}) |
||||
.compileComponents(); |
||||
})); |
||||
|
||||
beforeEach(() => { |
||||
fixture = TestBed.createComponent(BasePageComponent); |
||||
component = fixture.componentInstance; |
||||
fixture.detectChanges(); |
||||
}); |
||||
|
||||
it('should create', () => { |
||||
expect(component).toBeTruthy(); |
||||
}); |
||||
}); |
@ -0,0 +1,15 @@
|
||||
import { Component, OnInit } from '@angular/core'; |
||||
|
||||
@Component({ |
||||
selector: 'framadate-base-page', |
||||
templateUrl: './base-page.component.html', |
||||
styleUrls: ['./base-page.component.scss'] |
||||
}) |
||||
export class BasePageComponent implements OnInit { |
||||
|
||||
constructor() { } |
||||
|
||||
ngOnInit() { |
||||
} |
||||
|
||||
} |
@ -0,0 +1 @@
|
||||
<p>page-kind works!</p> |
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
||||
|
||||
import { PageKindComponent } from './page-kind.component'; |
||||
|
||||
describe('PageKindComponent', () => { |
||||
let component: PageKindComponent; |
||||
let fixture: ComponentFixture<PageKindComponent>; |
||||
|
||||
beforeEach(async(() => { |
||||
TestBed.configureTestingModule({ |
||||
declarations: [ PageKindComponent ] |
||||
}) |
||||
.compileComponents(); |
||||
})); |
||||
|
||||
beforeEach(() => { |
||||
fixture = TestBed.createComponent(PageKindComponent); |
||||
component = fixture.componentInstance; |
||||
fixture.detectChanges(); |
||||
}); |
||||
|
||||
it('should create', () => { |
||||
expect(component).toBeTruthy(); |
||||
}); |
||||
}); |
@ -0,0 +1,15 @@
|
||||
import { Component, OnInit } from '@angular/core'; |
||||
|
||||
@Component({ |
||||
selector: 'framadate-page-kind', |
||||
templateUrl: './page-kind.component.html', |
||||
styleUrls: ['./page-kind.component.scss'] |
||||
}) |
||||
export class PageKindComponent implements OnInit { |
||||
|
||||
constructor() { } |
||||
|
||||
ngOnInit() { |
||||
} |
||||
|
||||
} |
@ -0,0 +1,12 @@
|
||||
import { TestBed } from '@angular/core/testing'; |
||||
|
||||
import { ProgressionService } from './progression.service'; |
||||
|
||||
describe('ProgressionService', () => { |
||||
beforeEach(() => TestBed.configureTestingModule({})); |
||||
|
||||
it('should be created', () => { |
||||
const service: ProgressionService = TestBed.get(ProgressionService); |
||||
expect(service).toBeTruthy(); |
||||
}); |
||||
}); |
@ -0,0 +1,9 @@
|
||||
import { Injectable } from '@angular/core'; |
||||
|
||||
@Injectable({ |
||||
providedIn: 'root' |
||||
}) |
||||
export class ProgressionService { |
||||
|
||||
constructor() { } |
||||
} |
Loading…
Reference in new issue