diff --git a/src/app/modals/profile/edit-profile/edit-profile-routing.module.ts b/src/app/modals/profile/edit-profile/edit-profile-routing.module.ts new file mode 100644 index 000000000..1055e551e --- /dev/null +++ b/src/app/modals/profile/edit-profile/edit-profile-routing.module.ts @@ -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 {} diff --git a/src/app/modals/profile/edit-profile/edit-profile.module.ts b/src/app/modals/profile/edit-profile/edit-profile.module.ts new file mode 100644 index 000000000..622248725 --- /dev/null +++ b/src/app/modals/profile/edit-profile/edit-profile.module.ts @@ -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 {} diff --git a/src/app/modals/profile/edit-profile/edit-profile.page.html b/src/app/modals/profile/edit-profile/edit-profile.page.html new file mode 100644 index 000000000..a80695759 --- /dev/null +++ b/src/app/modals/profile/edit-profile/edit-profile.page.html @@ -0,0 +1,76 @@ + +
+ +
+ +
+ +
+
+
Perfil
+
+ + +
+ +
+
+ +
+
+ +
+
Dados Perfil
+
{{loggeduser.RoleDescription}}
+ +
+ + + +
+ +
+
+ +
+ + + +
+ + + + + + + +
+ +
diff --git a/src/app/modals/profile/edit-profile/edit-profile.page.scss b/src/app/modals/profile/edit-profile/edit-profile.page.scss new file mode 100644 index 000000000..fd1c49f37 --- /dev/null +++ b/src/app/modals/profile/edit-profile/edit-profile.page.scss @@ -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; +} diff --git a/src/app/modals/profile/edit-profile/edit-profile.page.spec.ts b/src/app/modals/profile/edit-profile/edit-profile.page.spec.ts new file mode 100644 index 000000000..2f52dba55 --- /dev/null +++ b/src/app/modals/profile/edit-profile/edit-profile.page.spec.ts @@ -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; + + 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(); + }); +}); diff --git a/src/app/modals/profile/edit-profile/edit-profile.page.ts b/src/app/modals/profile/edit-profile/edit-profile.page.ts new file mode 100644 index 000000000..35c1f7690 --- /dev/null +++ b/src/app/modals/profile/edit-profile/edit-profile.page.ts @@ -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 = '' + } + + } + +} + diff --git a/src/app/modals/profile/profile-routing.module.ts b/src/app/modals/profile/profile-routing.module.ts index a7052f82c..b45610c01 100644 --- a/src/app/modals/profile/profile-routing.module.ts +++ b/src/app/modals/profile/profile-routing.module.ts @@ -7,6 +7,10 @@ const routes: Routes = [ { path: '', component: ProfilePage + }, + { + path: 'edit-profile', + loadChildren: () => import('./edit-profile/edit-profile.module').then( m => m.EditProfilePageModule) } ]; diff --git a/src/app/modals/profile/profile.page.html b/src/app/modals/profile/profile.page.html index df059333e..fbb6f01b3 100644 --- a/src/app/modals/profile/profile.page.html +++ b/src/app/modals/profile/profile.page.html @@ -1,82 +1,71 @@ +
+ +
+ +
+
+
-
-
-
Perfil
-
- - +
+ {{loggeduser.RoleDescription}}
-
-
- -
-
- -
-
Dados Perfil
-
{{loggeduser.RoleDescription}}
- -
- - - -
- - +
+ + +
+
+
+
+ 2 novas notificações + +
+
+
+ +
+
+

08:00

+

09:00

+
+
+

Luanda | Palácio Presidencial

+

Almoço de Família

+
+
+
+
+
+
+
+ +
+
+

28-07-21

+

09:00

+
+
+

Relatório FMI

+

Luanda | Palácio Presidencial

