mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
merge
This commit is contained in:
@@ -489,7 +489,7 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
|
CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 88;
|
CURRENT_PROJECT_VERSION = 94;
|
||||||
DEVELOPMENT_TEAM = 94BRNM2LSS;
|
DEVELOPMENT_TEAM = 94BRNM2LSS;
|
||||||
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
||||||
INFOPLIST_FILE = App/Info.plist;
|
INFOPLIST_FILE = App/Info.plist;
|
||||||
@@ -498,7 +498,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 3.8;
|
MARKETING_VERSION = 4.4;
|
||||||
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
|
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.gpr.gabinetedigital.teste;
|
PRODUCT_BUNDLE_IDENTIFIER = com.gpr.gabinetedigital.teste;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
@@ -516,7 +516,7 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
|
CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 88;
|
CURRENT_PROJECT_VERSION = 94;
|
||||||
DEVELOPMENT_TEAM = 94BRNM2LSS;
|
DEVELOPMENT_TEAM = 94BRNM2LSS;
|
||||||
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
||||||
INFOPLIST_FILE = App/Info.plist;
|
INFOPLIST_FILE = App/Info.plist;
|
||||||
@@ -525,7 +525,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 3.8;
|
MARKETING_VERSION = 4.4;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.gpr.gabinetedigital.teste;
|
PRODUCT_BUNDLE_IDENTIFIER = com.gpr.gabinetedigital.teste;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "";
|
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "";
|
||||||
|
|||||||
@@ -87,6 +87,23 @@
|
|||||||
</array>
|
</array>
|
||||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||||
<true/>
|
<true/>
|
||||||
|
<key>NSExtensionActivationRule</key>
|
||||||
|
<dict>
|
||||||
|
<key>NSExtensionActivationSupportsFileWithMaxCount</key>
|
||||||
|
<integer>5</integer>
|
||||||
|
<key>NSExtensionActivationSupportsImageWithMaxCount</key>
|
||||||
|
<integer>5</integer>
|
||||||
|
<key>NSExtensionActivationSupportsMovieWithMaxCount</key>
|
||||||
|
<integer>5</integer>
|
||||||
|
<key>NSExtensionActivationSupportsText</key>
|
||||||
|
<true/>
|
||||||
|
<key>NSExtensionActivationSupportsWebPageWithMaxCount</key>
|
||||||
|
<integer>1</integer>
|
||||||
|
<key>NSExtensionActivationSupportsWebURLWithMaxCount</key>
|
||||||
|
<integer>1</integer>
|
||||||
|
<key>NSExtensionActivationUsesStrictMatching</key>
|
||||||
|
<false/>
|
||||||
|
</dict>
|
||||||
<key>UNUserNotificationCenterDelegate</key>
|
<key>UNUserNotificationCenterDelegate</key>
|
||||||
<string>YourApp.NotificationDelegate</string>
|
<string>YourApp.NotificationDelegate</string>
|
||||||
</dict>
|
</dict>
|
||||||
|
|||||||
@@ -15,12 +15,20 @@
|
|||||||
<dict>
|
<dict>
|
||||||
<key>NSExtensionActivationRule</key>
|
<key>NSExtensionActivationRule</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>NSExtensionActivationSupportsImageWithMaxCount</key>
|
<key>NSExtensionActivationSupportsFileWithMaxCount</key>
|
||||||
<integer>1</integer>
|
<integer>5</integer>
|
||||||
<key>NSExtensionActivationSupportsMovieWithMaxCount</key>
|
<key>NSExtensionActivationSupportsImageWithMaxCount</key>
|
||||||
<integer>1</integer>
|
<integer>5</integer>
|
||||||
<key>NSExtensionActivationSupportsWebURLWithMaxCount</key>
|
<key>NSExtensionActivationSupportsMovieWithMaxCount</key>
|
||||||
<integer>1</integer>
|
<integer>5</integer>
|
||||||
|
<key>NSExtensionActivationSupportsText</key>
|
||||||
|
<true/>
|
||||||
|
<key>NSExtensionActivationSupportsWebPageWithMaxCount</key>
|
||||||
|
<integer>1</integer>
|
||||||
|
<key>NSExtensionActivationSupportsWebURLWithMaxCount</key>
|
||||||
|
<integer>1</integer>
|
||||||
|
<key>NSExtensionActivationUsesStrictMatching</key>
|
||||||
|
<false/>
|
||||||
</dict>
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
<key>NSExtensionMainStoryboard</key>
|
<key>NSExtensionMainStoryboard</key>
|
||||||
|
|||||||
@@ -301,6 +301,10 @@ const routes = [
|
|||||||
{
|
{
|
||||||
path: 'not-found',
|
path: 'not-found',
|
||||||
loadChildren: () => import('./pages/not-found/not-found.module').then( m => m.NotFoundPageModule)
|
loadChildren: () => import('./pages/not-found/not-found.module').then( m => m.NotFoundPageModule)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'view-document-second-options',
|
||||||
|
loadChildren: () => import('./modals/view-document-second-options/view-document-second-options.module').then( m => m.ViewDocumentSecondOptionsPageModule)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
|
||||||
|
import { ViewDocumentSecondOptionsPage } from './view-document-second-options.page';
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: ViewDocumentSecondOptionsPage
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [RouterModule.forChild(routes)],
|
||||||
|
exports: [RouterModule],
|
||||||
|
})
|
||||||
|
export class ViewDocumentSecondOptionsPageRoutingModule {}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { FormsModule } from '@angular/forms';
|
||||||
|
|
||||||
|
import { IonicModule } from '@ionic/angular';
|
||||||
|
|
||||||
|
import { ViewDocumentSecondOptionsPageRoutingModule } from './view-document-second-options-routing.module';
|
||||||
|
|
||||||
|
import { ViewDocumentSecondOptionsPage } from './view-document-second-options.page';
|
||||||
|
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
FormsModule,
|
||||||
|
IonicModule,
|
||||||
|
ViewDocumentSecondOptionsPageRoutingModule,
|
||||||
|
FontAwesomeModule
|
||||||
|
],
|
||||||
|
declarations: [ViewDocumentSecondOptionsPage]
|
||||||
|
})
|
||||||
|
export class ViewDocumentSecondOptionsPageModule {}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
<ion-header class="ion-no-border">
|
||||||
|
<ion-toolbar class="d-flex">
|
||||||
|
<div class="d-flex align-items-center px-20 pt-20 font-25">
|
||||||
|
<div class="left cursor-pointer" (click)="close()">
|
||||||
|
<fa-icon icon="chevron-left" class="menu-icon font-awesome-1"></fa-icon>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="middle ">
|
||||||
|
{{filename}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div *ngIf=" task || Document" class="right cursor-pointer" (click)="openOptions()">
|
||||||
|
<fa-icon icon="ellipsis-v" class="menu-icon font-awesome-1"></fa-icon>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</ion-toolbar>
|
||||||
|
</ion-header>
|
||||||
|
|
||||||
|
<ion-content class="pt-10 height-100">
|
||||||
|
<div class="height-100">
|
||||||
|
<iframe class="iframe" [src]="trustedUrl" height="100%" width="100%" title="Iframe Example"></iframe>
|
||||||
|
</div>
|
||||||
|
</ion-content>
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
.left{
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
.middle{
|
||||||
|
float: left;
|
||||||
|
padding-left: 5px !important;
|
||||||
|
}
|
||||||
|
.right{
|
||||||
|
float: right;
|
||||||
|
margin-left: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.container-img {
|
||||||
|
background-image: url(/assets/gif/theme/gov/Blocks-loader.svg);
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position-x: center;
|
||||||
|
background-position-y: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@media only screen and (max-width: 650px) {
|
||||||
|
|
||||||
|
.container-img {
|
||||||
|
background-size: 25%;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||||
|
import { IonicModule } from '@ionic/angular';
|
||||||
|
|
||||||
|
import { ViewDocumentSecondOptionsPage } from './view-document-second-options.page';
|
||||||
|
|
||||||
|
describe('ViewDocumentSecondOptionsPage', () => {
|
||||||
|
let component: ViewDocumentSecondOptionsPage;
|
||||||
|
let fixture: ComponentFixture<ViewDocumentSecondOptionsPage>;
|
||||||
|
|
||||||
|
beforeEach(waitForAsync(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ ViewDocumentSecondOptionsPage ],
|
||||||
|
imports: [IonicModule.forRoot()]
|
||||||
|
}).compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(ViewDocumentSecondOptionsPage);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
}));
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { DomSanitizer } from '@angular/platform-browser';
|
||||||
|
import { ModalController, NavParams } from '@ionic/angular';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-view-document-second-options',
|
||||||
|
templateUrl: './view-document-second-options.page.html',
|
||||||
|
styleUrls: ['./view-document-second-options.page.scss'],
|
||||||
|
})
|
||||||
|
export class ViewDocumentSecondOptionsPage implements OnInit {
|
||||||
|
|
||||||
|
fileUrl: string;
|
||||||
|
filename: string;
|
||||||
|
completeUrl: string
|
||||||
|
trustedUrl: any;
|
||||||
|
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private modalController: ModalController,
|
||||||
|
private navParams: NavParams,
|
||||||
|
private sanitazer: DomSanitizer,
|
||||||
|
) {
|
||||||
|
this.fileUrl = this.navParams.get('fileUrl');
|
||||||
|
this.filename = this.navParams.get('filename');
|
||||||
|
this.completeUrl = `/assets/www/pdfjs/web/viewer.html?file=${this.fileUrl}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
console.log(this.fileUrl)
|
||||||
|
console.log(this.completeUrl)
|
||||||
|
|
||||||
|
const link: string = this.completeUrl.replace('//pdfjs/web/', '/pdfjs/web/')
|
||||||
|
this.trustedUrl = this.sanitazer.bypassSecurityTrustResourceUrl(link);
|
||||||
|
}
|
||||||
|
|
||||||
|
close() {
|
||||||
|
this.modalController.dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -146,7 +146,6 @@
|
|||||||
[eventSource]="listToPresent"
|
[eventSource]="listToPresent"
|
||||||
[calendarMode]="calendar.mode"
|
[calendarMode]="calendar.mode"
|
||||||
[currentDate]="calendar.currentDate"
|
[currentDate]="calendar.currentDate"
|
||||||
(onEventSelected)="onEventSelected($event)"
|
|
||||||
(onTitleChanged)="onViewTitleChanged($event)"
|
(onTitleChanged)="onViewTitleChanged($event)"
|
||||||
(onRangeChanged)="onRangeChanged($event)"
|
(onRangeChanged)="onRangeChanged($event)"
|
||||||
(onCurrentDateChanged)="onCurrentChanged($event)"
|
(onCurrentDateChanged)="onCurrentChanged($event)"
|
||||||
|
|||||||
@@ -290,6 +290,7 @@ export class AgendaPage implements OnInit {
|
|||||||
this.onDropDownScrollWeal()
|
this.onDropDownScrollWeal()
|
||||||
} catch (e) { }
|
} catch (e) { }
|
||||||
|
|
||||||
|
this.reloadCalendar();
|
||||||
this.updateEventListBox()
|
this.updateEventListBox()
|
||||||
|
|
||||||
realoadCounter++;
|
realoadCounter++;
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ import { RouteService } from 'src/app/services/route.service';
|
|||||||
import { FileValidatorService } from "src/app/services/file/file-validator.service"
|
import { FileValidatorService } from "src/app/services/file/file-validator.service"
|
||||||
import { sanitize } from "sanitize-filename-ts";
|
import { sanitize } from "sanitize-filename-ts";
|
||||||
import { FilePicker } from '@capawesome/capacitor-file-picker';
|
import { FilePicker } from '@capawesome/capacitor-file-picker';
|
||||||
|
import { ViewDocumentSecondOptionsPage } from 'src/app/modals/view-document-second-options/view-document-second-options.page';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-group-messages',
|
selector: 'app-group-messages',
|
||||||
@@ -1160,7 +1161,16 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async openFile(pdfString, filename, type) {
|
async openFile(pdfString, filename, type) {
|
||||||
const blob = this.b64toBlob(pdfString, type)
|
const modal = await this.modalController.create({
|
||||||
|
component: ViewDocumentSecondOptionsPage,
|
||||||
|
componentProps: {
|
||||||
|
fileUrl: pdfString,
|
||||||
|
filename: filename
|
||||||
|
},
|
||||||
|
cssClass: 'modal modal-desktop'
|
||||||
|
});
|
||||||
|
await modal.present();
|
||||||
|
/* const blob = this.b64toBlob(pdfString, type)
|
||||||
let pathFile = ''
|
let pathFile = ''
|
||||||
const fileName = filename
|
const fileName = filename
|
||||||
const contentFile = blob
|
const contentFile = blob
|
||||||
@@ -1180,7 +1190,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
.open(dir.uri, type)
|
.open(dir.uri, type)
|
||||||
.then(() => console.log())
|
.then(() => console.log())
|
||||||
.catch(e => console.error(e))
|
.catch(e => console.error(e))
|
||||||
});
|
}); */
|
||||||
}
|
}
|
||||||
|
|
||||||
downloadFileMsg(msg: MessageService) {
|
downloadFileMsg(msg: MessageService) {
|
||||||
@@ -1242,7 +1252,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
});
|
});
|
||||||
modal.present();
|
modal.present();
|
||||||
} else {
|
} else {
|
||||||
this.openFile(str, msg.attachments[0].title, msg.file.type);
|
this.openFile(msg.attachments[0].image_url, msg.attachments[0].title, msg.file.type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,7 +80,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div *ngIf="msg.file && msg.delate == false">
|
<div *ngIf="msg.file && msg.delate == false">
|
||||||
<div (press)="handlePress(msg._id)"
|
<div (press)="handlePress(msg._id)"
|
||||||
class='message-container incoming-{{msg.u.username!=sessionStore.user.UserName}}'
|
class='message-container incoming-{{msg.u.username!=sessionStore.user.UserName}}'
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { AfterViewInit, Component, ElementRef, OnDestroy, OnInit, ViewChild } fr
|
|||||||
import { Router } from '@angular/router'
|
import { Router } from '@angular/router'
|
||||||
import { GestureController, ModalController, NavParams, PopoverController, Platform, AlertController } from '@ionic/angular';
|
import { GestureController, ModalController, NavParams, PopoverController, Platform, AlertController } from '@ionic/angular';
|
||||||
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
||||||
|
import { ViewDocumentSecondOptionsPage} from 'src/app/modals/view-document-second-options/view-document-second-options.page';
|
||||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||||
import { ExpedientTaskModalPageNavParamsTask } from 'src/app/models/ExpedientTaskModalPage';
|
import { ExpedientTaskModalPageNavParamsTask } from 'src/app/models/ExpedientTaskModalPage';
|
||||||
import { ContactsPage } from 'src/app/pages/chat/messages/contacts/contacts.page';
|
import { ContactsPage } from 'src/app/pages/chat/messages/contacts/contacts.page';
|
||||||
@@ -143,7 +144,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
this.ChatSystemService.getDmRoom(this.roomId).loadHistory({})
|
this.ChatSystemService.getDmRoom(this.roomId).loadHistory({})
|
||||||
this.ChatSystemService.getDmRoom(this.roomId).scrollDown = this.scrollToBottomClicked
|
this.ChatSystemService.getDmRoom(this.roomId).scrollDown = this.scrollToBottomClicked
|
||||||
this.ChatSystemService.openRoom(this.roomId)
|
this.ChatSystemService.openRoom(this.roomId)
|
||||||
this.ChatSystemService.getDmRoom(this.roomId).setChangeDetector(()=> {
|
this.ChatSystemService.getDmRoom(this.roomId).setChangeDetector(() => {
|
||||||
|
|
||||||
this.changeDetector()
|
this.changeDetector()
|
||||||
})
|
})
|
||||||
@@ -163,7 +164,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
try {
|
try {
|
||||||
// console.log(this.router.url);
|
// console.log(this.router.url);
|
||||||
this.createDirectoryImage()
|
this.createDirectoryImage()
|
||||||
// this.chatService.refreshtoken();
|
// this.chatService.refreshtoken();
|
||||||
this.ChatSystemService.getUserOfRoom(this.roomId).then((value) => {
|
this.ChatSystemService.getUserOfRoom(this.roomId).then((value) => {
|
||||||
@@ -852,7 +853,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
console.log('add file ')
|
console.log('add file ')
|
||||||
const roomId = this.roomId
|
const roomId = this.roomId
|
||||||
|
|
||||||
if(this.platform.is('ios')) {
|
if (this.platform.is('ios')) {
|
||||||
console.log('ios add file ')
|
console.log('ios add file ')
|
||||||
|
|
||||||
const resultt = await FilePicker.pickFiles({
|
const resultt = await FilePicker.pickFiles({
|
||||||
@@ -861,7 +862,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
readData: true,
|
readData: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log('RESULT', resultt.files[0])
|
console.log('RESULT', resultt.files[0].data)
|
||||||
|
|
||||||
const blobb = this.fileService.base64toBlob(resultt.files[0].data, resultt.files[0].mimeType)
|
const blobb = this.fileService.base64toBlob(resultt.files[0].data, resultt.files[0].mimeType)
|
||||||
|
|
||||||
@@ -904,41 +905,41 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
formData.append('blobFile', blob);
|
formData.append('blobFile', blob);
|
||||||
console.log('add file', fileBase64) */
|
console.log('add file', fileBase64) */
|
||||||
|
|
||||||
const fileName = file.name
|
const fileName = file.name
|
||||||
|
|
||||||
const validation = this.FileValidatorService.fileNameValidation(fileName)
|
const validation = this.FileValidatorService.fileNameValidation(fileName)
|
||||||
|
|
||||||
if(validation.isOk) {
|
if (validation.isOk) {
|
||||||
|
|
||||||
const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch((error) => {
|
const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch((error) => {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
})));
|
})));
|
||||||
console.log(encodedData)
|
console.log(encodedData)
|
||||||
const blob = this.fileService.base64toBlob(encodedData, file.type)
|
const blob = this.fileService.base64toBlob(encodedData, file.type)
|
||||||
|
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
formData.append('blobFile', blob);
|
formData.append('blobFile', blob);
|
||||||
/* console.log('add file', fileBase64) */
|
/* console.log('add file', fileBase64) */
|
||||||
|
|
||||||
this.ChatSystemService.getDmRoom(roomId).send({
|
this.ChatSystemService.getDmRoom(roomId).send({
|
||||||
file: {
|
file: {
|
||||||
"type": file.type,
|
"type": file.type,
|
||||||
"guid": '',
|
"guid": '',
|
||||||
},
|
},
|
||||||
attachments: [{
|
attachments: [{
|
||||||
"title": sanitize(fileName),
|
"title": sanitize(fileName),
|
||||||
"name": sanitize(fileName),
|
"name": sanitize(fileName),
|
||||||
// "text": "description",
|
// "text": "description",
|
||||||
"title_link_download": false,
|
"title_link_download": false,
|
||||||
}],
|
}],
|
||||||
temporaryData: formData,
|
temporaryData: formData,
|
||||||
attachmentsModelData: {
|
attachmentsModelData: {
|
||||||
fileBase64: encodedData,
|
fileBase64: encodedData,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.toastService._badRequest("Ficheiro inválido")
|
this.toastService._badRequest("Ficheiro inválido")
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1105,7 +1106,38 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
return blob;
|
return blob;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
blobToBase64(blob) {
|
||||||
|
return new Promise((resolve, _) => {
|
||||||
|
const reader = new FileReader();
|
||||||
|
reader.onloadend = () => resolve(reader.result);
|
||||||
|
reader.readAsDataURL(blob);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
async openFile(pdfString, filename, type) {
|
async openFile(pdfString, filename, type) {
|
||||||
|
|
||||||
|
console.log('url while open ',pdfString)
|
||||||
|
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: ViewDocumentSecondOptionsPage,
|
||||||
|
componentProps: {
|
||||||
|
fileUrl: pdfString,
|
||||||
|
filename: filename
|
||||||
|
},
|
||||||
|
cssClass: 'modal modal-desktop'
|
||||||
|
});
|
||||||
|
await modal.present();
|
||||||
|
/*
|
||||||
|
var blob = new Blob([pdfString], { type: 'application/pdf' });
|
||||||
|
|
||||||
|
console.log('blob blob', blob)
|
||||||
|
|
||||||
|
this.blobToBase64(blob).then((value) => {
|
||||||
|
console.log(value)
|
||||||
|
}).catch((error) => {
|
||||||
|
console.log(error)
|
||||||
|
})
|
||||||
|
|
||||||
let pathFile = ''
|
let pathFile = ''
|
||||||
const fileName = filename
|
const fileName = filename
|
||||||
if (this.platform.is('ios')) {
|
if (this.platform.is('ios')) {
|
||||||
@@ -1114,13 +1146,17 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
pathFile = this.file.externalRootDirectory
|
pathFile = this.file.externalRootDirectory
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log('file data', pdfString)
|
||||||
console.log(pathFile)
|
console.log(pathFile)
|
||||||
|
|
||||||
|
let removePre = this.removeTextBeforeSlash(pdfString,',')
|
||||||
|
console.log('file data remove ', removePre)
|
||||||
|
|
||||||
await Filesystem.writeFile({
|
await Filesystem.writeFile({
|
||||||
path: fileName,
|
path: fileName,
|
||||||
data: pdfString,
|
data: removePre,
|
||||||
directory: Directory.Cache,
|
directory: Directory.Cache,
|
||||||
encoding: Encoding.UTF8,
|
encoding: Encoding.UTF8
|
||||||
}).then((dir) => {
|
}).then((dir) => {
|
||||||
console.log('DIR ', dir)
|
console.log('DIR ', dir)
|
||||||
this.fileOpener
|
this.fileOpener
|
||||||
@@ -1129,7 +1165,16 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
.catch(e => console.error(e))
|
.catch(e => console.error(e))
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
console.log('error writing the file', error)
|
console.log('error writing the file', error)
|
||||||
});
|
}); */
|
||||||
|
}
|
||||||
|
|
||||||
|
removeTextBeforeSlash(inputString, controlString) {
|
||||||
|
if (inputString.includes(controlString)) {
|
||||||
|
const parts = inputString.split(controlString);
|
||||||
|
return parts.length > 1 ? parts[1] : inputString;
|
||||||
|
} else {
|
||||||
|
return inputString;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
downloadFileFromBrowser(fileName: string, data: any): void {
|
downloadFileFromBrowser(fileName: string, data: any): void {
|
||||||
@@ -1195,7 +1240,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
});
|
});
|
||||||
modal.present();
|
modal.present();
|
||||||
} else {
|
} else {
|
||||||
this.openFile(str, msg.attachments[0].title, msg.file.type);
|
this.openFile(msg.attachments[0].image_url, msg.attachments[0].title, msg.file.type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1295,7 +1340,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
const blob = new Blob([int8Array], { type: 'application/pdf' });
|
const blob = new Blob([int8Array], { type: 'application/pdf' });
|
||||||
return blob;
|
return blob;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -278,42 +278,36 @@ export class NewPublicationPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async loadVideo() {
|
async loadVideo() {
|
||||||
|
const result = await FilePicker.pickMedia ({ multiple: true, });
|
||||||
const result = await FilePicker.pickMedia
|
|
||||||
({
|
|
||||||
multiple: true,
|
|
||||||
});
|
|
||||||
console.log(result.files)
|
console.log(result.files)
|
||||||
result.files.forEach(async element => {
|
result.files.forEach(async element => {
|
||||||
|
|
||||||
this.filesSizeSum = this.filesSizeSum + element.size
|
this.filesSizeSum = this.filesSizeSum + element.size
|
||||||
if (this.fileSizeToMB(this.filesSizeSum) <= 20) {
|
if (this.fileSizeToMB(this.filesSizeSum) <= 20) {
|
||||||
console.log('pass size verificartion')
|
console.log('pass size verificartion')
|
||||||
if (this.checkFileType.checkFileType(element.mimeType) == 'image' || this.checkFileType.checkFileType(element.mimeType) == 'video') {
|
if (this.checkFileType.checkFileType(element.mimeType) == 'video' && this.platform.is('ios')) {
|
||||||
let resultUrl = decodeURIComponent(element.path);
|
let resultUrl = decodeURIComponent(element.path); console.log('pass type verification ', resultUrl)
|
||||||
console.log('pass type verification ', resultUrl)
|
try {
|
||||||
|
this.recordevideoIos(resultUrl)
|
||||||
try {
|
|
||||||
|
|
||||||
if(this.platform.is('ios')) {
|
|
||||||
this.recordevideoIos(resultUrl)
|
|
||||||
} else {
|
|
||||||
this.loadVideoAndroid(resultUrl,element)
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('upload video error: ', error)
|
console.log('upload video error: ', error)
|
||||||
}
|
}
|
||||||
|
} else if (this.checkFileType.checkFileType(element.mimeType) == 'image' || this.checkFileType.checkFileType(element.mimeType) == 'video') {
|
||||||
|
let resultUrl = decodeURIComponent(element.path);
|
||||||
|
console.log('pass type verification ', resultUrl)
|
||||||
|
try {
|
||||||
|
this.loadVideoAndroid(resultUrl,element)
|
||||||
|
} catch (error) {
|
||||||
|
console.log('upload video error: ', error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (this.seletedContent.length === 0)
|
||||||
|
this.filesSizeSum = 0
|
||||||
|
|
||||||
|
this.httpErrorHandle.validationMessagge('filessize')
|
||||||
}
|
}
|
||||||
} else {
|
});
|
||||||
if (this.seletedContent.length === 0)
|
};
|
||||||
this.filesSizeSum = 0
|
|
||||||
|
|
||||||
this.httpErrorHandle.validationMessagge('filessize')
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
chossePhotoOrVideo() {
|
chossePhotoOrVideo() {
|
||||||
@@ -841,7 +835,7 @@ console.log(stringGerada);
|
|||||||
fileObject ={};
|
fileObject ={};
|
||||||
const deleteSecretFile = async () => {
|
const deleteSecretFile = async () => {
|
||||||
await Filesystem.deleteFile({
|
await Filesystem.deleteFile({
|
||||||
path: 'output.mp4',
|
path: `${stringGerada}.mp4`,
|
||||||
directory: Directory.Cache,
|
directory: Directory.Cache,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -958,27 +952,27 @@ console.log(stringGerada);
|
|||||||
});
|
});
|
||||||
|
|
||||||
let fileObject ={};
|
let fileObject ={};
|
||||||
this.videoconvertService.convertVideo(fullPath,directory.uri,filename,'mp4').then(() => {
|
this.videoconvertService.convertVideo(fullPath,directory.uri,filename,'mp4').then(async () => {
|
||||||
Filesystem.readFile({ path: `${directory.uri}output.mp4`})
|
await Filesystem.readFile({ path: `${directory.uri}${filename}.mp4`})
|
||||||
|
|
||||||
.then(async (content) => {
|
.then(async (content) => {
|
||||||
console.log(content.data)
|
console.log(content.data)
|
||||||
this.filecontent = true;
|
this.filecontent = true;
|
||||||
fileObject = {
|
/* fileObject = {
|
||||||
FileBase64: this.removeTextBeforeSlash(content.data, ','),
|
FileBase64: this.removeTextBeforeSlash(content.data, ','),
|
||||||
FileExtension: FileExtension,
|
FileExtension: 'mp4',
|
||||||
OriginalFileName: 'shared',
|
OriginalFileName: 'shared',
|
||||||
}
|
} */
|
||||||
fileObject = {
|
fileObject = {
|
||||||
FileBase64: 'data:video/mp4;base64,' + this.removeTextBeforeSlash(content.data, ','),
|
FileBase64: 'data:video/mp4;base64,' + this.removeTextBeforeSlash(content.data, ','),
|
||||||
FileExtension: FileExtension,
|
FileExtension: 'mp4',
|
||||||
OriginalFileName: 'shared',
|
OriginalFileName: 'shared',
|
||||||
}
|
}
|
||||||
this.seletedContent.push(fileObject)
|
this.seletedContent.push(fileObject)
|
||||||
fileObject ={};
|
fileObject ={};
|
||||||
const deleteSecretFile = async () => {
|
const deleteSecretFile = async () => {
|
||||||
await Filesystem.deleteFile({
|
await Filesystem.deleteFile({
|
||||||
path: 'output.mp4',
|
path: `${filename}.mp4`,
|
||||||
directory: Directory.Cache,
|
directory: Directory.Cache,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -456,9 +456,12 @@ export class MessageService {
|
|||||||
if (this.file.type == "application/img") {
|
if (this.file.type == "application/img") {
|
||||||
downloadFile = 'data:image/jpeg;base64,' + btoa(new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), ''));
|
downloadFile = 'data:image/jpeg;base64,' + btoa(new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), ''));
|
||||||
} else if (this.file.type != "application/img") {
|
} else if (this.file.type != "application/img") {
|
||||||
|
downloadFile = event.url
|
||||||
downloadFile = new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), '');
|
/*
|
||||||
|
let */
|
||||||
|
/* downloadFile = btoa(new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), '')); */
|
||||||
console.log('downloaded file', downloadFile)
|
console.log('downloaded file', downloadFile)
|
||||||
|
console.log('event body downloaded file', event.url)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -891,7 +891,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
fileBase64 = await this._getBase64(file)
|
fileBase64 = await this._getBase64(file)
|
||||||
|
|
||||||
formData = new FormData();
|
formData = new FormData();
|
||||||
formData.append('blobFile', file);
|
formData.append('blobFile', blob);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -784,7 +784,7 @@ console.log(stringGerada);
|
|||||||
|
|
||||||
this.videoconvertService.convertVideo(fullPath,directory.uri,stringGerada,'mp4');
|
this.videoconvertService.convertVideo(fullPath,directory.uri,stringGerada,'mp4');
|
||||||
|
|
||||||
Filesystem.readFile({ path: `${directory.uri}output.mp4`})
|
Filesystem.readFile({ path: `${directory.uri}${stringGerada}.mp4`})
|
||||||
|
|
||||||
.then(async (content) => {
|
.then(async (content) => {
|
||||||
this.filecontent = true;
|
this.filecontent = true;
|
||||||
|
|||||||
@@ -1923,7 +1923,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (file) {
|
if (file) {
|
||||||
PDFViewerApplication.open(new URLSearchParams(window.location.search).get('file'));
|
PDFViewerApplication.open(new URLSearchParams(window.location.search).get("file"));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user