From 30aba9b182c15ea7321fc807156acacacc2d383e Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Tue, 15 Aug 2023 10:15:08 +0100 Subject: [PATCH] improve --- .../chat/messages/contacts/contacts.page.ts | 10 ++- .../new-publication/new-publication.page.html | 48 +++++++------ .../new-publication/new-publication.page.scss | 4 +- .../new-publication/new-publication.page.ts | 67 ++----------------- src/app/services/chat/chat-system.service.ts | 8 ++- .../chat/messages/contacts/contacts.page.html | 2 +- .../chat/messages/contacts/contacts.page.ts | 14 +++- .../new-publication/new-publication.page.html | 62 +++++++++-------- .../new-publication/new-publication.page.ts | 11 ++- version/git-version.ts | 10 +-- 10 files changed, 107 insertions(+), 129 deletions(-) diff --git a/src/app/pages/chat/messages/contacts/contacts.page.ts b/src/app/pages/chat/messages/contacts/contacts.page.ts index 9955b6bc1..c4ddf258b 100644 --- a/src/app/pages/chat/messages/contacts/contacts.page.ts +++ b/src/app/pages/chat/messages/contacts/contacts.page.ts @@ -95,9 +95,13 @@ export class ContactsPage implements OnInit { } this.chatService.createRoom(body).subscribe(async(res) => { this.room = res['room']; - await this.ChatSystemService.getAllRooms(); - this.getDirectMessage(this.room._id); - this.loading = false + + this.ChatSystemService.getAllRooms(() => { + this.getDirectMessage(this.room._id); + this.loading = false + }, this.room._id); + + }, ()=> { this.loading = false }); diff --git a/src/app/pages/publications/new-publication/new-publication.page.html b/src/app/pages/publications/new-publication/new-publication.page.html index 2e89f18df..4c245deb2 100644 --- a/src/app/pages/publications/new-publication/new-publication.page.html +++ b/src/app/pages/publications/new-publication/new-publication.page.html @@ -1,15 +1,15 @@
-
-
+
+
{{publicationTitle}}
Campos marcados com * são obrigatórios
-
+
@@ -25,41 +25,39 @@
-
- Fotografia Anexada +
+ Fotografia Anexada - - +
+
+ - - - - - - - -

{{capturedImageTitle}}

- -
-
+ + + +

{{capturedImageTitle}}

