Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
allo-app
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nabil Sadki
allo-app
Commits
09e2dc6d
Commit
09e2dc6d
authored
Sep 30, 2019
by
Nabil Sadki
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v1.1.4.0' into v1.1.5.0
# Conflicts: # src/app/pages/menu/menu.page.html
parents
a0ad77ff
36dcfd0c
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
30 additions
and
17 deletions
+30
-17
config.xml
config.xml
+1
-0
login.page.ts
src/app/pages/compte/login/login.page.ts
+2
-1
menu.page.html
src/app/pages/menu/menu.page.html
+4
-4
menu.page.ts
src/app/pages/menu/menu.page.ts
+14
-7
offres-carte.page.html
src/app/pages/offres/offres-carte/offres-carte.page.html
+2
-0
offres-carte.page.ts
src/app/pages/offres/offres-carte/offres-carte.page.ts
+2
-0
auth.service.ts
src/app/services/auth.service.ts
+5
-5
No files found.
config.xml
View file @
09e2dc6d
...
@@ -105,4 +105,5 @@
...
@@ -105,4 +105,5 @@
<feature
name=
"StatusBar"
>
<feature
name=
"StatusBar"
>
<param
name=
"ios-package"
onload=
"true"
value=
"CDVStatusBar"
/>
<param
name=
"ios-package"
onload=
"true"
value=
"CDVStatusBar"
/>
</feature>
</feature>
<engine
name=
"android"
spec=
"^8.1.0"
/>
</widget>
</widget>
src/app/pages/compte/login/login.page.ts
View file @
09e2dc6d
...
@@ -65,6 +65,7 @@ export class LoginPage implements OnInit {
...
@@ -65,6 +65,7 @@ export class LoginPage implements OnInit {
}
}
doAnonymousLogIn
()
{
doAnonymousLogIn
()
{
this
.
_AUTH
.
isAnonymous
=
true
;
const
wpUser
=
{
const
wpUser
=
{
token
:
null
,
token
:
null
,
user_nicename
:
'anonymous'
,
user_nicename
:
'anonymous'
,
...
@@ -89,7 +90,7 @@ export class LoginPage implements OnInit {
...
@@ -89,7 +90,7 @@ export class LoginPage implements OnInit {
.
then
(
.
then
(
res
=>
{
res
=>
{
this
.
_ALLO
.
dismissLoading
();
this
.
_ALLO
.
dismissLoading
();
console
.
log
(
'User exist'
,
res
)
;
this
.
_AUTH
.
isAnonymous
=
false
;
this
.
storage
.
get
(
'APP_PARAMS'
).
then
(
appParams
=>
{
this
.
storage
.
get
(
'APP_PARAMS'
).
then
(
appParams
=>
{
if
(
appParams
.
PARAM_mainslider
)
{
if
(
appParams
.
PARAM_mainslider
)
{
this
.
router
.
navigate
([
'app/dashboard'
]);
this
.
router
.
navigate
([
'app/dashboard'
]);
...
...
src/app/pages/menu/menu.page.html
View file @
09e2dc6d
...
@@ -83,7 +83,7 @@
...
@@ -83,7 +83,7 @@
<ion-content>
<ion-content>
<div
*
ngFor=
"let p of pages"
>
<div
*
ngFor=
"let p of pages"
>
<div
*
ngIf=
"p.anonymous || (!p.anonymous && !_AUTH.isAnonymous)"
>
<!-- Standard Menu Item -->
<!-- Standard Menu Item -->
<ion-menu-toggle
*
ngIf=
"p.url"
>
<ion-menu-toggle
*
ngIf=
"p.url"
>
<ion-item
[
routerLink
]="
p
.
url
"
routerDirection=
"root"
routerLinkActive=
"active"
>
<ion-item
[
routerLink
]="
p
.
url
"
routerDirection=
"root"
routerLinkActive=
"active"
>
...
@@ -95,8 +95,8 @@
...
@@ -95,8 +95,8 @@
</ion-menu-toggle>
</ion-menu-toggle>
<!-- Item with Children -->
<!-- Item with Children -->
<ion-item
button
*
ngIf=
"p.children?.length > 0"
(
click
)="
p
.
open =
!p.open"
[
class
.
parent-active
]="
p
.
open
"
<ion-item
button
*
ngIf=
"p.children?.length > 0"
(
click
)="
p
.
open =
!
p.open"
detail=
"false"
>
[
class
.
parent-active
]="
p
.
open
"
detail=
"false"
>
<ion-icon
slot=
"start"
name=
"arrow-forward"
*
ngIf=
"!p.open"
></ion-icon>
<ion-icon
slot=
"start"
name=
"arrow-forward"
*
ngIf=
"!p.open"
></ion-icon>
<ion-icon
slot=
"start"
name=
"arrow-down"
*
ngIf=
"p.open"
></ion-icon>
<ion-icon
slot=
"start"
name=
"arrow-down"
*
ngIf=
"p.open"
></ion-icon>
<ion-label>
{{ p.title }}
</ion-label>
<ion-label>
{{ p.title }}
</ion-label>
...
@@ -114,7 +114,7 @@
...
@@ -114,7 +114,7 @@
</ion-item>
</ion-item>
</ion-menu-toggle>
</ion-menu-toggle>
</ion-list>
</ion-list>
</div>
</div>
</div>
</ion-content>
</ion-content>
...
...
src/app/pages/menu/menu.page.ts
View file @
09e2dc6d
...
@@ -13,17 +13,20 @@ export class MenuPage implements OnInit {
...
@@ -13,17 +13,20 @@ export class MenuPage implements OnInit {
{
{
title
:
'Les promos'
,
title
:
'Les promos'
,
url
:
'/app/dashboard'
,
url
:
'/app/dashboard'
,
icon
:
'home'
icon
:
'home'
,
anonymous
:
'true'
},
},
{
{
title
:
'Partenaires'
,
title
:
'Partenaires'
,
url
:
'/app/partenaires'
,
url
:
'/app/partenaires'
,
icon
:
'contacts'
icon
:
'contacts'
,
anonymous
:
true
},
},
{
{
title
:
'Favoris'
,
title
:
'Favoris'
,
url
:
'/app/favoris'
,
url
:
'/app/favoris'
,
icon
:
'bookmark'
icon
:
'bookmark'
,
anonymous
:
false
},
},
{
{
title
:
'Mes mérites'
,
title
:
'Mes mérites'
,
...
@@ -33,22 +36,26 @@ export class MenuPage implements OnInit {
...
@@ -33,22 +36,26 @@ export class MenuPage implements OnInit {
{
{
title
:
'Paramètres'
,
title
:
'Paramètres'
,
url
:
'/app/params'
,
url
:
'/app/params'
,
icon
:
'settings'
icon
:
'settings'
,
anonymous
:
true
},
},
{
{
title
:
'Contact'
,
title
:
'Contact'
,
url
:
'/app/contact'
,
url
:
'/app/contact'
,
icon
:
'at'
icon
:
'at'
,
anonymous
:
true
},
},
{
{
title
:
'A propos'
,
title
:
'A propos'
,
url
:
'/app/a-propos'
,
url
:
'/app/a-propos'
,
icon
:
'alert'
icon
:
'alert'
,
anonymous
:
true
},
},
{
{
title
:
'Présentation'
,
title
:
'Présentation'
,
url
:
'/mainslider'
,
url
:
'/mainslider'
,
icon
:
'albums'
icon
:
'albums'
,
anonymous
:
true
}
}
];
];
...
...
src/app/pages/offres/offres-carte/offres-carte.page.html
View file @
09e2dc6d
...
@@ -52,6 +52,7 @@
...
@@ -52,6 +52,7 @@
</ion-card>
</ion-card>
</div>
</div>
<div
class=
"card-wrapper"
*
ngFor=
"let trip of _TRIP.offersCardList"
>
<div
class=
"card-wrapper"
*
ngFor=
"let trip of _TRIP.offersCardList"
>
<div
*
ngIf=
"!_AUTH.isAnonymous"
>
<ion-button
color=
"light"
fill=
"solid"
class=
"bookmark"
(
click
)="
_TRIP
.
wishList
(
trip
,
'
add
')"
<ion-button
color=
"light"
fill=
"solid"
class=
"bookmark"
(
click
)="
_TRIP
.
wishList
(
trip
,
'
add
')"
*
ngIf=
"!trip.bookmarked"
no-padding
>
*
ngIf=
"!trip.bookmarked"
no-padding
>
<ion-icon
name=
"heart-empty"
></ion-icon>
<ion-icon
name=
"heart-empty"
></ion-icon>
...
@@ -60,6 +61,7 @@
...
@@ -60,6 +61,7 @@
*
ngIf=
"trip.bookmarked"
no-padding
>
*
ngIf=
"trip.bookmarked"
no-padding
>
<ion-icon
name=
"heart"
color=
"danger"
></ion-icon>
<ion-icon
name=
"heart"
color=
"danger"
></ion-icon>
</ion-button>
</ion-button>
</div>
<ion-card
(
click
)="
viewDetail
(
trip
.
id
)"
tappable
no-margin
margin-bottom
>
<ion-card
(
click
)="
viewDetail
(
trip
.
id
)"
tappable
no-margin
margin-bottom
>
<div
class=
"img-spinner-wrap ion-text-center"
>
<div
class=
"img-spinner-wrap ion-text-center"
>
<ion-spinner
name=
"dots"
*
ngIf=
"trip.hidden"
></ion-spinner>
<ion-spinner
name=
"dots"
*
ngIf=
"trip.hidden"
></ion-spinner>
...
...
src/app/pages/offres/offres-carte/offres-carte.page.ts
View file @
09e2dc6d
import
{
Component
,
OnInit
,
ViewChild
}
from
'@angular/core'
;
import
{
Component
,
OnInit
,
ViewChild
}
from
'@angular/core'
;
import
{
ToastController
,
IonInfiniteScroll
}
from
'@ionic/angular'
;
import
{
ToastController
,
IonInfiniteScroll
}
from
'@ionic/angular'
;
import
{
AlloService
}
from
'../../../services/allo-service'
;
import
{
AlloService
}
from
'../../../services/allo-service'
;
import
{
AuthService
}
from
'../../../services/auth.service'
;
import
{
TripService
}
from
'../../../services/trip-service'
;
import
{
TripService
}
from
'../../../services/trip-service'
;
import
{
Storage
}
from
'@ionic/storage'
;
import
{
Storage
}
from
'@ionic/storage'
;
import
{
Router
}
from
'@angular/router'
;
import
{
Router
}
from
'@angular/router'
;
...
@@ -17,6 +18,7 @@ export class OffresCartePage implements OnInit {
...
@@ -17,6 +18,7 @@ export class OffresCartePage implements OnInit {
constructor
(
constructor
(
public
_ALLO
:
AlloService
,
public
_ALLO
:
AlloService
,
public
_AUTH
:
AuthService
,
public
_TRIP
:
TripService
,
public
_TRIP
:
TripService
,
public
toastCtrl
:
ToastController
,
public
toastCtrl
:
ToastController
,
private
router
:
Router
,
private
router
:
Router
,
...
...
src/app/services/auth.service.ts
View file @
09e2dc6d
...
@@ -22,7 +22,7 @@ export class AuthService {
...
@@ -22,7 +22,7 @@ export class AuthService {
public
infoEmail
;
public
infoEmail
;
authState
=
new
BehaviorSubject
(
false
);
authState
=
new
BehaviorSubject
(
false
);
authProfile
=
new
BehaviorSubject
(
false
)
;
public
isAnonymous
=
false
;
constructor
(
constructor
(
private
platform
:
Platform
,
private
platform
:
Platform
,
...
@@ -41,7 +41,7 @@ export class AuthService {
...
@@ -41,7 +41,7 @@ export class AuthService {
}
}
});
});
this
.
isLoggedIn
();
this
.
isLoggedIn
();
this
.
i
sAnonymous
();
this
.
checkI
sAnonymous
();
});
});
}
}
...
@@ -56,16 +56,16 @@ export class AuthService {
...
@@ -56,16 +56,16 @@ export class AuthService {
isLoggedIn
()
{
isLoggedIn
()
{
this
.
storage
.
get
(
'wpUser'
).
then
((
wpUser
)
=>
{
this
.
storage
.
get
(
'wpUser'
).
then
((
wpUser
)
=>
{
if
(
wpUser
)
{
if
(
wpUser
)
{
console
.
log
(
'wpuser found'
)
this
.
authState
.
next
(
true
);
this
.
authState
.
next
(
true
);
}
}
});
});
}
}
i
sAnonymous
()
{
checkI
sAnonymous
()
{
this
.
storage
.
get
(
'wpUser'
).
then
((
wpUser
)
=>
{
this
.
storage
.
get
(
'wpUser'
).
then
((
wpUser
)
=>
{
if
(
wpUser
&&
wpUser
.
hasOwnProperty
(
'user_nicename'
)
&&
wpUser
.
user_nicename
===
'anonymous'
)
{
if
(
wpUser
&&
wpUser
.
hasOwnProperty
(
'user_nicename'
)
&&
wpUser
.
user_nicename
===
'anonymous'
)
{
this
.
authProfile
.
next
(
true
);
this
.
isAnonymous
=
true
;
console
.
log
(
'this.isAnonymous'
,
this
.
isAnonymous
);
}
}
});
});
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment