From cdf15a37fb4b98997cb0af6af1640bf20fa96bbc Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Wed, 16 Feb 2022 15:49:08 +0100 Subject: [PATCH 01/17] save --- .../event-list/event-list.page.ts | 18 +++++++++--------- src/app/services/route.service.ts | 4 ++++ .../events-to-approve.page.ts | 6 +++--- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/app/pages/gabinete-digital/event-list/event-list.page.ts b/src/app/pages/gabinete-digital/event-list/event-list.page.ts index 52ffc12d5..ba560742e 100644 --- a/src/app/pages/gabinete-digital/event-list/event-list.page.ts +++ b/src/app/pages/gabinete-digital/event-list/event-list.page.ts @@ -27,8 +27,8 @@ export class EventListPage implements OnInit { profile: string; segment: string; showLoader: boolean; - eventsPRList: any = [] - eventsMDGPRList: any = [] + eventsPRList: any = []; + eventsMDGPRList: any = []; eventPerson: EventPerson; eventBody: EventBody; categories: string[]; @@ -76,7 +76,7 @@ export class EventListPage implements OnInit { window.onresize = (event) => { // if not mobile remove all component - if (window.innerWidth <= 800) { + if (window.innerWidth < 701) { this.modalController.dismiss(); } }; @@ -85,13 +85,13 @@ export class EventListPage implements OnInit { getEventToAproveFromDB() { - + if (this.platform.is('desktop') || this.platform.is('mobileweb')) { this.storage.get('event-to-aproveMD').then((events) => { this.eventsMDGPRList = events }) - + this.storage.get('event-to-aprovePR').then((events) => { this.eventsPRList = events }) @@ -99,17 +99,17 @@ export class EventListPage implements OnInit { this.platform.ready().then(() => { this.sqliteservice.getListOfEventAprove('Agenda Oficial MDGPR', 'Agenda Pessoal MDGPR').then((event: any[]) => { - + this.eventsMDGPRList = this.sortService.sortDate(this.transformaDataDB(event), 'taskStartDate') //this.eventsMDGPRList = this.eventsMDGPRList.filter(element => element.interveners != null) console.log('MD event to aprove', this.eventsMDGPRList) - + }) - + this.sqliteservice.getListOfEventAprove('Agenda Oficial PR', 'Agenda Pessoal PR').then((event: any[]) => { this.eventsPRList = this.sortService.sortDate(this.transformaDataDB(event), 'taskStartDate') console.log('PR event to aprove', this.eventsPRList) - + }) }) diff --git a/src/app/services/route.service.ts b/src/app/services/route.service.ts index d1531e0e6..ba25c2bd3 100644 --- a/src/app/services/route.service.ts +++ b/src/app/services/route.service.ts @@ -34,7 +34,11 @@ export class RouteService { * @param option [Object] some options to the url */ goBack(url = null, option: object = {}) { + console.log(url); + if(this.history.length >= 2) { + console.log(this.history); + this.history.pop(); const goTo = this.history.pop(); this.isGoBack = true; diff --git a/src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page.ts b/src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page.ts index 34a6c3042..6336ab10d 100644 --- a/src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page.ts +++ b/src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page.ts @@ -18,8 +18,8 @@ import { Storage } from '@ionic/storage'; export class EventsToApprovePage implements OnInit { showLoader: boolean; - eventsPRList: any; - eventsMDGPRList: any; + eventsPRList: any[] = []; + eventsMDGPRList: any[] = []; eventPerson: EventPerson; eventBody: EventBody; categories: string[]; @@ -84,7 +84,7 @@ export class EventsToApprovePage implements OnInit { let prEventsPessoal = await this.processes.GetTasksList('Agenda Pessoal PR', false).toPromise(); this.eventsPRList = prEventsOficial.concat(prEventsPessoal); this.eventsPRList = this.sortService.sortArrayByDate(this.eventsPRList) - + this.storage.set('event-to-aprovePR',this.eventsPRList).then(() => { console.log(' EVENTPR TO APROVE SAVED') }) From 0a5767a3a5ae0872a7e331fa5acf39168dabc950 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Fri, 18 Feb 2022 11:37:56 +0100 Subject: [PATCH 02/17] save --- .../modals/dar-parecer/dar-parecer.page.ts | 20 +++++++++---------- .../pedidos/pedido/pedido.page.ts | 6 ++++-- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/app/modals/dar-parecer/dar-parecer.page.ts b/src/app/modals/dar-parecer/dar-parecer.page.ts index e31ff5945..5e464bcf9 100644 --- a/src/app/modals/dar-parecer/dar-parecer.page.ts +++ b/src/app/modals/dar-parecer/dar-parecer.page.ts @@ -24,7 +24,7 @@ export class DarParecerPage implements OnInit { private animationController: AnimationController, private toastService: ToastService, public ThemeService: ThemeService - ) { + ) { this.serialNumber = this.navParams.get('serialNumber'); this.instanceId = this.navParams.get('ProcessInstanceID'); } @@ -32,15 +32,15 @@ export class DarParecerPage implements OnInit { ngOnInit() { console.log(this.serialNumber ); - + } - + cancel() { this.modalController.dismiss(); } - + async save() { - + const DocumentToSave = this.documents.map((e) => { return { ApplicationId: e.ApplicationType, @@ -53,8 +53,8 @@ export class DarParecerPage implements OnInit { Attachments: DocumentToSave, } - let body = { - "serialNumber": this.serialNumber, + let body = { + "serialNumber": this.serialNumber, "action": "Registar", "ActionTypeId": 104, "dataFields": { @@ -68,7 +68,7 @@ export class DarParecerPage implements OnInit { try { await this.processes.CompleteTask(body).toPromise(); - this.modalController.dismiss(); + this.modalController.dismiss('sucess'); this.toastService._successMessage('Parecer enviado'); } catch (error) { this.toastService._badRequest("Parecer não solicitado"); @@ -81,7 +81,7 @@ export class DarParecerPage implements OnInit { removeAttachment(index: number){ this.documents = this.documents.filter( (e, i) => index != i); } - + async getDoc() { const modal = await this.modalController.create({ component: SearchPage, @@ -102,5 +102,5 @@ export class DarParecerPage implements OnInit { } - + } diff --git a/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts b/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts index 0152cfd80..0874bd07e 100644 --- a/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts +++ b/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts @@ -602,7 +602,7 @@ export class PedidoPage implements OnInit { console.log(task); let classs; - if (window.innerWidth <= 800) { + if (window.innerWidth < 701) { classs = 'book-meeting-modal modal modal-desktop' } else { classs = 'add-note-modal-no-height showAsideOptions' @@ -618,7 +618,9 @@ export class PedidoPage implements OnInit { }); await modal.present(); modal.onDidDismiss().then(res => { - this.goBack(); + if(res.data == 'sucess'){ + this.goBack(); + } }); } From 2766a397589f096e1e36937fb4deec38ea8a7895 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Fri, 18 Feb 2022 15:08:13 +0100 Subject: [PATCH 03/17] fix --- src/app/services/chat/message.service.ts | 5 +++++ src/theme/variables.scss | 1 + 2 files changed, 6 insertions(+) diff --git a/src/app/services/chat/message.service.ts b/src/app/services/chat/message.service.ts index f181a90a7..aa093b8ed 100644 --- a/src/app/services/chat/message.service.ts +++ b/src/app/services/chat/message.service.ts @@ -79,6 +79,10 @@ export class MessageService { } } + // if(typeof(this.file?.type)) { + // this.hasFile = true + // } + if(this.hasFile) { this.getFileFromDb() if(this.file.type != 'application/webtrix') { @@ -178,6 +182,7 @@ export class MessageService { } } + } redefinedMessage(ChatMessage) { diff --git a/src/theme/variables.scss b/src/theme/variables.scss index 1918c97b0..ef4d21407 100644 --- a/src/theme/variables.scss +++ b/src/theme/variables.scss @@ -116,6 +116,7 @@ $app-theme: mat-light-theme( --ion-color-expediente: #dae3f3; } +// dark-mode @media (prefers-color-scheme: dark) { /* * Dark Colors From 2448100fb732f2e0092c82e4459a513dcf3a7d96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eudes=20In=C3=A1cio?= Date: Fri, 18 Feb 2022 15:28:30 +0100 Subject: [PATCH 04/17] Publications are better --- package-lock.json | 8 ++-- package.json | 2 +- src/app/home/home.module.ts | 3 +- src/app/pages/login/login.page.ts | 8 ++-- .../view-publications.module.ts | 13 +++++- .../view-publications.page.html | 41 ++++++++++++++----- .../view-publications.page.ts | 12 +++--- src/app/services/chat.service.ts | 4 +- .../view-publications.module.ts | 16 +++++++- .../view-publications.page.html | 24 ++++++++++- .../view-publications.page.ts | 2 +- 11 files changed, 98 insertions(+), 35 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1fb79cf6f..5142b17d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16457,11 +16457,11 @@ "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=" }, "ng-lazyload-image": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/ng-lazyload-image/-/ng-lazyload-image-9.1.0.tgz", - "integrity": "sha512-ZdfCXMTaehfzxcSRRThpz9YZbEA+8LPA086Od6JiylrGj0yNM7Aq830A1x6NE/M8o2VuVq93emH9m8T6SFBHlA==", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/ng-lazyload-image/-/ng-lazyload-image-9.1.2.tgz", + "integrity": "sha512-E5oz5HdTRtYW/TH+jceT4VMcRXKdX9Ut82eEwt2K0/bFAXKU14HluCFa8cMidPBgSa08Mlf+gmoKCTvAfUPgag==", "requires": { - "tslib": "^2.0.0" + "tslib": "^2.3.0" } }, "ng2-pdf-viewer": { diff --git a/package.json b/package.json index c1c493293..9ea74a7ec 100644 --- a/package.json +++ b/package.json @@ -132,7 +132,7 @@ "jetifier": "^1.6.8", "lite-server": "^2.6.1", "moment": "^2.29.1", - "ng-lazyload-image": "^9.1.0", + "ng-lazyload-image": "^9.1.2", "ng2-pdf-viewer": "^7.0.1", "ngx-cookie-service": "^12.0.3", "ngx-image-compress": "^11.0.3", diff --git a/src/app/home/home.module.ts b/src/app/home/home.module.ts index c978800ce..a541aa08c 100644 --- a/src/app/home/home.module.ts +++ b/src/app/home/home.module.ts @@ -5,7 +5,7 @@ import { FormsModule } from '@angular/forms'; import { IonicModule } from '@ionic/angular'; import { HomePageRoutingModule } from './home-routing.module'; - +import { LazyLoadImageModule } from 'ng-lazyload-image'; import { HomePage } from './home.page'; /* import { IonicSelectableModule } from 'ionic-selectable'; */ @@ -15,6 +15,7 @@ import { HomePage } from './home.page'; FormsModule, IonicModule, HomePageRoutingModule, + LazyLoadImageModule ], declarations: [HomePage], }) diff --git a/src/app/pages/login/login.page.ts b/src/app/pages/login/login.page.ts index 9f2092bdd..5ff574166 100644 --- a/src/app/pages/login/login.page.ts +++ b/src/app/pages/login/login.page.ts @@ -102,8 +102,8 @@ export class LoginPage implements OnInit { if (attempt) { if (attempt.UserId == SessionStore.user.UserId) { await this.authService.SetSession(attempt, this.userattempt); - await this.authService.loginChat(); - await this.authService.loginToChatWs() + //await this.authService.loginChat(); + //await this.authService.loginToChatWs() this.getToken(); SessionStore.setInativity(true); @@ -117,8 +117,8 @@ export class LoginPage implements OnInit { await this.authService.SetSession(attempt, this.userattempt); this.changeProfileService.run() - await this.authService.loginChat(); - await this.authService.loginToChatWs() + /* await this.authService.loginChat(); + await this.authService.loginToChatWs() */ this.getToken(); this.router.navigateByUrl('/pin', { replaceUrl: true }); } diff --git a/src/app/pages/publications/view-publications/view-publications.module.ts b/src/app/pages/publications/view-publications/view-publications.module.ts index 35b432670..c3bb97330 100644 --- a/src/app/pages/publications/view-publications/view-publications.module.ts +++ b/src/app/pages/publications/view-publications/view-publications.module.ts @@ -10,8 +10,16 @@ import { ViewPublicationsPage } from './view-publications.page'; import { HeaderPageModule } from 'src/app/shared/header/header.module'; -import { LazyLoadImageModule } from 'ng-lazyload-image'; // <-- import it +import { Attributes, IntersectionObserverHooks, LazyLoadImageModule, LAZYLOAD_IMAGE_HOOKS } from 'ng-lazyload-image'; // <-- import it +export class LazyLoadImageHooks extends IntersectionObserverHooks { +setup(attributes: Attributes) { + attributes.offset = 10; + attributes.defaultImagePath = "/assets/icon/icon-no-image.svg"; + attributes.errorImagePath = "/assets/icon/icon-no-image.svg"; + return super.setup(attributes); +} +} @NgModule({ imports: [ @@ -24,6 +32,7 @@ import { LazyLoadImageModule } from 'ng-lazyload-image'; // <-- import it LazyLoadImageModule ], exports: [ViewPublicationsPage], - declarations: [ViewPublicationsPage] + declarations: [ViewPublicationsPage], + providers: [{provide: LAZYLOAD_IMAGE_HOOKS, useClass: LazyLoadImageHooks}] }) export class ViewPublicationsPageModule {} diff --git a/src/app/pages/publications/view-publications/view-publications.page.html b/src/app/pages/publications/view-publications/view-publications.page.html index db5984a90..847b460c5 100644 --- a/src/app/pages/publications/view-publications/view-publications.page.html +++ b/src/app/pages/publications/view-publications/view-publications.page.html @@ -26,25 +26,44 @@ - + + --> +
+ + + +
+ +
+
+
+
+ {{publication.Title}} +
+
{{publication.DatePublication | date: 'dd-MM-yy | HH:mm'}}
+
+
+

{{publication.Message}}

+
+
+
+
+
+
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 39409c42c..1b2827755 100644 --- a/src/app/pages/publications/view-publications/view-publications.page.ts +++ b/src/app/pages/publications/view-publications/view-publications.page.ts @@ -14,6 +14,7 @@ import { SqliteService } from 'src/app/services/sqlite.service'; import { BackgroundService } from 'src/app/services/background.service'; import { ThemeService } from 'src/app/services/theme.service' import { forkJoin } from 'rxjs'; +import { ToastService } from 'src/app/services/toast.service'; @Component({ selector: 'app-view-publications', @@ -26,7 +27,7 @@ export class ViewPublicationsPage implements OnInit { publicationList: Publication[] = new Array(); item: PublicationFolder; - defaultImage = "https://governo.gov.ao/ao/noticias/presidente-joao-lourenco-ouviu-a-voz-da-igreja/" + defaultImage = "/assets/icon/icon-no-image.svg"; folderId: string; id: string; error: any; @@ -48,7 +49,8 @@ export class ViewPublicationsPage implements OnInit { private router: Router, private sqliteservice: SqliteService, private backgroundservice: BackgroundService, - public ThemeService: ThemeService) { + public ThemeService: ThemeService, + private toastService: ToastService,) { this.item = new PublicationFolder(); this.activatedRoute.paramMap.subscribe(params => { @@ -72,7 +74,7 @@ export class ViewPublicationsPage implements OnInit { this.getPublicationDetail(); this.getPublicationsIds(); /* setTimeout(() => { - this.getPublicationsIds(); + this.getPublications(); }, 1000); */ this.backgroundservice.registerBackService('Online', () => { @@ -94,7 +96,7 @@ export class ViewPublicationsPage implements OnInit { // } //this.testForkJoin() //this.getPublicationDetail(); - // this.getPublicationsIds(); + // this.getPublications(); } doRefresh = (event) => { @@ -269,7 +271,7 @@ export class ViewPublicationsPage implements OnInit { }); - this.getpublication = publicationArray; + this.publicationList = publicationArray; }) } diff --git a/src/app/services/chat.service.ts b/src/app/services/chat.service.ts index d4b8512f0..e5da6103b 100644 --- a/src/app/services/chat.service.ts +++ b/src/app/services/chat.service.ts @@ -32,13 +32,13 @@ export class ChatService { private storageService:StorageService, ) { - this.loggedUserChat = authService.ValidatedUserChat; + /* this.loggedUserChat = authService.ValidatedUserChat; this.headers = new HttpHeaders(); this.headers = this.headers.set('X-User-Id', this.loggedUserChat['data'].userId); this.headers = this.headers.set('X-Auth-Token', this.loggedUserChat['data'].authToken); this.options = { headers: this.headers, - }; + }; */ } diff --git a/src/app/shared/publication/view-publications/view-publications.module.ts b/src/app/shared/publication/view-publications/view-publications.module.ts index 27e09ec09..1b9114b60 100644 --- a/src/app/shared/publication/view-publications/view-publications.module.ts +++ b/src/app/shared/publication/view-publications/view-publications.module.ts @@ -6,15 +6,27 @@ import { IonicModule } from '@ionic/angular'; import { ViewPublicationsPageRoutingModule } from './view-publications-routing.module'; import { ViewPublicationsPage } from './view-publications.page'; +import { Attributes, IntersectionObserverHooks, LazyLoadImageModule, LAZYLOAD_IMAGE_HOOKS } from 'ng-lazyload-image'; + +export class LazyLoadImageHooks extends IntersectionObserverHooks { +setup(attributes: Attributes) { + attributes.offset = 10; + attributes.defaultImagePath = "/assets/icon/icon-no-image.svg"; + attributes.errorImagePath = "/assets/icon/icon-no-image.svg"; + return super.setup(attributes); +} +} @NgModule({ imports: [ CommonModule, FormsModule, IonicModule, - ViewPublicationsPageRoutingModule + ViewPublicationsPageRoutingModule, + LazyLoadImageModule ], exports: [ViewPublicationsPage], - declarations: [ViewPublicationsPage] + declarations: [ViewPublicationsPage], + providers: [{provide: LAZYLOAD_IMAGE_HOOKS, useClass: LazyLoadImageHooks}] }) export class ViewPublicationsPageModule {} diff --git a/src/app/shared/publication/view-publications/view-publications.page.html b/src/app/shared/publication/view-publications/view-publications.page.html index 83acf49c6..81573e3ce 100644 --- a/src/app/shared/publication/view-publications/view-publications.page.html +++ b/src/app/shared/publication/view-publications/view-publications.page.html @@ -39,7 +39,27 @@
- + + + +
+ +
+
+
+
+ {{publication.Title}} +
+
{{publication.DatePublication | date: 'dd-MM-yy | HH:mm'}}
+
+
+

{{publication.Message}}

+
+
+
+
+
+
diff --git a/src/app/shared/publication/view-publications/view-publications.page.ts b/src/app/shared/publication/view-publications/view-publications.page.ts index 5584d9bf1..6ebf25996 100644 --- a/src/app/shared/publication/view-publications/view-publications.page.ts +++ b/src/app/shared/publication/view-publications/view-publications.page.ts @@ -146,7 +146,7 @@ export class ViewPublicationsPage implements OnInit { getFromDB() { this.storage.get('view_publications').then((viewPublications) => { - this.getpublication = viewPublications; + this.publicationList = viewPublications; }) } From d3f20417ac6c01186ee2b1fd9984f7fe49aee60c Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Fri, 18 Feb 2022 21:08:48 +0100 Subject: [PATCH 05/17] add top spacing at header --- src/app/shared/header/header.page.html | 6 +++--- src/app/shared/header/header.page.scss | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/app/shared/header/header.page.html b/src/app/shared/header/header.page.html index fb691770c..d64b7ded8 100644 --- a/src/app/shared/header/header.page.html +++ b/src/app/shared/header/header.page.html @@ -2,7 +2,7 @@
-
+
-