mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 21:35:50 +00:00
fix
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
<ion-tabs class="tab">
|
<ion-tabs class="tab" *ngIf="p.userPermissionCount([permissionList.Agenda.access, permissionList.Gabinete.access, permissionList.Actions.access, permissionList.Chat.access]) >= 2">
|
||||||
<ion-tab-bar class="bottoms" slot="bottom">
|
<ion-tab-bar class="bottoms" slot="bottom">
|
||||||
|
|
||||||
<ion-tab-button *ngIf="p.userPermission([permissionList.Agenda.access]) || p.userPermission([permissionList.Gabinete.access])" tab="events" [class.active]="pathname === '/home/events'">
|
<ion-tab-button *ngIf="p.userPermission([permissionList.Agenda.access]) || p.userPermission([permissionList.Gabinete.access])" tab="events" [class.active]="pathname === '/home/events'">
|
||||||
|
|||||||
@@ -103,11 +103,18 @@
|
|||||||
</ion-row>
|
</ion-row>
|
||||||
<ion-row class="ion-align-items-center">
|
<ion-row class="ion-align-items-center">
|
||||||
|
|
||||||
<button *ngIf="profile == 'mdgpr' && eventService.calendarOwnerIds.length >= 2 " (click)="changeProfile()" class="d-md-none btn-no-color resize">
|
<!-- <div *ngIf="loggeduser.Profile != 'PR' && loggeduser.Profile != 'MDGPR'" class="calendar-letters"> -->
|
||||||
|
<div class="calendar-letters cal-reverse" *ngIf="loggeduser.Profile != 'PR' && loggeduser.Profile != 'MDGPR' && eventService.calendarOwnerIds.length >= 2" class="calendar-letters" [class.cal-reverse]="loggeduser.Profile != 'PR' && loggeduser.Profile != 'MDGPR' && profile == 'mdgpr' " (click)="changeProfile()">
|
||||||
|
<div class="text">
|
||||||
|
{{ sessionStore.getInitials }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button *ngIf="profile == 'mdgpr' && eventService.calendarOwnerIds.length >= 2 && ( loggeduser.Profile == 'PR' || loggeduser.Profile == 'MDGPR') " (click)="changeProfile()" class="d-md-none btn-no-color resize">
|
||||||
<ion-icon class="right-icons" src="assets/images/icons-profile-calendar-md.svg"></ion-icon>
|
<ion-icon class="right-icons" src="assets/images/icons-profile-calendar-md.svg"></ion-icon>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button title="Mudar de Agenda" *ngIf="profile == 'pr'&& eventService.calendarOwnerIds.length >= 2 " (click)="changeProfile()" class="btn-no-color resize">
|
<button title="Mudar de Agenda" *ngIf="profile == 'pr'&& eventService.calendarOwnerIds.length >= 2 && ( loggeduser.Profile == 'PR' || loggeduser.Profile == 'MDGPR')" (click)="changeProfile()" class="btn-no-color resize">
|
||||||
<ion-icon class="right-icons d-md-none" src="assets/images/icons-profile-calendar-pr.svg"></ion-icon>
|
<ion-icon class="right-icons d-md-none" src="assets/images/icons-profile-calendar-pr.svg"></ion-icon>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
@@ -218,11 +225,11 @@
|
|||||||
|
|
||||||
<div class="calendar-title-container px-20 d-none d-md-flex" *ngIf="loggeduser.Profile == 'MDGPR'">
|
<div class="calendar-title-container px-20 d-none d-md-flex" *ngIf="loggeduser.Profile == 'MDGPR'">
|
||||||
<div class="calendar-title-description flex-grow-1 text-grey d-flex justify-center align-center">
|
<div class="calendar-title-description flex-grow-1 text-grey d-flex justify-center align-center">
|
||||||
<div>Calendário do MDGPR</div>
|
<div *ngIf="loggeduser.Profile == 'PR' || loggeduser.Profile == 'MDGPR'">Calendário do MDGPR</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="calendar-title-description text-black align-center">
|
<div class="calendar-title-description text-black align-center">
|
||||||
<div class="flex-grow-1 text-grey d-flex justify-center align-center">
|
<div class="flex-grow-1 text-grey d-flex justify-center align-center">
|
||||||
<div>Calendário do Presidente da República</div>
|
<div *ngIf="loggeduser.Profile == 'PR' || loggeduser.Profile == 'MDGPR'">Calendário do Presidente da República</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -857,3 +857,26 @@ $font-size: 11pt;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.calendar-letters {
|
||||||
|
width: 36px;
|
||||||
|
height: 36px;
|
||||||
|
background-color: #f05d5e;
|
||||||
|
border-radius: 44px;
|
||||||
|
text-align: center;
|
||||||
|
align-items: center;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
margin-top: -3px;
|
||||||
|
border: 1.5px solid black;
|
||||||
|
color: white;
|
||||||
|
.text{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.cal-reverse {
|
||||||
|
background: white !important;
|
||||||
|
color: black !important;
|
||||||
|
border-color: #f05d5e !important;
|
||||||
|
}
|
||||||
@@ -32,6 +32,7 @@ import { ChangeProfileService } from 'src/app/services/change-profile.service';
|
|||||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||||
import { BackgroundService } from 'src/app/services/background.service';
|
import { BackgroundService } from 'src/app/services/background.service';
|
||||||
import { ThemeService } from 'src/app/services/theme.service'
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
|
import { SessionStore } from 'src/app/store/session.service';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -163,6 +164,8 @@ export class AgendaPage implements OnInit {
|
|||||||
listToPresent
|
listToPresent
|
||||||
array = []
|
array = []
|
||||||
|
|
||||||
|
sessionStore = SessionStore;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private alertCtrl: AlertController,
|
private alertCtrl: AlertController,
|
||||||
@Inject(LOCALE_ID) private locale: string,
|
@Inject(LOCALE_ID) private locale: string,
|
||||||
|
|||||||
@@ -262,8 +262,6 @@ export class ViewEventPage implements OnInit {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
alert('generic delete')
|
|
||||||
|
|
||||||
this.eventsService.genericDeleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName, this.loadedEvent.CalendarId).subscribe(async () => {
|
this.eventsService.genericDeleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName, this.loadedEvent.CalendarId).subscribe(async () => {
|
||||||
const alert = await this.alertController.create({
|
const alert = await this.alertController.create({
|
||||||
cssClass: 'my-custom-class',
|
cssClass: 'my-custom-class',
|
||||||
|
|||||||
@@ -154,6 +154,8 @@ export class LoginPage implements OnInit {
|
|||||||
else {
|
else {
|
||||||
this.toastService._badRequest('Por favor, insira o seu nome de utilizador');
|
this.toastService._badRequest('Por favor, insira o seu nome de utilizador');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
goback() {
|
goback() {
|
||||||
|
|||||||
@@ -132,6 +132,8 @@ export class AuthService {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.initialsService.getInitials(session.FullName);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Login to rocketChat server2
|
//Login to rocketChat server2
|
||||||
@@ -298,8 +300,8 @@ export class AuthService {
|
|||||||
this.userData$.next('');
|
this.userData$.next('');
|
||||||
this.router.navigate(['']);
|
this.router.navigate(['']);
|
||||||
}) */
|
}) */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async presentAlert(message: string) {
|
async presentAlert(message: string) {
|
||||||
const alert = await this.alertController.create({
|
const alert = await this.alertController.create({
|
||||||
cssClass: 'my-custom-class',
|
cssClass: 'my-custom-class',
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { StorageService } from './storage.service';
|
|||||||
import { HttpClient, HttpHeaderResponse } from '@angular/common/http';
|
import { HttpClient, HttpHeaderResponse } from '@angular/common/http';
|
||||||
import { environment } from 'src/environments/environment';
|
import { environment } from 'src/environments/environment';
|
||||||
import { Storage } from '@ionic/storage';
|
import { Storage } from '@ionic/storage';
|
||||||
|
import { PermissionService } from './permission.service';
|
||||||
|
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
@@ -29,15 +30,19 @@ export class ChatService {
|
|||||||
private authService: AuthService,
|
private authService: AuthService,
|
||||||
private storage: Storage,
|
private storage: Storage,
|
||||||
private storageService:StorageService,
|
private storageService:StorageService,
|
||||||
|
public p: PermissionService,
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
this.loggedUserChat = authService.ValidatedUserChat;
|
this.loggedUserChat = authService.ValidatedUserChat;
|
||||||
this.headers = new HttpHeaders();
|
this.headers = new HttpHeaders();
|
||||||
this.headers = this.headers.set('X-User-Id', this.loggedUserChat['data'].userId);
|
|
||||||
this.headers = this.headers.set('X-Auth-Token', this.loggedUserChat['data'].authToken);
|
if(this.p.userPermission(this.p.permissionList.Chat.access)) {
|
||||||
this.options = {
|
this.headers = this.headers.set('X-User-Id', this.loggedUserChat['data'].userId);
|
||||||
headers: this.headers,
|
this.headers = this.headers.set('X-Auth-Token', this.loggedUserChat['data'].authToken);
|
||||||
};
|
this.options = {
|
||||||
|
headers: this.headers,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,23 @@ export class PermissionService {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
userPermissionCount(args) {
|
||||||
|
if(!Array.isArray(args)) {
|
||||||
|
args = [args]
|
||||||
|
}
|
||||||
|
|
||||||
|
let count = 0
|
||||||
|
|
||||||
|
for(let permission of (this.SessionStore.user.UserPermissions || [])) {
|
||||||
|
if (args.includes(permission)) {
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
role(args: any) {
|
role(args: any) {
|
||||||
|
|
||||||
let UserRoleIsValid = this.userRole(args)
|
let UserRoleIsValid = this.userRole(args)
|
||||||
|
|||||||
@@ -95,6 +95,18 @@ class SessionService {
|
|||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
get getInitials() {
|
||||||
|
let names = this._user.FullName.split(' ') || ' ',
|
||||||
|
initials = names[0].substring(0, 1).toUpperCase();
|
||||||
|
if (names.length > 1) {
|
||||||
|
initials += names[names.length - 1].substring(0, 1).toUpperCase();
|
||||||
|
}
|
||||||
|
|
||||||
|
return initials;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user