+
+
+
+ +
-
- - Alterar PIN - -
- - diff --git a/src/app/modals/profile/profile.page.scss b/src/app/modals/profile/profile.page.scss index 65d3675e1..081d3b5ff 100644 --- a/src/app/modals/profile/profile.page.scss +++ b/src/app/modals/profile/profile.page.scss @@ -1,64 +1,114 @@ -.profile-content{ +.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: 35px; + font-size: 40px; } -.go-back{ - font-family: Roboto; - font-size: 25px; - .icon{ - margin-right: 7px; - } +.profile-title{ + font-weight: 300; + font-size: 20px !important; + margin-bottom: 40px !important; } -.profile-pic{ - width: 200px; - height: 200px; - border-radius: 20px; - margin: 0px auto; +.line{ + width: 100% !important; + margin-top: 15px; + border-top: 1px solid #d8d8d8; } -.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; - } - +.btn-delete{ + width: 40% !important; + margin-left: 0 !important; } - -.login-preference{ - margin-top: 44px; - - .preference{ - font-family: Roboto; - font-size: 15px; - margin-bottom: 20px; - font-weight: bold; - } - .checkBox{ - margin-right: 10px; - } +.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; +} diff --git a/src/app/modals/profile/profile.page.ts b/src/app/modals/profile/profile.page.ts index d77d04348..60b1cc2f2 100644 --- a/src/app/modals/profile/profile.page.ts +++ b/src/app/modals/profile/profile.page.ts @@ -6,6 +6,7 @@ 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', @@ -37,80 +38,7 @@ export class ProfilePage implements OnInit { 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(); - } + notImplemented(){} logout() { // clear local storage @@ -121,28 +49,6 @@ export class ProfilePage implements OnInit { 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() { @@ -157,4 +63,41 @@ export class ProfilePage implements OnInit { } + 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(); + } + } diff --git a/src/app/pages/events/events.page.html b/src/app/pages/events/events.page.html index 9b3866f23..a5179fa11 100644 --- a/src/app/pages/events/events.page.html +++ b/src/app/pages/events/events.page.html @@ -25,7 +25,7 @@ - +
@@ -36,9 +36,9 @@
A sua Agenda
@@ -46,8 +46,7 @@
+ (click)="goToEvent(event.EventId)">
@@ -64,7 +63,7 @@ -
- +
@@ -100,10 +99,10 @@
{{ task.workflowInstanceDataFields.Sender }}
- +
- \ No newline at end of file + diff --git a/src/app/shared/headers/header-no-search/header-no-search.page.ts b/src/app/shared/headers/header-no-search/header-no-search.page.ts index cc42609fe..13c72f775 100644 --- a/src/app/shared/headers/header-no-search/header-no-search.page.ts +++ b/src/app/shared/headers/header-no-search/header-no-search.page.ts @@ -6,6 +6,7 @@ import { ProfileComponent } from './profile/profile.page'; import { Router } from '@angular/router'; import { AuthService } from 'src/app/services/auth.service'; import { User } from 'src/app/models/user.model'; +import { ProfilePage } from 'src/app/modals/profile/profile.page'; @Component({ selector: 'app-header-no-search', templateUrl: './header-no-search.page.html', @@ -14,12 +15,12 @@ import { User } from 'src/app/models/user.model'; export class HeaderNoSearchPage implements OnInit { loggeduser: User; - + constructor(private modalController: ModalController, private menu: MenuController, private animationController: AnimationController, private router: Router, - authService: AuthService) { + authService: AuthService) { this.loggeduser = authService.ValidatedUser; } @@ -51,12 +52,12 @@ export class HeaderNoSearchPage implements OnInit { const leaveAnimation = (baseEl: any) => { return enterAnimation(baseEl).direction('reverse'); } - + const modal = await this.modalController.create({ enterAnimation, leaveAnimation, - component: ProfileComponent, + component: ProfilePage, cssClass: 'model profile-modal', componentProps: { } diff --git a/src/assets/images/icons-default-profile.svg b/src/assets/images/icons-default-profile.svg new file mode 100644 index 000000000..dd82c44a7 --- /dev/null +++ b/src/assets/images/icons-default-profile.svg @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/theme/variables.scss b/src/theme/variables.scss index c09c7af4e..5651bbcf2 100644 --- a/src/theme/variables.scss +++ b/src/theme/variables.scss @@ -408,10 +408,10 @@ $app-theme: mat-light-theme(( } .approve-event-time{ + width: 33px; float: left; } .approve-event-time p{ - width: 33px; font-family: Roboto; font-size: 13px; font-weight: normal;