This commit is contained in:
Peter Maquiran
2022-04-02 09:40:09 +01:00
parent 53c59e7a43
commit e69392ce58
19 changed files with 786 additions and 213 deletions
+23 -6
View File
@@ -97,9 +97,26 @@ export class AuthService {
session.Profile = 'PR'
} else if(session.RoleID == 100000011) {
session.Profile = 'MDGPR'
} else if(session.RoleID == 99999872) {
session.Profile = 'Consultant'
}
else{
session.Profile = this.initialsService.getInitials(session.FullName);
else if(session.RoleID == 99999873) {
session.Profile = 'Assistant'
}
else if(session.RoleID == 99999874) {
session.Profile = 'Department boss'
}
else if(session.RoleID == 99999875) {
session.Profile = 'Director'
}
else if(session.RoleID == 99999876) {
session.Profile = 'Deputy Director'
}
else if(session.RoleID == 99999885) {
session.Profile = 'Secretariat'
}
else if(session.RoleID == 99999886) {
session.Profile = 'General secretary'
}
session.Password = user.password
@@ -131,7 +148,7 @@ export class AuthService {
let responseChat = await this.httpService.post('login', postData).toPromise();
if(responseChat) {
console.log('Login to Rocket chat OK', responseChat);
this.ValidatedUserChat = responseChat;
localStorage.setItem('userChat', JSON.stringify(responseChat));
this.storageService.store(AuthConnstants.AUTH, responseChat);
@@ -211,7 +228,7 @@ export class AuthService {
this.NfService.downloadFileMsg = async (message: MessageService, room?: RoomService) => {
console.log('FILE TYPE', message.file.type)
// console.log('FILE TYPE', message.file.type)
let downloadFile = "";
if (message.file.type == "application/img") {
const event: any = await this.AttachmentsService.downloadFile(message.file.guid).toPromise();
@@ -220,7 +237,7 @@ export class AuthService {
if (event.type === HttpEventType.DownloadProgress) {
//this.downloadProgess = Math.round((100 * event.loaded) / event.total);
console.log('FILE TYPE 33', message.file.type)
// console.log('FILE TYPE 33', message.file.type)
return true
} else if (event.type === HttpEventType.Response) {
downloadFile = 'data:image/jpeg;base64,' + btoa(new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), ''));
@@ -232,7 +249,7 @@ export class AuthService {
}
await this.storage.set(message.file.guid, downloadFile).then(() => {
console.log('IMAGE SAVED')
// console.log('IMAGE SAVED')
});
return true
}