Merge branch 'thierry' of ssh://git.marbelium.com:10023/Viiciouss/XJC into anis

thierry
Viiciouss 7 years ago
commit 6e5031ad4e

@ -1,57 +1,59 @@
{
"name": "quickstart-angular2",
"version": "4.2.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@agm/core": "^1.0.0-beta.0",
"@angular/animations": "^4.0.0",
"@angular/common": "^4.0.0",
"@angular/compiler": "^4.0.0",
"@angular/core": "^4.0.0",
"@angular/forms": "^4.0.0",
"@angular/http": "^4.0.0",
"@angular/platform-browser": "^4.0.0",
"@angular/platform-browser-dynamic": "^4.0.0",
"@angular/router": "^4.0.0",
"angular-bootstrap-md": "*",
"angularfire2": "^4.0.0-rc.1",
"chart.js": "2.5.0",
"classlist.js": "^1.1.20150312",
"core-js": "^2.4.1",
"easy-pie-chart": "^2.1.7",
"firebase": "^4.2.0",
"font-awesome": "^4.7.0",
"hammerjs": "^2.0.8",
"rxjs": "^5.1.0",
"screenfull": "^3.2.0",
"web-animations-js": "^2.2.5",
"zone.js": "^0.8.4"
},
"devDependencies": {
"@angular/cli": "1.0.0",
"@angular/compiler-cli": "^4.0.0",
"@types/jasmine": "2.5.38",
"@types/node": "~6.0.60",
"codelyzer": "~2.0.0",
"jasmine-core": "~2.5.2",
"jasmine-spec-reporter": "~3.2.0",
"karma": "~1.4.1",
"karma-chrome-launcher": "~2.0.0",
"karma-cli": "~1.0.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"karma-coverage-istanbul-reporter": "^0.2.0",
"protractor": "~5.1.0",
"ts-node": "~2.0.0",
"tslint": "~4.5.0",
"typescript": "~2.2.0"
}
}
{
"name": "quickstart-angular2",
"version": "4.2.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@agm/core": "^1.0.0-beta.0",
"@angular/animations": "^4.0.0",
"@angular/common": "^4.0.0",
"@angular/compiler": "^4.0.0",
"@angular/core": "^4.0.0",
"@angular/forms": "^4.0.0",
"@angular/http": "^4.0.0",
"@angular/platform-browser": "^4.0.0",
"@angular/platform-browser-dynamic": "^4.0.0",
"@angular/router": "^4.0.0",
"angular-bootstrap-md": "*",
"angularfire2": "^4.0.0-rc.1",
"chart.js": "2.5.0",
"classlist.js": "^1.1.20150312",
"core-js": "^2.4.1",
"easy-pie-chart": "^2.1.7",
"firebase": "^4.2.0",
"firebase-functions": "^0.6.3",
"font-awesome": "^4.7.0",
"hammerjs": "^2.0.8",
"nodemailer": "^4.1.0",
"rxjs": "^5.1.0",
"screenfull": "^3.2.0",
"web-animations-js": "^2.2.5",
"zone.js": "^0.8.4"
},
"devDependencies": {
"@angular/cli": "1.0.0",
"@angular/compiler-cli": "^4.0.0",
"@types/jasmine": "2.5.38",
"@types/node": "~6.0.60",
"codelyzer": "~2.0.0",
"jasmine-core": "~2.5.2",
"jasmine-spec-reporter": "~3.2.0",
"karma": "~1.4.1",
"karma-chrome-launcher": "~2.0.0",
"karma-cli": "~1.0.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"karma-coverage-istanbul-reporter": "^0.2.0",
"protractor": "~5.1.0",
"ts-node": "~2.0.0",
"tslint": "~4.5.0",
"typescript": "~2.2.0"
}
}

@ -76,6 +76,7 @@
<!-- Si cest un parrain existant -->
<div *ngIf="radioParrain === 'ParrainExist'">
<p>{{parSelect}}</p>
<!--
<div class="dropdown" dropdown>
<button dropdownToggle type="button" class="btn btn-primary dropdown-toggle waves-light" mdbRippleRadius>
Parrains Existants
@ -86,6 +87,18 @@
<a class="dropdown-item" *ngFor="let par of parrainExistList | async" (click)="getIdParrain(par.uid)">{{par.firstname}} {{par.familyname}}</a>
</div>
</div>
-->
<input
#query
(keyup)="filter(query.value)"
type="text" class="form-control" placeholder="Cherchez Parrains Existants...">
<div *ngFor="let parrain of filteredParrainsTest">
<a (click)="getIdParrain(parrain.uid)">{{parrain.firstname}} {{parrain.familyname}}</a>
<p>
{{parrain?.status}}
</p>
</div>
<div class="md-form" style="padding-top:2%;">
<i class="fa fa-birthday-cake prefix grey-text"></i>

