diff --git a/capacitor.config.ts b/capacitor.config.ts index 35aed5d7f..d0412a5fa 100644 --- a/capacitor.config.ts +++ b/capacitor.config.ts @@ -7,7 +7,7 @@ import { CapacitorConfig } from '@capacitor/cli'; const config: CapacitorConfig = { appId: 'com.capacitorjs.app.testapp', appName: 'capacitor-testapp', - webDir: 'build', + webDir: 'www', plugins: { SplashScreen: { launchAutoHide: false, diff --git a/package-lock.json b/package-lock.json index c0cec9246..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" } @@ -8115,6 +8123,19 @@ } } }, + "cordova-sqlite-storage": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cordova-sqlite-storage/-/cordova-sqlite-storage-6.0.0.tgz", + "integrity": "sha512-njRloA3AICaUFztKHXoFfVcwlL7zbvyFxtdZIkK7P+MA3umILXtSKhYAQkSe2GtHr0LBNzJI5xUUqAlZl/Js0A==", + "requires": { + "cordova-sqlite-storage-dependencies": "4.0.0" + } + }, + "cordova-sqlite-storage-dependencies": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cordova-sqlite-storage-dependencies/-/cordova-sqlite-storage-dependencies-4.0.0.tgz", + "integrity": "sha512-dTBxYaX/RGzH6+pp49o4sb3FuHCvhrssaKn1XMJ4LL3f9dnvz3rhFK2LdcWrdFkhOLOndnW/azUkbzZd+WWhRA==" + }, "core-js": { "version": "3.18.1", "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.18.1.tgz", @@ -10210,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", @@ -16194,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 d2b3d0859..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", @@ -104,6 +105,7 @@ "cordova-plugin-okhttp": "^2.0.0", "cordova-plugin-screen-orientation": "^3.0.2", "cordova-res": "^0.15.3", + "cordova-sqlite-storage": "^6.0.0", "cross-env": "^7.0.3", "crypto-js": "^4.0.0", "date-fns": "^2.17.0", @@ -150,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/home/home.page.ts b/src/app/home/home.page.ts index 36ac32e4e..7d4f59046 100644 --- a/src/app/home/home.page.ts +++ b/src/app/home/home.page.ts @@ -183,7 +183,7 @@ export class HomePage implements OnInit { JSON.parse(req).forEach(element => { this.eventservice.editEvent(element, 2, 3).subscribe((res) => { this.storage.remove('eventEdit') - this.sqliteservice.deleteEventTable(); + //this.sqliteservice.deleteeventsTable(); console.log('eventEdit synchnize', res) }) }); @@ -198,7 +198,6 @@ export class HomePage implements OnInit { console.log('DELETE data SYNC', element) this.eventservice.deleteEvent(element.eventid, element.eventDeleteType, element.calendarName).subscribe((res) => { this.storage.remove('eventDelete') - this.sqliteservice.deleteEventTable(); console.log('eventDelete synchnize', res) }) }); @@ -213,7 +212,6 @@ export class HomePage implements OnInit { console.log('REVER data SYNC', element) this.processservice.PostTaskAction(element).subscribe((res) => { this.storage.remove('event-listRever') - this.sqliteservice.deleteEventTable(); console.log('event-listRever synchnize', res) }) }); @@ -221,6 +219,8 @@ export class HomePage implements OnInit { } catch (error) { console.log('error event-list rever synch') } + + this.sqliteservice.deleteAllTables(); } } diff --git a/src/app/modals/preview-camera/preview-camera.page.html b/src/app/modals/preview-camera/preview-camera.page.html index 8c57c1bf4..f4a96098a 100644 --- a/src/app/modals/preview-camera/preview-camera.page.html +++ b/src/app/modals/preview-camera/preview-camera.page.html @@ -1,66 +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 23b2c37ec..6a32f3d6b 100644 --- a/src/app/modals/preview-camera/preview-camera.page.ts +++ b/src/app/modals/preview-camera/preview-camera.page.ts @@ -4,6 +4,8 @@ import { ImageCroppedEvent } from 'ngx-image-cropper'; import { PublicationsService } from 'src/app/services/publications.service'; import { GroupIconsPage } from '../group-icons/group-icons.page'; import { Share } from '@capacitor/share'; +import { Router } from '@angular/router'; +import { Directory, Filesystem } from '@capacitor/filesystem'; @Component({ selector: 'app-preview-camera', @@ -14,12 +16,13 @@ export class PreviewCameraPage implements OnInit { constructor( private modalController: ModalController, private navParams:NavParams, + public router: Router, private publicService: PublicationsService) { } @ViewChild(IonSlides) slides : IonSlides image: any; - username: string + name: string _updatedAt: string @@ -37,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 @@ -94,27 +97,50 @@ async getIconGallery(){ } deleteImage(){ - window.onload = function(){ - const delmage = document.getElementById("img") - delmage.onclick = function(){ - return window.localStorage.removeItem("img") - } - + document.addEventListener('DOMContentLoaded', ()=>{ + document.querySelector('img').addEventListener('click',removeImage) + }) + function removeImage(ev){ + console.log(ev.target, ev.currentTarget) + let img = ev.currentTarget + let src = ev.target.closest('.img') + src?.parentElement.removeChild(src) + } + } + -} 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', }); } +redirPage(){ + this.router.navigateByUrl('/chat') +} - - +async deleteFile(entry){ + if(entry.isFile){ + await Filesystem.deleteFile({ + directory: Directory.Documents, + path: this.image.src + '/' + entry.name + }) + }else{ + await Filesystem.rmdir({ + directory: Directory.Documents, + path: this.image.src + '/' + entry.name, + recursive:true //remove all file as well + }) + } } +} + + diff --git a/src/app/pages/agenda/agenda.page.ts b/src/app/pages/agenda/agenda.page.ts index 04cf0752f..ec5221a8f 100644 --- a/src/app/pages/agenda/agenda.page.ts +++ b/src/app/pages/agenda/agenda.page.ts @@ -233,7 +233,7 @@ export class AgendaPage implements OnInit { ngOnInit() { - this.getFromDB(); + //this.getFromDB(); const pathname = window.location.pathname let realoadCounter = 0 @@ -243,7 +243,7 @@ export class AgendaPage implements OnInit { this.segment = "Combinado"; } if (realoadCounter != 0) { - //this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate); + this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate); } realoadCounter++; } @@ -515,6 +515,7 @@ export class AgendaPage implements OnInit { console.log('CALENDAR STORE', this.CalendarStore.eventSource) this.listToPresent = this.CalendarStore.eventSource + this.trasnformData(response, 'md'); this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate }) @@ -537,12 +538,15 @@ export class AgendaPage implements OnInit { else if (this.profile == "pr" && this.loggeduser.Profile == 'MDGPR') { this.eventService.getAllSharedEvents(momentG(new Date(startTime), 'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime), 'yyyy-MM-dd 23:59:59')).then((response: any) => { + this.addEventToDB(response, "pr"); this.CalendarStore.removeRange(startTime, endTime, 'pr') // calendar this.CalendarStore.pushEvent(response, 'pr'); + this.listToPresent = this.CalendarStore.eventSource + this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate }) console.log('check list to present data', this.listToPresent); @@ -555,9 +559,9 @@ export class AgendaPage implements OnInit { }).catch((error) => { this.getFromDB() }) - .finally(() => { - this.showLoader = false; - }) + .finally(() => { + this.showLoader = false; + }) } else if (this.loggeduser.Profile == 'PR') { @@ -571,6 +575,7 @@ export class AgendaPage implements OnInit { // startTime = 1, endTime = 31 this.CalendarStore.removeRange(startTime, endTime, 'pr') this.CalendarStore.pushEvent(response, 'pr'); + this.listToPresent = this.CalendarStore.eventSource @@ -603,12 +608,14 @@ export class AgendaPage implements OnInit { this.eventService.getAllMdEvents(momentG(new Date(startTime), 'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime), 'yyyy-MM-dd 23:59:59')).then((response: any) => { + this.addEventToDB(response, "md"); let eventsList = response; this.CalendarStore.removeRange(startTime, endTime, 'md') // loop this.CalendarStore.pushEvent(eventsList, 'md'); + this.listToPresent = this.CalendarStore.eventSource this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate }) @@ -628,23 +635,26 @@ export class AgendaPage implements OnInit { }).catch((error) => { this.getFromDB() }) - .finally(() => { - counter++; - if (counter == 2) { - this.showLoader = false; - } - }) + .finally(() => { + counter++; + if (counter == 2) { + this.showLoader = false; + } + }) this.eventService.getAllSharedEvents(momentG(new Date(startTime), 'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime), 'yyyy-MM-dd 23:59:59')).then((response: any) => { + this.addEventToDB(response, "pr"); let eventsList = response; // clear the current month only this.CalendarStore.removeRange(startTime, endTime, 'pr') + this.CalendarStore.pushEvent(eventsList, 'pr'); this.listToPresent = this.CalendarStore.eventSource + this.TimelinePRList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate }) console.log('check list to present data', this.listToPresent); @@ -663,18 +673,19 @@ export class AgendaPage implements OnInit { }).catch((error) => { this.getFromDB() }) - .finally(() => { - counter++; - if (counter == 2) { - this.showLoader = false; - } - }) + .finally(() => { + counter++; + if (counter == 2) { + this.showLoader = false; + } + }) } else { // view PR calendar with PR profile this.eventService.getAllPrEvents(momentG(new Date(startTime), 'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime), 'yyyy-MM-dd 23:59:59')).then((response: any) => { + this.addEventToDB(response, "pr"); let eventsList; if (this.segment == 'Oficial') { eventsList = response.filter(data => data.CalendarName == "Oficial"); @@ -708,18 +719,19 @@ export class AgendaPage implements OnInit { }).catch((error) => { this.getFromDB() }) - .finally(() => { - if (counter == 1 || this.loggeduser.Profile == 'PR') { - this.showLoader = false; - } - }) + .finally(() => { + if (counter == 1 || this.loggeduser.Profile == 'PR') { + this.showLoader = false; + } + }) } } } - trasnformData(response,profile) { + trasnformData(response, profile) { + console.log('Transform ', response) response.forEach(element => { let event = { startTime: new Date(element.StartDate), @@ -736,6 +748,25 @@ export class AgendaPage implements OnInit { console.log('LIST TO PRESET', this.listToPresent) } + //Deve ser removido para ficar só um method transform + trasnformDataDB(response) { + console.log('Transform ', response) + response.forEach(element => { + let event = { + startTime: new Date(element.StartDate), + endTime: new Date(element.EndDate), + allDay: false, + event: element, + calendarName: element.CalendarName, + profile: element.Profile, + id: element.EventId, + } + this.array.push(event) + }); + this.listToPresent = this.array; + console.log('LIST TO PRESET', this.listToPresent) + } + addEventToDB(response, profile) { if (this.platform.is('desktop') || this.platform.is('mobileweb')) { } else { @@ -756,7 +787,7 @@ export class AgendaPage implements OnInit { Profile: profile } this.sqliteservice.addEvent(event) - + }); } } @@ -767,7 +798,8 @@ export class AgendaPage implements OnInit { this.sqliteservice.getAllEvents().then((events: any[]) => { console.log('ALL EVENTS FROM DB', events) let eventArray = []; - this.trasnformData(events,this.profile) + + this.trasnformDataDB(events) this.updateEventListBox() this.myCal.update(); @@ -816,7 +848,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 591b68890..55a687601 100644 --- a/src/app/pages/chat/messages/messages.page.ts +++ b/src/app/pages/chat/messages/messages.page.ts @@ -24,7 +24,7 @@ import { Filesystem, Directory, Encoding } from '@capacitor/filesystem'; import { VoiceRecorder, VoiceRecorderPlugin, RecordingData, GenericResponse, CurrentRecordingStatus } from 'capacitor-voice-recorder'; import { Haptics, ImpactStyle } from '@capacitor/haptics'; import { PreviewCameraPage } from 'src/app/modals/preview-camera/preview-camera.page'; -import { SocialSharing } from '@ionic-native/social-sharing/ngx'; +// import { SocialSharing } from '@ionic-native/social-sharing/ngx'; import { Share } from '@capacitor/share'; const IMAGE_DIR = 'stored-images'; @@ -91,7 +91,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy { private processes: ProcessesService, public ThemeService: ThemeService, private changeDetectorRef: ChangeDetectorRef, - private socialSharing: SocialSharing + // private socialSharing: SocialSharing ) { this.loggedUser = authService.ValidatedUserChat['data']; this.roomId = this.navParams.get('roomId'); @@ -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, } @@ -675,15 +675,15 @@ getPicture(img){ } - async ShareEmail(msg){ - // Check if sharing via email is supported - await Share.share({ - title: msg.u.username, - text: msg._updatedAt, - url: msg.attachments[0].image_url, - dialogTitle: 'Share with buddies', - }); - } + // async ShareEmail(msg){ + // // Check if sharing via email is supported + // await Share.share({ + // title: msg.u.username, + // text: msg._updatedAt, + // url: msg.attachments[0].image_url, + // dialogTitle: 'Share with buddies', + // }); + // } } diff --git a/src/app/pages/events/events.page.ts b/src/app/pages/events/events.page.ts index e9a4177b0..c5e6e044c 100644 --- a/src/app/pages/events/events.page.ts +++ b/src/app/pages/events/events.page.ts @@ -197,10 +197,13 @@ export class EventsPage implements OnInit { this.showLoader = true; let date = new Date(); - date.setMonth(date.getMonth() + 1); - let start = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds(); - let end = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " 23:59:59"; + let month = date.getMonth() + 1; + //date.setMonth(date.getMonth() + 1); + let start = date.getFullYear() + "-" + month + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds(); + let end = date.getFullYear() + "-" + month + "-" + date.getDate() + " 23:59:59"; + console.log('Data start yahaya', start) + console.log('Data end yahaya', end) if (this.loggeduser.Profile == 'MDGPR') { @@ -368,8 +371,9 @@ export class EventsPage implements OnInit { getEventsFromLocalDb() { let date = new Date(); - date.setMonth(date.getMonth() + 1); - let dateToday = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate(); + let month = date.getMonth() + 1; + //date.setMonth(date.getMonth() + 1); + let dateToday = date.getFullYear() + "-" + month + "-" + date.getDate(); console.log('dateeeeee', dateToday) if (this.platform.is('desktop') || this.platform.is('mobileweb')) { @@ -420,16 +424,20 @@ export class EventsPage implements OnInit { var expedientlist: any = new Array(); process.forEach((element) => { - let task = { - activityInstanceName: element.activityInstanceName, - deadline: null, - serialNumber: element.serialNumber, - taskStartDate: element.taskStartDate, - totalDocuments: element.totalDocuments, - workflowDisplayName: element.workflowDisplayName, - workflowInstanceDataFields: JSON.parse(element.workflowInstanceDataFields) + if(JSON.parse(element.workflowInstanceDataFields).TaskMessage || JSON.parse(element.workflowInstanceDataFields).Note) { + + let task = { + activityInstanceName: element.activityInstanceName, + deadline: null, + serialNumber: element.serialNumber, + taskStartDate: element.taskStartDate, + totalDocuments: element.totalDocuments, + workflowDisplayName: element.workflowDisplayName, + workflowInstanceDataFields: JSON.parse(element.workflowInstanceDataFields) + } + expedientlist.push(task); + } - expedientlist.push(task); }) console.log('OFOFOFOOF22222', expedientlist) diff --git a/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts index 4be371ca6..24daead73 100644 --- a/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts +++ b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts @@ -148,6 +148,24 @@ export class ExpedienteDetailPage implements OnInit { "InstanceID": workflow.InstanceID } + this.fulltask = { + Documents: JSON.parse(process[0].Documents), + actions: JSON.parse(process[0].actions), + activityInstanceName: process[0].activityInstanceName, + formURL: process[0].formURL, + interveners: process[0].interveners, + originator: JSON.parse(process[0].originator), + serialNumber: process[0].serialNumber, + taskStartDate: process[0].taskStartDate, + totalDocuments: process[0].totalDocuments, + workflowDisplayName: process[0].workflowDisplayName, + workflowID: process[0].workflowID, + workflowInstanceDataFields: JSON.parse(process[0].workflowInstanceDataFields), + workflowInstanceFolio: process[0].workflowInstanceFolio, + workflowInstanceID: process[0].workflowInstanceID, + workflowName: process[0].workflowName, + } + }) }) } @@ -341,7 +359,7 @@ export class ExpedienteDetailPage implements OnInit { }) console.log('this.task', this.task.InstanceID) - console.log('this.task.DocumentURL', this.task.DocumentURL) + console.log('this.task.DocumentURL', this.fulltask) }, (error) => { @@ -615,21 +633,21 @@ export class ExpedienteDetailPage implements OnInit { return await popover.present(); } - openNewGroupPage(){ + openNewGroupPage() { this.router.navigate(['/home/chat']); this.dataService.set("newGroup", true); - if( window.innerWidth < 801){ + if (window.innerWidth < 801) { this.newGroup(); } - else{ + else { this.dataService.set("newGroup", true); /* this.closeAllDesktopComponents(); this.showNewGroup=true; */ } } - async newGroup(){ + async newGroup() { const modal = await this.modalController.create({ component: NewGroupPage, cssClass: 'modal modal-desktop', 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/pages/publications/view-publications/view-publications.page.ts b/src/app/pages/publications/view-publications/view-publications.page.ts index 2d453c187..8d8839623 100644 --- a/src/app/pages/publications/view-publications/view-publications.page.ts +++ b/src/app/pages/publications/view-publications/view-publications.page.ts @@ -68,8 +68,7 @@ export class ViewPublicationsPage implements OnInit { if (typeof (this.folderId) == 'object') { this.folderId = this.folderId['ProcessId'] } - - this.getPublicationsIds() + this.testForkJoin() this.getPublicationDetail(); setTimeout(() => { this.getPublicationsIds(); @@ -77,7 +76,7 @@ export class ViewPublicationsPage implements OnInit { this.backgroundservice.registerBackService('Online', () => { this.getPublicationDetail(); - this.getPublicationsIds(); + this.testForkJoin() }) @@ -94,14 +93,14 @@ export class ViewPublicationsPage implements OnInit { // } this.testForkJoin() this.getPublicationDetail(); - this.getPublicationsIds(); + // this.getPublicationsIds(); } doRefresh = (event) => { setTimeout(() => { this.testForkJoin() this.getPublicationDetail(); - this.getPublicationsIds(); + // this.getPublicationsIds(); event.target.complete(); }, 3000); @@ -129,35 +128,35 @@ export class ViewPublicationsPage implements OnInit { } // goes to fork - getPublicationsIds() { - - this.showLoader = true; - const folderId = this.folderId - - this.publications.GetIdsPublicationsImages(this.id).subscribe(res => { - - console.log(this.id) - - this.publicationList = new Array(); - // getPublicationsIds() { // this.showLoader = true; // const folderId = this.folderId - // this.publications.GetPublicationsID(this.folderId).subscribe(res => { + // this.publications.GetIdsPublicationsImages(this.id).subscribe(res => { + + // console.log(this.id) - // console.log('publications ids', res) // this.publicationList = new Array(); - // for(let i of res) { - // this.publications.GetPublicationById(i).subscribe(ress => { - // console.log('publications by ids', ress) - // let item: Publication = this.publicationPipe.itemList(ress) - // console.log('publications by ids 2', item) - // this.publicationList.push(item); - // }) - // } + getPublicationsIds() { + + this.showLoader = true; + const folderId = this.folderId + + this.publications.GetPublicationsImages(this.folderId).subscribe(res => { + + console.log('publications ids', res) + this.publicationList = new Array(); + + for(let i of res) { + this.publications.GetPublicationById(i).subscribe(ress => { + console.log('publications by ids', ress) + let item: Publication = this.publicationPipe.itemList(ress) + console.log('publications by ids 2', item) + this.publicationList.push(item); + }) + } /* res.forEach(element => { console.log('publications elements', element) 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/app/services/publications.service.ts b/src/app/services/publications.service.ts index 491effd8c..e381adad9 100644 --- a/src/app/services/publications.service.ts +++ b/src/app/services/publications.service.ts @@ -84,7 +84,7 @@ export class PublicationsService { return this.http.delete(`${geturl}`, options); } - GetPublicationsID(folder:any) { + GetPublicationsImages(folder:any) { const geturl = environment.apiURL + 'presidentialActions/'+ folder +'/posts/ids'; let params = new HttpParams(); diff --git a/src/app/services/sqlite.service.ts b/src/app/services/sqlite.service.ts index ce1bd7a58..01bd2cfb6 100644 --- a/src/app/services/sqlite.service.ts +++ b/src/app/services/sqlite.service.ts @@ -516,9 +516,36 @@ export class SqliteService { }); } - deleteEventTable() { - this.dbInstance.executeSql("delete from "+ this.events).then((res) => { + deleteAllTables() { + this.deleteeventsTable(); + this.deleteallprocessTable(); + this.deleteactionsTable(); + this.deletepublicationsTable(); + + console.log('All tables deleted') + } + + deleteeventsTable() { + return this.dbInstance.executeSql("DELETE from "+ this.events).then((res) => { console.log('DELETE EVENT TABLE RESULT ', res) }); } + + deleteallprocessTable() { + return this.dbInstance.executeSql("DELETE from "+ this.allprocess).then((res) => { + console.log('DELETE ALLPROCESS TABLE RESULT ', res) + }); + } + + deleteactionsTable() { + return this.dbInstance.executeSql("DELETE from "+ this.actions).then((res) => { + console.log('DELETE actions TABLE RESULT ', res) + }); + } + + deletepublicationsTable() { + return this.dbInstance.executeSql("DELETE from "+ this.publications).then((res) => { + console.log('DELETE publications TABLE RESULT ', res) + }); + } } 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; } }