mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
improve
This commit is contained in:
@@ -18,8 +18,6 @@ import { Camera, CameraResultType, CameraSource, Photo } from '@capacitor/camera
|
|||||||
|
|
||||||
import { Filesystem, Directory } from '@capacitor/filesystem';
|
import { Filesystem, Directory } from '@capacitor/filesystem';
|
||||||
import { NgxImageCompressService } from "ngx-image-compress";
|
import { NgxImageCompressService } from "ngx-image-compress";
|
||||||
import { readAndCompressImage } from 'browser-image-resizer';
|
|
||||||
import { environment } from 'src/environments/environment';
|
|
||||||
|
|
||||||
const IMAGE_DIR = 'stored-images';
|
const IMAGE_DIR = 'stored-images';
|
||||||
|
|
||||||
@@ -110,7 +108,7 @@ export class NewPublicationPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async takePicture() {
|
async takePicture() {
|
||||||
alert('take')
|
|
||||||
const capturedImage = await Camera.getPhoto({
|
const capturedImage = await Camera.getPhoto({
|
||||||
quality: 90,
|
quality: 90,
|
||||||
// allowEditing: true,
|
// allowEditing: true,
|
||||||
@@ -121,30 +119,11 @@ export class NewPublicationPage implements OnInit {
|
|||||||
const response = await fetch(capturedImage.webPath!);
|
const response = await fetch(capturedImage.webPath!);
|
||||||
const blob = await response.blob();
|
const blob = await response.blob();
|
||||||
|
|
||||||
const config = {
|
this.convertBlobToBase64Worker.postMessage(blob);
|
||||||
quality: 0.5,
|
|
||||||
maxWidth: 800,
|
|
||||||
debug: true
|
|
||||||
};
|
|
||||||
|
|
||||||
var file = new File([blob], "camera.jpg");
|
|
||||||
|
|
||||||
// Note: A single file comes from event.target.files on <input>
|
|
||||||
readAndCompressImage(file, config)
|
|
||||||
.then(resizedImage => {
|
|
||||||
console.log('resizedImage', resizedImage);
|
|
||||||
|
|
||||||
this.convertBlobToBase64Worker.postMessage(resizedImage);
|
|
||||||
this.convertBlobToBase64Worker.onmessage = async (oEvent)=> {
|
this.convertBlobToBase64Worker.onmessage = async (oEvent)=> {
|
||||||
this.capturedImage = oEvent.data
|
this.capturedImage = oEvent.data
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
|
||||||
.then(result => {
|
|
||||||
// TODO: Handle the result
|
|
||||||
console.log('result', result);
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
imageSize(image) {
|
imageSize(image) {
|
||||||
@@ -201,34 +180,11 @@ export class NewPublicationPage implements OnInit {
|
|||||||
const response = await fetch(capturedImage.webPath!);
|
const response = await fetch(capturedImage.webPath!);
|
||||||
const blob = await response.blob();
|
const blob = await response.blob();
|
||||||
|
|
||||||
|
this.convertBlobToBase64Worker.postMessage(blob);
|
||||||
const config = {
|
|
||||||
quality: 0.9,
|
|
||||||
maxWidth: 800,
|
|
||||||
debug: !environment.production
|
|
||||||
};
|
|
||||||
|
|
||||||
var file = new File([blob], "camera.jpg");
|
|
||||||
|
|
||||||
// Note: A single file comes from event.target.files on <input>
|
|
||||||
readAndCompressImage(file, config)
|
|
||||||
.then(resizedImage => {
|
|
||||||
console.log('resizedImage', resizedImage);
|
|
||||||
|
|
||||||
this.convertBlobToBase64Worker.postMessage(resizedImage);
|
|
||||||
this.convertBlobToBase64Worker.onmessage = async (oEvent)=> {
|
this.convertBlobToBase64Worker.onmessage = async (oEvent)=> {
|
||||||
this.capturedImage = oEvent.data
|
this.capturedImage = oEvent.data
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
|
||||||
.then(result => {
|
|
||||||
// TODO: Handle the result
|
|
||||||
// console.log('result', result);
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -242,7 +198,7 @@ export class NewPublicationPage implements OnInit {
|
|||||||
|
|
||||||
this.Form = new FormGroup({
|
this.Form = new FormGroup({
|
||||||
Subject: new FormControl(this.pub.Title, [
|
Subject: new FormControl(this.pub.Title, [
|
||||||
Validators.required,
|
//Validators.required,
|
||||||
// Validators.minLength(4)
|
// Validators.minLength(4)
|
||||||
]),
|
]),
|
||||||
capturedImage: new FormControl(this.capturedImage, [
|
capturedImage: new FormControl(this.capturedImage, [
|
||||||
@@ -285,11 +241,11 @@ export class NewPublicationPage implements OnInit {
|
|||||||
try {
|
try {
|
||||||
|
|
||||||
await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
|
await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
|
||||||
this.toastService.successMessage("Publicação editada")
|
this.toastService._successMessage("Publicação editada")
|
||||||
|
|
||||||
this.close();
|
this.close();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.toastService.badRequest("Publicação não editada")
|
this.toastService._badRequest("Publicação não editada")
|
||||||
} finally {
|
} finally {
|
||||||
loader.remove()
|
loader.remove()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
export let versionData = {
|
export let versionData = {
|
||||||
"shortSHA": "07b958651",
|
"shortSHA": "d933df5b3",
|
||||||
"SHA": "07b958651a574b627e9d04fce33427260960525b",
|
"SHA": "d933df5b31737aaf00a0113b669227b73c6e354a",
|
||||||
"branch": "no_bug_movemente",
|
"branch": "no_bug_movemente",
|
||||||
"lastCommitAuthor": "'Peter Maquiran'",
|
"lastCommitAuthor": "'Peter Maquiran'",
|
||||||
"lastCommitTime": "'Thu Feb 9 15:26:14 2023 +0100'",
|
"lastCommitTime": "'Thu Feb 9 16:05:36 2023 +0100'",
|
||||||
"lastCommitMessage": "fix take picture immage to big",
|
"lastCommitMessage": "feature",
|
||||||
"lastCommitNumber": "4760",
|
"lastCommitNumber": "4761",
|
||||||
"change": "",
|
"change": "",
|
||||||
"changeStatus": "On branch no_bug_movemente\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/pages/chat/chat.page.ts\n\tmodified: src/app/pages/events/edit-event/edit-event.page.ts\n\tmodified: src/app/pages/events/event-detail-modal/event-detail-modal.page.ts\n\tmodified: src/app/pages/events/event-detail/event-detail.page.ts\n\tmodified: src/app/pages/events/events.page.ts\n\tmodified: src/app/pages/gabinete-digital/despachos-pr/despachos-pr.page.ts\n\tmodified: src/app/pages/gabinete-digital/despachos/despachos.page.ts\n\tmodified: src/app/pages/gabinete-digital/event-list/event-list.page.ts\n\tmodified: src/app/pages/gabinete-digital/expediente/expediente.page.ts\n\tmodified: src/app/pages/gabinete-digital/expedientes-pr/expedientes-pr.page.ts\n\tmodified: src/app/pages/gabinete-digital/gabinete-digital.page.ts\n\tmodified: src/app/pages/gabinete-digital/pedidos/pedidos.page.ts\n\tmodified: src/app/pages/gabinete-digital/pendentes/pendentes.page.ts\n\tmodified: src/app/pages/publications/publication-detail/publication-detail.page.ts\n\tmodified: src/app/pages/publications/publications.page.ts\n\tmodified: src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts\n\tmodified: src/app/pages/publications/view-publications/view-publications.page.ts\n\tmodified: src/app/services/chat/chat-system.service.ts\n\tmodified: src/app/services/events/edit-event/edit-event.page.ts\n\tmodified: src/app/services/events/event-detail-modal/event-detail-modal.page.ts\n\tmodified: src/app/services/events/event-detail/event-detail.page.ts\n\tmodified: src/app/services/events/events.page.ts\n\tmodified: src/app/shared/agenda/event-list/event-list.page.ts\n\tmodified: src/app/shared/gabinete-digital/all-processes/all-processes.page.ts\n\tmodified: src/app/shared/gabinete-digital/despachos-pr/despachos-pr.page.ts\n\tmodified: src/app/shared/gabinete-digital/despachos/despachos.page.ts\n\tmodified: src/app/shared/gabinete-digital/diplomas-assinar/diplomas-assinar.page.ts\n\tmodified: src/app/shared/gabinete-digital/diplomas-gerar/diplomas-gerar.page.ts\n\tmodified: src/app/shared/gabinete-digital/diplomas-gerar/expedients/expedients.page.ts\n\tmodified: src/app/shared/gabinete-digital/diplomas/diplomas.page.ts\n\tmodified: src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page.ts\n\tmodified: src/app/shared/gabinete-digital/expedientes-pr/expedientes-pr.page.ts\n\tmodified: src/app/shared/gabinete-digital/expedients/expedients.page.ts\n\tmodified: src/app/shared/gabinete-digital/pedidos/pedidos.page.ts\n\tmodified: src/app/shared/gabinete-digital/pendentes/pendentes.page.ts\n\tmodified: src/app/shared/publication/view-publications/publication-detail/publication-detail.page.ts",
|
"changeStatus": "On branch no_bug_movemente\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/pages/publications/new-publication/new-publication.page.ts",
|
||||||
"changeAuthor": "peter.maquiran"
|
"changeAuthor": "peter.maquiran"
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user