Skip to content

Local ado #146

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 45 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
ad7887b
Ajout composants
AdonisVienet Feb 21, 2023
e9843e2
Merge pull request #1 from AdonisVienet/localAdonis
AdonisVienet Feb 21, 2023
6f401ce
ajout services
Feb 21, 2023
8b31416
ajout des models
BaptisteMchlt Feb 21, 2023
8a1f6f5
Merge pull request #2 from AdonisVienet/localRama
AdonisVienet Feb 21, 2023
35b7c49
Merge pull request #3 from AdonisVienet/localBapt
AdonisVienet Feb 21, 2023
ddbde1c
finition des modeles/services/components
BaptisteMchlt Feb 21, 2023
8690870
Merge pull request #4 from AdonisVienet/localBapt
AdonisVienet Feb 21, 2023
0e1f1e5
premier essai des pages web
BaptisteMchlt Feb 22, 2023
1bea99c
Merge pull request #6 from AdonisVienet/localBapt
AdonisVienet Feb 22, 2023
b5bc227
login ok
Feb 22, 2023
a1e2ccb
Merge https://github.com/AdonisVienet/agenceImmoFront into localRama
Feb 22, 2023
cf01e06
Merge pull request #7 from AdonisVienet/localRama2
AdonisVienet Feb 22, 2023
045d0f8
page d'accueil 1er jet
BaptisteMchlt Feb 23, 2023
67fb214
Merge pull request #8 from AdonisVienet/localBapt
AdonisVienet Feb 23, 2023
9ee94a3
push page d'accueil chocolate
BaptisteMchlt Feb 23, 2023
65d99b9
Merge pull request #10 from AdonisVienet/localBapt
AdonisVienet Feb 23, 2023
cd43913
c'est la fin du login
BaptisteMchlt Feb 23, 2023
9396cca
Merge pull request #11 from AdonisVienet/localBapt
AdonisVienet Feb 23, 2023
c9fc082
Hello Adonis
BaptisteMchlt Feb 23, 2023
feea12a
Merge pull request #12 from AdonisVienet/localBapt
AdonisVienet Feb 23, 2023
0ca6e98
pas ouf comme commit
BaptisteMchlt Feb 23, 2023
b294097
Profil utilisateur
AdonisVienet Feb 23, 2023
48cd4c4
Merge pull request #13 from AdonisVienet/localAdo
AdonisVienet Feb 23, 2023
49080ca
normalement la liste d'utilisateur fonctionne
BaptisteMchlt Feb 24, 2023
0c7ec4d
liste utilisateur fonctionne
BaptisteMchlt Feb 24, 2023
38a0754
Merge branch 'master' into localBapt
AdonisVienet Feb 24, 2023
c414c1b
Merge pull request #14 from AdonisVienet/localBapt
AdonisVienet Feb 24, 2023
c9d8ce7
Ajout list offre (sans image)
AdonisVienet Feb 24, 2023
8138831
Merge pull request #15 from AdonisVienet/localAdo
AdonisVienet Feb 24, 2023
298c7a5
le formulaire d'ajout is terminado
BaptisteMchlt Feb 24, 2023
1108a6a
Merge branch 'master' of https://github.com/AdonisVienet/agenceImmoFr…
BaptisteMchlt Feb 24, 2023
9539581
Merge pull request #16 from AdonisVienet/localBapt
AdonisVienet Feb 24, 2023
964cf02
formulaire okkk
Feb 24, 2023
181e72e
formu okk
Feb 24, 2023
062cf9a
l'onglet contact est fait
BaptisteMchlt Feb 24, 2023
b61cddf
Merge pull request #18 from AdonisVienet/localBapt
AdonisVienet Feb 24, 2023
66916e5
formu okk
Feb 24, 2023
de5c356
Merge branch 'master' of https://github.com/AdonisVienet/agenceImmoFr…
Feb 26, 2023
4c9b323
Recherche avancée
Feb 27, 2023
a9868ba
liste des offres et espace perso fonctionnel
AdonisVienet Feb 27, 2023
885690c
Merge pull request #19 from AdonisVienet/localAdo
AdonisVienet Feb 27, 2023
90d8760
Merge branch 'master' into localRama2
Feb 27, 2023
2220ac6
Merge pull request #20 from AdonisVienet/localRama2
AdonisVienet Feb 27, 2023
c078695
profil utilisateur fini
AdonisVienet Feb 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions src/app/app.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,42 @@ import { Router } from '@angular/router';
})
export class AppService {
// Authentification
authenticated=false;
authenticated = false;
responseAll: any;
// Autorisation :
isAdmin = false;
isGerant = false;
isClient = false;
constructor(private httpClient:HttpClient, private router:Router) { }
// Step 1
idUser: any;
constructor(private httpClient: HttpClient, private router: Router) { }

authenticate(credentials:any,callback:any){
authenticate(credentials: any, callback: any) {
const headersAgency = new HttpHeaders(
credentials ? {
authorization : 'Basic ' + btoa(credentials.username+ ':' +credentials.password)
authorization: 'Basic ' + btoa(credentials.username + ':' + credentials.password)
} : {}
);
this.httpClient.get('http://localhost:8080/login/user',{headers:headersAgency}).subscribe(response => {
this.httpClient.get('http://localhost:8080/login/user', { headers: headersAgency }).subscribe(response => {
this.responseAll = response; // objet = utilisateur
console.log("responseAll="+this.responseAll);
if(this.responseAll['username']){
console.log("responseAll=" + this.responseAll);
// Step 2
this.idUser = this.responseAll['idUtilisateur'];
if (this.responseAll['username']) {
this.authenticated = true;
// vérification des profils :
for(let i=0;i<this.responseAll['roles'].length;i++){
if(this.responseAll['roles'][i]['idRole']==1){
for (let i = 0; i < this.responseAll['roles'].length; i++) {
if (this.responseAll['roles'][i]['idRole'] == 1) {
this.isAdmin = true;
}
if(this.responseAll['roles'][i]['idRole']==2){
if (this.responseAll['roles'][i]['idRole'] == 2) {
this.isGerant = true;
}
if(this.responseAll['roles'][i]['idRole']==3){
if (this.responseAll['roles'][i]['idRole'] == 3) {
this.isClient = true;
}
}
}else{
} else {
this.authenticated = false;
}
return callback && callback();
Expand Down
1 change: 1 addition & 0 deletions src/app/dashboard/dashboard.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

<br>
<br>
<h1>Hello {{user.prenomUtilisateur}}</h1>
<br>
<br>
<div style="position: relative; left: 10px; background-color: white; border-color: black; border-width: thick;">
Expand Down
274 changes: 144 additions & 130 deletions src/app/dashboard/dashboard.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { Component, OnInit } from '@angular/core';
import { AppService } from 'app/app.service';
import { Utilisateur } from 'app/model/utilisateur';
import { UtilisateurService } from 'app/services/utilisateur.service';
import * as Chartist from 'chartist';

@Component({
Expand All @@ -7,144 +10,155 @@ import * as Chartist from 'chartist';
styleUrls: ['./dashboard.component.css']
})
export class DashboardComponent implements OnInit {

constructor() { }
startAnimationForLineChart(chart){
let seq: any, delays: any, durations: any;
seq = 0;
delays = 80;
durations = 500;

chart.on('draw', function(data) {
if(data.type === 'line' || data.type === 'area') {
data.element.animate({
d: {
begin: 600,
dur: 700,
from: data.path.clone().scale(1, 0).translate(0, data.chartRect.height()).stringify(),
to: data.path.clone().stringify(),
easing: Chartist.Svg.Easing.easeOutQuint
}
});
} else if(data.type === 'point') {
seq++;
data.element.animate({
opacity: {
begin: seq * delays,
dur: durations,
from: 0,
to: 1,
easing: 'ease'
}
});
// Step 3
idUser: any;
user: Utilisateur = new Utilisateur();
// Step 4
constructor(private utilisateurService: UtilisateurService, private appService: AppService) { }
startAnimationForLineChart(chart) {
let seq: any, delays: any, durations: any;
seq = 0;
delays = 80;
durations = 500;

chart.on('draw', function (data) {
if (data.type === 'line' || data.type === 'area') {
data.element.animate({
d: {
begin: 600,
dur: 700,
from: data.path.clone().scale(1, 0).translate(0, data.chartRect.height()).stringify(),
to: data.path.clone().stringify(),
easing: Chartist.Svg.Easing.easeOutQuint
}
});
} else if (data.type === 'point') {
seq++;
data.element.animate({
opacity: {
begin: seq * delays,
dur: durations,
from: 0,
to: 1,
easing: 'ease'
}
});
});
}
});

seq = 0;
seq = 0;
};
startAnimationForBarChart(chart){
let seq2: any, delays2: any, durations2: any;

seq2 = 0;
delays2 = 80;
durations2 = 500;
chart.on('draw', function(data) {
if(data.type === 'bar'){
seq2++;
data.element.animate({
opacity: {
begin: seq2 * delays2,
dur: durations2,
from: 0,
to: 1,
easing: 'ease'
}
});
}
});
startAnimationForBarChart(chart) {
let seq2: any, delays2: any, durations2: any;

seq2 = 0;
delays2 = 80;
durations2 = 500;
chart.on('draw', function (data) {
if (data.type === 'bar') {
seq2++;
data.element.animate({
opacity: {
begin: seq2 * delays2,
dur: durations2,
from: 0,
to: 1,
easing: 'ease'
}
});
}
});

seq2 = 0;
seq2 = 0;
};
// Step 5
findOne(id: number) {
this.utilisateurService.findOne(id).subscribe(data => { this.user = data; });
}
ngOnInit() {
/* ----------========== Daily Sales Chart initialization For Documentation ==========---------- */

const dataDailySalesChart: any = {
labels: ['M', 'T', 'W', 'T', 'F', 'S', 'S'],
series: [
[12, 17, 7, 17, 23, 18, 38]
]
};

const optionsDailySalesChart: any = {
lineSmooth: Chartist.Interpolation.cardinal({
tension: 0
}),
low: 0,
high: 50, // creative tim: we recommend you to set the high sa the biggest value + something for a better look
chartPadding: { top: 0, right: 0, bottom: 0, left: 0},
}

var dailySalesChart = new Chartist.Line('#dailySalesChart', dataDailySalesChart, optionsDailySalesChart);

this.startAnimationForLineChart(dailySalesChart);


/* ----------========== Completed Tasks Chart initialization ==========---------- */

const dataCompletedTasksChart: any = {
labels: ['12p', '3p', '6p', '9p', '12p', '3a', '6a', '9a'],
series: [
[230, 750, 450, 300, 280, 240, 200, 190]
]
};

const optionsCompletedTasksChart: any = {
lineSmooth: Chartist.Interpolation.cardinal({
tension: 0
}),
low: 0,
high: 1000, // creative tim: we recommend you to set the high sa the biggest value + something for a better look
chartPadding: { top: 0, right: 0, bottom: 0, left: 0}
}

var completedTasksChart = new Chartist.Line('#completedTasksChart', dataCompletedTasksChart, optionsCompletedTasksChart);

// start animation for the Completed Tasks Chart - Line Chart
this.startAnimationForLineChart(completedTasksChart);



/* ----------========== Emails Subscription Chart initialization ==========---------- */

var datawebsiteViewsChart = {
labels: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
series: [
[542, 443, 320, 780, 553, 453, 326, 434, 568, 610, 756, 895]

]
};
var optionswebsiteViewsChart = {
axisX: {
showGrid: false
},
low: 0,
high: 1000,
chartPadding: { top: 0, right: 5, bottom: 0, left: 0}
};
var responsiveOptions: any[] = [
['screen and (max-width: 640px)', {
seriesBarDistance: 5,
axisX: {
labelInterpolationFnc: function (value) {
return value[0];
}
// Step 6
this.idUser = this.appService.idUser;
console.log("user profile " + this.idUser);
this.findOne(this.idUser);
/* ----------========== Daily Sales Chart initialization For Documentation ==========---------- */

const dataDailySalesChart: any = {
labels: ['M', 'T', 'W', 'T', 'F', 'S', 'S'],
series: [
[12, 17, 7, 17, 23, 18, 38]
]
};

const optionsDailySalesChart: any = {
lineSmooth: Chartist.Interpolation.cardinal({
tension: 0
}),
low: 0,
high: 50, // creative tim: we recommend you to set the high sa the biggest value + something for a better look
chartPadding: { top: 0, right: 0, bottom: 0, left: 0 },
}

var dailySalesChart = new Chartist.Line('#dailySalesChart', dataDailySalesChart, optionsDailySalesChart);

this.startAnimationForLineChart(dailySalesChart);


/* ----------========== Completed Tasks Chart initialization ==========---------- */

const dataCompletedTasksChart: any = {
labels: ['12p', '3p', '6p', '9p', '12p', '3a', '6a', '9a'],
series: [
[230, 750, 450, 300, 280, 240, 200, 190]
]
};

const optionsCompletedTasksChart: any = {
lineSmooth: Chartist.Interpolation.cardinal({
tension: 0
}),
low: 0,
high: 1000, // creative tim: we recommend you to set the high sa the biggest value + something for a better look
chartPadding: { top: 0, right: 0, bottom: 0, left: 0 }
}

var completedTasksChart = new Chartist.Line('#completedTasksChart', dataCompletedTasksChart, optionsCompletedTasksChart);

// start animation for the Completed Tasks Chart - Line Chart
this.startAnimationForLineChart(completedTasksChart);



/* ----------========== Emails Subscription Chart initialization ==========---------- */

var datawebsiteViewsChart = {
labels: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
series: [
[542, 443, 320, 780, 553, 453, 326, 434, 568, 610, 756, 895]

]
};
var optionswebsiteViewsChart = {
axisX: {
showGrid: false
},
low: 0,
high: 1000,
chartPadding: { top: 0, right: 5, bottom: 0, left: 0 }
};
var responsiveOptions: any[] = [
['screen and (max-width: 640px)', {
seriesBarDistance: 5,
axisX: {
labelInterpolationFnc: function (value) {
return value[0];
}
}]
];
var websiteViewsChart = new Chartist.Bar('#websiteViewsChart', datawebsiteViewsChart, optionswebsiteViewsChart, responsiveOptions);
}
}]
];
var websiteViewsChart = new Chartist.Bar('#websiteViewsChart', datawebsiteViewsChart, optionswebsiteViewsChart, responsiveOptions);

//start animation for the Emails Subscription Chart
this.startAnimationForBarChart(websiteViewsChart);
//start animation for the Emails Subscription Chart
this.startAnimationForBarChart(websiteViewsChart);
}

}