Skip to content
Snippets Groups Projects
Commit 6679ad9c authored by florimondmanca's avatar florimondmanca
Browse files

switch to Angular4 and @angular/cli, remove heavy pdf file

parent 4fda1d49
No related branches found
No related tags found
4 merge requests!5Première version,!15Merge all in dev branch,!2Passage à Angular4 et @angular/cli, ajout site vitrine,!16Staging
Showing
with 2754 additions and 2013 deletions
# oser-frontend # oser-frontend
Frontend du site d'Ouverture Sociale pour l'Egalité et la Réussite Frontend du site d'Ouverture Sociale pour l'Egalité et la Réussite.
## Installation
Après avoir cloné le repo :
```
$ cd oser-frontend
```
1. Installez `@angular/cli` si ce n'est pas encore fait
```
$ npm install -g @angular/cli
```
2. Installez les dépendances
```
$ npm install
```
3. Lancez le serveur de dev
```
$ ng serve -o
```
{ {
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": { "project": {
"version": "1.0.0-beta.28.3",
"name": "oser-app" "name": "oser-app"
}, },
"apps": [ "apps": [
...@@ -15,14 +15,15 @@ ...@@ -15,14 +15,15 @@
"main": "main.ts", "main": "main.ts",
"polyfills": "polyfills.ts", "polyfills": "polyfills.ts",
"test": "test.ts", "test": "test.ts",
"tsconfig": "tsconfig.json", "tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json",
"prefix": "app", "prefix": "app",
"styles": [ "styles": [
"styles.css" "styles.css"
], ],
"scripts": [], "scripts": [],
"environmentSource": "environments/environment.ts",
"environments": { "environments": {
"source": "environments/environment.ts",
"dev": "environments/environment.ts", "dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts" "prod": "environments/environment.prod.ts"
} }
...@@ -35,12 +36,13 @@ ...@@ -35,12 +36,13 @@
}, },
"lint": [ "lint": [
{ {
"files": "src/**/*.ts", "project": "src/tsconfig.app.json"
"project": "src/tsconfig.json"
}, },
{ {
"files": "e2e/**/*.ts", "project": "src/tsconfig.spec.json"
"project": "e2e/tsconfig.json" },
{
"project": "e2e/tsconfig.e2e.json"
} }
], ],
"test": { "test": {
...@@ -50,18 +52,6 @@ ...@@ -50,18 +52,6 @@
}, },
"defaults": { "defaults": {
"styleExt": "css", "styleExt": "css",
"prefixInterfaces": false, "component": {}
"inline": {
"style": false,
"template": false
},
"spec": {
"class": false,
"component": true,
"directive": true,
"module": false,
"pipe": true,
"service": true
}
} }
} }
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
# compiled output # compiled output
/dist /dist
/tmp /tmp
/out-tsc
# dependencies # dependencies
/node_modules /node_modules
...@@ -14,6 +15,7 @@ ...@@ -14,6 +15,7 @@
.c9/ .c9/
*.launch *.launch
.settings/ .settings/
*.sublime-workspace
# IDE - VSCode # IDE - VSCode
.vscode/* .vscode/*
...@@ -25,7 +27,7 @@ ...@@ -25,7 +27,7 @@
# misc # misc
/.sass-cache /.sass-cache
/connect.lock /connect.lock
/coverage/* /coverage
/libpeerconnection.log /libpeerconnection.log
npm-debug.log npm-debug.log
testem.log testem.log
......
# OserApp # OserApp
This project was generated with [angular-cli](https://github.com/angular/angular-cli) version 1.0.0-beta.28.3. This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.0.0.
## Development server ## Development server
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
## Code scaffolding ## Code scaffolding
...@@ -22,10 +23,6 @@ Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github. ...@@ -22,10 +23,6 @@ Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
Before running the tests make sure you are serving the app via `ng serve`. Before running the tests make sure you are serving the app via `ng serve`.
## Deploying to GitHub Pages
Run `ng github-pages:deploy` to deploy to GitHub Pages.
## Further help ## Further help
To get more help on the `angular-cli` use `ng help` or go check out the [Angular-CLI README](https://github.com/angular/angular-cli/blob/master/README.md). To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
import { OserAppPage } from './app.po'; import { OserAppPage } from './app.po';
describe('oser-app App', function() { describe('oser-app App', () => {
let page: OserAppPage; let page: OserAppPage;
beforeEach(() => { beforeEach(() => {
......
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/e2e",
"module": "commonjs",
"target": "es5",
"types":[
"jasmine",
"node"
]
}
}
...@@ -4,35 +4,36 @@ ...@@ -4,35 +4,36 @@
module.exports = function (config) { module.exports = function (config) {
config.set({ config.set({
basePath: '', basePath: '',
frameworks: ['jasmine', 'angular-cli'], frameworks: ['jasmine', '@angular/cli'],
plugins: [ plugins: [
require('karma-jasmine'), require('karma-jasmine'),
require('karma-chrome-launcher'), require('karma-chrome-launcher'),
require('karma-remap-istanbul'), require('karma-jasmine-html-reporter'),
require('angular-cli/plugins/karma') require('karma-coverage-istanbul-reporter'),
require('@angular/cli/plugins/karma')
], ],
client:{
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
files: [ files: [
{ pattern: './src/test.ts', watched: false } { pattern: './src/test.ts', watched: false }
], ],
preprocessors: { preprocessors: {
'./src/test.ts': ['angular-cli'] './src/test.ts': ['@angular/cli']
}, },
mime: { mime: {
'text/x-typescript': ['ts','tsx'] 'text/x-typescript': ['ts','tsx']
}, },
remapIstanbulReporter: { coverageIstanbulReporter: {
reports: { reports: [ 'html', 'lcovonly' ],
html: 'coverage', fixWebpackSourcePaths: true
lcovonly: './coverage/coverage.lcov'
}
}, },
angularCli: { angularCli: {
config: './angular-cli.json',
environment: 'dev' environment: 'dev'
}, },
reporters: config.angularCli && config.angularCli.codeCoverage reporters: config.angularCli && config.angularCli.codeCoverage
? ['progress', 'karma-remap-istanbul'] ? ['progress', 'coverage-istanbul']
: ['progress'], : ['progress', 'kjhtml'],
port: 9876, port: 9876,
colors: true, colors: true,
logLevel: config.LOG_INFO, logLevel: config.LOG_INFO,
......
This diff is collapsed.
...@@ -2,45 +2,45 @@ ...@@ -2,45 +2,45 @@
"name": "oser-app", "name": "oser-app",
"version": "0.0.0", "version": "0.0.0",
"license": "MIT", "license": "MIT",
"angular-cli": {},
"scripts": { "scripts": {
"ng": "ng", "ng": "ng",
"start": "ng serve", "start": "ng serve",
"build": "ng build",
"test": "ng test", "test": "ng test",
"pree2e": "webdriver-manager update --standalone false --gecko false", "lint": "ng lint",
"e2e": "protractor" "e2e": "ng e2e"
}, },
"private": true, "private": true,
"dependencies": { "dependencies": {
"@angular/common": "^2.3.1", "@angular/common": "^4.0.0",
"@angular/compiler": "^2.3.1", "@angular/compiler": "^4.0.0",
"@angular/core": "^2.3.1", "@angular/core": "^4.0.0",
"@angular/forms": "^2.3.1", "@angular/forms": "^4.0.0",
"@angular/http": "^2.3.1", "@angular/http": "^4.0.0",
"@angular/platform-browser": "^2.3.1", "@angular/platform-browser": "^4.0.0",
"@angular/platform-browser-dynamic": "^2.3.1", "@angular/platform-browser-dynamic": "^4.0.0",
"@angular/router": "^3.3.1", "@angular/router": "^4.0.0",
"core-js": "^2.4.1", "core-js": "^2.4.1",
"rxjs": "^5.0.1", "rxjs": "^5.1.0",
"ts-helpers": "^1.1.1", "zone.js": "^0.8.4"
"zone.js": "^0.7.2"
}, },
"devDependencies": { "devDependencies": {
"@angular/compiler-cli": "^2.3.1", "@angular/cli": "1.0.0",
"@angular/compiler-cli": "^4.0.0",
"@types/jasmine": "2.5.38", "@types/jasmine": "2.5.38",
"@types/node": "^6.0.42", "@types/node": "~6.0.60",
"angular-cli": "1.0.0-beta.28.3", "codelyzer": "~2.0.0",
"codelyzer": "~2.0.0-beta.1", "jasmine-core": "~2.5.2",
"jasmine-core": "2.5.2", "jasmine-spec-reporter": "~3.2.0",
"jasmine-spec-reporter": "2.5.0", "karma": "~1.4.1",
"karma": "1.2.0", "karma-chrome-launcher": "~2.0.0",
"karma-chrome-launcher": "^2.0.0", "karma-cli": "~1.0.1",
"karma-cli": "^1.0.1", "karma-jasmine": "~1.1.0",
"karma-jasmine": "^1.0.2", "karma-jasmine-html-reporter": "^0.2.2",
"karma-remap-istanbul": "^0.2.1", "karma-coverage-istanbul-reporter": "^0.2.0",
"protractor": "~4.0.13", "protractor": "~5.1.0",
"ts-node": "1.2.1", "ts-node": "~2.0.0",
"tslint": "^4.3.0", "tslint": "~4.5.0",
"typescript": "~2.0.3" "typescript": "~2.2.0"
} }
} }
// Protractor configuration file, see link for more information // Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts // https://github.com/angular/protractor/blob/master/lib/config.ts
/*global jasmine */ const { SpecReporter } = require('jasmine-spec-reporter');
var SpecReporter = require('jasmine-spec-reporter');
exports.config = { exports.config = {
allScriptsTimeout: 11000, allScriptsTimeout: 11000,
...@@ -20,13 +19,12 @@ exports.config = { ...@@ -20,13 +19,12 @@ exports.config = {
defaultTimeoutInterval: 30000, defaultTimeoutInterval: 30000,
print: function() {} print: function() {}
}, },
useAllAngular2AppRoots: true,
beforeLaunch: function() { beforeLaunch: function() {
require('ts-node').register({ require('ts-node').register({
project: 'e2e' project: 'e2e/tsconfig.e2e.json'
}); });
}, },
onPrepare: function() { onPrepare() {
jasmine.getEnv().addReporter(new SpecReporter()); jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
} }
}; };
/* tslint:disable:no-unused-variable */
import { TestBed, async } from '@angular/core/testing'; import { TestBed, async } from '@angular/core/testing';
import { AppComponent } from './app.component'; import { AppComponent } from './app.component';
describe('AppComponent', () => { describe('AppComponent', () => {
beforeEach(() => { beforeEach(async(() => {
TestBed.configureTestingModule({ TestBed.configureTestingModule({
declarations: [ declarations: [
AppComponent AppComponent
], ],
}); }).compileComponents();
TestBed.compileComponents(); }));
});
it('should create the app', async(() => { it('should create the app', async(() => {
const fixture = TestBed.createComponent(AppComponent); const fixture = TestBed.createComponent(AppComponent);
......
...@@ -14,13 +14,15 @@ body { ...@@ -14,13 +14,15 @@ body {
background-color: #fff; background-color: #fff;
border: 1px solid rgba(0, 0, 0, 0.1); border: 1px solid rgba(0, 0, 0, 0.1);
} }
.form-signin .form-signin-heading,
.form-signin .checkbox { .form-signin .form-signin-heading, .form-signin .checkbox {
margin-bottom: 30px; margin-bottom: 30px;
} }
.form-signin .checkbox { .form-signin .checkbox {
font-weight: normal; font-weight: normal;
} }
.form-signin .form-control { .form-signin .form-control {
position: relative; position: relative;
font-size: 16px; font-size: 16px;
...@@ -30,17 +32,19 @@ body { ...@@ -30,17 +32,19 @@ body {
-moz-box-sizing: border-box; -moz-box-sizing: border-box;
box-sizing: border-box; box-sizing: border-box;
} }
.form-signin .form-control:focus { .form-signin .form-control:focus {
z-index: 2; z-index: 2;
} }
.form-signin input[type="text"] { .form-signin input[type="text"] {
margin-bottom: -1px; margin-bottom: -1px;
border-bottom-left-radius: 0; border-bottom-left-radius: 0;
border-bottom-right-radius: 0; border-bottom-right-radius: 0;
} }
.form-signin input[type="confirm"] { .form-signin input[type="confirm"] {
margin-bottom: 20px; margin-bottom: 20px;
border-top-left-radius: 0; border-top-left-radius: 0;
border-top-right-radius: 0; border-top-right-radius: 0;
} }
\ No newline at end of file
/* tslint:disable:no-unused-variable */
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { DebugElement } from '@angular/core';
import { SignupPageComponent } from './signup-page.component'; import { SignupPageComponent } from './signup-page.component';
......
// The file contents for the current environment will overwrite these during build. // The file contents for the current environment will overwrite these during build.
// The build system defaults to the dev environment which uses `environment.ts`, but if you do // The build system defaults to the dev environment which uses `environment.ts`, but if you do
// `ng build --env=prod` then `environment.prod.ts` will be used instead. // `ng build --env=prod` then `environment.prod.ts` will be used instead.
// The list of which env maps to which file can be found in `angular-cli.json`. // The list of which env maps to which file can be found in `.angular-cli.json`.
export const environment = { export const environment = {
production: false production: false
......
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { enableProdMode } from '@angular/core'; import { enableProdMode } from '@angular/core';
import { environment } from './environments/environment'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module'; import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) { if (environment.production) {
enableProdMode(); enableProdMode();
......
// This file includes polyfills needed by Angular and is loaded before the app. /**
// You can add your own extra polyfills to this file. * This file includes polyfills needed by Angular and is loaded before the app.
import 'core-js/es6/symbol'; * You can add your own extra polyfills to this file.
import 'core-js/es6/object'; *
import 'core-js/es6/function'; * This file is divided into 2 sections:
import 'core-js/es6/parse-int'; * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
import 'core-js/es6/parse-float'; * 2. Application imports. Files imported after ZoneJS that should be loaded before your main
import 'core-js/es6/number'; * file.
import 'core-js/es6/math'; *
import 'core-js/es6/string'; * The current setup is for so-called "evergreen" browsers; the last versions of browsers that
import 'core-js/es6/date'; * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
import 'core-js/es6/array'; * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
import 'core-js/es6/regexp'; *
import 'core-js/es6/map'; * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html
import 'core-js/es6/set'; */
import 'core-js/es6/reflect';
/***************************************************************************************************
* BROWSER POLYFILLS
*/
/** IE9, IE10 and IE11 requires all of the following polyfills. **/
// import 'core-js/es6/symbol';
// import 'core-js/es6/object';
// import 'core-js/es6/function';
// import 'core-js/es6/parse-int';
// import 'core-js/es6/parse-float';
// import 'core-js/es6/number';
// import 'core-js/es6/math';
// import 'core-js/es6/string';
// import 'core-js/es6/date';
// import 'core-js/es6/array';
// import 'core-js/es6/regexp';
// import 'core-js/es6/map';
// import 'core-js/es6/set';
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
// import 'classlist.js'; // Run `npm install --save classlist.js`.
/** IE10 and IE11 requires the following to support `@angular/animation`. */
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
/** Evergreen browsers require these. **/
import 'core-js/es6/reflect';
import 'core-js/es7/reflect'; import 'core-js/es7/reflect';
import 'zone.js/dist/zone';
// If you need to support the browsers/features below, uncomment the import
// and run `npm install import-name-here';
// Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html
// Needed for: IE9 /** ALL Firefox browsers require the following to support `@angular/animation`. **/
// import 'classlist.js'; // import 'web-animations-js'; // Run `npm install --save web-animations-js`.
/***************************************************************************************************
* Zone JS is required by Angular itself.
*/
import 'zone.js/dist/zone'; // Included with Angular CLI.
// Animations
// Needed for: All but Chrome and Firefox, Not supported in IE9
// import 'web-animations-js';
// Date, currency, decimal and percent pipes /***************************************************************************************************
// Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10 * APPLICATION IMPORTS
// import 'intl'; */
// NgClass on SVG elements /**
// Needed for: IE10, IE11 * Date, currency, decimal and percent pipes.
// import 'classlist.js'; * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10
*/
// import 'intl'; // Run `npm install --save intl`.
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"module": "es2015",
"baseUrl": "",
"types": []
},
"exclude": [
"test.ts",
"**/*.spec.ts"
]
}
{
"compilerOptions": {
"baseUrl": "",
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": ["es6", "dom"],
"mapRoot": "./",
"module": "es6",
"moduleResolution": "node",
"outDir": "../dist/out-tsc",
"sourceMap": true,
"target": "es5",
"typeRoots": [
"../node_modules/@types"
]
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment