mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
Merge branch 'feature/viewer-attachment' of https://bitbucket.org/equilibriumito/gabinete-digital-fo into feature/viewer-attachment
This commit is contained in:
@@ -6,6 +6,7 @@ import { ThemeService } from 'src/app/services/theme.service';
|
|||||||
import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
|
import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
|
||||||
import { SessionStore } from 'src/app/store/session.service';
|
import { SessionStore } from 'src/app/store/session.service';
|
||||||
import { ToastService } from 'src/app/services/toast.service';
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
|
import { catchError } from 'rxjs/operators';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-new-group',
|
selector: 'app-new-group',
|
||||||
@@ -66,46 +67,72 @@ export class NewGroupPage implements OnInit {
|
|||||||
let customFields = {}
|
let customFields = {}
|
||||||
let res: any;
|
let res: any;
|
||||||
|
|
||||||
if (this.thedate) {
|
if(!SessionStore.user?.ChatData?.data) {
|
||||||
let customFields = {
|
this.toastService._successMessage("Chat temporariamente indisponível")
|
||||||
"countDownDate": this.thedate
|
|
||||||
}
|
|
||||||
res = await this.ChatSystemService.createPrivateRoom(name, SessionStore.user.UserName, customFields);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
res = await this.ChatSystemService.createPrivateRoom(name, SessionStore.user.UserName, customFields);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.isGroupCreated = true;
|
try {
|
||||||
this.addContacts(res.result);
|
|
||||||
this.ChatSystemService.getRoom([res.result]);
|
|
||||||
|
|
||||||
setTimeout(() => {
|
if (this.thedate) {
|
||||||
this.ChatSystemService.subscribeToRoomUpdate(res.result.rid, res.result);
|
let customFields = {
|
||||||
}, 10)
|
"countDownDate": this.thedate
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (res?.result?.rid) {
|
|
||||||
|
|
||||||
this.ChatSystemService.getAllRooms(() => {
|
|
||||||
if (!this.ChatSystemService.getGroupRoom(res.result.rid)) {
|
|
||||||
this.createGroupWithAttachmentsCath(res)
|
|
||||||
} else {
|
|
||||||
setTimeout(() => {
|
|
||||||
|
|
||||||
this.createGroupWithAttachments(res)
|
|
||||||
|
|
||||||
}, 500)
|
|
||||||
}
|
}
|
||||||
}, res.result.rid);
|
res = await this.ChatSystemService.createPrivateRoom(name, SessionStore.user.UserName, customFields);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
res = await this.ChatSystemService.createPrivateRoom(name, SessionStore.user.UserName, customFields);
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
this.isGroupCreated = true;
|
||||||
|
this.addContacts(res.result);
|
||||||
|
this.ChatSystemService.getRoom([res.result]);
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
this.ChatSystemService.subscribeToRoomUpdate(res.result.rid, res.result);
|
||||||
|
}, 10)
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
await this.ChatSystemService.getUser();
|
||||||
|
await this.ChatSystemService.getAllRooms();
|
||||||
|
await this.ChatSystemService.subscribeToRoom();
|
||||||
|
|
||||||
|
this.isGroupCreated = true;
|
||||||
|
this.addContacts(res.result);
|
||||||
|
this.ChatSystemService.getRoom([res.result]);
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
this.ChatSystemService.subscribeToRoomUpdate(res.result.rid, res.result);
|
||||||
|
}, 10)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
if (res?.result?.rid) {
|
||||||
|
|
||||||
this.toastService._badRequest('Existe um grupo com este nome!');
|
this.ChatSystemService.getAllRooms(() => {
|
||||||
|
if (!this.ChatSystemService.getGroupRoom(res.result.rid)) {
|
||||||
|
this.createGroupWithAttachmentsCath(res)
|
||||||
|
} else {
|
||||||
|
setTimeout(() => {
|
||||||
|
|
||||||
|
this.createGroupWithAttachments(res)
|
||||||
|
|
||||||
|
}, 500)
|
||||||
|
}
|
||||||
|
}, res.result.rid);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.toastService._badRequest('Existe um grupo com este nome!');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch(error) {
|
||||||
|
this.toastService._successMessage("Chat temporariamente indisponível")
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -246,7 +246,7 @@ GetIdsPublicationNext(id:any){
|
|||||||
body.Files = body.Files.map( e => ({
|
body.Files = body.Files.map( e => ({
|
||||||
FileBase64: e.FileBase64,
|
FileBase64: e.FileBase64,
|
||||||
FileExtension: e.FileExtension,
|
FileExtension: e.FileExtension,
|
||||||
OriginalFileName: 'foto'
|
OriginalFileName: e.OriginalFileName || 'foto'
|
||||||
}))
|
}))
|
||||||
|
|
||||||
return this.http.put<any>(`${geturl}`, body, options)
|
return this.http.put<any>(`${geturl}`, body, options)
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
<div class="buttons width-100">
|
<div class="buttons width-100">
|
||||||
<button (click)="openAddNoteModal('Arquivo')" class="btn-cancel" shape="round" >Arquivar</button>
|
<button (click)="openAddNoteModal('Arquivo')" class="btn-cancel" shape="round" >Arquivar</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="buttons width-100" *ngIf="task.activityInstanceName != 'Assinar Diploma'">
|
<div class="buttons width-100" *ngIf="task.activityInstanceName != 'Assinar Diploma' && task.activityInstanceName != 'Revisar Diploma'">
|
||||||
<button (click)="openExpedientActionsModal('0',task)" class="btn-cancel" shape="round" >Efetuar despacho</button>
|
<button (click)="openExpedientActionsModal('0',task)" class="btn-cancel" shape="round" >Efetuar despacho</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -143,6 +143,7 @@ export class OptsExpedientePage implements OnInit {
|
|||||||
|
|
||||||
this.attachmentsService.AddAttachment(body).subscribe((res)=> {
|
this.attachmentsService.AddAttachment(body).subscribe((res)=> {
|
||||||
this.toastService._successMessage()
|
this.toastService._successMessage()
|
||||||
|
this.popoverController.dismiss()
|
||||||
}, (error) => {
|
}, (error) => {
|
||||||
this.httpErrorHanlde.httpStatusHandle(error)
|
this.httpErrorHanlde.httpStatusHandle(error)
|
||||||
},()=> {
|
},()=> {
|
||||||
@@ -151,7 +152,7 @@ export class OptsExpedientePage implements OnInit {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.popoverController.dismiss()
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}, (error) => {
|
}, (error) => {
|
||||||
|
|||||||
@@ -110,6 +110,8 @@ export class NewPublicationPage implements OnInit {
|
|||||||
this.showLoader = true;
|
this.showLoader = true;
|
||||||
this.publications.GetPublicationWithArrayOfFilesById(this.documentId).subscribe(res => {
|
this.publications.GetPublicationWithArrayOfFilesById(this.documentId).subscribe(res => {
|
||||||
this.processData(res)
|
this.processData(res)
|
||||||
|
|
||||||
|
console.log("res get", res)
|
||||||
this.showLoader = false;
|
this.showLoader = false;
|
||||||
}, (error) => {
|
}, (error) => {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
@@ -120,6 +122,8 @@ export class NewPublicationPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processData(res) {
|
processData(res) {
|
||||||
|
|
||||||
|
console.log("res process", res)
|
||||||
this.publicationFormMV.form.Files = []
|
this.publicationFormMV.form.Files = []
|
||||||
this.publicationFormMV.form.setData({
|
this.publicationFormMV.form.setData({
|
||||||
DateIndex: res.DateIndex,
|
DateIndex: res.DateIndex,
|
||||||
@@ -177,7 +181,6 @@ export class NewPublicationPage implements OnInit {
|
|||||||
FileType: 'image'
|
FileType: 'image'
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
newAttachment.needUpload()
|
|
||||||
this.publicationFormMV.form.Files.push(newAttachment)
|
this.publicationFormMV.form.Files.push(newAttachment)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -295,6 +298,7 @@ export class NewPublicationPage implements OnInit {
|
|||||||
OriginalFileName: 'video',
|
OriginalFileName: 'video',
|
||||||
FileType: this.checkFileType.checkFileType( this.removeTextBeforeSlash(element.mimeType, '/')) as any
|
FileType: this.checkFileType.checkFileType( this.removeTextBeforeSlash(element.mimeType, '/')) as any
|
||||||
})
|
})
|
||||||
|
|
||||||
this.publicationFormMV.form.Files.push(fileObject)
|
this.publicationFormMV.form.Files.push(fileObject)
|
||||||
})
|
})
|
||||||
.catch((err) => console.error(err));
|
.catch((err) => console.error(err));
|
||||||
@@ -351,8 +355,8 @@ export class NewPublicationPage implements OnInit {
|
|||||||
|
|
||||||
if(upload) {
|
if(upload) {
|
||||||
this.publicationFormMV.form.Files = this.publicationFormMV.form.Files.map((e:PublicationAttachmentEntity)=> {
|
this.publicationFormMV.form.Files = this.publicationFormMV.form.Files.map((e:PublicationAttachmentEntity)=> {
|
||||||
if(e.FileType == 'video') {
|
if(e.FileType == 'video' && e.blobFile && e.toUpload) {
|
||||||
e.OriginalFileName = e.chucksManager.path.replace(".mp4", "")
|
e.OriginalFileName = e?.chucksManager?.path?.replace(".mp4", "") || e.OriginalFileName
|
||||||
e.FileExtension = "mp4"
|
e.FileExtension = "mp4"
|
||||||
}
|
}
|
||||||
return e
|
return e
|
||||||
@@ -402,7 +406,7 @@ export class NewPublicationPage implements OnInit {
|
|||||||
|
|
||||||
if(upload) {
|
if(upload) {
|
||||||
this.publicationFormMV.form.Files = this.publicationFormMV.form.Files.map((e:PublicationAttachmentEntity) => {
|
this.publicationFormMV.form.Files = this.publicationFormMV.form.Files.map((e:PublicationAttachmentEntity) => {
|
||||||
if(e.FileType == 'video') {
|
if(e.FileType == 'video' && e.blobFile && e.toUpload) {
|
||||||
e.OriginalFileName = e.chucksManager.path.replace(".mp4", "")
|
e.OriginalFileName = e.chucksManager.path.replace(".mp4", "")
|
||||||
e.FileExtension = "mp4"
|
e.FileExtension = "mp4"
|
||||||
e.Base64 = ""
|
e.Base64 = ""
|
||||||
@@ -427,8 +431,6 @@ export class NewPublicationPage implements OnInit {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
console.log({publication})
|
|
||||||
|
|
||||||
await this.publications.CreatePublication(publication.ProcessId, publication).toPromise()
|
await this.publications.CreatePublication(publication.ProcessId, publication).toPromise()
|
||||||
if (this.publicationTitle == '1') {
|
if (this.publicationTitle == '1') {
|
||||||
|
|
||||||
@@ -781,6 +783,7 @@ console.log(stringGerada);
|
|||||||
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
// fileObject.needUpload()
|
||||||
this.publicationFormMV.form.Files.push(fileObject)
|
this.publicationFormMV.form.Files.push(fileObject)
|
||||||
})
|
})
|
||||||
.catch((erro) => console.error('read converted video erro ', erro));
|
.catch((erro) => console.error('read converted video erro ', erro));
|
||||||
@@ -810,6 +813,7 @@ console.log(stringGerada);
|
|||||||
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
// fileObject.needUpload()
|
||||||
this.publicationFormMV.form.Files.push(fileObject)
|
this.publicationFormMV.form.Files.push(fileObject)
|
||||||
})
|
})
|
||||||
.catch((err) => console.error(err));
|
.catch((err) => console.error(err));
|
||||||
|
|||||||
@@ -246,7 +246,7 @@ export class PublicationFormMV {
|
|||||||
|
|
||||||
if(!PublicationAttachmentEntity.hasChunkManger) {
|
if(!PublicationAttachmentEntity.hasChunkManger) {
|
||||||
const fileBlob = PublicationAttachmentEntity.blobFile;
|
const fileBlob = PublicationAttachmentEntity.blobFile;
|
||||||
const fileChunks = new Chunks({chunkSize: 40 })
|
const fileChunks = new Chunks({chunkSize: 400 })
|
||||||
fileChunks.setFile(fileBlob)
|
fileChunks.setFile(fileBlob)
|
||||||
|
|
||||||
PublicationAttachmentEntity.setChunkManger(fileChunks)
|
PublicationAttachmentEntity.setChunkManger(fileChunks)
|
||||||
@@ -303,7 +303,7 @@ export class PublicationFormMV {
|
|||||||
// this.ObjectMergeNotification.socket.registerWhenConnected(() => {
|
// this.ObjectMergeNotification.socket.registerWhenConnected(() => {
|
||||||
const videosFiles = this.getVideoFiles()
|
const videosFiles = this.getVideoFiles()
|
||||||
|
|
||||||
const videosFilesToUploads = videosFiles.filter( e => e.FileType == "video")
|
const videosFilesToUploads = videosFiles.filter( e => e.FileType == "video" && e.toUpload && e.blobFile)
|
||||||
|
|
||||||
const Promises: Promise<any>[] = []
|
const Promises: Promise<any>[] = []
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user