diff --git a/src/app/services/DomSanitizer.service.spec.ts b/src/app/services/DomSanitizer.service.spec.ts
new file mode 100644
index 000000000..e0212900a
--- /dev/null
+++ b/src/app/services/DomSanitizer.service.spec.ts
@@ -0,0 +1,16 @@
+import { TestBed } from '@angular/core/testing';
+
+import { DomSanitizerService } from './DomSanitizer.service';
+
+describe('ActiveTabService', () => {
+ let service: DomSanitizerService;
+
+ beforeEach(() => {
+ TestBed.configureTestingModule({});
+ service = TestBed.inject(DomSanitizerService);
+ });
+
+ it('should be created', () => {
+ expect(service).toBeTruthy();
+ });
+});
diff --git a/src/app/services/DomSanitizer.service.ts b/src/app/services/DomSanitizer.service.ts
new file mode 100644
index 000000000..e41857209
--- /dev/null
+++ b/src/app/services/DomSanitizer.service.ts
@@ -0,0 +1,20 @@
+import { Injectable, SecurityContext } from '@angular/core';
+import { DomSanitizer } from '@angular/platform-browser';
+import { Router } from '@angular/router';
+
+@Injectable({
+ providedIn: 'root'
+})
+export class DomSanitizerService {
+
+
+
+ constructor(private sanitizer: DomSanitizer) {
+
+
+ }
+
+ sanitizeInput(input: string): string {
+ return this.sanitizer.sanitize(SecurityContext.HTML, input);
+ }
+}
diff --git a/src/app/services/theme.service.ts b/src/app/services/theme.service.ts
index c881a4bb7..9e9d0653e 100644
--- a/src/app/services/theme.service.ts
+++ b/src/app/services/theme.service.ts
@@ -13,7 +13,7 @@ export class ThemeService {
'doneIt'
]
- private defaultTheme: any = 'gov'
+ private defaultTheme: any = 'default'
currentTheme: 'gov' | 'default' | 'doneIt' = this.defaultTheme
keyName: string
diff --git a/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.ts b/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.ts
index 396c11d80..4886c19d7 100644
--- a/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.ts
+++ b/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.ts
@@ -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=>{
diff --git a/src/app/shared/agenda/edit-event/edit-event.page.ts b/src/app/shared/agenda/edit-event/edit-event.page.ts
index 1918cea0a..337c3180c 100644
--- a/src/app/shared/agenda/edit-event/edit-event.page.ts
+++ b/src/app/shared/agenda/edit-event/edit-event.page.ts
@@ -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'
diff --git a/src/app/shared/agenda/new-event/new-event.page.html b/src/app/shared/agenda/new-event/new-event.page.html
index 7aec72e58..bca7d4e11 100644
--- a/src/app/shared/agenda/new-event/new-event.page.html
+++ b/src/app/shared/agenda/new-event/new-event.page.html
@@ -16,7 +16,7 @@
-
+
@@ -293,7 +293,7 @@
-
+
diff --git a/src/app/shared/agenda/new-event/new-event.page.ts b/src/app/shared/agenda/new-event/new-event.page.ts
index e0c90110c..fabbf552f 100644
--- a/src/app/shared/agenda/new-event/new-event.page.ts
+++ b/src/app/shared/agenda/new-event/new-event.page.ts
@@ -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) {
diff --git a/src/app/shared/agenda/view-event/view-event.page.html b/src/app/shared/agenda/view-event/view-event.page.html
index ddc34319b..3cd10fa57 100644
--- a/src/app/shared/agenda/view-event/view-event.page.html
+++ b/src/app/shared/agenda/view-event/view-event.page.html
@@ -31,7 +31,7 @@
diff --git a/src/app/shared/chat/group-messages/group-messages.page.html b/src/app/shared/chat/group-messages/group-messages.page.html
index 30655c9b1..5d2516d3f 100644
--- a/src/app/shared/chat/group-messages/group-messages.page.html
+++ b/src/app/shared/chat/group-messages/group-messages.page.html
@@ -8,7 +8,7 @@
diff --git a/src/app/shared/chat/messages/messages.page.html b/src/app/shared/chat/messages/messages.page.html
index 43111d900..ab8a5091d 100644
--- a/src/app/shared/chat/messages/messages.page.html
+++ b/src/app/shared/chat/messages/messages.page.html
@@ -9,7 +9,7 @@
diff --git a/src/app/shared/chat/messages/messages.page.ts b/src/app/shared/chat/messages/messages.page.ts
index 5f8a4245d..7653fb6b9 100644
--- a/src/app/shared/chat/messages/messages.page.ts
+++ b/src/app/shared/chat/messages/messages.page.ts
@@ -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) {
diff --git a/src/app/shared/gabinete-digital/generic/task-detail-header/task-detail-header.page.html b/src/app/shared/gabinete-digital/generic/task-detail-header/task-detail-header.page.html
index b301b2ac2..5c9a18d48 100644
--- a/src/app/shared/gabinete-digital/generic/task-detail-header/task-detail-header.page.html
+++ b/src/app/shared/gabinete-digital/generic/task-detail-header/task-detail-header.page.html
@@ -9,7 +9,7 @@
{{ task.Folio}}
-
+
diff --git a/src/app/shared/gabinete-digital/generic/task-details/task-details.page.html b/src/app/shared/gabinete-digital/generic/task-details/task-details.page.html
index 34e18c0f6..8c0e44185 100644
--- a/src/app/shared/gabinete-digital/generic/task-details/task-details.page.html
+++ b/src/app/shared/gabinete-digital/generic/task-details/task-details.page.html
@@ -9,7 +9,7 @@
{{ task.Folio}}
-
+
diff --git a/src/assets/images/donit.jpg b/src/assets/images/donit.jpg
new file mode 100644
index 000000000..b339554e3
Binary files /dev/null and b/src/assets/images/donit.jpg differ
diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts
index a9256d5a8..915b3d28f 100644
--- a/src/environments/environment.prod.ts
+++ b/src/environments/environment.prod.ts
@@ -4,4 +4,4 @@ import { doneITProd } from './suport/doneIt'
import { DevDev } from './suport/dev'
-export const environment: Environment = DevDev;
+export const environment: Environment = doneITProd;
diff --git a/src/environments/environment.ts b/src/environments/environment.ts
index 1618c4dec..b4e6335b1 100644
--- a/src/environments/environment.ts
+++ b/src/environments/environment.ts
@@ -4,4 +4,4 @@ import { doneITDev } from './suport/doneIt'
import { DevDev } from './suport/dev'
-export const environment: Environment = DevDev
+export const environment: Environment = doneITDev
diff --git a/src/environments/suport/doneIt.ts b/src/environments/suport/doneIt.ts
index b8214d0d2..ec9d71d5f 100644
--- a/src/environments/suport/doneIt.ts
+++ b/src/environments/suport/doneIt.ts
@@ -3,12 +3,16 @@ import { Environment } from './../../app/models/envarioment';
export const doneITProd: Environment = {
id:'1',
- apiURL: 'https://API.DONEIT.CO.AO/api/',
+ apiURL: 'https://gdapi-dev.dyndns.info/api/',
+ apiChatUrl: 'https://gdchat-dev.dyndns.info/api/v1/',
+ apiWsChatUrl: 'wss://gdchat-dev.dyndns.info/websocket',
+ apiPCURL: 'https://gdcmapi-dev.dyndns.info/api/',
+/* apiURL: 'https://API.DONEIT.CO.AO/api/',
apiChatUrl: 'https://CHAT.DONEIT.CO.AO/api/v1/',
apiWsChatUrl: 'wss://CHAT.DONEIT.CO.AO/websocket',
- apiPCURL: 'http://192.168.0.21:9099/api/',
+ apiPCURL: 'http://192.168.0.21:9099/api/', */
production: true,
- domain: 'equilibrium.co.ao',
+ domain: 'gabinetedigital.local',
defaultuser: '',
defaultuserpwd: '',
chatOffline: true,
@@ -29,14 +33,18 @@ export const doneITProd: Environment = {
export const doneITDev: Environment = {
id:'1',
- apiURL: 'https://API.DONEIT.CO.AO/api/',
+ apiURL: 'https://gdapi-dev.dyndns.info/api/',
+ apiChatUrl: 'https://gdchat-dev.dyndns.info/api/v1/',
+ apiWsChatUrl: 'wss://gdchat-dev.dyndns.info/websocket',
+ apiPCURL: 'https://gdcmapi-dev.dyndns.info/api/',
+/* apiURL: 'https://API.DONEIT.CO.AO/api/',
apiChatUrl: 'https://CHAT.DONEIT.CO.AO/api/v1/',
apiWsChatUrl: 'wss://CHAT.DONEIT.CO.AO/websocket',
- apiPCURL: 'http://192.168.0.21:9099/api/',
+ apiPCURL: 'http://192.168.0.21:9099/api/', */
production: true,
- domain: 'equilibrium.co.ao',
- defaultuser: 'peter.maquiran@equilibrium.co.ao',
- defaultuserpwd: 'codcodccx',
+ domain: 'gabinetedigital.local',
+ defaultuser: '',
+ defaultuserpwd: '',
chatOffline: true,
presidential: false,
version: versionData,