This commit is contained in:
tykayn 2019-08-09 15:14:23 +02:00
parent 40b1a7bbf9
commit 512d569c54
23 changed files with 276 additions and 20 deletions

View File

@ -12,7 +12,7 @@
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"prefix": "framadate",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
@ -126,4 +126,4 @@
}
}},
"defaultProject": "framadate"
}
}

25
messages.xlf Normal file
View File

@ -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>

View File

@ -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>

View File

@ -3,14 +3,26 @@ 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 { HeaderComponent } from './header/header.component';
import {FormsModule} from '@angular/forms';
@NgModule({
declarations: [
AppComponent
AppComponent,
FormContainerComponent,
BasePageComponent,
PageKindComponent,
HeaderComponent,
],
imports: [
BrowserModule,
AppRoutingModule
AppRoutingModule,
FormsModule,
],
providers: [],
bootstrap: [AppComponent]

View File

@ -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>

View File

@ -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();
});
});

View File

@ -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;
}
}

View File

@ -0,0 +1 @@
<p>(progression)</p>

View File

View File

@ -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();
});
});

View File

@ -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() {
}
}

View File

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

View File

@ -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();
});
});

View File

@ -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() {
}
}

View File

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

View File

@ -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();
});
});

View File

@ -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() {
}
}

View File

@ -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();
});
});

View File

@ -0,0 +1,9 @@
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class ProgressionService {
constructor() { }
}

View File