fix some bug on blue theme

This commit is contained in:
Eudes Inácio
2023-11-14 12:04:31 +01:00
parent 99d21a716b
commit af69d80453
30 changed files with 196 additions and 113 deletions
@@ -15,6 +15,7 @@ import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
import { EventToApproveEdit } from 'src/app/models/event.model';
import { ThemeService } from 'src/app/services/theme.service'
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
import { DomSanitizerService } from 'src/app/services/DomSanitizer.service';
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
@@ -131,7 +132,8 @@ export class EditEventToApprovePage implements OnInit {
private processes:ProcessesService,
private toastService: ToastService,
public ThemeService: ThemeService,
public httpErrorHandler: HttpErrorHandle
public httpErrorHandler: HttpErrorHandle,
private domSanitizeService: DomSanitizerService
) {
this.isEventEdited = false;
}
@@ -324,6 +326,10 @@ export class EditEventToApprovePage implements OnInit {
e.IsRequired = false
})
this.eventProcess.workflowInstanceDataFields.Subject = this.domSanitizeService.sanitizeInput(this.eventProcess.workflowInstanceDataFields.Subject);
this.eventProcess.workflowInstanceDataFields.Location = this.domSanitizeService.sanitizeInput(this.eventProcess.workflowInstanceDataFields.Location);
this.eventProcess.workflowInstanceDataFields.Body = this.domSanitizeService.sanitizeInput(this.eventProcess.workflowInstanceDataFields.Body);
this.eventProcess.workflowInstanceDataFields.ParticipantsList = this.taskParticipants.concat(this.taskParticipantsCc)
this.eventProcess.workflowInstanceDataFields.ParticipantsList.forEach(e=>{
@@ -15,6 +15,7 @@ import { ThemeService } from 'src/app/services/theme.service'
import { SessionStore } from 'src/app/store/session.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
import { ContactsService } from 'src/app/services/contacts.service'
import { DomSanitizerService } from 'src/app/services/DomSanitizer.service';
@Component({
selector: 'app-edit-event',
@@ -100,7 +101,8 @@ export class EditEventPage implements OnInit {
private attachmentsService: AttachmentsService,
public ThemeService: ThemeService,
private httpErrorHandle: HttpErrorHandle,
private contactsService: ContactsService
private contactsService: ContactsService,
private domSanitizeService: DomSanitizerService
) {}
ngOnInit() {
@@ -344,6 +346,9 @@ export class EditEventPage implements OnInit {
}
this._postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
this._postEvent.Subject = this.domSanitizeService.sanitizeInput(this._postEvent.Subject);
this._postEvent.Location = this.domSanitizeService.sanitizeInput(this._postEvent.Location);
this._postEvent.Body.Text = this.domSanitizeService.sanitizeInput(this._postEvent.Body.Text);
if(!this._postEvent.EventRecurrence.hasOwnProperty('Type')) {
this._postEvent.EventRecurrence.Type = '-1'
@@ -16,7 +16,7 @@
<div class="main-content">
<div class="ion-item-container" [class.input-error]="Form?.get('Subject')?.invalid && validateFrom ">
<ion-input appInputFilter autocomplete="on" autocorrect="on" spellcheck="true" type="text" placeholder="Assunto*" [(ngModel)]="postEvent.Subject"></ion-input>
<ion-input autocomplete="on" autocorrect="on" spellcheck="true" type="text" placeholder="Assunto*" [(ngModel)]="postEvent.Subject"></ion-input>
</div>
<div *ngIf="Form && validateFrom" >
@@ -293,7 +293,7 @@
</div>
<div class="ion-input-class-no-height flex-grow-1">
<ion-textarea appInputFilter class="heigh-200" autocomplete="on" autocorrect="on" spellcheck="true" [(ngModel)]="postEvent.Body.Text" placeholder="Detalhes" autoGrow="true" ></ion-textarea>
<ion-textarea class="heigh-200" autocomplete="on" autocorrect="on" spellcheck="true" [(ngModel)]="postEvent.Body.Text" placeholder="Detalhes" autoGrow="true" ></ion-textarea>
</div>
</div>
@@ -35,6 +35,7 @@ import { Subject } from 'rxjs';
import { TaskService } from 'src/app/services/task.service'
import { ContactsService } from 'src/app/services/contacts.service';
import { DomSanitizerService } from 'src/app/services/DomSanitizer.service';
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
parse: {
dateInput: "YYYY-MMMM-DD HH:mm"
@@ -147,6 +148,7 @@ export class NewEventPage implements OnInit {
private processeService: ProcessesService,
public TaskService: TaskService,
private contactsService: ContactsService,
private domSanitazerService: DomSanitizerService
) {
this.dateAdapter.setLocale('pt');
this.loggeduser = SessionStore.user;
@@ -503,6 +505,10 @@ export class NewEventPage implements OnInit {
}
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
this.postEvent.Subject = this.domSanitazerService.sanitizeInput(this.postEvent.Subject);
this.postEvent.Location = this.domSanitazerService.sanitizeInput(this.postEvent.Location);
this.postEvent.Body.Text = this.domSanitazerService.sanitizeInput(this.postEvent.Body.Text);
if (this.documents.length > 0) {
@@ -31,7 +31,7 @@
<!-- <div class="div-icon" (click)="openOptions()">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-menu.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/theme/blue/icons-menu.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-menu.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/{{ThemeService.currentTheme}}/icons-menu.svg"></ion-icon>
</div>
@@ -130,7 +130,7 @@
</div>
<!-- <div (click)="docIndex(i);LoadDocumentDetails()" class="doc-options">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-menu.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/theme/blue/icons-menu.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' "
src="assets/images/theme/gov/icons-menu.svg"></ion-icon>
</div> -->
@@ -8,7 +8,7 @@
<div class="right">
<!-- <div (click)=" ChatSystemService.getGroupRoom(this.roomId).deleteAll()">delete all</div> -->
<button title="Menu" class="btn-no-color" (click)="openGroupMessagesOptions()">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-menu.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/theme/blue/icons-menu.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-menu.svg"></ion-icon>
</button>
</div>
@@ -9,7 +9,7 @@
</div>
<div hidden class="right">
<button title="Menu" class="btn-no-color" (click)="_openMessagesOptions()">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-menu.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/theme/blue/icons-menu.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-menu.svg">
</ion-icon>
</button>
+88 -78
View File
@@ -650,7 +650,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
resultType: CameraResultType.Base64,
source: CameraSource.Camera
});
console.log('Selected: ', file)
var base64 = 'data:image/jpeg;base64,' + file.base64String
const compressedImage = await this.compressImageBase64(
base64,
@@ -658,7 +658,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
800, // maxHeight
0.9 // quality
).then((picture) => {
console.log('Selected: ', picture)
base64 = picture
});
@@ -790,42 +790,46 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
//const imageData = await this.fileToBase64Service.convert(file)
//
console.log('Selected: ', file)
var base64 = 'data:image/jpeg;base64,' + file.base64String
const compressedImage = await this.compressImageBase64(
base64,
800, // maxWidth
800, // maxHeight
0.9 // quality
).then((picture) => {
console.log('Selected: ', picture)
base64 = picture
});
if (file.format == "jpeg" || file.format == "png" || file.format == "gif") {
const response = await fetch(base64);
const blob = await response.blob();
const compressedImage = await this.compressImageBase64(
base64,
800, // maxWidth
800, // maxHeight
0.9 // quality
).then((picture) => {
console.log(base64)
base64 = picture
});
const formData = new FormData();
formData.append("blobFile", blob);
const response = await fetch(base64);
const blob = await response.blob();
console.log(base64)
const formData = new FormData();
formData.append("blobFile", blob);
this.ChatSystemService.getDmRoom(roomId).send({
file: {
"type": "application/img",
"guid": ''
},
temporaryData: formData,
attachments: [{
"title": file.path,
//"image_url": 'data:image/jpeg;base64,' + file.base64String,
"text": "description",
"title_link_download": false,
}],
attachmentsModelData: {
fileBase64: base64,
}
})
}
this.ChatSystemService.getDmRoom(roomId).send({
file: {
"type": "application/img",
"guid": ''
},
temporaryData: formData,
attachments: [{
"title": file.path,
//"image_url": 'data:image/jpeg;base64,' + file.base64String,
"text": "description",
"title_link_download": false,
}],
attachmentsModelData: {
fileBase64: base64,
}
})
}
@@ -838,63 +842,69 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
const file: any = await this.fileService.getFileFromDevice(types);
const fileName = file.name
if (file.type == 'application/pdf' || file.type == 'application/doc' || file.type == 'application/docx' ||
file.type == 'application/xls' || file.type == 'application/xlsx' || file.type == 'application/ppt' ||
file.type == 'application/pptx' || file.type == 'application/txt') {
const validation = this.FileValidatorService.fileNameValidation(fileName)
console.log('FILE', file)
if(validation.isOk) {
const fileName = file.name
const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch((error) => {
console.error(error);
})));
const validation = this.FileValidatorService.fileNameValidation(fileName)
let blob;
let formData
let fileBase64
if (this.platform.is("tablet")) {
if (validation.isOk) {
blob = this.fileService.base64toBlob(encodedData, file.type)
console.log('BLOB BLOB', blob)
const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch((error) => {
console.error(error);
})));
formData = new FormData();
formData.append('blobFile', blob);
/* console.log('add file', fileBase64) */
let blob;
let formData
let fileBase64
if (this.platform.is("tablet")) {
blob = this.fileService.base64toBlob(encodedData, file.type)
console.log('BLOB BLOB', blob)
formData = new FormData();
formData.append('blobFile', blob);
/* console.log('add file', fileBase64) */
} else {
blob = this.fileService.base64toBlob(encodedData, file.type)
fileBase64 = await this._getBase64(file)
formData = new FormData();
formData.append('blobFile', blob);
}
this.ChatSystemService.getDmRoom(roomId).send({
file: {
"type": file.type,
"guid": '',
},
attachments: [{
"title": file.name,
"name": file.name,
//"image_url": res,
// "text": "description",
"title_link_download": false,
}],
temporaryData: formData,
attachmentsModelData: {
fileBase64: fileBase64,
}
})
} else {
blob = this.fileService.base64toBlob(encodedData, file.type)
fileBase64 = await this._getBase64(file)
formData = new FormData();
formData.append('blobFile', blob);
this.toastService._badRequest("Ficheiro inválido")
}
this.ChatSystemService.getDmRoom(roomId).send({
file: {
"type": file.type,
"guid": '',
},
attachments: [{
"title": file.name,
"name": file.name,
//"image_url": res,
// "text": "description",
"title_link_download": false,
}],
temporaryData: formData,
attachmentsModelData: {
fileBase64: fileBase64,
}
})
} else {
this.toastService._badRequest("Ficheiro inválido")
}
}
_getBase64(file) {
@@ -9,7 +9,7 @@
<ion-label class="title">{{ task.Folio}}</ion-label>
</div>
<div class="div-icon" (click)="openOptions.emit()">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-menu.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/theme/blue/icons-menu.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-menu.svg"></ion-icon>
</div>
</div>
@@ -9,7 +9,7 @@
<ion-label class="title">{{ task.Folio}}</ion-label>
</div>
<div class="div-icon" (click)="openOptions.emit()">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-menu.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/theme/blue/icons-menu.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-menu.svg"></ion-icon>
</div>
</div>