From 28a5071109b08f0fc43a31982b8492e384f7e73b Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Wed, 7 Jul 2021 16:52:37 +0100 Subject: [PATCH 1/7] Fix input dont reset value --- .../expedient-task-modal/expedient-task-modal.page.ts | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.ts b/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.ts index 6aa2de511..34560e57c 100644 --- a/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.ts +++ b/src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page.ts @@ -104,12 +104,9 @@ export class ExpedientTaskModalPage implements OnInit { this.loggeduser = userAuth.ValidatedUser; this.task = this.navParams.get('task'); - - console.log('task', this.task) this.taskType = this.navParams.get('taskAction'); - //Initialize SubjectTypes Array with the value "Indefinido" this.selectedTypes = ['99999850']; this.postData = new Despacho(); @@ -222,8 +219,6 @@ export class ExpedientTaskModalPage implements OnInit { if(this.Form.invalid) return false } - - if(this.postData.Priority=='99999861') { this.dispatchFolder.DeadlineType = 'Normal'; } @@ -258,10 +253,6 @@ export class ExpedientTaskModalPage implements OnInit { }); docs.Attachments = DocumentToSave; - if (window.innerWidth >= 800) { - this.selectedTypes = this.toppingsValues - } - let loader = this.toastService.loading() this.dispatchFolder.SubjectTypes = this.selectedTypes; From bf4b9e4662cef50240500e89c1344f842307c8fa Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Wed, 7 Jul 2021 17:02:19 +0100 Subject: [PATCH 2/7] issue 923 --- .../edit-action/edit-action.module.ts | 30 +++- .../edit-action/edit-action.page.html | 133 +++++++++++++++++- .../edit-action/edit-action.page.scss | 127 +++++++++++++++++ .../edit-action/edit-action.page.ts | 102 +++++++++++++- .../pages/publications/publications.page.html | 15 +- .../pages/publications/publications.page.scss | 16 ++- .../pages/publications/publications.page.ts | 6 +- .../edit-action/edit-action.page.html | 2 +- 8 files changed, 415 insertions(+), 16 deletions(-) diff --git a/src/app/pages/publications/edit-action/edit-action.module.ts b/src/app/pages/publications/edit-action/edit-action.module.ts index 99e36907b..350242d99 100644 --- a/src/app/pages/publications/edit-action/edit-action.module.ts +++ b/src/app/pages/publications/edit-action/edit-action.module.ts @@ -4,6 +4,22 @@ import { FormsModule } from '@angular/forms'; import { IonicModule } from '@ionic/angular'; +import { MatNativeDateModule } from '@angular/material/core'; +import { + NgxMatDatetimePickerModule, + NgxMatNativeDateModule, + NgxMatTimepickerModule +} from '@angular-material-components/datetime-picker'; +import { ReactiveFormsModule } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatSelectModule } from '@angular/material/select'; +import { NgxMatMomentModule } from '@angular-material-components/moment-adapter'; +import { MAT_DATE_LOCALE } from '@angular/material/core'; +import { MatDatepickerModule } from '@angular/material/datepicker'; +import { MatInputModule } from '@angular/material/input'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatMenuModule } from '@angular/material/menu'; + import { EditActionPageRoutingModule } from './edit-action-routing.module'; import { EditActionPage } from './edit-action.page'; @@ -13,7 +29,19 @@ import { EditActionPage } from './edit-action.page'; CommonModule, FormsModule, IonicModule, - EditActionPageRoutingModule + EditActionPageRoutingModule, + // Angular material + MatDatepickerModule, + MatInputModule, + MatNativeDateModule, + NgxMatDatetimePickerModule, + NgxMatTimepickerModule, + NgxMatNativeDateModule, + NgxMatMomentModule, + MatSelectModule, + MatButtonModule, + ReactiveFormsModule, + MatDialogModule, ], declarations: [EditActionPage] }) diff --git a/src/app/pages/publications/edit-action/edit-action.page.html b/src/app/pages/publications/edit-action/edit-action.page.html index 3abd6d729..049ddd4b2 100644 --- a/src/app/pages/publications/edit-action/edit-action.page.html +++ b/src/app/pages/publications/edit-action/edit-action.page.html @@ -1,9 +1,134 @@ - - - edit-action - + +
+
+ Editar acção presidencial +
+ + +
+
+ +
+ +
+ +
+
+
+ +
+
+ + + + + + + + + + + +
+
+
+ +
+
+
+ +
+
+ + + + + + + + + +
+
+
+ +
+
+
+ +
+
+ +
+
+
+
+ +
+ + + + + + + + + + + + diff --git a/src/app/pages/publications/edit-action/edit-action.page.scss b/src/app/pages/publications/edit-action/edit-action.page.scss index e69de29bb..260338602 100644 --- a/src/app/pages/publications/edit-action/edit-action.page.scss +++ b/src/app/pages/publications/edit-action/edit-action.page.scss @@ -0,0 +1,127 @@ +:host{ + background: #fff; + } + ion-content{ + --background: transparent; + transform: translate3d(0, 5px, 0); + --border-radius: 30px; + } + ion-footer{ + background: #fff; + } + ion-toolbar{ + /* --background:#0782c9; */ + border-width: 0 !important; + } + .div-top-header{ + margin: 0 auto; + background-color: #0782c9; + overflow: auto; + padding-top: 15px; + border: 0!important; + } + .div-search{ + font-size: 45px; + float: left; + margin: 0 0 0 10px + } + .div-logo{ + background: transparent; + width: 140px; + margin: 5px 0 0px 71px; + float: left; + } + .div-logo img{ + width: 100%; + } + .div-profile{ + font-size: 45px; + float: right; + margin-right: 10px; + } + .content-top{ + background: #f3f2f2; + height: 20px; + margin: 0 auto; + border-top-left-radius: 25px; + border-top-right-radius: 25px; + } + .content-container{ + width: 100%; + margin:0 auto; + border-top-left-radius: 25px; + border-top-right-radius: 25px; + background: #ffffff; + height: 100%; + padding: 25px 20px 0 20px; + overflow: auto; + } + .title-content{ + margin: 0px auto; + overflow: auto; + padding: 0 !important; + } + .div-title{ + width: fit-content; + float: left; + margin: 2.5px 0 0 5px; + } + .title{ + font-size: 25px; + } + .container-div{ + margin-bottom: 15px; + overflow: auto; + } + .ion-item-container{ + margin: 15px auto; + border: 1px solid #ebebeb; + border-radius: 5px; + padding-left: 10px; + } + .ion-item-container-no-border{ + width: 100%; + margin: 0px auto; + padding: 0 !important; + overflow: auto; + } + .ion-item-class-2{ + margin: 0px auto; + } + .ion-icon-class{ + width: 45px; + height: 45px; + float: left; + padding: 10px; + font-size: 25px; + } + .ion-input-class{ + height: auto; + border: 1px solid #ebebeb; + border-radius: 5px; + padding-left: 5px; + padding-right: 10px; + float: left; + } + .ion-textarea-class{ + width: 315px; + height: auto; + border: 1px solid #ebebeb; + border-radius: 5px; + padding-left: 5px; + padding-right: 10px; + float: left; + } + .ion-input-class-no-height{ + border: 1px solid #ebebeb; + border-radius: 5px; + overflow: auto; + } + .actionType{ + float: right; + overflow: auto; + border-radius: 30px; + } + .ion-segment{ + --background: #0782c9; + } \ No newline at end of file diff --git a/src/app/pages/publications/edit-action/edit-action.page.ts b/src/app/pages/publications/edit-action/edit-action.page.ts index c1b0fe866..ec7440581 100644 --- a/src/app/pages/publications/edit-action/edit-action.page.ts +++ b/src/app/pages/publications/edit-action/edit-action.page.ts @@ -1,4 +1,10 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; +import { ModalController, NavParams } from '@ionic/angular'; +import * as moment from 'moment'; +import { PublicationFolder } from 'src/app/models/publicationfolder'; +import { PublicationsService } from 'src/app/services/publications.service'; +import { ToastService } from 'src/app/services/toast.service'; @Component({ selector: 'app-edit-action', @@ -7,9 +13,99 @@ import { Component, OnInit } from '@angular/core'; }) export class EditActionPage implements OnInit { - constructor() { } + Form: FormGroup; + validateFrom = false - ngOnInit() { + public date: any; + public disabled = false; + public showSpinners = true; + public showSeconds = false; + public touchUi = false; + public enableMeridian = false; + public minDate: any; + public maxDate: any; + public stepHour = 1; + public stepMinute = 5; + public stepSecond = 5; + public dateControlStart = new FormControl(moment("DD MM YYYY hh")); + public dateControlEnd = new FormControl(moment("DD MM YYYY hh")); + + folder: PublicationFolder; + folderId: string; + @Output() closeDesktopComponent= new EventEmitter(); + @Output() updateDesktopComponent= new EventEmitter(); + + constructor( + private publicationsService: PublicationsService, + private toastService: ToastService, + private navParams: NavParams, + private modalController: ModalController, + ) { + this.folder = new PublicationFolder(); + this.folderId = this.navParams.get('folderId'); } + ngOnInit() { + this.getPublicationDetail(); + } + + close() { + this.modalController.dismiss(); + } + + getPublicationDetail() { + this.publicationsService.GetPresidentialAction(this.folderId).subscribe( res => { + this.folder = res; + + this.dateControlStart = new FormControl(moment(new Date(this.folder.DateBegin))); + this.dateControlEnd = new FormControl(moment(new Date(this.folder.DateEnd))); + + }); + } + + get dateValid() { + if (window.innerWidth <= 800) { + return this.folder.DateBegin < this.folder.DateEnd? ['ok']: [] + } else { + return ['ok'] + } + } + + runValidation() { + this.validateFrom = true + } + + injectValidation() { + + this.Form = new FormGroup({ + Subject: new FormControl(this.folder.Description, [ + Validators.required, + // Validators.minLength(4) + ]), + Date: new FormControl(this.dateValid, [ + Validators.required + ]), + }) + } + + async save() { + let body = { + ProcessId: this.folderId, + Description: this.folder.Description, + Detail: this.folder.Detail, + DateBegin: this.folder.DateBegin, + DateEnd: this.folder.DateEnd, + ActionType: this.folder.ActionType, + } + console.log(body); + + try { + await this.publicationsService.UpdatePresidentialAction(body).toPromise() + this.close(); + this.updateDesktopComponent.emit(); + this.toastService.successMessage('Acção presidencial atualizada') + } catch (error) { + this.toastService.badRequest('Não foi possivel atualizar a acção presidencial') + } + } } diff --git a/src/app/pages/publications/publications.page.html b/src/app/pages/publications/publications.page.html index dafecd572..ca4b486b6 100644 --- a/src/app/pages/publications/publications.page.html +++ b/src/app/pages/publications/publications.page.html @@ -51,11 +51,11 @@ - + + + + + - +
@@ -56,7 +57,7 @@ - + @@ -80,7 +81,8 @@ --> -
diff --git a/src/app/pages/publications/publications.page.scss b/src/app/pages/publications/publications.page.scss index 2dac3d4b2..62fd90cfc 100644 --- a/src/app/pages/publications/publications.page.scss +++ b/src/app/pages/publications/publications.page.scss @@ -163,6 +163,11 @@ ion-toolbar{ } } + ion-item-options{ + border: 1px solid #fff; + overflow: auto; + } + ion-item-option{ display: flex; background: #ffe0e0; @@ -170,19 +175,28 @@ ion-toolbar{ align-content: center; } - .edit-option{ + .delete-option{ display: flex; - background: #e0e9ee; + background: #ffe0e0; align-items: center; align-content: center; + border: 1px solid #d30a0a67; + } + + .edit-option{ + display: flex; + background: #fff; + align-items: center; + align-content: center; + border: 1px solid #42b9feb9; } .edit{ - padding: 7px; + padding: 6px; font-size: 35px; color:#061b52; border-radius: 20px; - margin: 8px; + margin: 7px; } .delete{ padding: 7px; From a3cb001b3c12d91e898c2d318bf7ed02e3730f52 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Thu, 8 Jul 2021 09:24:22 +0100 Subject: [PATCH 5/7] save --- src/app/pages/publications/publications.page.html | 8 ++++---- src/app/pages/publications/publications.page.scss | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/app/pages/publications/publications.page.html b/src/app/pages/publications/publications.page.html index 165a59cc7..2d9063d32 100644 --- a/src/app/pages/publications/publications.page.html +++ b/src/app/pages/publications/publications.page.html @@ -35,10 +35,10 @@
- + class="width-100 d-flex ion-no-border ion-no-margin ion-no-padding">
@@ -82,7 +82,7 @@
@@ -103,7 +103,7 @@ - + diff --git a/src/app/pages/publications/publications.page.scss b/src/app/pages/publications/publications.page.scss index 62fd90cfc..1a9c5cd92 100644 --- a/src/app/pages/publications/publications.page.scss +++ b/src/app/pages/publications/publications.page.scss @@ -102,7 +102,7 @@ ion-toolbar{ } .item{ width: 100% !important; - padding: 0 0px 0 0px !important; + padding: 0px !important; border-bottom: 1px solid #ebebeb; align-items: center; justify-content: space-between; @@ -188,6 +188,7 @@ ion-toolbar{ background: #fff; align-items: center; align-content: center; + margin-right: 5px !important; border: 1px solid #42b9feb9; } From 3879a4c5ac2f58b862e5dc97431e9e70866b1856 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Thu, 8 Jul 2021 09:43:50 +0100 Subject: [PATCH 6/7] Improve bitbucket pipeline --- bitbucket-pipelines.yml | 2 +- package-lock.json | 5 +++++ package.json | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index 39b65a9b2..3fdb490ef 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -13,6 +13,6 @@ pipelines: - wget -q -O /usr/bin/xvfb-chrome https://bitbucket.org/atlassian/docker-node-chrome-firefox/raw/ff180e2f16ea8639d4ca4a3abb0017ee23c2836c/scripts/xvfb-chrome - ln -sf /usr/bin/xvfb-chrome /usr/bin/google-chrome - chmod 755 /usr/bin/google-chrome - - npm install + - npm ci - ./node_modules/@angular/cli/bin/ng -v - npm run test \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index cda21774a..646fdb778 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5345,6 +5345,11 @@ } } }, + "ci": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ci/-/ci-2.1.1.tgz", + "integrity": "sha512-StBCU1G9zbhgVBqvslvOpT601zme9YfyZaUSjgXCtfnIynPuDBHX85WwnXv5cnh74bYo8S3xfPpI41yk1jZmRw==" + }, "ci-info": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", diff --git a/package.json b/package.json index 11875f507..cc5ca799b 100644 --- a/package.json +++ b/package.json @@ -55,6 +55,7 @@ "angular-calendar": "^0.28.22", "angular-tag-cloud-module": "^5.2.2", "bootstrap": "^4.5.0", + "ci": "^2.1.1", "cordova": "^10.0.0", "cordova-plugin-camera": "^5.0.1", "cordova-plugin-filepath": "^1.5.8", From 42427d37d09c77d6480895b9f45365bc45963707 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Thu, 8 Jul 2021 09:49:18 +0100 Subject: [PATCH 7/7] save --- src/app/pages/publications/publications.page.html | 4 ++-- src/app/pages/publications/publications.page.ts | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/app/pages/publications/publications.page.html b/src/app/pages/publications/publications.page.html index 2d9063d32..24adc235f 100644 --- a/src/app/pages/publications/publications.page.html +++ b/src/app/pages/publications/publications.page.html @@ -35,7 +35,7 @@
- @@ -79,7 +79,7 @@
--> - { if( window.innerWidth < 801) { this.hideRefreshBtn = false; + this.showSlidingOptions = false; } else{ this.hideRefreshBtn = true; + this.showSlidingOptions = true; } } if(window.innerWidth < 801){ - console.log('YASS'); this.hideRefreshBtn = false; + this.showSlidingOptions = false; + } + else{ + this.hideRefreshBtn = true; + this.showSlidingOptions = true; } }