fix actions and draft data object

This commit is contained in:
Peter Maquiran
2024-01-17 10:25:16 +01:00
parent 69ee75b039
commit 4314ae1bff
35 changed files with 556 additions and 305 deletions
+1 -1
View File
@@ -116,4 +116,4 @@ export const tokenInterceptor = {
provide: HTTP_INTERCEPTORS,
useClass: TokenInterceptor,
multi: true
};
};
+1 -1
View File
@@ -62,7 +62,7 @@ export class AddNotePage implements OnInit {
this.documents.push(data.selected);
}
}, (error) => {
console.log(error)
// console.log(error)
});
await modal.present();
@@ -108,7 +108,7 @@ export class CreateProcessPage implements OnInit {
this.fulltask = this.navParams.get('fulltask');
console.log('this.fulltask', this.fulltask)
// console.log('this.fulltask', this.fulltask)
// if(this.fulltask?.Documents) {
@@ -121,7 +121,7 @@ export class CreateProcessPage implements OnInit {
this.taskType = this.navParams.get('taskAction');
console.log('this.taskType ',this.taskType )
// console.log('this.taskType ',this.taskType )
this.postData = new Despacho();
this.participants = this.participants = new Array();
@@ -132,7 +132,7 @@ export class CreateProcessPage implements OnInit {
} else {
this.placeholderSubject = 'Selecione o tipo de assunto*'
}
let NumberPDPP;
@@ -184,7 +184,7 @@ export class CreateProcessPage implements OnInit {
}
ngOnInit() {
console.log('crete process')
// console.log('crete process')
this.getSubjectType();
/* setTimeout(() => {
this.selectedTypes = ['99999850'];
@@ -209,7 +209,7 @@ export class CreateProcessPage implements OnInit {
getSubjectType() {
this.processes.GetSubjectType().subscribe(res => {
console.log('subjectTypes',res)
// console.log('subjectTypes',res)
this.subjectTypes = res;
});
}
@@ -326,7 +326,7 @@ export class CreateProcessPage implements OnInit {
} else {
if (this.loggeduser.Profile != 'PR') {
console.log('Despacho MD');
// console.log('Despacho MD');
switch (this.taskType) {
case '0': // Despacho
this.postData = {
+37
View File
@@ -12,6 +12,26 @@ import { SearchPage } from 'src/app/pages/search/search.page';
import { ThemeService } from 'src/app/services/theme.service'
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
import { TaskService } from 'src/app/services/task.service'
import { z } from "zod";
const Bodyschema = z.object({
SerialNumber: z.string(),
DispatchDocId: z.number(),
FolderID: z.any(),
Subject: z.string(),
Comment: z.string().optional(),
DelegatedUserEmail: z.string().email(),
UserId: z.any(),
DraftIds: z.string(),
})
const ProsSchema = z.object({
DraftIds: z.string(),
})
@Component({
selector: 'app-delegar',
@@ -64,6 +84,19 @@ export class DelegarPage implements OnInit {
/* this.postData.EndDate = new Date(selectedEndDate.setMinutes(new Date().getMinutes() + 30)); */
this.hideThisFeature = this.navParams.get('showAttachmentBtn');
const result = ProsSchema.safeParse(this.task);
if(!result.success) {
console.log(result)
console.log("result")
console.log(result["error"])
} else {
console.log(result.data)
}
}
ngOnInit() {
@@ -86,6 +119,7 @@ export class DelegarPage implements OnInit {
else if(this.taskParticipants.length > 1){
this.toastService._badRequest("Selecione apenas um destinatário");
}
else {
let body = {
"SerialNumber": this.task.SerialNumber,
@@ -94,8 +128,11 @@ export class DelegarPage implements OnInit {
"Subject": this.task.Folio,
"Comment": this.note,
"DelegatedUserEmail": this.taskParticipants[0].EmailAddress,
"DraftIds": this.task.DraftIds,
"UserId": this.taskParticipants[0].Id
}
const loader = this.toastService.loading()
this.processes.DelegateTask(body).subscribe(res=>{
@@ -545,15 +545,15 @@ export class DocumentSetUpMeetingPage implements OnInit {
});
}
this.contacts = result;
console.log('Attendes Email', this.loggeduser.Email)
//console.log('Attendes Email', this.loggeduser.Email)
let filterLoggedUserEmail = this.contacts.filter(item => item.RoleDescription == "Ministro e Director do Gabinete do PR")
console.log('Attendes Email', filterLoggedUserEmail)
//console.log('Attendes Email', filterLoggedUserEmail)
this.contacts = filterLoggedUserEmail;
const newAttendees: EventPerson[] = this.contacts;
this.setIntervenient(newAttendees);
console.log('Attendes Email', this.contacts)
//console.log('Attendes Email', this.contacts)
}
);
}
@@ -125,7 +125,7 @@ export class ViewDocumentPage implements OnInit {
}
async openBookMeetingModal() {
console.log('this.Document----------', this.Document)
//console.log('this.Document----------', this.Document)
let classs;
if( window.innerWidth < 701) {
classs = 'book-meeting-modal modal modal-desktop'
@@ -165,7 +165,7 @@ export class ViewDocumentPage implements OnInit {
}
// check passing
console.log('this.Document----------openExpedientActionsModal', this.Document)
//console.log('this.Document----------openExpedientActionsModal', this.Document)
const modal = await this.modalController.create({
component: ExpedientTaskModalPage,
componentProps: {
+2 -1
View File
@@ -5,4 +5,5 @@ export class EventPerson{
UserType: string;
IsPR: boolean;
RoleDescription: string;
}
Id: string
}
+1 -1
View File
@@ -429,7 +429,7 @@ export class AgendaPage implements OnInit {
}, 300)
}, 10)
} catch (error) {
console.log(error)
// console.log(error)
}
}
@@ -659,7 +659,7 @@ export class NewEventPage implements OnInit {
} catch (error) {
}
console.log('selectedCalendar', selectedCalendar)
// console.log('selectedCalendar', selectedCalendar)
if (selectedCalendar) {
if (selectedCalendar.Role = 'Presidente da República') {
@@ -859,15 +859,15 @@ export class NewEventPage implements OnInit {
});
}
this.contacts = result;
console.log('Attendes Email', this.loggeduser.Email)
//console.log('Attendes Email', this.loggeduser.Email)
let filterLoggedUserEmail = this.contacts.filter(item => item.RoleDescription == "Ministro e Director do Gabinete do PR")
console.log('Attendes Email', filterLoggedUserEmail)
//console.log('Attendes Email', filterLoggedUserEmail)
this.contacts = filterLoggedUserEmail;
const newAttendees: EventPerson[] = this.contacts;
this.setIntervenient(newAttendees);
console.log('Attendes Email', this.contacts)
//console.log('Attendes Email', this.contacts)
}
);
}
+5 -5
View File
@@ -153,7 +153,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
ngOnInit() {
try {
console.log(this.router.url);
// console.log(this.router.url);
this.createDirectoryImage()
// this.chatService.refreshtoken();
this.ChatSystemService.getUserOfRoom(this.roomId).then((value) => {
@@ -661,7 +661,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
imageBase64 = picture
});
console.log(imageBase64)
//console.log(imageBase64)
const blob = this.dataURItoBlob(imageBase64)
const formData = new FormData();
@@ -790,15 +790,15 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
imageBase64 = picture
});
console.log(imageBase64)
//console.log(imageBase64)
const response = await fetch(imageBase64);
const blob = await response.blob();
const formData = new FormData();
console.log('add file', formData)
//console.log('add file', formData)
formData.append("blobFile", blob);
console.log('add file', formData)
//console.log('add file', formData)
this.ChatSystemService.getDmRoom(roomId).send({
file: {
@@ -112,7 +112,8 @@ export class DespachoPrPage implements OnInit {
"DeadlineType": res.workflowInstanceDataFields.DeadlineType,
"Deadline": res.deadline,
"activityInstanceName": res.activityInstanceName,
"TaskStartDate": res.taskStartDate
"TaskStartDate": res.taskStartDate,
"DraftIds": res.workflowInstanceDataFields?.DraftIds
}
this.fulltask = res;
let stringDraft = res.workflowInstanceDataFields.DraftIds;
@@ -629,17 +630,17 @@ export class DespachoPrPage implements OnInit {
this.processes.GetDraftByID(element).subscribe((resd) => {
let object = {
"ApplicationId": "",
"Assunto": resd.data.description,
"Assunto": resd.data.document.description,
"DocDate": "",
"DocId": resd.data.id,
"DocId": resd.data.document.id,
"DocNumber": "",
"FolderId": "",
"Sender": "",
"SourceDocId": "",
"content": resd.data.content,
"path": resd.data.path,
"ownerId": resd.data.ownerId,
"status": resd.data.status,
"content": resd.data.document.content,
"path": resd.data.document.path,
"ownerId": resd.data.document.ownerId,
"status": resd.data.document.status,
}
this.mergedArray.push(object)
console.log('List of draff', resd)
@@ -142,8 +142,11 @@ export class DespachoPage implements OnInit {
"activityInstanceName": res.activityInstanceName,
"Status": res.workflowInstanceDataFields.Status,
"Deadline": res.deadline,
"DraftIds": res.workflowInstanceDataFields?.DraftIds
}
// console.log({res})
// this.updateProcessOnDB(res);
this.fulltask = res;
@@ -205,17 +208,17 @@ export class DespachoPage implements OnInit {
this.processes.GetDraftByID(element).subscribe((resd) => {
let object = {
"ApplicationId": "",
"Assunto": resd.data.description,
"Assunto": resd.data.document.description,
"DocDate": "",
"DocId": resd.data.id,
"DocId": resd.data.document.id,
"DocNumber": "",
"FolderId": "",
"Sender": "",
"SourceDocId": "",
"content": resd.data.content,
"path": resd.data.path,
"ownerId": resd.data.ownerId,
"status": resd.data.status,
"content": resd.data.document.content,
"path": resd.data.document.path,
"ownerId": resd.data.document.ownerId,
"status": resd.data.document.status,
}
this.mergedArray.push(object)
// console.log('List of draff', resd)
@@ -481,17 +481,17 @@ export class DiplomaAssinarPage implements OnInit {
let object = {
"ApplicationId": "",
"Assunto": resd.data.description,
"Assunto": resd.data.document.description,
"DocDate": "",
"DocId": resd.data.id,
"DocId": resd.data.document.id,
"DocNumber": "",
"FolderId": "",
"Sender": "",
"SourceDocId": "",
"content": resd.data.content,
"path": resd.data.path,
"ownerId": resd.data.ownerId,
"status": resd.data.status,
"content": resd.data.document.content,
"path": resd.data.document.path,
"ownerId": resd.data.document.ownerId,
"status": resd.data.document.status,
};
this.draftArray.push(object);
this.mergedArray.push(object);
@@ -106,7 +106,8 @@ export class DiplomasGerarPage implements OnInit {
"DeadlineType": res.workflowInstanceDataFields.DeadlineType,
"activityInstanceName": res.activityInstanceName,
"Deadline": res.deadline,
"TaskStartDate": res.taskStartDate
"TaskStartDate": res.taskStartDate,
"DraftIds": res.workflowInstanceDataFields?.DraftIds
}
this.fulltask = res;
@@ -144,6 +144,8 @@ export class DiplomaPage implements OnInit {
let stringDraft = res.workflowInstanceDataFields.DraftIds;
let split_stringDraft = stringDraft?.split(";").filter(Boolean);
console.log({split_stringDraft})
this.mergedArray = []
try {
this.getDraft(split_stringDraft);
@@ -537,17 +539,17 @@ export class DiplomaPage implements OnInit {
let object = {
"ApplicationId": "",
"Assunto": resd.data.description,
"Assunto": resd.data.document.description,
"DocDate": "",
"DocId": resd.data.id,
"DocId": resd.data.document.id,
"DocNumber": "",
"FolderId": "",
"Sender": "",
"SourceDocId": "",
"content": resd.data.content,
"path": resd.data.path,
"ownerId": resd.data.ownerId,
"status": resd.data.status,
"content": resd.data.document.content,
"path": resd.data.document.path,
"ownerId": resd.data.document.ownerId,
"status": resd.data.document.status,
}
this.mergedArray.push(object)
this.DraftNames = this.DraftNames + resd.data.description+";"
@@ -70,7 +70,7 @@ export class GabineteDigitalPage implements OnInit {
SessionStore = SessionStore
expedienteTaskPipe = new ExpedienteTaskPipe();
customTaskPipe = new CustomTaskPipe()
@@ -86,7 +86,7 @@ export class GabineteDigitalPage implements OnInit {
filterName: 'Para hoje' | 'Novos'| 'Lidos'| 'Não lidos'| 'OverdueTasks' | 'Todos' = 'Todos'
hideSearchBtn: boolean = false;
showSearch = true;
searchSubject: string = '';
@@ -160,21 +160,21 @@ export class GabineteDigitalPage implements OnInit {
const ordinance = this.ordinance
if(this.showSearch && this.searchSubject) {
const AllProcess = this.TaskService.AllProcess.filter((task) => {
let subject = task.Folio || task.Subject || task.workflowInstanceDataFields.Subject
subject = subject.toLowerCase();
return subject.includes(this.searchSubject.toLowerCase())
})
if(ordinance == this.ordinance) {
this.AllProcess = this.TaskService.reorderList(this.ordinance, AllProcess)
.filter( task => this.TaskService.filter(task, this.filterName))
}
} else {
const AllProcess = this.TaskService.AllProcess.filter( task => this.TaskService.filter(task, this.filterName))
if(ordinance == this.ordinance) {
this.AllProcess = this.TaskService.reorderList(this.ordinance, AllProcess)
.filter( task => this.TaskService.filter(task, this.filterName))
@@ -198,7 +198,7 @@ export class GabineteDigitalPage implements OnInit {
(async () => {
await this.loadAllProcesses()
this.TaskService.registerCallback({
@@ -208,12 +208,12 @@ export class GabineteDigitalPage implements OnInit {
}
})
})();
this.checkFilter();
this.checkRoutes();
this.dynamicSearch()
const pathname = '/home/gabinete-digital'
this.router.events.forEach((event) => {
if (event instanceof NavigationEnd && event.url.includes(pathname) && !event.url.includes('/home/gabinete-digital/')) {
@@ -230,13 +230,13 @@ export class GabineteDigitalPage implements OnInit {
// this.LoadCounts();
this.checkFilter()
}
this.mobile()
}
})
}
});
}
ngAfterViewInit(): void {
@@ -247,11 +247,11 @@ export class GabineteDigitalPage implements OnInit {
this.scroll.nativeElement.addEventListener("scroll", (e)=> {
this.changeTab()
});
} catch(error) {
}
}
@@ -269,7 +269,7 @@ export class GabineteDigitalPage implements OnInit {
} else {
this.refresh = false
}
}, 100);
}
@@ -291,14 +291,14 @@ export class GabineteDigitalPage implements OnInit {
this.dynamicSearch()
}
// console.log('this.filterName', this.filterName)
}
}
goto(url) {
this.router.navigate([url])
}
goToProcess(serialNumber: string, workflowName: string, activityName: string) {
@@ -349,7 +349,6 @@ export class GabineteDigitalPage implements OnInit {
}
hideRefreshButton() {
console.log(this.router.url)
if (window.innerWidth < 701) {
this.hideRefreshBtn = false;
this.hideInMobile = false;
@@ -363,7 +362,6 @@ export class GabineteDigitalPage implements OnInit {
}
mobile() {
console.log(this.router.url)
if (window.innerWidth < 701 && this.router.url.includes('filter=')) {
this.hideRefreshBtn = false;
this.hideInMobile = false;
@@ -375,7 +373,7 @@ export class GabineteDigitalPage implements OnInit {
checkRoutes() {
this.closeAllDesktopComponents();
// console.log(this.router.url, this.router.url.includes('processes=true'))
// alert('hello')s
if (this.router.url.includes('processes=true')) {
@@ -463,7 +461,7 @@ export class GabineteDigitalPage implements OnInit {
}
async loadAllProcesses() {
// this.skeletonLoader = true
await this.TaskService.LoadTask()
this.dynamicSearch()
@@ -472,14 +470,14 @@ export class GabineteDigitalPage implements OnInit {
doRefreshAside() {
try {
window['gabinete-aside-refresh']()
} catch(error) {}
setTimeout(() => {
this.loadAllProcesses();
}, 1000)
}, 1000)
}
doRefresh(event) {
@@ -494,7 +492,7 @@ export class GabineteDigitalPage implements OnInit {
event?.target?.complete();
} catch(error) {}
} catch(error) {}
}, 2000);
}
else {
@@ -671,7 +669,7 @@ export class GabineteDigitalPage implements OnInit {
this.segment = segment;
if (window.innerWidth < 701) {
let navigationExtras: NavigationExtras = { queryParams: { "gerarDiplomas": true }}
this.router.navigate(['/home/gabinete-digital/diplomas-gerar'], navigationExtras);
@@ -69,7 +69,7 @@ export class PedidoPage implements OnInit {
this.loggeduser = SessionStore.user;
this.activatedRoute.paramMap.subscribe(params => {
//
//
if (params["params"].SerialNumber) {
this.serialnumber = params["params"].SerialNumber;
@@ -103,9 +103,9 @@ export class PedidoPage implements OnInit {
this.processes.GetTask(this.serialnumber).subscribe(res => {
this.fulltask = res
this.TaskService.loadPedidos();
if (res.workflowDisplayName == 'Pedido de Parecer' || res.workflowDisplayName == 'Pedido de Parecer do Presidente') {
let date = new Date(res.taskStartDate);
@@ -131,7 +131,7 @@ export class PedidoPage implements OnInit {
"Status": res.workflowInstanceDataFields.Status,
"Deadline": res.deadline,
}
// this.updateProcess(res);
}
else if (res.workflowDisplayName == 'Pedido de Deferimento') {
@@ -156,6 +156,7 @@ export class PedidoPage implements OnInit {
"ProcessInstanceID": res.workflowInstanceDataFields.InstanceID,
"activityInstanceName": res.activityInstanceName,
"Status": res.workflowInstanceDataFields.Status,
"DraftIds": res.workflowInstanceDataFields?.DraftIds
}
// this.updateProcess(res)
}
@@ -164,7 +165,7 @@ export class PedidoPage implements OnInit {
this.customDate = this.days[thedate.getDay()] + ", " + thedate.getDate() + " de " + (this.months[thedate.getMonth()]);
this.processes.GetTaskParticipants(res.workflowInstanceDataFields.FolderID).subscribe((users = []) => {
// this.updateProcessInterveners(users)
this.intervenientes = users.filter(user => {
return user.Type == 'I';
@@ -214,7 +215,7 @@ export class PedidoPage implements OnInit {
getDocumentDetails(forlderId: string, applicationId: string) {
this.processes.GetDocumentDetails(forlderId, applicationId).subscribe(res => {
this.attachments = res.Documents;
})
}
@@ -345,7 +346,7 @@ export class PedidoPage implements OnInit {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
} finally {
@@ -385,7 +386,7 @@ export class PedidoPage implements OnInit {
});
modal.onDidDismiss().then(res => {
this.goBack();
}, (error) => {
console.log(error)
@@ -471,7 +472,7 @@ export class PedidoPage implements OnInit {
// }
async distartExpedientModal() {
const modal = await this.modalController.create({
component: DiscartExpedientModalPage,
componentProps: {
@@ -487,7 +488,7 @@ export class PedidoPage implements OnInit {
modal.onDidDismiss().then(res => {
if (res['data'] == 'close') {
this.close();
/*
/*
this.close();
this.openMenu(); */
}
@@ -500,7 +501,7 @@ export class PedidoPage implements OnInit {
}
async openDelegarModal(task: any) {
let classs;
if (window.innerWidth <= 800) {
@@ -516,7 +517,7 @@ export class PedidoPage implements OnInit {
cssClass: classs,
backdropDismiss: false
});
modal.onDidDismiss().then(res => {
if(res){
const data = res.data;
@@ -554,12 +555,12 @@ export class PedidoPage implements OnInit {
(error) => {
console.log(error)
})
await modal.present();
}
async openDarParecer(task: any) {
let classs;
if (window.innerWidth < 701) {
@@ -32,7 +32,7 @@
<div class="d-flex justify-content-between">
<div class="d-flex">
<ion-thumbnail *ngFor="let seleted of seletedContent.slice(0, displayLimit), let i = index" (click)="deleteFromSeletedContent(i)" lot="start">
<div *ngFor="let seleted of seletedContent.slice(0, displayLimit), let i = index" lot="start">
<ion-img *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'image'" [(ngModel)]="capturedImage"
name="image" ngDefaultControl [src]="'data:image/jpg;base64,' + seleted.FileBase64"
@@ -43,7 +43,11 @@
<source type="video/mp4" [src]="'data:video/mp4;base64,' + seleted.FileBase64">
</video>
</ion-thumbnail>
<div class="text-center cursor-pointer" (click)="deleteFromSeletedContent(i)">
<ion-icon src="assets/images/theme/gov/icons-delete.svg" class="delete md hydrated"></ion-icon>
</div>
</div>
<!-- Display the blurred image and count if there are more images -->
<ion-thumbnail *ngIf="seletedContent.length > displayLimit" lot="start">
<ion-img [src]="'data:image/jpg;base64,' + seletedContent[displayLimit - 1].base64"
@@ -57,9 +61,6 @@
</ion-label>
</div>
<div class="font-25" (click)="clear()">
<ion-icon name="close"></ion-icon>
</div>
</div>
</div>
@@ -400,21 +400,14 @@ export class NewPublicationPage implements OnInit {
if (this.publicationType == '3') {
const loader = this.toastService.loading()
this.publication = {
DateIndex: this.publication.DateIndex,
DocumentId: this.publication.DocumentId,
ProcessId: this.publication.ProcessId,
Title: this.pub.Title,
Message: this.pub.Message,
DatePublication: this.publication.DatePublication,
OriginalFileName: this.publication.OriginalFileName,
Files: this.seletedContent,
}
/* else {
if (this.seletedContent.length >= 1) {
const loader = this.toastService.loading()
this.publication = {
DateIndex: this.publication.DateIndex,
DocumentId: this.publication.DocumentId,
@@ -423,79 +416,77 @@ export class NewPublicationPage implements OnInit {
Message: this.pub.Message,
DatePublication: this.publication.DatePublication,
OriginalFileName: this.publication.OriginalFileName,
FileBase64: this.publication.FileBase64,
FileExtension: this.publication.FileExtension || 'jpeg',
Files: this.seletedContent,
}
} */
try {
const response = await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
this.httpErrorHandle.httpsSucessMessagge('Editar publicação')
console.log({ response })
this.close();
} catch (error) {
if (error.status == 404) {
this.PublicationFolderService.deletePost(this.publication.ProcessId, this.publication.DocumentId)
try {
const response = await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
this.httpErrorHandle.httpsSucessMessagge('Editar publicação')
console.log({ response })
this.close();
} catch (error) {
if (error.status == 404) {
this.PublicationFolderService.deletePost(this.publication.ProcessId, this.publication.DocumentId)
this.close();
}
this.httpErrorHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
this.httpErrorHandle.httpStatusHandle(error)
} finally {
loader.remove()
} else {
this.toastService._badRequest("É necessário adicionar anexo")
}
}
else {
const date = formatDate(new Date(), 'yyyy-MM-dd HH:mm:ss')
/* if (this.capturedImage != '') { */
this.publication = {
DateIndex: date,
DocumentId: null,
ProcessId: this.folderId,
Title: this.pub.Title,
Message: this.pub.Message,
DatePublication: date,
OriginalFileName: this.capturedImageTitle,
Files: this.seletedContent,
/* FileExtension: 'jpeg', */
}
if (this.seletedContent.length >= 1) {
/* } else if (this.capturedVideo != '') {
this.publication = {
DateIndex: date,
DocumentId: null,
ProcessId: this.folderId,
Title: this.pub.Title,
Message: this.pub.Message,
DatePublication: date,
OriginalFileName: this.capturedImageTitle || 'video',
Files: this.seletedContent,
FileExtension: 'mp4',
}
} */
const date = formatDate(new Date(), 'yyyy-MM-dd HH:mm:ss')
/* if (this.capturedImage != '') { */
this.publication = {
DateIndex: date,
DocumentId: null,
ProcessId: this.folderId,
Title: this.pub.Title,
Message: this.pub.Message,
DatePublication: date,
OriginalFileName: this.capturedImageTitle,
Files: this.seletedContent,
/* FileExtension: 'jpeg', */
}
const loader = this.toastService.loading()
try {
await this.publications.CreatePublication(this.folderId, this.publication).toPromise();
this.close();
this.httpErrorHandle.httpsSucessMessagge('Criar publicação')
window["sharedContent"] = null;
this.close();
} catch (error) {
this.httpErrorHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
const loader = this.toastService.loading()
try {
await this.publications.CreatePublication(this.folderId, this.publication).toPromise();
this.close();
this.httpErrorHandle.httpsSucessMessagge('Criar publicação')
window["sharedContent"] = null;
this.close();
} catch (error) {
this.httpErrorHandle.httpStatusHandle(error)
} finally {
loader.remove()
} else {
this.toastService._badRequest("É necessário adicionar anexo")
}
}
@@ -716,4 +707,3 @@ export class NewPublicationPage implements OnInit {
}
}
@@ -122,13 +122,10 @@ ion-toolbar {
.post-img {
width: 100%;
height: 100%;
max-height: 400px;
min-height: 350px;
min-width: 350px;
margin: 5px auto;
border-radius: 0px !important;
overflow: hidden;
background-color: white;
@@ -136,6 +133,10 @@ ion-toolbar {
justify-content: center;
align-items: center;
background: black;
-webkit-border-radius: 0px !important;
-moz-border-radius: 0px !important;
-ms-border-radius: 0px !important;
-o-border-radius: 0px !important;
}
.post-video {
width: 100%;
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { SocketConnectionMCRService } from './socket-connection-mcr.service';
describe('SocketConnectionMCRService', () => {
let service: SocketConnectionMCRService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(SocketConnectionMCRService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
@@ -0,0 +1,27 @@
import { Injectable } from '@angular/core';
import * as signalR from "@microsoft/signalr"
import { SessionStore } from '../store/session.service';
@Injectable({
providedIn: 'root'
})
export class SocketConnectionMCRService {
constructor() { }
connect() {
var connection = new signalR.HubConnectionBuilder()
.withUrl("https://gdcmapi-dev.dyndns.info/FileHub", {
accessTokenFactory: () => SessionStore.user.Authorization
}).configureLogging(signalR.LogLevel.Information)
.build()
connection.on("ReceiveMessage", (message) => {
console.log(message)
})
}
}
@@ -155,4 +155,28 @@ export class MiddlewareServiceService {
return this.http.post<IuploadFileLK>(`${geturl}`, formData, options)
}
// ===========================================================================
CMAPIFileContent({length, path, index, blobFile}) {
const headers = new HttpHeaders();
headers.set('Authorization', 'Bearer ' + SessionStore.user.Authorization);
//const geturl = environment.apiURL + 'Tasks/DelegateTask';
const geturl = environment.apiURL + 'ObjectServer/UploadFiles';
let options = {
headers: headers
};
const formData = new FormData();
formData.append("blobFile", blobFile);
formData.append("length", length);
formData.append("index", index.toString());
formData.append("path", path);
return this.http.post<IuploadFileLK>(`${geturl}`, formData, options)
}
}
@@ -1,8 +1,8 @@
import { Component, OnInit, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';
import { NavigationEnd, Router } from '@angular/router';
import { LoginUserRespose } from 'src/app/models/user.model';
import { ThemeService } from 'src/app/services/theme.service'
import { TaskService } from 'src/app/services/task.service'
import { ThemeService } from 'src/app/services/theme.service';
import { TaskService } from 'src/app/services/task.service';
@Component({
selector: 'app-all-processes',
@@ -17,7 +17,7 @@ export class AllProcessesPage implements OnInit {
hideSearchBtn: boolean = false;
showSearch = false;
searchSubject: string = '';
filterName: 'Para hoje' | 'Novos'| 'Lidos'| 'Não lidos'| 'OverdueTasks' | 'Todos' = 'Todos'
/* miniSearch = new MiniSearch({
@@ -28,7 +28,7 @@ export class AllProcessesPage implements OnInit {
AllProcess = []
ordinance: string = 'old'
/**
* @description Update List subcription
*/
@@ -55,7 +55,7 @@ export class AllProcessesPage implements OnInit {
funx:() => {
this.dynamicSearch()
}
})
@@ -103,13 +103,13 @@ export class AllProcessesPage implements OnInit {
this.ordinance = orderBy;
this.cdr.markForCheck()
this.dynamicSearch();
this.dynamicSearch();
}
async dynamicSearch() {
if(this.showSearch && this.searchSubject) {
const AllProcess = this.TaskService.AllProcess.filter((task) => {
let subject = task.Folio || task.Subject || task.workflowInstanceDataFields.Subject
subject = subject.toLowerCase();
@@ -137,7 +137,7 @@ export class AllProcessesPage implements OnInit {
}
this.cdr.markForCheck()
}
}
goToProcess(serialNumber: string, workflowName: string, activityName: string) {
@@ -15,11 +15,11 @@ export class TaskDetailsPage implements OnInit {
@Input() customDate = ''
@Input() mergedArray = []
@Input() fulltask = new fullTask()
@Output() openOptions = new EventEmitter<any>();
@Output() goBack = new EventEmitter<any>();
@Output() viewDocument = new EventEmitter<any>();
constructor(
public ThemeService: ThemeService
) { }
@@ -40,40 +40,45 @@
<!-- Captured -->
<div class="ion-item-container-no-border" *ngIf="seletedContent.length > 0">
<ion-label class="attached-title pb-10">Fotografia Anexada</ion-label>
<div class="d-flex justify-content-between">
<div *ngIf="seletedContent.length > 0">
<ion-label class="attached-title pb-10">Anexos</ion-label>
<div>
<div class="d-flex">
<ion-thumbnail *ngFor="let seleted of seletedContent.slice(0, displayLimit), let i = index" (click)="deleteFromSeletedContent(i)" lot="start">
<div *ngFor="let seleted of seletedContent.slice(0, displayLimit), let i = index" lot="start" class="mr-10">
<div>
<ion-img *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'image'"
name="image" ngDefaultControl [src]="seleted.FileBase64" style="width: 50px;"></ion-img>
<ion-img *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'image'"
name="image" ngDefaultControl [src]="seleted.FileBase64"></ion-img>
<video *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'video'" width="70" height="70"
preload="metadata" webkit-playsinline="webkit-playsinline">
<source type="video/mp4" [src]="seleted.FileBase64">
</video>
<video *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'video'" width="70" height="70"
preload="metadata" webkit-playsinline="webkit-playsinline">
<source type="video/mp4" [src]="seleted.FileBase64">
</video>
<div class="text-center cursor-pointer" (click)="deleteFromSeletedContent(i)">
<ion-icon src="assets/images/theme/gov/icons-delete.svg" class="delete md hydrated"></ion-icon>
</div>
</div>
</ion-thumbnail>
</div>
<!-- Display the blurred image and count if there are more images -->
<ion-thumbnail *ngIf="seletedContent.length > displayLimit" lot="start">
<div *ngIf="seletedContent.length > displayLimit" lot="start">
<ion-img [src]="'data:image/jpg;base64,' + seletedContent[displayLimit - 1].FileBase64"
style="filter: blur(5px);"></ion-img>
<p>mais {{ seletedContent.length - displayLimit }}</p>
</ion-thumbnail>
</div>
<ion-label class="pl-10">
<p>{{capturedImageTitle}}</p>
<p hidden>size</p>
</ion-label>
</div>
<button class="btn-no-color" (click)="clear()">
<!-- <button class="btn-no-color" (click)="clear()">
<ion-icon name="close"></ion-icon>
</button>
</button> -->
</div>
</div>
@@ -102,7 +107,7 @@
</div>
</div> -->
<div class="ion-item-container-no-border hide-desktop">
<div class="hide-desktop">
<ion-label (click)="loadVideo()">
<div class="attach-icon">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-add-photo.svg"></ion-icon>
@@ -115,7 +120,7 @@
</ion-label>
</div>
<div class="ion-item-container-no-border">
<div >
<ion-label (click)="loadVideo()" class="cursor-pointer">
<div class="attach-icon">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-add-photos.svg"></ion-icon>
File diff suppressed because one or more lines are too long
@@ -58,6 +58,10 @@
</div>
</swiper-slide>
<!-- <div *ngIf="publication?.Files?.length == 0">
12
</div>
-->
<!--
<div class="swiper-button-next"
@@ -195,16 +195,17 @@
.post-content{
margin: 0 auto;
margin-bottom: 35px;
min-width: 468px;
}
.post-title-time{
width: 100%;
overflow: auto;
}
.post-title{
width: 60%;
float: left;
font-size: rem(15);
color: var(--title-text-color);
width: 60%;
float: left;
font-size: rem(15);
color: #0d89d1;
}
.post-data{
width: 40%;
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { CMAPIService } from './cmapi.service';
describe('CMAPIService', () => {
let service: CMAPIService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(CMAPIService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
@@ -0,0 +1,26 @@
import { Injectable } from '@angular/core';
import { MiddlewareServiceService } from "src/app/shared/API/middleware/middleware-service.service";
import { ok, err } from 'neverthrow';
@Injectable({
providedIn: 'root'
})
export class CMAPIService {
constructor(public MiddlewareServiceService: MiddlewareServiceService) {
window["CMAPIService"] = this
}
async FileContent({length, path, index, blobFile}) {
try {
const result = await this.MiddlewareServiceService.CMAPIFileContent({length, path, index, blobFile}).toPromise();
return ok(result)
} catch (error) {
return err(error)
}
}
}