mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Merge branch 'feature/viewer-attachment' of https://bitbucket.org/equilibriumito/gabinete-digital-fo into feature/viewer-attachment
This commit is contained in:
@@ -374,7 +374,10 @@ export class NewPublicationPage implements OnInit {
|
|||||||
|
|
||||||
if (this.PublicationFromMvService.form.Files.length != 0) {
|
if (this.PublicationFromMvService.form.Files.length != 0) {
|
||||||
|
|
||||||
this.close();
|
if (!window["sharedContent"]) {
|
||||||
|
this.close();
|
||||||
|
}
|
||||||
|
|
||||||
this.PublicationFromMvService.setFolderId(this.folderId)
|
this.PublicationFromMvService.setFolderId(this.folderId)
|
||||||
await this.PublicationFromMvService.save()
|
await this.PublicationFromMvService.save()
|
||||||
|
|
||||||
@@ -394,10 +397,6 @@ export class NewPublicationPage implements OnInit {
|
|||||||
this.modalController.dismiss(this.PublicationFromMvService.form).then(() => {
|
this.modalController.dismiss(this.PublicationFromMvService.form).then(() => {
|
||||||
this.showLoader = true;
|
this.showLoader = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (window["sharedContent"]) {
|
|
||||||
this.closeApp();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
clear() {
|
clear() {
|
||||||
@@ -631,14 +630,6 @@ export class NewPublicationPage implements OnInit {
|
|||||||
this.PublicationFromMvService.form.Files.splice(index, 1)
|
this.PublicationFromMvService.form.Files.splice(index, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
closeApp() {
|
|
||||||
if (this.platform.is('android')) {
|
|
||||||
App.exitApp()
|
|
||||||
} else {
|
|
||||||
window["sharedContent"] = null
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
async recordevideoIos(fullPath, element) {
|
async recordevideoIos(fullPath, element) {
|
||||||
|
|
||||||
@@ -785,21 +776,29 @@ export class NewPublicationPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async shareContentIso(fullPath, FileExtension, filename) {
|
async shareContentIso(fullPath, FileExtension, filename) {
|
||||||
|
|
||||||
|
console.log({fullPath, FileExtension, filename})
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
if (this.checkFileType.checkFileType(FileExtension) == 'image') {
|
if (this.checkFileType.checkFileType(FileExtension) == 'image') {
|
||||||
|
|
||||||
Filesystem.readFile({ path: fullPath }).then(async (content) => {
|
Filesystem.readFile({ path: fullPath }).then(async (content) => {
|
||||||
let fileObject;
|
|
||||||
try {
|
try {
|
||||||
fileObject = {
|
|
||||||
FileBase64: this.removeTextBeforeSlash(content.data, ','),
|
|
||||||
FileExtension: FileExtension,
|
|
||||||
OriginalFileName: 'shared',
|
|
||||||
}
|
|
||||||
console.log('shared base', content.data)
|
console.log('shared base', content.data)
|
||||||
|
|
||||||
this.PublicationFromMvService.form.Files.push(fileObject)
|
const newAttachment = new PublicationAttachmentEntity(
|
||||||
|
{
|
||||||
|
base64: this.removeTextBeforeSlash(content.data, ','),
|
||||||
|
extension: FileExtension,
|
||||||
|
FileType: this.checkFileType.checkFileType(FileExtension) as any,
|
||||||
|
OriginalFileName: 'shared'
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
this.PublicationFromMvService.form.Files.push(newAttachment)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('error shared filesystem', error)
|
console.log('error shared filesystem', error)
|
||||||
}
|
}
|
||||||
@@ -811,7 +810,6 @@ export class NewPublicationPage implements OnInit {
|
|||||||
path: '',
|
path: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
let fileObject = {};
|
|
||||||
this.videoconvertService.convertVideo(fullPath, directory.uri, filename, 'mp4').then(async () => {
|
this.videoconvertService.convertVideo(fullPath, directory.uri, filename, 'mp4').then(async () => {
|
||||||
await Filesystem.readFile({ path: `${directory.uri}${filename}.mp4` })
|
await Filesystem.readFile({ path: `${directory.uri}${filename}.mp4` })
|
||||||
|
|
||||||
@@ -835,7 +833,7 @@ export class NewPublicationPage implements OnInit {
|
|||||||
newAttachment.needUpload()
|
newAttachment.needUpload()
|
||||||
|
|
||||||
this.PublicationFromMvService.form.Files.push(newAttachment)
|
this.PublicationFromMvService.form.Files.push(newAttachment)
|
||||||
fileObject = {};
|
|
||||||
const deleteSecretFile = async () => {
|
const deleteSecretFile = async () => {
|
||||||
await Filesystem.deleteFile({
|
await Filesystem.deleteFile({
|
||||||
path: `${filename}.mp4`,
|
path: `${filename}.mp4`,
|
||||||
@@ -844,7 +842,7 @@ export class NewPublicationPage implements OnInit {
|
|||||||
};
|
};
|
||||||
deleteSecretFile().then((value) => {
|
deleteSecretFile().then((value) => {
|
||||||
console.log('delete file', value)
|
console.log('delete file', value)
|
||||||
fileObject = {};
|
|
||||||
})
|
})
|
||||||
.catch((erro) => console.error('read converted video erro ', erro));
|
.catch((erro) => console.error('read converted video erro ', erro));
|
||||||
});
|
});
|
||||||
@@ -861,27 +859,39 @@ export class NewPublicationPage implements OnInit {
|
|||||||
|
|
||||||
shareContentAndroid(resultUrl, FileExtension) {
|
shareContentAndroid(resultUrl, FileExtension) {
|
||||||
|
|
||||||
|
console.log({resultUrl, FileExtension})
|
||||||
|
|
||||||
Filesystem.readFile({ path: resultUrl }).then(async (content) => {
|
Filesystem.readFile({ path: resultUrl }).then(async (content) => {
|
||||||
let fileObject;
|
|
||||||
try {
|
try {
|
||||||
if (this.checkFileType.checkFileType(FileExtension) == 'image') {
|
if (this.checkFileType.checkFileType(FileExtension) == 'image') {
|
||||||
fileObject = {
|
let newAttachment = new PublicationAttachmentEntity(
|
||||||
FileBase64: 'data:image/jpeg;base64,' + this.removeTextBeforeSlash(content.data, ','),
|
{
|
||||||
FileExtension: FileExtension,
|
base64: 'data:image/jpeg;base64,' + this.removeTextBeforeSlash(content.data, ','),
|
||||||
OriginalFileName: 'shared',
|
extension: FileExtension,
|
||||||
}
|
FileType: this.checkFileType.checkFileType(FileExtension) as any,
|
||||||
|
OriginalFileName: 'shared'
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
this.PublicationFromMvService.form.Files.push(newAttachment)
|
||||||
|
|
||||||
} else if (this.checkFileType.checkFileType(FileExtension) == 'video') {
|
} else if (this.checkFileType.checkFileType(FileExtension) == 'video') {
|
||||||
fileObject = {
|
|
||||||
FileBase64: 'data:video/mp4;base64,' + this.removeTextBeforeSlash(content.data, ','),
|
let newAttachment = new PublicationAttachmentEntity(
|
||||||
FileExtension: FileExtension,
|
{
|
||||||
OriginalFileName: 'shared',
|
base64: content.data,
|
||||||
}
|
extension: 'mp4',
|
||||||
|
FileType: this.checkFileType.checkFileType('mp4') as any,
|
||||||
|
OriginalFileName: 'shared'
|
||||||
|
}
|
||||||
|
)
|
||||||
|
newAttachment.needUpload()
|
||||||
|
this.PublicationFromMvService.form.Files.push(newAttachment)
|
||||||
|
|
||||||
}
|
}
|
||||||
console.log('shared base', content.data)
|
console.log('shared base', content.data)
|
||||||
|
|
||||||
this.PublicationFromMvService.form.Files.push(fileObject)
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('error shared filesystem', error)
|
console.log('error shared filesystem', error)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -219,6 +219,9 @@ export class RoomService {
|
|||||||
if (difference < 0) {
|
if (difference < 0) {
|
||||||
|
|
||||||
this.deleteRoom();
|
this.deleteRoom();
|
||||||
|
if(this.chatOpen) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ import { v4 as uuidv4 } from 'uuid'
|
|||||||
import { Result } from 'neverthrow';
|
import { Result } from 'neverthrow';
|
||||||
import { IPublicationFormModelEntity } from '../new-publication/interface/interface';
|
import { IPublicationFormModelEntity } from '../new-publication/interface/interface';
|
||||||
import { CMAPIService } from "src/app/shared/repository/CMAPI/cmapi.service"
|
import { CMAPIService } from "src/app/shared/repository/CMAPI/cmapi.service"
|
||||||
|
import { App } from '@capacitor/app';
|
||||||
|
import { ModalController, NavParams, Platform, LoadingController } from '@ionic/angular';
|
||||||
|
|
||||||
enum ActionType {
|
enum ActionType {
|
||||||
newRapid = "1",
|
newRapid = "1",
|
||||||
@@ -37,7 +39,8 @@ export class PublicationFromMvService {
|
|||||||
private httpErroHandle: HttpErrorHandle,
|
private httpErroHandle: HttpErrorHandle,
|
||||||
public PublicationFolderService: PublicationFolderService,
|
public PublicationFolderService: PublicationFolderService,
|
||||||
private CMAPIService: CMAPIService,
|
private CMAPIService: CMAPIService,
|
||||||
public publicationFolderService: PublicationFolderService
|
public publicationFolderService: PublicationFolderService,
|
||||||
|
private platform: Platform,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
|
||||||
@@ -63,7 +66,7 @@ export class PublicationFromMvService {
|
|||||||
this.folderId = folderId
|
this.folderId = folderId
|
||||||
}
|
}
|
||||||
|
|
||||||
save = async() => {
|
save = async() => {
|
||||||
|
|
||||||
const needChunk = this.needToUploadChunk()
|
const needChunk = this.needToUploadChunk()
|
||||||
|
|
||||||
@@ -183,7 +186,7 @@ export class PublicationFromMvService {
|
|||||||
try {
|
try {
|
||||||
|
|
||||||
await this.publications.CreatePublication(publication.ProcessId, publication).toPromise()
|
await this.publications.CreatePublication(publication.ProcessId, publication).toPromise()
|
||||||
|
this.closeApp()
|
||||||
if (this.publicationType == '1') {
|
if (this.publicationType == '1') {
|
||||||
|
|
||||||
} else if (this.publicationType == '2') {
|
} else if (this.publicationType == '2') {
|
||||||
@@ -219,7 +222,21 @@ export class PublicationFromMvService {
|
|||||||
|
|
||||||
|
|
||||||
// this.PublicationHolderService.setPublication(this.publicationFormMV)
|
// this.PublicationHolderService.setPublication(this.publicationFormMV)
|
||||||
|
|
||||||
this.ObjectMergeNotification.close()
|
this.ObjectMergeNotification.close()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
closeApp() {
|
||||||
|
if (window["sharedContent"]) {
|
||||||
|
|
||||||
|
if (this.platform.is('android')) {
|
||||||
|
App.exitApp()
|
||||||
|
} else {
|
||||||
|
window["sharedContent"] = null
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,4 +4,4 @@ import { environment as oaprProd } from './suport/oapr'
|
|||||||
import { DevDev } from './suport/dev'
|
import { DevDev } from './suport/dev'
|
||||||
|
|
||||||
|
|
||||||
export const environment: Environment = oaprProd;
|
export const environment: Environment = DevDev;
|
||||||
|
|||||||
@@ -2,6 +2,9 @@
|
|||||||
"folders": [
|
"folders": [
|
||||||
{
|
{
|
||||||
"path": "."
|
"path": "."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "../sih/ORM"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"settings": {
|
"settings": {
|
||||||
|
|||||||
Reference in New Issue
Block a user