mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
Merge branch 'developer' of bitbucket.org:equilibriumito/gabinete-digital into developer
This commit is contained in:
@@ -8,7 +8,7 @@ import { DocumentDetailPageRoutingModule } from './document-detail-routing.modul
|
||||
|
||||
import { DocumentDetailPage } from './document-detail.page';
|
||||
import { SharedModule } from 'src/app/shared/shared.module';
|
||||
import { ComponentsModule } from 'src/app/components/components.module';
|
||||
|
||||
import { BtnModalDismissPageModule } from 'src/app/shared/btn-modal-dismiss/btn-modal-dismiss.module';
|
||||
|
||||
@NgModule({
|
||||
@@ -16,7 +16,7 @@ import { BtnModalDismissPageModule } from 'src/app/shared/btn-modal-dismiss/btn-
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
ComponentsModule,
|
||||
|
||||
DocumentDetailPageRoutingModule,
|
||||
BtnModalDismissPageModule,
|
||||
],
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { EditProfilePage } from './edit-profile.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: EditProfilePage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class EditProfilePageRoutingModule {}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { EditProfilePageRoutingModule } from './edit-profile-routing.module';
|
||||
|
||||
import { EditProfilePage } from './edit-profile.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
EditProfilePageRoutingModule
|
||||
],
|
||||
declarations: [EditProfilePage]
|
||||
})
|
||||
export class EditProfilePageModule {}
|
||||
@@ -0,0 +1,76 @@
|
||||
<ion-content class=" bg-blue">
|
||||
<div class="btn-close d-flex" (click)="close()">
|
||||
<ion-icon class="icon" src="assets/images/icons-search-close.svg"></ion-icon>
|
||||
</div>
|
||||
|
||||
<div class="profile-content width-100">
|
||||
|
||||
<div class="d-flex justify-space-between align-center">
|
||||
<div class="go-back d-flex align-center" (click)="close()">
|
||||
<ion-icon class="icon" src="assets/images/icons-calendar-arrow-left.svg"></ion-icon> <div>Perfil</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="d-flex " (click)="close()">
|
||||
<ion-icon class="icon" src="assets/images/icons-search-close.svg"></ion-icon>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<div >
|
||||
<div class="d-flex align-center">
|
||||
<ion-icon class="profile-pic" src="assets/images/icons-default-profile.svg"></ion-icon>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="profile-info">
|
||||
<div class="label-text">Dados Perfil</div>
|
||||
<div class="user-role">{{loggeduser.RoleDescription}}</div>
|
||||
<div class="email">{{loggeduser.Email}}</div>
|
||||
</div>
|
||||
|
||||
<div class="login-preference" (mouseover)="checkState()" (click)="checkState()">
|
||||
<div class="preference">Preferência Login</div>
|
||||
|
||||
<ion-row>
|
||||
<ion-col class="align-center d-flex">
|
||||
<div class="d-flex align-center" (click)="LoginPreferenceMethod('pin')">
|
||||
<ion-checkbox [checked]="userLoginPreference=='pin' " class="checkBox" ></ion-checkbox>
|
||||
PIN
|
||||
</div>
|
||||
|
||||
</ion-col>
|
||||
<ion-col class="align-center d-flex">
|
||||
<div (click)="addFingerprint()" class="d-flex align-center">
|
||||
<ion-checkbox class="checkBox" [checked]="false"></ion-checkbox>
|
||||
Impressão Digital
|
||||
</div>
|
||||
</ion-col>
|
||||
|
||||
</ion-row>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-center mt-10">
|
||||
<button (click)="addPin()" class="btn-ok buttonSize" fill="clear" color="#fff" >
|
||||
<ion-label>Alterar PIN</ion-label>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
|
||||
<ion-footer class=" footer-container ion-no-border bg-blue">
|
||||
|
||||
<div class="d-flex justify-space-between">
|
||||
|
||||
<ion-buttons slot="start" (click)="close()">
|
||||
<button class="btn-cancel" fill="clear" color="#061b52" >
|
||||
<ion-label>Cancelar</ion-label>
|
||||
</button>
|
||||
</ion-buttons>
|
||||
<ion-buttons slot="end" (click)="close()">
|
||||
<button class="btn-ok" fill="clear" color="#fff" >
|
||||
<ion-label>Gravar</ion-label>
|
||||
</button>
|
||||
</ion-buttons>
|
||||
</div>
|
||||
|
||||
</ion-footer>
|
||||
@@ -0,0 +1,73 @@
|
||||
.btn-close{
|
||||
padding: 20px 20px;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.profile-content{
|
||||
width: 100% !important;
|
||||
padding: 0px 20px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.icon{
|
||||
font-size: 35px;
|
||||
}
|
||||
|
||||
.go-back{
|
||||
font-family: Roboto;
|
||||
font-size: 25px;
|
||||
.icon{
|
||||
margin-right: 7px;
|
||||
}
|
||||
}
|
||||
|
||||
.profile-pic{
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
border-radius: 20px;
|
||||
margin: 0px auto;
|
||||
}
|
||||
|
||||
.profile-info{
|
||||
.label-text{
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
color: white;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.user-role{
|
||||
background-color: white;
|
||||
border-radius: 5px;
|
||||
padding: 12px;
|
||||
font-family: Roboto;
|
||||
font-size: 13px;
|
||||
color: black;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.email {
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.login-preference{
|
||||
margin-top: 44px;
|
||||
|
||||
.preference{
|
||||
font-family: Roboto;
|
||||
font-size: 15px;
|
||||
margin-bottom: 20px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.checkBox{
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.buttonSize {
|
||||
width: 100% !important;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { EditProfilePage } from './edit-profile.page';
|
||||
|
||||
describe('EditProfilePage', () => {
|
||||
let component: EditProfilePage;
|
||||
let fixture: ComponentFixture<EditProfilePage>;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ EditProfilePage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(EditProfilePage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,161 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { AnimationController, ModalController } from '@ionic/angular';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { FingerprintPage } from 'src/app/shared/fingerprint/fingerprint.page';
|
||||
import { PinPage } from 'src/app/shared/pin/pin.page';
|
||||
import { LocalstoreService } from 'src/app/store/localstore.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-edit-profile',
|
||||
templateUrl: './edit-profile.page.html',
|
||||
styleUrls: ['./edit-profile.page.scss'],
|
||||
})
|
||||
export class EditProfilePage implements OnInit {
|
||||
|
||||
loggeduser: User;
|
||||
userLoginPreference = ''
|
||||
|
||||
constructor(private modalController:ModalController,
|
||||
private authService: AuthService,
|
||||
private animationController: AnimationController,
|
||||
private router: Router,
|
||||
private localstoreService: LocalstoreService
|
||||
) {
|
||||
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
|
||||
console.log(this.loggeduser.RoleDescription)
|
||||
|
||||
this.checkState()
|
||||
}
|
||||
|
||||
ngOnInit() {}
|
||||
|
||||
close() {
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
|
||||
async addPin() {
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
|
||||
|
||||
const wrapperAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('.modal-wrapper')!)
|
||||
.keyframes([
|
||||
{ offset: 0, opacity: '1', right: '-100%' },
|
||||
{ offset: 1, opacity: '1', right: '0px' }
|
||||
]);
|
||||
|
||||
return this.animationController.create()
|
||||
.addElement(baseEl)
|
||||
.easing('ease-out')
|
||||
.duration(500)
|
||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
||||
}
|
||||
|
||||
const leaveAnimation = (baseEl: any) => {
|
||||
return enterAnimation(baseEl).direction('reverse');
|
||||
}
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
enterAnimation,
|
||||
leaveAnimation,
|
||||
component: PinPage,
|
||||
cssClass: 'model profile-modal',
|
||||
componentProps: {
|
||||
}
|
||||
});
|
||||
|
||||
modal.present();
|
||||
}
|
||||
|
||||
|
||||
async addFingerprint() {
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
|
||||
|
||||
const wrapperAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('.modal-wrapper')!)
|
||||
.keyframes([
|
||||
{ offset: 0, opacity: '1', right: '-100%' },
|
||||
{ offset: 1, opacity: '1', right: '0px' }
|
||||
]);
|
||||
|
||||
return this.animationController.create()
|
||||
.addElement(baseEl)
|
||||
.easing('ease-out')
|
||||
.duration(500)
|
||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
||||
}
|
||||
|
||||
const leaveAnimation = (baseEl: any) => {
|
||||
return enterAnimation(baseEl).direction('reverse');
|
||||
}
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
enterAnimation,
|
||||
leaveAnimation,
|
||||
component: FingerprintPage,
|
||||
cssClass: 'model profile-modal',
|
||||
componentProps: {
|
||||
}
|
||||
});
|
||||
|
||||
modal.present();
|
||||
}
|
||||
|
||||
logout() {
|
||||
// clear local storage
|
||||
window.localStorage.clear();
|
||||
|
||||
setTimeout(()=>{
|
||||
window.location.pathname = '/'
|
||||
location.reload();
|
||||
}, 1000)
|
||||
|
||||
|
||||
}
|
||||
|
||||
LoginPreferenceMethod(type: string) {
|
||||
|
||||
let userData = this.localstoreService.get('UserData', {})
|
||||
|
||||
if (userData.hasOwnProperty('loginPreference')) {
|
||||
if (userData.loginPreference != type) {
|
||||
if (type) {
|
||||
userData.loginPreference = type
|
||||
}
|
||||
} else {
|
||||
userData.loginPreference = 'none'
|
||||
}
|
||||
|
||||
} else {
|
||||
userData.loginPreference = 'none'
|
||||
}
|
||||
|
||||
|
||||
this.localstoreService.set('UserData', userData)
|
||||
}
|
||||
|
||||
checkState() {
|
||||
|
||||
let userData = this.localstoreService.get('UserData', {})
|
||||
|
||||
if (userData.hasOwnProperty('loginPreference')) {
|
||||
this.userLoginPreference = userData.loginPreference
|
||||
} else {
|
||||
this.userLoginPreference = ''
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { ProfilePage } from './profile.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: ProfilePage
|
||||
},
|
||||
{
|
||||
path: 'edit-profile',
|
||||
loadChildren: () => import('./edit-profile/edit-profile.module').then( m => m.EditProfilePageModule)
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class ProfilePageRoutingModule {}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { ProfilePageRoutingModule } from './profile-routing.module';
|
||||
|
||||
import { ProfilePage } from './profile.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
ProfilePageRoutingModule
|
||||
],
|
||||
declarations: [ProfilePage]
|
||||
})
|
||||
export class ProfilePageModule {}
|
||||
@@ -0,0 +1,71 @@
|
||||
<ion-content class=" bg-blue">
|
||||
|
||||
<div class="profile-header width-100">
|
||||
<div class="div-logo">
|
||||
<div class="logo height-fit-content">
|
||||
<img class="img" src='assets/images/logo-no-bg.png' alt='logo'>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btn-close d-flex" (click)="close()">
|
||||
<ion-icon class="icon" src="assets/images/icons-search-close.svg"></ion-icon>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="profile-content">
|
||||
|
||||
<div class="profile-title d-flex justify-content-center width-100">
|
||||
<ion-label >{{loggeduser.RoleDescription}}</ion-label>
|
||||
</div>
|
||||
|
||||
<div class="d-flex mt-10 width-100">
|
||||
<ion-buttons slot="start" class="buttonSize" >
|
||||
<button (click)="logout()" class="btn-delete" fill="clear" style="background:#ffe0e0;" >
|
||||
<ion-label style="color:#d30a0a;">Terminar sessão</ion-label>
|
||||
</button>
|
||||
<button (click)="editProfile()" class="btn-cancel" fill="clear" color="#fff" >
|
||||
<ion-label>Editar Perfil</ion-label>
|
||||
</button>
|
||||
</ion-buttons>
|
||||
</div>
|
||||
<div class="line"></div>
|
||||
</div>
|
||||
<div class="notifications-content">
|
||||
<ion-label>2 novas notificações</ion-label>
|
||||
<ion-list>
|
||||
<div class="item cursor-pointer ion-no-padding ion-no-margin" lines="none">
|
||||
<div class="item-content width-100">
|
||||
<div class="notification-item">
|
||||
<img class="notification-icon" slot="end" src="assets/images/icons-default-agenda.svg" >
|
||||
</div>
|
||||
<div class="approve-event-time">
|
||||
<p>08:00</p>
|
||||
<p>09:00</p>
|
||||
</div>
|
||||
<div class="approve-event-detail">
|
||||
<p>Luanda | Palácio Presidencial</p>
|
||||
<h3>Almoço de Família</h3>
|
||||
</div>
|
||||
<div class="notification-label"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item cursor-pointer ion-no-padding ion-no-margin" lines="none">
|
||||
<div class="item-content width-100">
|
||||
<div class="notification-item">
|
||||
<img class="notification-icon" slot="end" src="assets/images/icons-correspondencias.svg" >
|
||||
</div>
|
||||
<div class="approve-event-time">
|
||||
<p>28-07-21</p>
|
||||
<p>09:00</p>
|
||||
</div>
|
||||
<div class="approve-event-detail">
|
||||
<h3>Relatório FMI</h3>
|
||||
<p>Luanda | Palácio Presidencial</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ion-list>
|
||||
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
@@ -0,0 +1,114 @@
|
||||
.profile-header{
|
||||
margin: 0 em(20px);
|
||||
// background-color: #0782c9;
|
||||
padding: 20px 20px;
|
||||
border: 0!important;
|
||||
overflow: auto;
|
||||
|
||||
.div-logo{
|
||||
background: transparent;
|
||||
width: calc(100% - 40px) !important;
|
||||
justify-content: center;
|
||||
display: flex;
|
||||
float: left;
|
||||
|
||||
.logo{
|
||||
width: 140px;
|
||||
.img{
|
||||
width: 100%;
|
||||
margin: 0px auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.btn-close{
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
float: left;
|
||||
}
|
||||
.profile-content{
|
||||
padding: 20px 20px;
|
||||
}
|
||||
|
||||
.icon{
|
||||
font-size: 40px;
|
||||
}
|
||||
|
||||
.profile-title{
|
||||
font-weight: 300;
|
||||
font-size: 20px !important;
|
||||
margin-bottom: 40px !important;
|
||||
}
|
||||
|
||||
.line{
|
||||
width: 100% !important;
|
||||
margin-top: 15px;
|
||||
border-top: 1px solid #d8d8d8;
|
||||
}
|
||||
|
||||
.btn-delete{
|
||||
width: 40% !important;
|
||||
margin-left: 0 !important;
|
||||
}
|
||||
.btn-cancel{
|
||||
width: 40% !important;
|
||||
margin-right: 0 !important;
|
||||
}
|
||||
|
||||
.buttonSize {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
ion-list{
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
.notifications-content{
|
||||
padding: 0px 20px;
|
||||
.item{
|
||||
display: flex;
|
||||
border-radius: 15px;
|
||||
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.07);
|
||||
border: solid 1px #e9e9e9;
|
||||
background-color: var(--white);
|
||||
margin: 0 auto;
|
||||
padding: 10px;
|
||||
margin-bottom: 10px;
|
||||
color: #000;
|
||||
overflow: hidden;
|
||||
|
||||
border: 1px solid blue;
|
||||
|
||||
.notification-item{
|
||||
width: fit-content;
|
||||
float: left;
|
||||
margin-right: 10px;
|
||||
padding: 0 !important;
|
||||
overflow: auto;
|
||||
|
||||
|
||||
}
|
||||
.notification-icon{
|
||||
font-size: 35px !important;
|
||||
}
|
||||
.approve-event-time{
|
||||
width: fit-content !important;
|
||||
float: left;
|
||||
}
|
||||
.approve-event-detail{
|
||||
width: calc(100% - 115px) !important;
|
||||
float: left;
|
||||
}
|
||||
.notification-label{
|
||||
float: right;
|
||||
width: 5px;
|
||||
height: 100%;
|
||||
border-radius: 0% 100% 100% 0%;
|
||||
background-color: #ffb703;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
.item-inner{
|
||||
padding: 0 !important;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { ProfilePage } from './profile.page';
|
||||
|
||||
describe('ProfilePage', () => {
|
||||
let component: ProfilePage;
|
||||
let fixture: ComponentFixture<ProfilePage>;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ProfilePage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(ProfilePage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,103 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { AnimationController, ModalController } from '@ionic/angular';
|
||||
import { User } from 'src/app/models/user.model';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { FingerprintPage } from 'src/app/shared/fingerprint/fingerprint.page';
|
||||
import { PinPage } from 'src/app/shared/pin/pin.page';
|
||||
import { LocalstoreService } from 'src/app/store/localstore.service';
|
||||
import { EditProfilePage } from './edit-profile/edit-profile.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-profile',
|
||||
templateUrl: './profile.page.html',
|
||||
styleUrls: ['./profile.page.scss'],
|
||||
})
|
||||
export class ProfilePage implements OnInit {
|
||||
|
||||
loggeduser: User;
|
||||
userLoginPreference = ''
|
||||
|
||||
constructor(private modalController:ModalController,
|
||||
private authService: AuthService,
|
||||
private animationController: AnimationController,
|
||||
private router: Router,
|
||||
private localstoreService: LocalstoreService
|
||||
) {
|
||||
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
|
||||
console.log(this.loggeduser.RoleDescription)
|
||||
|
||||
this.checkState()
|
||||
}
|
||||
|
||||
ngOnInit() {}
|
||||
|
||||
close() {
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
|
||||
notImplemented(){}
|
||||
|
||||
logout() {
|
||||
// clear local storage
|
||||
window.localStorage.clear();
|
||||
|
||||
setTimeout(()=>{
|
||||
window.location.pathname = '/'
|
||||
location.reload();
|
||||
}, 1000)
|
||||
|
||||
}
|
||||
|
||||
checkState() {
|
||||
|
||||
let userData = this.localstoreService.get('UserData', {})
|
||||
|
||||
if (userData.hasOwnProperty('loginPreference')) {
|
||||
this.userLoginPreference = userData.loginPreference
|
||||
} else {
|
||||
this.userLoginPreference = ''
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async editProfile() {
|
||||
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
|
||||
|
||||
const wrapperAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('.modal-wrapper')!)
|
||||
.keyframes([
|
||||
{ offset: 0, opacity: '1', right: '-100%' },
|
||||
{ offset: 1, opacity: '1', right: '0px' }
|
||||
]);
|
||||
|
||||
return this.animationController.create()
|
||||
.addElement(baseEl)
|
||||
.easing('ease-out')
|
||||
.duration(500)
|
||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
||||
}
|
||||
|
||||
const leaveAnimation = (baseEl: any) => {
|
||||
return enterAnimation(baseEl).direction('reverse');
|
||||
}
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
enterAnimation,
|
||||
leaveAnimation,
|
||||
component: EditProfilePage,
|
||||
cssClass: 'model profile-modal',
|
||||
componentProps: {
|
||||
}
|
||||
});
|
||||
return await modal.present();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user