@ -16,7 +16,8 @@ import { OperationCommerciale } from '../../../../models/OperationCommerciale';
import { CarteParrainage } from '../../../../models/CarteParrainage';
import { OpCommercialService } from '../../../services/opCommercial/op-commercial.service';
import { Subject } from 'rxjs/Subject';
import { Subscription } from 'rxjs/Subscription';
import {forEach} from '@angular/router/src/utils/collection';
import { AuthService } from '../../../services/auth/auth.service';
@ -47,6 +48,14 @@ export class EnvoyerCarteComponent implements OnInit, OnDestroy {
parrainAffListTemp = [];
databaseRef: any;
/////
parrainsTest: Parrain[];
filteredParrainsTest: any[];
subscription: Subscription;
//startAt = new Subject();
//endAt = new Subject();
/////
constructor(public afAuth: AngularFireAuth, public afDb: AngularFireDatabase,
private router: Router, private authService: AuthService,
private opComService: OpCommercialService, private route: ActivatedRoute) {
@ -148,6 +157,16 @@ export class EnvoyerCarteComponent implements OnInit, OnDestroy {
}
);
}
//////
filter(query: string) {
this.filteredParrainsTest = (query) ?
this.parrainsTest.filter(p => (p.firstname.toLowerCase() + p.familyname.toLowerCase()).includes(query.toLowerCase())) :
[];
}
//////
registerNewParrain() {
this.parrain.status = 'Parrain';
@ -221,11 +240,15 @@ export class EnvoyerCarteComponent implements OnInit, OnDestroy {
this.opComService.creerCartePar(this.cartePar);
}
//////
ngOnInit() {
this.subscription = this.opComService.getParrains()
.subscribe(parrains => this.parrainsTest = parrains);
}
//////
ngOnDestroy() {
this.subscription.unsubscribe();
this.radioParrain = '';
this.cartePar = {
uid: '',

@ -32,6 +32,7 @@ export class ProfilComponent implements OnInit, OnDestroy {
profileData: FirebaseListObservable<any[]>;
imageProfil: string;
constructor(public afAuth: AngularFireAuth, public afDb: AngularFireDatabase,
private router: Router, private authService: AuthService) {
this.localUser = new User();

@ -23,6 +23,7 @@ export class RegisterComponent implements OnInit, OnDestroy {
ConfirmPasswordCommercant: String;
test: boolean;
constructor(private router: Router, private authService: AuthService) {
this.currentUser = new User();
this.parrain = new Parrain();

@ -6,6 +6,8 @@ import { HttpModule, Headers } from '@angular/http';
import { Observable } from 'rxjs/Observable';
import * as firebase from 'firebase/app';
// import * as functions from 'firebase-functions';
// import * as functions from 'firebase/functions';
import { AngularFireAuth } from 'angularfire2/auth';
import { AngularFireDatabase, FirebaseListObservable } from 'angularfire2/database';
@ -14,9 +16,13 @@ import { Parrain } from '../../../models/Parrain';
import { Image } from '../../../models/Image';
import { Commercant } from '../../../models/Commercant';
//import * as NodeMailer from 'nodemailer/lib/nodemailer';
@Injectable()
export class AuthService {
//nodemailer: NodeMailer;
databaseRef: any;
storageRef: any;
changeRequest: any;
@ -24,12 +30,14 @@ export class AuthService {
parrain: Parrain;
commercant: Commercant;
test: string;
uti: firebase.User;
@Input() folder: string;
//fileList: FirebaseListObservable<Image[]>;
constructor(private http: HttpModule, public afAuth: AngularFireAuth, public afDb: AngularFireDatabase, public router: Router) {
this.databaseRef = firebase.database().ref();
//var nodemailer = require('nodemailer');
}
saveInfo(user: firebase.User, infoUser: any) {
@ -54,13 +62,18 @@ export class AuthService {
signIn(email: string, password: string) {
firebase.auth().signInWithEmailAndPassword(email, password).then(user => {
if (user) {
console.log('salut le ' + user.displayName + ' ' + user.email + ' has signed!');
if (user.displayName === 'Parrain') {
this.router.navigate(['/carteParrainageComponent']);
}
else if (user.displayName === 'Commercant') {
this.router.navigate(['/opCommercial']);
if (user.emailVerified){
console.log('salut le ' + user.displayName + ' ' + user.email + ' has signed!');
if (user.displayName === 'Parrain') {
this.router.navigate(['/carteParrainageComponent']);
}
else if (user.displayName === 'Commercant') {
this.router.navigate(['/opCommercial']);
}
}else{
console.log('email non verifié!!');
}
}else {
console.log('error!!');
}
@ -86,10 +99,19 @@ export class AuthService {
signUp(infoUser: any) {
firebase.auth().createUserWithEmailAndPassword(infoUser.email, infoUser.password).then(userCreate => {
userCreate.sendEmailVerification().then(res => {
console.log('res : ');
});
this.sendEmail();
this.setUserInfo(userCreate, infoUser);
});
}
sendEmail() {
}
logout() {
firebase.auth().signOut();
}

@ -38,6 +38,15 @@ export class OpCommercialService {
this.storageRef = firebase.storage().ref();
}
getParrains(): FirebaseListObservable<any> {
return this.afDb.list('/Parrain/', {
query: {
orderByChild: 'uid'
}
}
);
}
creerCartePar(infoCartePar: CarteParrainage) {
console.log('ba');
infoCartePar.uid = firebase.database().ref().child('CarteParrainage').push().key;

@ -0,0 +1,25 @@
var nodemailer = require('nodemailer');
var transporter = nodemailer.createTransport({
service: 'gmail',
auth: {
user: 'youremail@gmail.com',
pass: 'yourpassword'
}
});
var mailOptions = {
from: 'youremail@gmail.com',
to: 'myfriend@yahoo.com',
subject: 'Sending Email using Node.js',
text: 'That was easy!'
};
transporter.sendMail(mailOptions, function(error, info){
if (error) {
console.log(error);
} else {
console.log('Email sent: ' + info.response);
}
});
Loading…
Cancel
Save