From 6788c7b6d284c64c1e9997c9651c4bd556a7f947 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Wed, 17 Mar 2021 10:03:39 +0100 Subject: [PATCH 01/15] Improve publication back sequence --- .../pages/publications/publications.page.html | 1 + .../pages/publications/publications.page.ts | 8 +++++++- .../new-publication/new-publication.page.html | 4 ++-- .../new-publication/new-publication.page.ts | 20 ++++++++++++------- .../publication-detail.page.scss | 2 -- .../view-publications.page.html | 4 ++-- .../view-publications.page.ts | 4 ---- 7 files changed, 25 insertions(+), 18 deletions(-) diff --git a/src/app/pages/publications/publications.page.html b/src/app/pages/publications/publications.page.html index 7851858b0..ab50275a4 100644 --- a/src/app/pages/publications/publications.page.html +++ b/src/app/pages/publications/publications.page.html @@ -76,6 +76,7 @@ class="height-100 d-flex flex-column overflow-hidden flex-grow-1" (addNewPublication)="addNewPublication($event)" (openPublicationDetails)="openPublicationDetails($event)" + (goBacktoPublicationDetails)="goBacktoPublicationDetails($event)" (goBackToViewPublications)="goBackToViewPublications($event)" (closeDesktopComponent)="closeDesktopComponent($event)" > diff --git a/src/app/pages/publications/publications.page.ts b/src/app/pages/publications/publications.page.ts index 18305e427..847c37051 100644 --- a/src/app/pages/publications/publications.page.ts +++ b/src/app/pages/publications/publications.page.ts @@ -179,18 +179,24 @@ export class PublicationsPage implements OnInit { } } - // called from view publications + + // called from publications details + // Emittter goBackToViewPublications(){ this.closeDesktopComponent(); this.desktopComponent.showViewPublication = true; } + // called from publications details + // Emitters goBackToPubications(){ this.closeDesktopComponent(); this.desktopComponent.showViewPublication = true; } + // called from edit publication (Emitters only) + // Emitters async goBacktoPublicationDetails(){ this.closeDesktopComponent(); this.desktopComponent.showPublicationDetail = true; 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 64332cdcc..fca85e913 100644 --- a/src/app/shared/publication/new-publication/new-publication.page.html +++ b/src/app/shared/publication/new-publication/new-publication.page.html @@ -1,8 +1,8 @@
-
+
{{publicationTitle}}
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 ed7493069..c547eb9b5 100644 --- a/src/app/shared/publication/new-publication/new-publication.page.ts +++ b/src/app/shared/publication/new-publication/new-publication.page.ts @@ -39,8 +39,9 @@ export class NewPublicationPage implements OnInit { @Input() publicationType: string; @Input() folderId: string; @Output() closeDesktopComponent = new EventEmitter(); - @Output() goBacktoPublicationDetails = new EventEmitter(); - + @Output() openPublicationDetails = new EventEmitter(); + @Output() goBackToViewPublications = new EventEmitter(); + @Output() goBacktoPublicationDetails = new EventEmitter(); guestPicture:any; @@ -121,7 +122,7 @@ export class NewPublicationPage implements OnInit { console.log('Edit change image'); console.log(this.publication); this.publications.UpdatePublication(this.publication.ProcessId, this.publication); - this.closeDesktopComponent.emit(); + this.goBack(); } else{ this.publication = { @@ -138,7 +139,7 @@ export class NewPublicationPage implements OnInit { console.log('Edit - keep image'); console.log(this.publication); this.publications.UpdatePublication(this.publication.ProcessId, this.publication); - this.closeDesktopComponent.emit(); + this.goBack(); } } else{ @@ -164,7 +165,7 @@ export class NewPublicationPage implements OnInit { close(){ - this.closeDesktopComponent.emit('!???____!!'); + this.goBack(); } clear(){ this.capturedImage = ''; @@ -183,8 +184,13 @@ export class NewPublicationPage implements OnInit { } async goBack(){ - - this.goBacktoPublicationDetails.emit(); + + if(this.publicationType == '2'){ + this.goBackToViewPublications.emit(); + } else { + this.goBacktoPublicationDetails.emit(); + } + } /* async openGallery() { diff --git a/src/app/shared/publication/view-publications/publication-detail/publication-detail.page.scss b/src/app/shared/publication/view-publications/publication-detail/publication-detail.page.scss index 06637624b..e0273da92 100644 --- a/src/app/shared/publication/view-publications/publication-detail/publication-detail.page.scss +++ b/src/app/shared/publication/view-publications/publication-detail/publication-detail.page.scss @@ -74,7 +74,6 @@ } .post-img{ width: 100%; - height: 400px; margin: 0 auto; border-radius: 0px!important; overflow: hidden; @@ -85,7 +84,6 @@ object-fit: cover; } .post-description{ - width: 360px; margin: 0 auto; margin-bottom: 35px; } \ No newline at end of file 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 fab92d47f..73200cd06 100644 --- a/src/app/shared/publication/view-publications/view-publications.page.html +++ b/src/app/shared/publication/view-publications/view-publications.page.html @@ -3,9 +3,9 @@
-
+
{{item.Description}}

{{item.Detail}}

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 411457d99..ca483e02d 100644 --- a/src/app/shared/publication/view-publications/view-publications.page.ts +++ b/src/app/shared/publication/view-publications/view-publications.page.ts @@ -149,9 +149,5 @@ export class ViewPublicationsPage implements OnInit { } - async goBack(){ - console.log('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!') - this.goBacktoPublicationDetails.emit(); - } } From 65b1d67ab3227c0b79a271727d45c71d441a22a5 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Wed, 17 Mar 2021 10:57:16 +0100 Subject: [PATCH 02/15] Improve publicaton page --- .../pages/publications/publications.page.ts | 7 +++++- .../new-publication/new-publication.page.html | 21 +++++++++++++++- .../new-publication/new-publication.page.scss | 24 ++++++++++++++++++- .../view-publications.page.html | 4 ++-- 4 files changed, 51 insertions(+), 5 deletions(-) diff --git a/src/app/pages/publications/publications.page.ts b/src/app/pages/publications/publications.page.ts index 847c37051..6cef68a6c 100644 --- a/src/app/pages/publications/publications.page.ts +++ b/src/app/pages/publications/publications.page.ts @@ -203,13 +203,18 @@ export class PublicationsPage implements OnInit { } + // add new publication or edit publicaton async addNewPublication({publicationType, folderId, publication}){ this.closeDesktopComponent(); // propr to add new publication this.publicationType = publicationType; - this.folderId = folderId; + // edit publication will send null + if (folderId != undefined) { + this.folderId = folderId; + } + this.publication = publication; this.desktopComponent.showAddNewPublication = true; 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 fca85e913..b07846703 100644 --- a/src/app/shared/publication/new-publication/new-publication.page.html +++ b/src/app/shared/publication/new-publication/new-publication.page.html @@ -16,7 +16,9 @@
-
+ + +
@@ -26,6 +28,23 @@
+ +
Fotografia Anexada
+ +
+
+ image +
+
+
{{publication.OriginalFileName}}
+
75 Kb
+
+
+
X
+
+ +
+
Fotografia Anexada diff --git a/src/app/shared/publication/new-publication/new-publication.page.scss b/src/app/shared/publication/new-publication/new-publication.page.scss index 733e5e2d4..9ea7ca39a 100644 --- a/src/app/shared/publication/new-publication/new-publication.page.scss +++ b/src/app/shared/publication/new-publication/new-publication.page.scss @@ -73,6 +73,7 @@ font-size: 25px; .container-div{ margin-bottom: 15px; overflow: auto; + border-bottom: 1px solid #ebebeb; } .ion-item-container{ margin: 15px auto; @@ -131,4 +132,25 @@ font-size: 25px; line-height: normal; letter-spacing: normal; color: #000; - } \ No newline at end of file + } + + +.picture{ + .post-img{ + width: 60px; + height: 45px; + } + .picture-file-name{ + font-size: 15px; + color: #0d89d1; + } + .size{ + color: #cecece; + font-size: 13px; + } +} + +.container-title{ + font-size: 15px; + font-weight: bold; +} \ No newline at end of file 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 73200cd06..1d889b432 100644 --- a/src/app/shared/publication/view-publications/view-publications.page.html +++ b/src/app/shared/publication/view-publications/view-publications.page.html @@ -2,11 +2,11 @@
-
+
-
+
{{item.Description}}

{{item.Detail}}

From 4d107249dcab81680ea7140922a07020468d821b Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Wed, 17 Mar 2021 11:12:20 +0100 Subject: [PATCH 03/15] Improve publicaton page --- .../pages/publications/new-publication/new-publication.page.ts | 1 - src/app/pages/publications/publications.page.ts | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) 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 1e9d1ac94..502a47b0c 100644 --- a/src/app/pages/publications/new-publication/new-publication.page.ts +++ b/src/app/pages/publications/new-publication/new-publication.page.ts @@ -54,7 +54,6 @@ export class NewPublicationPage implements OnInit { private camera: Camera, ) { - alert('!!!!!') this.publicationType = this.navParams.get('publicationType'); this.folderId = this.navParams.get('folderId'); this.publicationTitle = 'Nova Publicação'; diff --git a/src/app/pages/publications/publications.page.ts b/src/app/pages/publications/publications.page.ts index 6cef68a6c..c565c6809 100644 --- a/src/app/pages/publications/publications.page.ts +++ b/src/app/pages/publications/publications.page.ts @@ -107,7 +107,8 @@ export class PublicationsPage implements OnInit { async AddPublicationFolder(item:any) { this.closeDesktopComponent(); - if(window.innerHeight >= 1024){ + if(window.innerWidth <= 1024){ + const modal = await this.modalController.create({ component: NewActionPage, componentProps:{ From d8af7815558cfc420798ff53fc4ed8bee15c5453 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Wed, 17 Mar 2021 11:41:58 +0100 Subject: [PATCH 04/15] savw --- src/app/pages/agenda/agenda.page.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/pages/agenda/agenda.page.ts b/src/app/pages/agenda/agenda.page.ts index 73f143d4a..d6b101306 100644 --- a/src/app/pages/agenda/agenda.page.ts +++ b/src/app/pages/agenda/agenda.page.ts @@ -161,6 +161,7 @@ export class AgendaPage implements OnInit { if( window.innerWidth <= 1024){ console.log('mobile') this.cloneAllmobileComponent(); + } }; From a2c66e870c11fbcd4b9b6f62721fa7b64cc1eb92 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Wed, 17 Mar 2021 11:51:21 +0100 Subject: [PATCH 05/15] improve public edit post --- .../shared/publication/new-publication/new-publication.page.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/shared/publication/new-publication/new-publication.page.scss b/src/app/shared/publication/new-publication/new-publication.page.scss index 9ea7ca39a..d4f8b2a55 100644 --- a/src/app/shared/publication/new-publication/new-publication.page.scss +++ b/src/app/shared/publication/new-publication/new-publication.page.scss @@ -138,7 +138,6 @@ font-size: 25px; .picture{ .post-img{ width: 60px; - height: 45px; } .picture-file-name{ font-size: 15px; From b07e0168d0acbcb16ddf71b81868ed9fb8fa880d Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Wed, 17 Mar 2021 11:55:33 +0100 Subject: [PATCH 06/15] update publication --- .../publication/new-publication/new-publication.page.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 b07846703..810ff4866 100644 --- a/src/app/shared/publication/new-publication/new-publication.page.html +++ b/src/app/shared/publication/new-publication/new-publication.page.html @@ -31,12 +31,12 @@
Fotografia Anexada
-
+
image
-
{{publication.OriginalFileName}}
+
{{publication.OriginalFileName}}.{{publication.FileExtension}}
75 Kb
From e206ac965c5bb236a770e879d6614a0a90f3b528 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Wed, 17 Mar 2021 11:59:35 +0100 Subject: [PATCH 07/15] update publication --- .../publication-detail/publication-detail.page.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/shared/publication/view-publications/publication-detail/publication-detail.page.ts b/src/app/shared/publication/view-publications/publication-detail/publication-detail.page.ts index 5a0adbe7c..284ec6377 100644 --- a/src/app/shared/publication/view-publications/publication-detail/publication-detail.page.ts +++ b/src/app/shared/publication/view-publications/publication-detail/publication-detail.page.ts @@ -89,7 +89,7 @@ export class PublicationDetailPage implements OnInit { async editPost(publicationType:any) { console.log(this.publication); - if(window.innerHeight >= 1024){ + if(window.innerWidth >= 1024){ const modal = await this.modalController.create({ component: NewPublicationPage, componentProps:{ From 5ca0f71d6518b499a0f0a5dd1bdb15a33218b367 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Wed, 17 Mar 2021 12:02:57 +0100 Subject: [PATCH 08/15] update publication --- .../publication-detail/publication-detail.page.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/shared/publication/view-publications/publication-detail/publication-detail.page.ts b/src/app/shared/publication/view-publications/publication-detail/publication-detail.page.ts index 284ec6377..0b836a3c4 100644 --- a/src/app/shared/publication/view-publications/publication-detail/publication-detail.page.ts +++ b/src/app/shared/publication/view-publications/publication-detail/publication-detail.page.ts @@ -89,7 +89,7 @@ export class PublicationDetailPage implements OnInit { async editPost(publicationType:any) { console.log(this.publication); - if(window.innerWidth >= 1024){ + if(window.innerWidth <= 1024){ const modal = await this.modalController.create({ component: NewPublicationPage, componentProps:{ From 307335ef7b8d1d1dd5c07719913c022908ab4f24 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Wed, 17 Mar 2021 20:45:57 +0100 Subject: [PATCH 09/15] Improve agenda timeline --- src/app/pages/agenda/agenda.page.html | 61 ++++++++++++++++++--------- src/app/pages/agenda/agenda.page.scss | 10 +++-- src/app/pages/agenda/agenda.page.ts | 3 +- src/global.scss | 33 +++++++++++++++ 4 files changed, 82 insertions(+), 25 deletions(-) diff --git a/src/app/pages/agenda/agenda.page.html b/src/app/pages/agenda/agenda.page.html index 4a5df9b76..7d0f2b7df 100644 --- a/src/app/pages/agenda/agenda.page.html +++ b/src/app/pages/agenda/agenda.page.html @@ -6,7 +6,7 @@
-
+
@@ -230,10 +230,10 @@ - + - + Hoje,   {{ timelineDate }} @@ -250,11 +250,23 @@ + +
+
+
Prória
+
+
+
+
Presidente da Republica
+
+
+
+
-
+
@@ -262,24 +274,33 @@ -
- - - -
- - +
+
+ +
+ + +
+ + +
+ + +
+
+
diff --git a/src/app/pages/agenda/agenda.page.scss b/src/app/pages/agenda/agenda.page.scss index e71c616e2..0f61d69fc 100644 --- a/src/app/pages/agenda/agenda.page.scss +++ b/src/app/pages/agenda/agenda.page.scss @@ -501,7 +501,6 @@ td.monthview-primary-with-event { .container-wrapper{ height: 100%; .calendar-timeline{ - flex-wrap: wrap; border-top-right-radius: 24px; width: calc(100%); @@ -535,10 +534,14 @@ td.monthview-primary-with-event { height: 100%; .calendar-timeline{ - flex-wrap: wrap; border-top-right-radius: 0px; width: calc(100% - 40%); border-right: 1px solid #d8d8d8; + + display: flex; + flex-direction: column; + height: 100%; + flex-wrap: unset; } } .event-details{ @@ -600,4 +603,5 @@ app-approve-event{ display: flex; align-items: center; height: 100%; -} \ No newline at end of file +} + diff --git a/src/app/pages/agenda/agenda.page.ts b/src/app/pages/agenda/agenda.page.ts index d6b101306..e1968049d 100644 --- a/src/app/pages/agenda/agenda.page.ts +++ b/src/app/pages/agenda/agenda.page.ts @@ -127,7 +127,7 @@ export class AgendaPage implements OnInit { private sanitizer: DomSanitizer ) { - this.calendarHeight = "347px"; + this.calendarHeight = '333px'; this.showCalendar = true; this.timelineDate = momentG(new Date(),'dd MMMM yyyy'); @@ -161,7 +161,6 @@ export class AgendaPage implements OnInit { if( window.innerWidth <= 1024){ console.log('mobile') this.cloneAllmobileComponent(); - } }; diff --git a/src/global.scss b/src/global.scss index 625e68241..dffe67857 100644 --- a/src/global.scss +++ b/src/global.scss @@ -414,4 +414,37 @@ td.monthview-secondary-with-event, td.monthview-secondary-with-event[_ngcontent- } ._xl{ width: 1140px; +} + + + +// timeline +.timeline-md{ + .cal-time{ + display: none; + } + .cal-current-time-marker::before { + display: none !important; + } + + .timeline-box{ + left: -12%; + position: relative; + width: 110%; + } +} + + +.timeline-mobile{ + .timeline-box { + position: relative; + left: -4%; + width: 102%; + } +} + +.timeline{ + div.cal-event:focus{ + outline: none !important; + } } \ No newline at end of file From 000a937bb8a83eef423ad6c6101260695a631097 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Wed, 17 Mar 2021 20:48:06 +0100 Subject: [PATCH 10/15] Improve agenda timeline --- src/app/pages/agenda/agenda.page.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/pages/agenda/agenda.page.html b/src/app/pages/agenda/agenda.page.html index 7d0f2b7df..88ede90c2 100644 --- a/src/app/pages/agenda/agenda.page.html +++ b/src/app/pages/agenda/agenda.page.html @@ -266,7 +266,7 @@
-
+
From 1ab022018c8f29f0268e22d2aed32fae432a8290 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Wed, 17 Mar 2021 21:17:36 +0100 Subject: [PATCH 11/15] Improve agenda page --- src/global.scss | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/global.scss b/src/global.scss index dffe67857..7ef62786d 100644 --- a/src/global.scss +++ b/src/global.scss @@ -428,9 +428,9 @@ td.monthview-secondary-with-event, td.monthview-secondary-with-event[_ngcontent- } .timeline-box{ - left: -12%; - position: relative; - width: 110%; + left: -17%; + position: relative; + width: 115%; } } From 2798d162f46e8e995e6236e2bcc4ad7a864f96ec Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Thu, 18 Mar 2021 20:02:44 +0100 Subject: [PATCH 12/15] Improve calendar page --- src/app/pages/agenda/agenda.page.html | 46 +- src/app/pages/agenda/agenda.page.ts | 454 +++++++++++------- .../gabinete-digital.page.html | 2 +- .../agenda/view-event/view-event.page.html | 8 +- .../agenda/view-event/view-event.page.scss | 6 - .../agenda/view-event/view-event.page.ts | 6 + 6 files changed, 315 insertions(+), 207 deletions(-) diff --git a/src/app/pages/agenda/agenda.page.html b/src/app/pages/agenda/agenda.page.html index 88ede90c2..29b7bf964 100644 --- a/src/app/pages/agenda/agenda.page.html +++ b/src/app/pages/agenda/agenda.page.html @@ -42,8 +42,8 @@ - - + + @@ -251,7 +251,7 @@ -
+
Prória
@@ -275,20 +275,9 @@
-
- -
- - -
- +
-
+
+
+ + +
+ +
+ + +
+
@@ -320,7 +331,6 @@ diff --git a/src/app/pages/agenda/agenda.page.ts b/src/app/pages/agenda/agenda.page.ts index e1968049d..823f3f24c 100644 --- a/src/app/pages/agenda/agenda.page.ts +++ b/src/app/pages/agenda/agenda.page.ts @@ -58,10 +58,16 @@ export class AgendaPage implements OnInit { // for timeline events: CalendarEvent[] = []; + TimelinePR: CalendarEvent[] = []; + TimelineMD: CalendarEvent[] = []; + + showTimelinePR = false; + showTimelineMD = false; + // timeline filter timelineFilterState: string = 'Todos'; showTimelineFilterState: boolean; - showTimeline: boolean; + showTimeline=true; /* List of events of our calendar */ eventSource = []; @@ -117,7 +123,7 @@ export class AgendaPage implements OnInit { saveData: {} } - constructor( + constructor( private alertCtrl: AlertController, @Inject(LOCALE_ID) private locale: string, private modalCtrl: ModalController, @@ -127,7 +133,7 @@ export class AgendaPage implements OnInit { private sanitizer: DomSanitizer ) { - this.calendarHeight = '333px'; + this.calendarHeight = "333px"; this.showCalendar = true; this.timelineDate = momentG(new Date(),'dd MMMM yyyy'); @@ -135,7 +141,7 @@ export class AgendaPage implements OnInit { this.showTimelineFilterState = false; this.showTimeline = false; - } + } ngOnInit() { this.profile = "mdgpr"; @@ -276,6 +282,7 @@ export class AgendaPage implements OnInit { currentDayEventDisplayBorder(day: any, id: any){ const events = day[id].events; + if (events.length == 0) { return ""; } else if (events.length >= 1) { @@ -326,7 +333,7 @@ export class AgendaPage implements OnInit { } // for timeline - timeLineTemplate(startTime: string, eventlocation: string, eventDiscription: any, calendarName: string, subject: string, startTimeWisthS: string, endTime: string, eventIndex: number): string{ + timeLineTemplate(startTime: string, eventlocation: string, eventDiscription: any, calendarName: string, subject: string, startTimeWisthS: string, endTime: string, eventIndex: number, profile: string): string{ const startHours = parseInt(startTimeWisthS.split(':')[0]); const startMinutos = parseInt(startTimeWisthS.split(':')[1]); @@ -342,8 +349,13 @@ export class AgendaPage implements OnInit { } } + console.log(profile); + + const profile_ = profile == 'md'? 'mdgpr': 'pr'; + + return ` -
+
${startTimeWisthS}${eventlocation}
@@ -366,7 +378,26 @@ export class AgendaPage implements OnInit { var minutes = ((endEvent.getTime() - startEvent.getTime()) / 1000) / 60; const top = (startEvent.getTime() - (new Date(2020, 1, 3)).getTime()) /60; - document.querySelectorAll('.timeline-box').forEach(ele => { + document.querySelectorAll('.fs-timeline .timeline-box').forEach(ele => { + + if(ele.className.indexOf(`timeline-box-event-${eventIndex}`)>=0){ + ele.setAttribute('style',`height:${minutes}px`); + } + }); + + }); + },timeout) + + setTimeout(()=>{ + this.TimelinePR.forEach((el, eventIndex)=>{ + + const startEvent = new Date(el['startTime']); + const endEvent = new Date(el['endTime']); + + var minutes = ((endEvent.getTime() - startEvent.getTime()) / 1000) / 60; + const top = (startEvent.getTime() - (new Date(2020, 1, 3)).getTime()) /60; + + document.querySelectorAll('.sd-timeline .timeline-box').forEach(ele => { if(ele.className.indexOf(`timeline-box-event-${eventIndex}`)>=0){ ele.setAttribute('style',`height:${minutes}px`); @@ -379,14 +410,16 @@ export class AgendaPage implements OnInit { // for timeline - timelineFilter(calendarName){ + timelineFilter(calendarName, eventsList, profile){ this.timelineFilterState = calendarName; // remove all event - this.events = []; + let events = []; - this.eventsList.forEach((element, eventIndex) => { + console.log(eventsList); + + eventsList.forEach((element, eventIndex) => { // timeline start const startHours = new Date(element.StartDate).getHours().toLocaleString(); @@ -395,207 +428,274 @@ export class AgendaPage implements OnInit { const startHoursOtherFormate = new Date(element.StartDate).getHours().toLocaleString()+':'+new Date(element.StartDate).getMinutes().toLocaleString(); const EndHoursOtherFormate = formatDate(new Date(element.EndDate), 'HH:mm', 'pt'); - if (element.CalendarName == calendarName) { - this.events.push({ - title: this.timeLineTemplate(startHours, element.Location, element.Body, element.CalendarName, element.Subject,startHoursOtherFormate,EndHoursOtherFormate, eventIndex), - start: setHours(setMinutes(new Date(element.StartDate), 0), parseInt(startHours)), - end: setHours(setMinutes(new Date(element.EndDate), 0), parseInt(EndHours)), - color: { - primary: 'white', - secondary: 'white' - }, - id: element.EventId - }); - } else if (calendarName == 'Todos'){ - this.events.push({ - title: this.timeLineTemplate(startHours, element.Location, element.Body, element.CalendarName, element.Subject,startHoursOtherFormate,EndHoursOtherFormate, eventIndex), - start: setHours(setMinutes(new Date(element.StartDate), 0), parseInt(startHours)), - end: setHours(setMinutes(new Date(element.EndDate), 0), parseInt(EndHours)), - color: { - primary: 'white', - secondary: 'white' - }, - id: element.EventId - }); - } - + events.push({ + title: this.timeLineTemplate(startHours, element.Location, element.Body, element.CalendarName, element.Subject,startHoursOtherFormate,EndHoursOtherFormate, eventIndex, profile), + start: setHours(setMinutes(new Date(element.StartDate), 0), parseInt(startHours)), + end: setHours(setMinutes(new Date(element.EndDate), 0), parseInt(EndHours)), + color: { + primary: 'white', + secondary: 'white' + }, + id: element.EventId, + }); + }); this.onCurrentChanged(this.eventSelectedDate); // this.showTimelineFilterState = false; + + return events; } loadRangeEvents(startTime: Date, endTime: Date){ - this.showTimeline = false; this.showLoader = true; - switch (this.segment) - { - case "Combinada": - //Inicializa o array eventSource - this.eventSource=[]; - + if(window.innerWidth < 1024){ + + this.showTimeline = false; - if(this.profile == "mdgpr"){ - this.eventService.getAllMdEvents( momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59') ).subscribe( - response => { - - this.eventSource=[]; - - this.eventsList = response; - // loop - this.eventsList.forEach((element, eventIndex) => { - - this.eventSource.push({ - title: element.Subject, - startTime: new Date(element.StartDate), - endTime: new Date(element.EndDate), - allDay: false, - event: element, - calendarName: element.CalendarName + switch (this.segment) { + case "Combinada": + //Inicializa o array eventSource + this.eventSource=[]; + + + if(this.profile == "mdgpr"){ + this.eventService.getAllMdEvents( momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59') ).subscribe( + response => { + + this.eventSource=[]; + + this.eventsList = response; + // loop + this.eventsList.forEach((element, eventIndex) => { + + this.eventSource.push({ + title: element.Subject, + startTime: new Date(element.StartDate), + endTime: new Date(element.EndDate), + allDay: false, + event: element, + calendarName: element.CalendarName, + }); }); + + this.events = this.timelineFilter(this.timelineFilterState, this.eventsList, 'md'); + + this.myCal.update(); + this.myCal.loadEvents(); + + this.showLoader = false; + this.showTimeline = true; + + this.timelineBoxCorrectHeight(500); + this.centralizeTimeline(500); + }); - - this.timelineFilter(this.timelineFilterState); - - this.myCal.update(); - this.myCal.loadEvents(); - - this.showLoader = false; - this.showTimeline = true; - - this.timelineBoxCorrectHeight(500); - this.centralizeTimeline(500); - - }); - - } - else{ - this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe( - response => { - - this.eventSource=[]; - - this.eventsList = response; - this.eventsList.forEach((element, eventIndex) => { - this.eventSource.push({ - title: element.Subject, - startTime: new Date(element.StartDate), - endTime: new Date(element.EndDate), - allDay: false, - event: element, - calendarName: element.CalendarName + + } + else{ + this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe( + response => { + + this.eventSource=[]; + + this.eventsList = response; + this.eventsList.forEach((element, eventIndex) => { + this.eventSource.push({ + title: element.Subject, + startTime: new Date(element.StartDate), + endTime: new Date(element.EndDate), + allDay: false, + event: element, + calendarName: element.CalendarName + }); + }); - + + this.events = this.timelineFilter(this.timelineFilterState, this.eventsList, 'pr'); + + this.myCal.update(); + this.myCal.loadEvents(); + this.showLoader = false; + this.showTimeline = true; + + this.timelineBoxCorrectHeight(500); + this.centralizeTimeline(500); + }); - - this.timelineFilter(this.timelineFilterState); - - this.myCal.update(); - this.myCal.loadEvents(); - this.showLoader = false; - this.showTimeline = true; - - this.timelineBoxCorrectHeight(500); - this.centralizeTimeline(500); - - }); - } - break; - - case "Pessoal": - //Inicializa o array eventSource - this.eventSource=[]; - if(this.profile == "mdgpr"){ - this.eventService.getAllMdEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(response => { - - this.eventSource=[]; - this.eventsListPessoal = response.filter(data => data.CalendarName == "Pessoal"); - this.eventsListPessoal.forEach(element => { - - this.eventSource.push({ - title: element.Subject, - startTime: new Date(element.StartDate), - endTime: new Date(element.EndDate), - allDay: false, - event: element - }); - }); - this.myCal.update(); - this.myCal.loadEvents(); - this.showLoader = false; - }); - - } - else{ - this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(response => { - this.eventSource=[]; - - this.eventsListPessoal = response.filter(data => data.CalendarName == "Pessoal"); - this.eventsListPessoal.forEach(element => { - this.eventSource.push({ - title: element.Subject, - startTime: new Date(element.StartDate), - endTime: new Date(element.EndDate), - allDay: false, - event: element - }); - }); - this.myCal.update(); - this.myCal.loadEvents(); - this.showLoader = false; - }); - } + } break; - - case "Oficial": - //Inicializa o array eventSource - this.eventSource=[]; - if(this.profile == "mdgpr"){ - this.eventService.getAllMdEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(res => { - this.eventSource=[]; - this.eventsListOficial = res.filter(data => data.CalendarName == "Oficial"); + + case "Pessoal": + //Inicializa o array eventSource + this.eventSource=[]; + if(this.profile == "mdgpr"){ + this.eventService.getAllMdEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(response => { + + this.eventSource=[]; + this.eventsListPessoal = response.filter(data => data.CalendarName == "Pessoal"); + this.eventsListPessoal.forEach(element => { + + this.eventSource.push({ + title: element.Subject, + startTime: new Date(element.StartDate), + endTime: new Date(element.EndDate), + allDay: false, + event: element, + profile: 'md' + }); + }); + this.myCal.update(); + this.myCal.loadEvents(); + this.showLoader = false; + }); + + } + else{ + this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(response => { + this.eventSource=[]; + + this.eventsListPessoal = response.filter(data => data.CalendarName == "Pessoal"); + this.eventsListPessoal.forEach(element => { + this.eventSource.push({ + title: element.Subject, + startTime: new Date(element.StartDate), + endTime: new Date(element.EndDate), + allDay: false, + event: element, + profile: 'pr' + }); + }); + this.myCal.update(); + this.myCal.loadEvents(); + this.showLoader = false; + }); + } + break; + + case "Oficial": + //Inicializa o array eventSource + this.eventSource=[]; + if(this.profile == "mdgpr"){ + this.eventService.getAllMdEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(res => { + this.eventSource=[]; + this.eventsListOficial = res.filter(data => data.CalendarName == "Oficial"); + this.eventsListOficial.forEach(element => { + this.eventSource.push({ + title: element.Subject, + startTime: new Date(element.StartDate), + endTime: new Date(element.EndDate), + allDay: false, + event: element, + profile: 'md' + }); + }); + this.myCal.update(); + this.myCal.loadEvents(); + this.showLoader = false; + }); + }else{ + this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(res => { + this.eventSource=[]; + this.eventsListOficial = res.filter(data => data.CalendarName == "Oficial"); this.eventsListOficial.forEach(element => { this.eventSource.push({ title: element.Subject, startTime: new Date(element.StartDate), endTime: new Date(element.EndDate), allDay: false, - event: element + event: element, + profile: 'pr' }); }); this.myCal.update(); this.myCal.loadEvents(); this.showLoader = false; }); - }else{ - this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(res => { - this.eventSource=[]; - this.eventsListOficial = res.filter(data => data.CalendarName == "Oficial"); - this.eventsListOficial.forEach(element => { - this.eventSource.push({ - title: element.Subject, - startTime: new Date(element.StartDate), - endTime: new Date(element.EndDate), - allDay: false, - event: element - }); - }); - this.myCal.update(); - this.myCal.loadEvents(); - this.showLoader = false; - }); - } - break; + } + break; + + } + } else { + + this.showTimelinePR = false; + this.showTimelineMD = false; + this.eventSource=[]; + + this.eventService.getAllMdEvents( momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59') ).subscribe( + response => { + + this.eventsList = response; + // loop + this.eventsList.forEach((element, eventIndex) => { + + this.eventSource.push({ + title: element.Subject, + startTime: new Date(element.StartDate), + endTime: new Date(element.EndDate), + allDay: false, + event: element, + calendarName: element.CalendarName, + profile: 'md' + }); + }); + + + this.TimelineMD = this.timelineFilter(this.timelineFilterState, this.eventsList, 'md'); + this.events = this.timelineFilter(this.timelineFilterState, this.eventsList, 'md'); + + this.myCal.update(); + this.myCal.loadEvents(); + + this.showTimelineMD = true; + + this.timelineBoxCorrectHeight(500); + this.centralizeTimeline(500); + + }); + + this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe( + response => { + + this.eventsList = response; + this.eventsList.forEach((element, eventIndex) => { + this.eventSource.push({ + title: element.Subject, + startTime: new Date(element.StartDate), + endTime: new Date(element.EndDate), + allDay: false, + event: element, + calendarName: element.CalendarName, + profile:'pr' + }); + + }); + + this.TimelinePR = this.timelineFilter(this.timelineFilterState, this.eventsList, 'pr'); + + console.log(this.TimelinePR); + + this.myCal.update(); + this.myCal.loadEvents(); + + this.showTimelinePR = true; + + this.timelineBoxCorrectHeight(500); + this.centralizeTimeline(500); + + this.showLoader = false; + }); + + } - } } actions(){ - } + } doRefresh(ev: any){ this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate); diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.html b/src/app/pages/gabinete-digital/gabinete-digital.page.html index 8146870bd..65c8eaaa9 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.html +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.html @@ -13,7 +13,7 @@
-
+

Gabinete Digital

diff --git a/src/app/shared/agenda/view-event/view-event.page.html b/src/app/shared/agenda/view-event/view-event.page.html index 835c8736e..9781d16bf 100644 --- a/src/app/shared/agenda/view-event/view-event.page.html +++ b/src/app/shared/agenda/view-event/view-event.page.html @@ -1,11 +1,11 @@ -
-
+
+
-
+
{{loadedEvent.Subject}}
@@ -20,7 +20,7 @@
-
+
{{loadedEvent.Location}}
diff --git a/src/app/shared/agenda/view-event/view-event.page.scss b/src/app/shared/agenda/view-event/view-event.page.scss index c2de1475b..530083ac4 100644 --- a/src/app/shared/agenda/view-event/view-event.page.scss +++ b/src/app/shared/agenda/view-event/view-event.page.scss @@ -25,7 +25,6 @@ ion-menu{ transform: translate3d(0, 1px, 0); .title-content{ - width: 360px; margin: 0px auto; overflow: auto; padding: 0 !important; @@ -91,25 +90,21 @@ ion-menu{ width: 100%; margin: 0 auto; padding: 0; - overflow: auto; } .location-detail{ - width: 210px; font-weight: 700; font-size: 18px; float: left; margin: 5px 5px 5px 0px; } .button-mdgpr-Oficial{ - width: 91px; --border-radius: 20px; --background: #ffb703; margin-left: 5px; float: left; } .button-mdgpr-Pessoal{ - width: 91px; --border-radius: 20px; --background: #f05d5e; margin-left: 5px; @@ -153,7 +148,6 @@ ion-menu{ } .bottom-content{ - width: 360px; margin: 0 auto; .bottom-content h3{ diff --git a/src/app/shared/agenda/view-event/view-event.page.ts b/src/app/shared/agenda/view-event/view-event.page.ts index 701e996fc..29e1e7e2f 100644 --- a/src/app/shared/agenda/view-event/view-event.page.ts +++ b/src/app/shared/agenda/view-event/view-event.page.ts @@ -55,6 +55,12 @@ export class ViewEventPage implements OnInit { this.getAttachments(); } + + ngOnChanges(changes: any): void { + this.loadEvent(); + this.getAttachments(); + } + close(){ console.log(this.isEventEdited); From 733c485e5dbd82edf0df4f06b19c28d60a482d81 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Fri, 19 Mar 2021 15:56:58 +0100 Subject: [PATCH 13/15] Update improve agenda --- src/app/pages/agenda/agenda.page.html | 11 ++--- src/app/pages/agenda/agenda.page.ts | 31 +++++++------- .../event-list/event-list.component.html | 2 +- .../event-list/event-list.component.scss | 4 +- .../agenda/new-event/new-event.component.html | 40 +++++++++---------- .../agenda/new-event/new-event.component.scss | 4 -- .../agenda/view-event/view-event.page.html | 2 +- src/global.scss | 38 ++++++++++++++---- 8 files changed, 74 insertions(+), 58 deletions(-) diff --git a/src/app/pages/agenda/agenda.page.html b/src/app/pages/agenda/agenda.page.html index 29b7bf964..5567fe84d 100644 --- a/src/app/pages/agenda/agenda.page.html +++ b/src/app/pages/agenda/agenda.page.html @@ -83,11 +83,12 @@ -
- {{ view.dates[row*7+col].label }} -
- -
+
+ +
+ {{ view.dates[row*7+col].label }} +
+
diff --git a/src/app/pages/agenda/agenda.page.ts b/src/app/pages/agenda/agenda.page.ts index 823f3f24c..5067fbf98 100644 --- a/src/app/pages/agenda/agenda.page.ts +++ b/src/app/pages/agenda/agenda.page.ts @@ -280,28 +280,27 @@ export class AgendaPage implements OnInit { // for calendar currentDayEventDisplayBorder(day: any, id: any){ - + const events = day[id].events; if (events.length == 0) { - return ""; - } else if (events.length >= 1) { - /** @description store all event type */ - let eventType = {}; - let eventTypeNum: number; + return ""; + + } else if (events.length >= 1) { + + let classs = []; events.forEach(element => { - eventType[element.calendarName] = 1; + + const profile_ = element.profile == 'md'? 'mdgpr': 'pr'; + const eventtype = element.event.CalendarName; + + classs.push(`calendar-event-border calendar-${profile_}-event-type-${eventtype}`); + }); - eventTypeNum = (Object.keys(eventType)).length - - if (eventTypeNum == 2) { - return ` calendar-event-border calendar-${this.profile}-event-type-both`; - } else { - return ` calendar-event-border calendar-${this.profile}-event-type-`+(Object.keys(eventType))[0]; - } + return classs.join(' '); } return ""; @@ -419,6 +418,8 @@ export class AgendaPage implements OnInit { console.log(eventsList); + this.showTimelineFilterState = false; + eventsList.forEach((element, eventIndex) => { // timeline start @@ -442,8 +443,6 @@ export class AgendaPage implements OnInit { }); this.onCurrentChanged(this.eventSelectedDate); - // - this.showTimelineFilterState = false; return events; } diff --git a/src/app/shared/agenda/event-list/event-list.component.html b/src/app/shared/agenda/event-list/event-list.component.html index fb5a3b5a0..e313061d5 100644 --- a/src/app/shared/agenda/event-list/event-list.component.html +++ b/src/app/shared/agenda/event-list/event-list.component.html @@ -1,4 +1,4 @@ - +
diff --git a/src/app/shared/agenda/event-list/event-list.component.scss b/src/app/shared/agenda/event-list/event-list.component.scss index cc474d78f..2b8edf01e 100644 --- a/src/app/shared/agenda/event-list/event-list.component.scss +++ b/src/app/shared/agenda/event-list/event-list.component.scss @@ -1,17 +1,15 @@ .header-content{ - width: 360px; overflow: auto; margin: 0 auto; padding-top: 25px; } .header-icon-left{ - width: 36px; font-size: 33px; color: #42b9fe; float: left; } .header-title{ - width: 300px; + font-family: Roboto; font-size: 25px; margin: 0 5px 0 5px; diff --git a/src/app/shared/agenda/new-event/new-event.component.html b/src/app/shared/agenda/new-event/new-event.component.html index a293c6218..b6242aa70 100644 --- a/src/app/shared/agenda/new-event/new-event.component.html +++ b/src/app/shared/agenda/new-event/new-event.component.html @@ -16,11 +16,11 @@
-
+
-
+
@@ -32,11 +32,11 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
Não se repete Repete @@ -125,11 +125,11 @@
-
+
-
+
@@ -146,11 +146,11 @@