diff --git a/package-lock.json b/package-lock.json index 7fdcc4b34..129f078ff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13294,6 +13294,15 @@ "fs-exists-sync": "^0.1.0" } }, + "d": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", + "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", + "requires": { + "es5-ext": "^0.10.50", + "type": "^1.0.1" + } + }, "damerau-levenshtein": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.6.tgz", @@ -13770,6 +13779,15 @@ "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=" }, + "duration": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/duration/-/duration-0.2.2.tgz", + "integrity": "sha512-06kgtea+bGreF5eKYgI/36A6pLXggY7oR4p1pq4SmdFBn1ReOL5D8RhG64VrqfTTKNucqqtBAwEj8aB88mcqrg==", + "requires": { + "d": "1", + "es5-ext": "~0.10.46" + } + }, "easy-extender": { "version": "2.3.4", "resolved": "https://registry.npmjs.org/easy-extender/-/easy-extender-2.3.4.tgz", @@ -14063,6 +14081,26 @@ "is-symbol": "^1.0.2" } }, + "es5-ext": { + "version": "0.10.53", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", + "integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==", + "requires": { + "es6-iterator": "~2.0.3", + "es6-symbol": "~3.1.3", + "next-tick": "~1.0.0" + } + }, + "es6-iterator": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", + "requires": { + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" + } + }, "es6-promise": { "version": "4.2.8", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", @@ -14078,6 +14116,15 @@ "es6-promise": "^4.0.3" } }, + "es6-symbol": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", + "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", + "requires": { + "d": "^1.0.1", + "ext": "^1.1.2" + } + }, "escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", @@ -14495,6 +14542,21 @@ } } }, + "ext": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz", + "integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==", + "requires": { + "type": "^2.0.0" + }, + "dependencies": { + "type": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/type/-/type-2.5.0.tgz", + "integrity": "sha512-180WMDQaIMm3+7hGXWf12GtdniDEy7nYcyFMKJn/eZz/6tSLXrUN9V0wKSbMjej0I1WHWbpREDEKHtqPQa9NNw==" + } + } + }, "extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", @@ -21530,6 +21592,11 @@ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true }, + "next-tick": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", + "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=" + }, "ngx-socket-io": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/ngx-socket-io/-/ngx-socket-io-3.2.0.tgz", @@ -28688,6 +28755,11 @@ "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" }, + "type": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", + "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==" + }, "type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", diff --git a/package.json b/package.json index 3cea6f4d7..3ec6745e2 100644 --- a/package.json +++ b/package.json @@ -76,6 +76,7 @@ "date-fns": "^2.17.0", "depd": "^2.0.0", "dotenv": "^10.0.0", + "duration": "^0.2.2", "faker": "^5.5.3", "global": "^4.4.0", "http-server": "^0.12.3", diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.html b/src/app/pages/gabinete-digital/gabinete-digital.page.html index 2a83b91a3..7f02566fa 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.html +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.html @@ -1,6 +1,28 @@ + + + + Gabinete Digital + + + + + + + + + + + + + + + + + + @@ -8,20 +30,19 @@ - + - + - + Gabinete Digital - - + - + --> - @@ -58,9 +77,19 @@ {{task.Senders}} - + + + {{task.customDate}} + + + - Data + + Agenda {{task.Agenda}} do Presidente da República + + + A sua agenda {{task.Agenda}} + diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.scss b/src/app/pages/gabinete-digital/gabinete-digital.page.scss index 9e2e511c5..f5456ea3c 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.scss +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.scss @@ -4,7 +4,7 @@ ion-content{ --padding-start:15px; */ /* --padding-bottom:15px; */ /* --background:#ecf8ff; */ - --background: transparent; + --background: #ecf8ff; } ion-segment{ overflow: auto; @@ -27,8 +27,12 @@ ion-segment-button{ text-align: center; } .title-container{ + background:#ecf8ff; padding: 30px 20px 15px 20px !important; //margin-bottom: 15px; + border-top-left-radius: 25px; + border-top-right-radius: 25px; + .title{ width: fit-content; font-size: 25px !important; @@ -118,11 +122,7 @@ ion-segment-button{ overflow:auto; padding: 0 !important; - border-top-left-radius: 25px; - border-top-right-radius: 25px; - .aside-wrapper{ - //border: 1px solid red; overflow: auto; .listview{ width: 100%t; @@ -269,6 +269,11 @@ ion-list{ .item-subject{ width: 84%; float: left; + + ion-label{ + margin: 0 !important; + padding: 2.5px 10.5px 2.5px 10.5px; + } } .item-icon{ @@ -386,11 +391,17 @@ ion-list{ @media only screen and (min-width: 701px) { + ion-content{ + --background: transparent; + } .title{ font-size: 15px !important; } .main-content{ + border-top-left-radius: 25px; + border-top-right-radius: 25px; + .aside-wrapper{ display: flex; width: 35%; diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.ts b/src/app/pages/gabinete-digital/gabinete-digital.page.ts index 33cb41b10..3fafb0a45 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.ts +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.ts @@ -108,7 +108,7 @@ export class GabineteDigitalPage implements OnInit { authService: AuthService, public p: PermissionService ) { - this.segmentVista = "listview"; + this.loggeduser = authService.ValidatedUser; window.onresize = (event) => { // if not mobile remove all component @@ -130,6 +130,13 @@ export class GabineteDigitalPage implements OnInit { ngOnInit() { + if( window.innerWidth < 701) { + this.segmentVista = "listview"; + } + else{ + this.segmentVista = "boxview"; + } + const pathname = window.location.pathname this.LoadCounts(); @@ -173,10 +180,12 @@ export class GabineteDigitalPage implements OnInit { "WorkflowName": element.workflowDisplayName, "activityInstanceName": element.activityInstanceName, "Status": element.workflowInstanceDataFields.Status, + "Agenda": element.workflowInstanceDataFields.Agenda, + "customDate": this.setFormatDate(new Date(element.workflowInstanceDataFields.StartDate), new Date(element.workflowInstanceDataFields.EndDate), element.workflowInstanceDataFields.IsAllDayEvent), } this.allProcessesList.push(task); this.allProcessesList = removeDuplicate( this.allProcessesList) - this.allProcessesList = this.sortArrayISODate(this.allProcessesList); + this.allProcessesList = this.sortArrayISODate(this.allProcessesList).reverse(); }); //this.pendentesstore.reset(this.allProcessesList); this.skeletonLoader = false; @@ -189,7 +198,58 @@ export class GabineteDigitalPage implements OnInit { }); } - viewProcessDetails(){} + setFormatDate(start:any, end:any, allday:boolean){ + let customDate; + /* start = new Date(); + end= new Date("2021-08-04T18:01:04.753Z"); */ + //end = new Date("2021-09-04T18:01:04.753Z"); + + const totalSeconds = Math.floor((end - (start))/1000);; + const totalMinutes = Math.floor(totalSeconds/60); + const totalHours = Math.floor(totalMinutes/60); + const totalDays = Math.floor(totalHours/24); + + const hours = totalHours - ( totalDays * 24 ); + const minutes = totalMinutes - ( totalDays * 24 * 60 ) - ( hours * 60 ); + const seconds = totalSeconds - ( totalDays * 24 * 60 * 60 ) - ( hours * 60 * 60 ) - ( minutes * 60 ); + + let diffDays = totalDays; + let diffMinutes = minutes; + + console.log(allday); + if(totalDays == 0){ + if(allday){ + customDate = this.getCustomDate(start)+", "+this.getCustomHours(start)+" (todo dia)"; + console.log(customDate); + return customDate; + } + else + { + //customDate = this.getCustomDate(start)+","+this.getCustomHours(start)+" ("+minutes+" mins)"; + customDate = this.getCustomDate(start)+", "+this.getCustomHours(start)+" | "+this.getCustomHours(end); + return customDate; + } + } + else{ + customDate = this.getCustomDate(start)+","+this.getCustomHours(start)+ + " (termina:"+ this.getCustomDate(end)+","+this.getCustomHours(end)+")"; + return customDate; + } + } + + getCustomDate(thedate: Date){ + return (thedate.getDay()+1) + "/" + + (thedate.getMonth()+1) + "/" + + thedate.getFullYear(); + } + getCustomHours(thedate: Date){ + return thedate.getHours() + ":" + + thedate.getMinutes(); + } + + viewProcessDetails(){ + + } onSegmentVistaChange(){ 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 bbc9eaabd..36d7382f5 100644 --- a/src/app/pages/publications/view-publications/view-publications.page.ts +++ b/src/app/pages/publications/view-publications/view-publications.page.ts @@ -89,7 +89,7 @@ export class ViewPublicationsPage implements OnInit { } getPublicationDetail() { - + setTimeout(() => { let allActions = this.publicationEventFolderStorage.list.concat(this.publicationTravelFolderService.list) this.item = allActions.find((e)=> e.ProcessId == this.folderId); @@ -128,6 +128,8 @@ export class ViewPublicationsPage implements OnInit { }); + console.log(folderId); + this.publicationListStorage.add(folderId, this.publicationList) this.showLoader = false; diff --git a/src/app/store/publication-list.service.ts b/src/app/store/publication-list.service.ts index 816798a22..92e6ad43b 100644 --- a/src/app/store/publication-list.service.ts +++ b/src/app/store/publication-list.service.ts @@ -11,13 +11,13 @@ export class PublicationListService { // main data private _document: Publication[] = [] // local storage keyName - private keyName: string; + private keyName: string; constructor() { this.keyName = (SHA1(this.constructor.name+ 'view-publication-list/local')).toString() - setTimeout(()=>{ + setTimeout(()=>{ let restore = localstoreService.get(this.keyName, []) this._document = restore.document }, 10) @@ -35,7 +35,7 @@ export class PublicationListService { add(folderId, document) { this._document[folderId] = document - setTimeout(()=> { + setTimeout(()=> { localstoreService.set(this.keyName, { document: this._document }) @@ -45,4 +45,4 @@ export class PublicationListService { } -export const PublicationListStorage = new PublicationListService() \ No newline at end of file +export const PublicationListStorage = new PublicationListService()