git pull made

This commit is contained in:
Eudes Inácio
2024-04-09 11:51:46 +01:00
8 changed files with 60 additions and 73 deletions
@@ -75,7 +75,7 @@
</div>
</div>
<div class="ion-item-container-no-border pt-10">
<div *ngIf="!intent" class="ion-item-container-no-border pt-10">
<ion-label (click)="takePicture()">
<div class="attach-icon">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' "
@@ -90,7 +90,7 @@
</ion-label>
</div>
<div class="ion-item-container-no-border pt-10">
<div *ngIf="!intent" class="ion-item-container-no-border pt-10">
<ion-label (click)="startVideoRecording()">
<div class="attach-icon">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' "
@@ -105,7 +105,7 @@
</ion-label>
</div>
<div class="ion-item-container-no-border">
<div *ngIf="!intent" class="ion-item-container-no-border">
<ion-label (click)="loadVideo()" class="cursor-pointer">
<div class="attach-icon">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' "
@@ -14,7 +14,7 @@ import { FormControl, FormGroup, Validators } from '@angular/forms';
import { ThemePalette } from '@angular/material/core';
import { formatDate } from 'src/plugin/momentG.js'
import { ThemeService } from 'src/app/services/theme.service';
import { Camera, CameraResultType, CameraSource, Photo } from '@capacitor/camera';
import { Camera, CameraResultType, CameraSource } from '@capacitor/camera';
import { Filesystem, Directory, Encoding, FilesystemDirectory, FilesystemEncoding } from '@capacitor/filesystem';
import { NgxImageCompressService } from "ngx-image-compress";
@@ -235,40 +235,9 @@ export class ViewPublicationsPage implements OnInit {
this.showLoader = true;
const folderId = this.folderId
try {
const publicationIds = await this.publications.GetPublicationsList(folderId).toPromise();
await this.publicationFolderService.getPublicationsIds(folderId)
this.createPublicationList(folderId)
let loadLater = []
for (let publicationId of publicationIds) {
if (!this.publicationIsPresent(publicationId, folderId)) {
await this.loadPublication(publicationId, folderId)
} else {
loadLater.push(publicationId)
}
}
for (let publicationId of loadLater) {
await this.loadPublication(publicationId, folderId)
}
for (let localPublication of this.publicationFolderService.publicationList[folderId]) {
const apiPublication = publicationIds.includes(localPublication.DocumentId)
if (!apiPublication) {
this.publicationFolderService.deletePost(folderId, localPublication.DocumentId)
}
}
this.showLoader = false;
this.storage.set(folderId, this.publicationFolderService.publicationList[folderId]);
this.getpublication = this.publicationFolderService.publicationList[folderId];
} catch (error) {
this.showLoader = false;
}
this.showLoader = false;
}
@@ -415,4 +384,3 @@ export class ViewPublicationsPage implements OnInit {
this.swiperIndex = this.swiperRef?.nativeElement.swiper.activeIndex;
}
}
@@ -64,7 +64,7 @@
</div>
<ion-img *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'image'"
name="image" ngDefaultControl [src]="'data:image/jpg;base64,' + seleted.Base64" style="height: 69px; width: 69px;"></ion-img>
name="image" ngDefaultControl [src]="seleted.url" style="height: 69px; width: 69px;"></ion-img>
<video class="sdf" *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'video' " width="70" height="70"
preload="metadata" webkit-playsinline="webkit-playsinline">
@@ -321,7 +321,7 @@ export class NewPublicationPage implements OnInit {
FileType: this.checkFileType.checkFileType( this.removeTextBeforeSlash(element.mimeType, '/')) as any
})
/* fileObject.needUpload() */
fileObject.needUpload()
this.PublicationFromMvService.form.Files.push(fileObject)
})
.catch((err) => console.error(err));
@@ -380,6 +380,7 @@ export class NewPublicationPage implements OnInit {
close() {
this.PublicationFromMvService.form.cancel = true
if(this.PublicationFromMvService.form.send == false) {
this.PublicationFromMvService.cancel()
this.PublicationFromMvService.ObjectMergeNotification.close()
@@ -765,38 +766,48 @@ console.log(stringGerada);
return stringAleatoria;
}
async showCroppModal() {
const modal = await this.modalController.create({
component: CropImagePage,
componentProps: {
base64ToCroppe: this.capturedImage
},
cssClass: 'modal modal-desktop'
});
async showCroppModal() {
modal.onDidDismiss().then((res) => {
if (res) {
this.capturedImage = res.data
this.filecontent = true;
this.photoOrVideo = false;
const modal = await this.modalController.create({
component: CropImagePage,
componentProps: {
base64ToCroppe: this.capturedImage
},
cssClass: 'modal modal-desktop'
});
const newAttachment = new PublicationAttachmentEntity(
{
base64: res.data.base64ToCroppe,
extension: 'jpeg',
OriginalFileName: "image",
FileType: 'image'
}
)
modal.onDidDismiss().then((res) => {
if (res) {
this.capturedImage = res.data
this.filecontent = true;
this.photoOrVideo = false;
this.PublicationFromMvService.form.Files.push(newAttachment)
}
}, (error) => {
console.log(error)
});
const newAttachment = new PublicationAttachmentEntity(
{
base64: res.data.base64ToCroppe,
extension: 'jpeg',
OriginalFileName: "image",
FileType: 'image'
}
)
await modal.present();
}
this.PublicationFromMvService.form.Files.push(newAttachment)
}
}, (error) => {
console.log(error)
});
await modal.present();
// let fileObject = new PublicationAttachmentEntity({
// base64: this.removeTextBeforeSlash(this.capturedImage, ',') ,
// extension: 'jpeg',
// OriginalFileName: 'video',
// FileType: 'image'
// })
// this.PublicationFromMvService.form.Files.push(fileObject)
}
}
@@ -203,7 +203,7 @@ export class PublicationFromMvService {
publication.DocumentId = null;
publication.ProcessId = this.folderId
if(this.form.cancel == false) {
if(this.form.cancel == true) {
window['upload-header-set-remove'](this.id);
return false
}
@@ -211,7 +211,6 @@ export class PublicationFromMvService {
try {
await this.publications.CreatePublication(publication.ProcessId, publication).toPromise()
if (this.publicationType == '1') {
this.httpErroHandle.httpsSucessMessagge('Criar publicação')
} else if (this.publicationType == '2') {
+11 -2
View File
@@ -131,6 +131,15 @@ export class PublicationFolderService {
await this.loadPublication(publicationId, folderId)
}
for (let localPublication of this.publicationList[folderId]) {
const apiPublication = publicationIds.includes(localPublication.DocumentId)
if (!apiPublication) {
this.deletePost(folderId, localPublication.DocumentId)
}
}
this.showLoader = false;
this.storage.set(folderId, this.publicationList[folderId]);
@@ -161,7 +170,7 @@ export class PublicationFolderService {
if (JSON.stringify(a) != JSON.stringify(b)) {
// console.log({a, b})
console.log({a, b})
this.publicationList[folderId][findIndex] = publicationDetails
} else {
// console.log({publicationDetails})
@@ -203,7 +212,7 @@ export class PublicationFolderService {
if (!found) {
this.publicationList[folderId].push(publicationDetails)
this.revertPublicationOrder(folderId);
} else {
return this.publicationList[folderId][findIndex]
}
+1 -1
View File
@@ -4,4 +4,4 @@ import { environment as oaprProd } from './suport/oapr'
import { DevDev } from './suport/dev'
export const environment: Environment = oaprProd;
export const environment: Environment = DevDev;