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

@ -28,6 +28,9 @@
"src/assets" "src/assets"
], ],
"styles": [ "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" "src/styles.scss"
], ],
"scripts": [ "scripts": [
@ -128,6 +131,7 @@
} }
} }
} }
}}, }
},
"defaultProject": "framadate" "defaultProject": "framadate"
} }

View File

@ -13,7 +13,8 @@
}, },
"private": true, "private": true,
"dependencies": { "dependencies": {
"@angular/animations": "~8.2.0", "@angular/animations": "^8.2.14",
"@angular/cdk": "^8.2.3",
"@angular/common": "~8.2.0", "@angular/common": "~8.2.0",
"@angular/compiler": "~8.2.0", "@angular/compiler": "~8.2.0",
"@angular/core": "~8.2.0", "@angular/core": "~8.2.0",
@ -21,11 +22,15 @@
"@angular/platform-browser": "~8.2.0", "@angular/platform-browser": "~8.2.0",
"@angular/platform-browser-dynamic": "~8.2.0", "@angular/platform-browser-dynamic": "~8.2.0",
"@angular/router": "~8.2.0", "@angular/router": "~8.2.0",
"@fullcalendar/core": "^4.3.1",
"@ngx-translate/core": "^11.0.1", "@ngx-translate/core": "^11.0.1",
"@ngx-translate/http-loader": "^4.0.0", "@ngx-translate/http-loader": "^4.0.0",
"chart.js": "^2.8.0", "chart.js": "^2.8.0",
"ngx-markdown": "^8.2.1", "ngx-markdown": "^8.2.1",
"ngx-toaster": "^1.0.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": "~6.4.0",
"rxjs-compat": "^6.5.3", "rxjs-compat": "^6.5.3",
"tslib": "^1.10.0", "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 {BrowserAnimationsModule} from "@angular/platform-browser/animations";
import {ConfigService} from "./services/config.service"; import {ConfigService} from "./services/config.service";
import {PollService} from "./services/poll.service"; import {PollService} from "./services/poll.service";
import {ToastModule} from 'primeng/toast';
import {MessageService} from "primeng";
export class MyMissingTranslationHandler implements MissingTranslationHandler { export class MyMissingTranslationHandler implements MissingTranslationHandler {
handle(params: MissingTranslationHandlerParams) { handle(params: MissingTranslationHandlerParams) {
@ -88,6 +90,7 @@ export function HttpLoaderFactory(http: HttpClient) {
BrowserModule, BrowserModule,
BrowserAnimationsModule, BrowserAnimationsModule,
AppRoutingModule, AppRoutingModule,
ToastModule,
MarkdownModule.forRoot(), MarkdownModule.forRoot(),
TranslateModule.forRoot({ TranslateModule.forRoot({
missingTranslationHandler: { missingTranslationHandler: {
@ -105,7 +108,7 @@ export function HttpLoaderFactory(http: HttpClient) {
FormsModule, FormsModule,
RouterModule.forRoot(Routes) RouterModule.forRoot(Routes)
], ],
providers: [TranslateService, ConfigService, PollService], providers: [TranslateService, ConfigService, PollService, MessageService],
bootstrap: [AppComponent] bootstrap: [AppComponent]
}) })
export class AppModule { export class AppModule {

View File

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

View File

@ -2,7 +2,7 @@ import {Injectable} from '@angular/core';
import {PollConfig} from '../config/PollConfig'; import {PollConfig} from '../config/PollConfig';
import {HttpClient, HttpHeaders, HttpParams} from "@angular/common/http"; import {HttpClient, HttpHeaders, HttpParams} from "@angular/common/http";
import {environment} from "../../environments/environment"; 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 * 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 myPolls: any;// list of retrieved polls from the backend api
constructor(public http: HttpClient) { constructor(public http: HttpClient,
private messageService: MessageService) {
super(); super();
} }
@ -108,6 +109,7 @@ export class ConfigService extends PollConfig {
// TODO handle a toast message // TODO handle a toast message
console.error('err', err) console.error('err', err)
this.loading = false; this.loading = false;
this.messageService.add({severity: 'success', summary: 'Service Message', detail: 'Via MessageService'});
} }

View File

@ -1,4 +1,4 @@
export const environment = { export const environment = {
production: true, 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