update dependencies with yarn, add primefaces to make toasts

This commit is contained in:
Baptiste Lemoine 2020-01-15 11:59:02 +01:00
parent cf4e9f4563
commit ded5e71e73
7 changed files with 769 additions and 773 deletions

View File

@ -1,133 +1,137 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"framadate": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"style": "scss"
}
},
"root": "",
"sourceRoot": "src",
"prefix": "framadate",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/framadate",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"aot": false,
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.scss"
],
"scripts": [
"node_modules/marked/lib/marked.js",
"node_modules/prismjs/prism.js",
"node_modules/prismjs/components/prism-css.min.js"
]
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"framadate": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"style": "scss"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
"root": "",
"sourceRoot": "src",
"prefix": "framadate",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/framadate",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"aot": false,
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"node_modules/primeicons/primeicons.css",
"node_modules/primeng/resources/themes/nova-light/theme.css",
"node_modules/primeng/resources/primeng.min.css",
"src/styles.scss"
],
"scripts": [
"node_modules/marked/lib/marked.js",
"node_modules/prismjs/prism.js",
"node_modules/prismjs/components/prism-css.min.js"
]
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "10kb"
}
]
}
}
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "10kb"
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "framadate:build"
},
"configurations": {
"production": {
"browserTarget": "framadate:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "framadate:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.scss"
],
"scripts": []
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"tsconfig.app.json",
"tsconfig.spec.json",
"e2e/tsconfig.json"
],
"exclude": [
"**/node_modules/**"
]
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "framadate:serve"
},
"configurations": {
"production": {
"devServerTarget": "framadate:serve:production"
}
}
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "framadate:build"
},
"configurations": {
"production": {
"browserTarget": "framadate:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "framadate:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.scss"
],
"scripts": []
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"tsconfig.app.json",
"tsconfig.spec.json",
"e2e/tsconfig.json"
],
"exclude": [
"**/node_modules/**"
]
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "framadate:serve"
},
"configurations": {
"production": {
"devServerTarget": "framadate:serve:production"
}
}
}
}
}},
"defaultProject": "framadate"
},
"defaultProject": "framadate"
}

View File

@ -13,7 +13,8 @@
},
"private": true,
"dependencies": {
"@angular/animations": "~8.2.0",
"@angular/animations": "^8.2.14",
"@angular/cdk": "^8.2.3",
"@angular/common": "~8.2.0",
"@angular/compiler": "~8.2.0",
"@angular/core": "~8.2.0",
@ -21,11 +22,15 @@
"@angular/platform-browser": "~8.2.0",
"@angular/platform-browser-dynamic": "~8.2.0",
"@angular/router": "~8.2.0",
"@fullcalendar/core": "^4.3.1",
"@ngx-translate/core": "^11.0.1",
"@ngx-translate/http-loader": "^4.0.0",
"chart.js": "^2.8.0",
"ngx-markdown": "^8.2.1",
"ngx-toaster": "^1.0.1",
"primeicons": "^2.0.0",
"primeng": "^9.0.0-rc.2",
"quill": "^1.3.7",
"rxjs": "~6.4.0",
"rxjs-compat": "^6.5.3",
"tslib": "^1.10.0",

View File

@ -43,6 +43,8 @@ import {SelectorComponent} from './ui/selector/selector.component';
import {BrowserAnimationsModule} from "@angular/platform-browser/animations";
import {ConfigService} from "./services/config.service";
import {PollService} from "./services/poll.service";
import {ToastModule} from 'primeng/toast';
import {MessageService} from "primeng";
export class MyMissingTranslationHandler implements MissingTranslationHandler {
handle(params: MissingTranslationHandlerParams) {
@ -88,6 +90,7 @@ export function HttpLoaderFactory(http: HttpClient) {
BrowserModule,
BrowserAnimationsModule,
AppRoutingModule,
ToastModule,
MarkdownModule.forRoot(),
TranslateModule.forRoot({
missingTranslationHandler: {
@ -105,7 +108,7 @@ export function HttpLoaderFactory(http: HttpClient) {
FormsModule,
RouterModule.forRoot(Routes)
],
providers: [TranslateService, ConfigService, PollService],
providers: [TranslateService, ConfigService, PollService, MessageService],
bootstrap: [AppComponent]
})
export class AppModule {

View File

@ -30,7 +30,7 @@
{{"config.find_my_polls"|translate}}
</h1>
<form
(ngSubmit)="findMyPollsByEmail(emailToFind.value)"
(ngSubmit)="findMyPollsByEmail(config.myEmail)"
>
<label
class="description"
@ -40,17 +40,19 @@
{{"config.find_helper"|translate}} :
</label>
<input
#emailToFind
type="email"
name="mail"
id="email"
autofocus="autofocus"
[(ngModel)]="config.myEmail"
required="required"
/>
<input
type="submit"
class="btn btn-block"
[ngClass]="{'btn-primary': config.myEmail}"
i18n-value="'config.find_button'|translate"
[disabled]="!emailToFind.value"
[disabled]="!config.myEmail"
/>
</form>
</section>

View File

@ -2,7 +2,7 @@ import {Injectable} from '@angular/core';
import {PollConfig} from '../config/PollConfig';
import {HttpClient, HttpHeaders, HttpParams} from "@angular/common/http";
import {environment} from "../../environments/environment";
import {MessageService} from 'primeng/api';
/**
* le service transverse à chaque page qui permet de syncroniser la configuration de sondage souhaitée
@ -17,7 +17,8 @@ export class ConfigService extends PollConfig {
myPolls: any;// list of retrieved polls from the backend api
constructor(public http: HttpClient) {
constructor(public http: HttpClient,
private messageService: MessageService) {
super();
}
@ -108,6 +109,7 @@ export class ConfigService extends PollConfig {
// TODO handle a toast message
console.error('err', err)
this.loading = false;
this.messageService.add({severity: 'success', summary: 'Service Message', detail: 'Via MessageService'});
}

View File

@ -1,4 +1,4 @@
export const environment = {
production: true,
baseApiHref: 'http://127.0.0.1:8000/api/v1/'
baseApiHref: 'https://framadate-api.cipherbliss.com/api/v1'
};

1258
yarn.lock

File diff suppressed because it is too large Load Diff