+ +
+
+ +
- - - +
-
+ +
image
{{publication.OriginalFileName}}.{{publication.FileExtension}}
-
75 Kb
+
-
-
X
+
+
diff --git a/src/app/pages/publications/new-publication/new-publication.page.scss b/src/app/pages/publications/new-publication/new-publication.page.scss index 2a9427312..2fa8e3f03 100644 --- a/src/app/pages/publications/new-publication/new-publication.page.scss +++ b/src/app/pages/publications/new-publication/new-publication.page.scss @@ -55,9 +55,11 @@ ion-toolbar{ background: #ffffff; height: 100%; box-shadow: 0px 0px 18px rgba(0, 0, 0, 0.6); - padding: 25px 20px 0 20px; overflow: auto; } +.padding{ + padding: 25px 20px 0 20px; +} .title-content{ margin: 0px auto; padding: 0 !important; diff --git a/src/app/pages/publications/new-publication/new-publication.page.ts b/src/app/pages/publications/new-publication/new-publication.page.ts index 51acf78e0..b9e15b1cc 100644 --- a/src/app/pages/publications/new-publication/new-publication.page.ts +++ b/src/app/pages/publications/new-publication/new-publication.page.ts @@ -125,6 +125,7 @@ export class NewPublicationPage implements OnInit { this.convertBlobToBase64Worker.postMessage(blob); this.convertBlobToBase64Worker.onmessage = async (oEvent)=> { this.capturedImage = oEvent.data + this.capturedImageTitle = 'foto' } } @@ -186,6 +187,7 @@ export class NewPublicationPage implements OnInit { this.convertBlobToBase64Worker.postMessage(blob); this.convertBlobToBase64Worker.onmessage = async (oEvent)=> { this.capturedImage = oEvent.data + this.capturedImageTitle = 'foto' } @@ -357,6 +359,7 @@ export class NewPublicationPage implements OnInit { } clear() { + this.capturedImageTitle = ''; this.capturedImage = ''; } @@ -375,30 +378,6 @@ export class NewPublicationPage implements OnInit { } } - /* async openGallery() { - const modal = await this.modalController.create({ - component: GalleryPage, - componentProps:{ - }, - cssClass: 'new-publication', - backdropDismiss: false - }); - await modal.present(); - modal.onDidDismiss(); - } */ - - /* async takePicture(){ - const image = await Plugins.Camera.getPhoto({ - quality: 100, - allowEditing: false, - resultType: CameraResultType.DataUrl, - source: CameraSource.Camera - }); - - - this.photo = this.sanitizer.bypassSecurityTrustResourceUrl(image && (image.dataUrl)); - } */ - async selectImage() { const image = await Camera.getPhoto({ quality: 90, @@ -453,26 +432,6 @@ export class NewPublicationPage implements OnInit { }); await loading.present(); - /* Filesystem.readdir({ - path: `${IMAGE_DIR}/${fileName}`, - directory: Directory.Data, - }).then(result => { - - let lastphoto = result.files[result.files.length - 1] - this.loadFileData(lastphoto); - }, - async (err) => { - - // Folder does not yet exists! - await Filesystem.mkdir({ - path: IMAGE_DIR, - directory: Directory.Data, - recursive: true - }); - } - ).then(_ => { - loading.dismiss(); - }); */ } async loadFileData(fileName: string) { @@ -506,22 +465,6 @@ export class NewPublicationPage implements OnInit { } - /* compressImage() { - let image = this.capturedImage; - this.imageCompress.compressFile(image, orientation, 50, 50,).then(() => { - - this.imgResultBeforeCompress = image; - - - this.imageCompress.compressFile(image, orientation, 50, 50).then( - result => { - this.imgResultAfterCompress = result; - - } - ); - }) - } */ - compressFile() { //this.imgResultBeforeCompress = image;s @@ -538,5 +481,7 @@ export class NewPublicationPage implements OnInit { } - + deletePublicationImage() { + this.publication.FileBase64 = "" + } } diff --git a/src/app/services/chat/chat-system.service.ts b/src/app/services/chat/chat-system.service.ts index de3410cf0..6c5c85cc7 100644 --- a/src/app/services/chat/chat-system.service.ts +++ b/src/app/services/chat/chat-system.service.ts @@ -199,7 +199,7 @@ export class ChatSystemService { } } - async getAllRooms () { + async getAllRooms (callback:Function = () =>{} , roomIdCallback = "") { this.loadingWholeList = true var rooms; @@ -295,7 +295,13 @@ export class ChatSystemService { rooms.result.update[index]['membersExcludeMe'] = users await this.prepareRoom(roomData); } + } + + if(roomId == roomIdCallback) { + callback() + } + index++; } diff --git a/src/app/shared/chat/messages/contacts/contacts.page.html b/src/app/shared/chat/messages/contacts/contacts.page.html index 1622ef118..3c8d597c7 100644 --- a/src/app/shared/chat/messages/contacts/contacts.page.html +++ b/src/app/shared/chat/messages/contacts/contacts.page.html @@ -22,7 +22,7 @@ - + diff --git a/src/app/shared/chat/messages/contacts/contacts.page.ts b/src/app/shared/chat/messages/contacts/contacts.page.ts index 4a7168408..681b0ff0f 100644 --- a/src/app/shared/chat/messages/contacts/contacts.page.ts +++ b/src/app/shared/chat/messages/contacts/contacts.page.ts @@ -21,6 +21,7 @@ export class ContactsPage implements OnInit { room:any; dm:any; sessionStore = SessionStore + loading = false @Input() roomId: string; @Output() openMessage:EventEmitter = new EventEmitter(); @@ -67,10 +68,19 @@ export class ContactsPage implements OnInit { let body = { username: username, } + + this.loading = true this.chatService.createRoom(body).subscribe(res => { - this.ChatSystemService.getAllRooms(); this.room = res['room']; - this.openMessage.emit(this.room._id); + + this.ChatSystemService.getAllRooms(() => { + this.openMessage.emit(this.room._id); + + this.loading = false + }, this.room._id); + + }, ()=> { + this.loading = false }); } } diff --git a/src/app/shared/publication/new-publication/new-publication.page.html b/src/app/shared/publication/new-publication/new-publication.page.html index 9a69f55b3..c0eac9b78 100644 --- a/src/app/shared/publication/new-publication/new-publication.page.html +++ b/src/app/shared/publication/new-publication/new-publication.page.html @@ -29,39 +29,47 @@
- +
- Fotografia Anexada - - - - - - -

{{capturedImageTitle}}

- -
+ Fotografia Anexada +
+
+ + + + + +

{{capturedImageTitle}}

+ +
+
- +
+
+ + + +
+ +
+
+ + + + + +

{{publication.OriginalFileName}}.{{publication.FileExtension}}

+ +
+
+ +
- -
-
- image -
-
-
{{publication.OriginalFileName}}.{{publication.FileExtension}}
-
75 Kb
-
-
-
X
-
-
- -
diff --git a/src/app/shared/publication/new-publication/new-publication.page.ts b/src/app/shared/publication/new-publication/new-publication.page.ts index 5671ea3f8..89f89425f 100644 --- a/src/app/shared/publication/new-publication/new-publication.page.ts +++ b/src/app/shared/publication/new-publication/new-publication.page.ts @@ -93,7 +93,7 @@ export class NewPublicationPage implements OnInit { }); this.capturedImage = 'data:image/jpeg;base64,' +capturedImage.base64String; - this.capturedImageTitle = capturedImage.path; + this.capturedImageTitle = 'foto'; // } @@ -105,7 +105,7 @@ export class NewPublicationPage implements OnInit { }); this.capturedImage = 'data:image/jpeg;base64,' +capturedImage.base64String; - this.capturedImageTitle = capturedImage.path; + this.capturedImageTitle = 'foto'; } @@ -272,10 +272,15 @@ export class NewPublicationPage implements OnInit { this.goBack(); } - clear(){ + clear() { + this.capturedImageTitle = ''; this.capturedImage = ''; } + deletePublicationImage() { + this.publication.FileBase64 = "" + } + setTitle(){ if(this.publicationType == '1') { this.publicationTitle = 'Nova Publicação Rápida'; diff --git a/version/git-version.ts b/version/git-version.ts index 420f1e1d1..f0dc8c63b 100644 --- a/version/git-version.ts +++ b/version/git-version.ts @@ -1,12 +1,12 @@ export let versionData = { - "shortSHA": "3dae0db03", - "SHA": "3dae0db03e713f2a8fa728ca8f12cb59195075ef", + "shortSHA": "4f4381a6d", + "SHA": "4f4381a6d7f9fb23cc31a0a57d4d1bcce86bb204", "branch": "developer", "lastCommitAuthor": "'Peter Maquiran'", - "lastCommitTime": "'Mon Aug 14 21:26:23 2023 +0100'", + "lastCommitTime": "'Mon Aug 14 21:43:52 2023 +0100'", "lastCommitMessage": "fix errors", - "lastCommitNumber": "5156", + "lastCommitNumber": "5157", "change": "", - "changeStatus": "On branch developer\nChanges to be committed:\n (use \"git restore --staged ...\" to unstage)\n\tmodified: src/app/shared/popover/event-details-documents-options/event-details-documents-options.page.html", + "changeStatus": "On branch developer\nChanges to be committed:\n (use \"git restore --staged ...\" to unstage)\n\tmodified: src/app/pages/chat/messages/contacts/contacts.page.ts\n\tmodified: src/app/pages/publications/new-publication/new-publication.page.html\n\tmodified: src/app/pages/publications/new-publication/new-publication.page.scss\n\tmodified: src/app/pages/publications/new-publication/new-publication.page.ts\n\tmodified: src/app/services/chat/chat-system.service.ts\n\tmodified: src/app/shared/chat/messages/contacts/contacts.page.html\n\tmodified: src/app/shared/chat/messages/contacts/contacts.page.ts\n\tmodified: src/app/shared/publication/new-publication/new-publication.page.html\n\tmodified: src/app/shared/publication/new-publication/new-publication.page.ts\n\tmodified: version/git-version.ts", "changeAuthor": "peter.maquiran" } \ No newline at end of file