diff --git a/package-lock.json b/package-lock.json index b68421a39..7340f71ad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2030,6 +2030,14 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, + "@byteowls/capacitor-filesharer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@byteowls/capacitor-filesharer/-/capacitor-filesharer-3.0.0.tgz", + "integrity": "sha512-7/ZL7eyK/7aZx7A5q2PtKc8s9jWAlHXmPOpINkEeoQ09xZNuKUFR/lxruPDgSJE+4/4wM5M4uxUBYCndmwXOSA==", + "requires": { + "file-saver": "^2.0.5" + } + }, "@capacitor-community/camera-preview": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@capacitor-community/camera-preview/-/camera-preview-1.2.1.tgz", @@ -2069,9 +2077,9 @@ "integrity": "sha512-NAIGWnyHBGQ/dgla/D4KDkAeQ2f3fzw+D+DIkGNH3f1ciX4bXC7lNbDVU67SMOuNt+CmcTJF64q3nVXcpv5JvQ==" }, "@capacitor/cli": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/@capacitor/cli/-/cli-3.3.0.tgz", - "integrity": "sha512-BkxagJhHG11+0ivFwUOnAhhdwQ1WXoX0WEzqzzGVL9k63hStuIOvPUusp34+G4EcNU01BAJlBt+dgefSvDhOFw==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/@capacitor/cli/-/cli-3.3.2.tgz", + "integrity": "sha512-LmH3DzuwNL3k995CgAs20KXjQhDWrQCQgur3M8nqIKecZk0xCoSGghht+rEK8/Gqn0XqdBGdgUgop+nep17edg==", "dev": true, "requires": { "@ionic/cli-framework-output": "^2.2.1", @@ -2173,9 +2181,9 @@ } }, "@capacitor/core": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/@capacitor/core/-/core-3.3.0.tgz", - "integrity": "sha512-bKkg/IGALz5OKJPGwtGXoqi4JUXWbuILnZ9J12Mv21fPMFBoszYOiMfm7FqdcCwqcyJWCdG3SQDxCz0Q3e2y8Q==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/@capacitor/core/-/core-3.3.2.tgz", + "integrity": "sha512-pyI3dQdQjA1L5iEw0jkeKCogx9t5d5kIFTB5M3CJRg9Uj5MIpU2J5CRj+74A7BflvZJo8IBd6IfMJaOArRumaw==", "requires": { "tslib": "^2.1.0" } @@ -10223,6 +10231,11 @@ "escape-string-regexp": "^1.0.5" } }, + "file-saver": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/file-saver/-/file-saver-2.0.5.tgz", + "integrity": "sha512-P9bmyZ3h/PRG+Nzga+rbdI4OEpNDzAVyy74uVO9ATgzLK6VtAsYybF/+TOCvrc0MO793d6+42lLyZTw7/ArVzA==" + }, "file-uri-to-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", @@ -16207,9 +16220,9 @@ } }, "bplist-parser": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.3.0.tgz", - "integrity": "sha512-zgmaRvT6AN1JpPPV+S0a1/FAtoxSreYDccZGIqEMSvZl9DMe70mJ7MFzpxa1X+gHVdkToE2haRUHHMiW1OdejA==", + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.3.1.tgz", + "integrity": "sha512-PyJxiNtA5T2PlLIeBot4lbp7rj4OadzjnMZD/G5zuBNt8ei/yCU7+wW0h2bag9vr8c+/WuRWmSxbqAl9hL1rBA==", "dev": true, "requires": { "big-integer": "1.6.x" diff --git a/package.json b/package.json index fca672493..e1e480761 100644 --- a/package.json +++ b/package.json @@ -31,12 +31,13 @@ "@angular/platform-browser": "~12.1.2", "@angular/platform-browser-dynamic": "~12.1.2", "@angular/router": "~12.1.2", + "@byteowls/capacitor-filesharer": "^3.0.0", "@capacitor-community/camera-preview": "^1.2.1", "@capacitor/android": "^3.3.2", "@capacitor/app": "^1.0.5", "@capacitor/browser": "1.0.6", "@capacitor/camera": "^1.2.0", - "@capacitor/core": "^3.3.0", + "@capacitor/core": "^3.3.2", "@capacitor/device": "^1.1.0", "@capacitor/filesystem": "^1.0.6", "@capacitor/haptics": "^1.1.2", @@ -151,7 +152,7 @@ "@angular/compiler": "^12.1.2", "@angular/compiler-cli": "^12.1.2", "@angular/language-service": "^12.1.2", - "@capacitor/cli": "^3.3.0", + "@capacitor/cli": "^3.3.2", "@ionic/angular-toolkit": "^4.0.0", "@ionic/lab": "3.1.7", "@types/jasmine": "~3.6.0", diff --git a/src/app/modals/preview-camera/preview-camera.page.html b/src/app/modals/preview-camera/preview-camera.page.html index 1f853c4d8..f4a96098a 100644 --- a/src/app/modals/preview-camera/preview-camera.page.html +++ b/src/app/modals/preview-camera/preview-camera.page.html @@ -1,70 +1,34 @@ + + + + +
+
+ +
+
+
{{name}}
+ {{_updatedAt | date}}
+ + +
+
+ +
+
+ + + + + + +
- - - - - - - {{username}} {{_updatedAt | date}}
- -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/src/app/modals/preview-camera/preview-camera.page.scss b/src/app/modals/preview-camera/preview-camera.page.scss index f1d3a917e..617ad8cd0 100644 --- a/src/app/modals/preview-camera/preview-camera.page.scss +++ b/src/app/modals/preview-camera/preview-camera.page.scss @@ -36,25 +36,76 @@ float: right; } - circle-xmark-solid{ - - // position: relative; - width: 512px; - height: 515px; - position: absolute; - left: 0%; - right: 0%; - top: 0%; - bottom: 0%; - - background: #FCD13A; - + ion-icon { + width: 500px; + height: 500px; } - - - + .Rectangle { + width: 400px; + height: 666px; + margin: 0px; + padding: 0px; + border-top-left-radius: 25px; + border-top-right-radius: 25px; + box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.49); + background-color: var(--white); + + } /* Vector */ + + .digitalizacao_001pd { + width: 238px; + height: 29px; + margin: 3px 3px 3px 0; + font-family: Roboto; + font-size: 20px; + font-weight: normal; + font-stretch: normal; + font-style: normal; + line-height: normal; + letter-spacing: normal; + color: var(--black); + + } + .iconsarrowarrow-left { + width: 36px; + height: 35px; + padding: 9px 14px 8px 13px; + object-fit: contain; + } + + +CSS +.Rectangle-Copy-5 { + width: 400px; + height: 60px; + margin: 43px 0 0; + background-color: #f9f9f9; +} + +CSS +.Bitmap { + width: 358px; + height: 506px; + margin: 100px; +} + +.inside{ + background-color: var(--very-light-grey); +} +.place{ +float : left; +font-size: 14px; + +} +.footer{ + background-color:transparent; +} + +.distance{ + margin-left: 100px; +} \ No newline at end of file diff --git a/src/app/modals/preview-camera/preview-camera.page.ts b/src/app/modals/preview-camera/preview-camera.page.ts index ae2dac286..6a32f3d6b 100644 --- a/src/app/modals/preview-camera/preview-camera.page.ts +++ b/src/app/modals/preview-camera/preview-camera.page.ts @@ -22,7 +22,7 @@ export class PreviewCameraPage implements OnInit { @ViewChild(IonSlides) slides : IonSlides image: any; - username: string + name: string _updatedAt: string @@ -40,7 +40,7 @@ export class PreviewCameraPage implements OnInit { ngOnInit() { this.image = this.navParams.get('image') - this.username = this.navParams.get('username') + this.name = this.navParams.get('username') this._updatedAt = this.navParams.get('_updatedAt') console.log(this.image) // this.image = this.myimage @@ -109,8 +109,6 @@ async getIconGallery(){ } } - - async getIconShare(){ @@ -118,7 +116,7 @@ async getIconShare(){ await Share.share({ title: 'See cool stuff', text: 'Really awesome thing you need to see right meow', - url: this.image, + url: "https://www.google.com/search?q=joao+louren%C3%A7o&rlz=1C1SQJL_pt-PTAO977AO977&sxsrf=AOaemvIEvXz_WiqNNapjaoE42Q8b71jtiA:1638355797910&source=lnms&tbm=isch&sa=X&sqi=2&ved=2ahUKEwjo9uX6tsL0AhXTlWoFHX1XAtcQ_AUoAXoECAMQAw&biw=1920&bih=937&dpr=1#imgrc=lH5UYZyhPKBhHM", dialogTitle: 'Share with buddies', }); diff --git a/src/app/pages/agenda/agenda.page.ts b/src/app/pages/agenda/agenda.page.ts index eae2f18df..0c858d0d9 100644 --- a/src/app/pages/agenda/agenda.page.ts +++ b/src/app/pages/agenda/agenda.page.ts @@ -841,7 +841,7 @@ export class AgendaPage implements OnInit { case "Oficial": if (this.profile == "mdgpr" && this.loggeduser.Profile == 'MDGPR') { - this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, {}) + this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, {segment: this.segment, selectedDate: this.eventSelectedDate}) } else { this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate }) diff --git a/src/app/pages/chat/group-messages/group-messages.page.ts b/src/app/pages/chat/group-messages/group-messages.page.ts index 4f6cbab0b..e571c6e4e 100644 --- a/src/app/pages/chat/group-messages/group-messages.page.ts +++ b/src/app/pages/chat/group-messages/group-messages.page.ts @@ -633,7 +633,7 @@ touchStart(card) { cssClass: 'transparent-modal', componentProps: { image: img.attachments[0].image_url, - username: img.u.username, + username: img.u.name, _updatedAt: img._updatedAt } }); diff --git a/src/app/pages/chat/messages/messages.page.ts b/src/app/pages/chat/messages/messages.page.ts index 011e867f9..55a687601 100644 --- a/src/app/pages/chat/messages/messages.page.ts +++ b/src/app/pages/chat/messages/messages.page.ts @@ -643,10 +643,10 @@ touchStart(card) { async openPreview(msg) { const modal = await this.modalController.create({ component: PreviewCameraPage, - cssClass: 'transparent-modal', + cssClass: 'modal modal-desktop', componentProps: { image: msg.attachments[0].image_url, - username: msg.u.username, + username: msg.u.name, _updatedAt: msg._updatedAt, } diff --git a/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts b/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts index d79e7f34a..7806b556e 100644 --- a/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts +++ b/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts @@ -126,7 +126,6 @@ export class PublicationDetailPage implements OnInit { } - async editPost(publicationType:any) { console.log(this.publication); const modal = await this.modalController.create({ diff --git a/src/app/services/functions/file.service.ts b/src/app/services/functions/file.service.ts index 146f8cb91..78f5c0a43 100644 --- a/src/app/services/functions/file.service.ts +++ b/src/app/services/functions/file.service.ts @@ -10,11 +10,15 @@ import { SearchList } from 'src/app/models/search-document'; import { ProcessesService } from '../processes.service'; import { ToastService } from '../toast.service'; import { Camera, CameraResultType, CameraSource, Photo} from '@capacitor/camera'; - +import { +FileSharer} from '@byteowls/capacitor-filesharer'; import { Filesystem, Directory } from '@capacitor/filesystem'; +import { Share } from '@capacitor/share'; +import { HttpClient } from '@angular/common/http'; const IMAGE_DIR = 'stored-images'; + interface LocalFile { name: string; path: string; @@ -45,7 +49,8 @@ export class FileService { private processesService: ProcessesService, private toastService: ToastService, private platform: Platform, - private loadingCtrl: LoadingController + private loadingCtrl: LoadingController, + private http: HttpClient ) { } async takePicture() { @@ -230,15 +235,11 @@ export class FileService { if (image) { await this.saveImage(image,roomId) } -/* const response = await fetch(capturedImage.webPath!); - const blob = await response.blob(); - this.photos.unshift({ - filepath: "soon...", - webviewPath: capturedImage.webPath - }); */ - - //this.capturedImage = this.capturedImage; + await Share.share({ + title: 'Check my image', + url: image.path + }) } @@ -256,6 +257,13 @@ export class FileService { if (capturedImage) { await this.saveImage(capturedImage,roomId) } + + await Share.share({ + title: 'Check my image', + url: capturedImage.path + }) + + /* const response = await fetch(capturedImage.webPath!); const blob = await response.blob(); @@ -289,6 +297,24 @@ export class FileService { //loader.remove(); }); */ } + async shareLocalFile(){ + this.http.get('./assets/any.svg', {responseType: 'blob'}).subscribe(res=>{ + const reader = new FileReader() + reader.onloadend=()=>{ + const result = reader.result as string + const base64Data = result.split(',')[1] + + FileSharer.share({ + filename:'any.pdf', + base64Data, + contentType: "application/pdf", + }) + reader.readAsDataURL(res) + } + + }) + +} addPictureToChat(roomId) { diff --git a/src/assets/any.pdf b/src/assets/any.pdf new file mode 100644 index 000000000..e24412c45 Binary files /dev/null and b/src/assets/any.pdf differ diff --git a/src/global.scss b/src/global.scss index 3e9a49fe0..05174772d 100644 --- a/src/global.scss +++ b/src/global.scss @@ -1340,12 +1340,12 @@ ngx-mat-datetime-content{ .ldio-rpinwye8j0b div { box-sizing: content-box; } .transparent-modal { - --background: #f1eaeae7; + --background:transparent; --margin: 0; --padding: 0; ion-content { - --background:#f1f0ebe7; + --background:transparent; } }