diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml new file mode 100644 index 000000000..3fdb490ef --- /dev/null +++ b/bitbucket-pipelines.yml @@ -0,0 +1,18 @@ +image: node:14.15.0 + +pipelines: + default: + - step: + caches: + - node + script: + - apt-get update; apt-get install -y gettext-base; + - echo 'deb http://dl.google.com/linux/chrome/deb/ stable main' > /etc/apt/sources.list.d/chrome.list + - wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - + - set -x && apt-get update && apt-get install -y xvfb google-chrome-stable + - 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 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 d448ba742..73e1c0b20 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 bb42f241d..f2a435fe0 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", diff --git a/src/app/modals/create-process/create-process.page.html b/src/app/modals/create-process/create-process.page.html index ca6e19283..fa36fe6fb 100644 --- a/src/app/modals/create-process/create-process.page.html +++ b/src/app/modals/create-process/create-process.page.html @@ -44,11 +44,11 @@ - - Normal (4 dias para a execução da tarefa) - Urgente (2 dias para a execução da tarefa) - Muito Urgente (1 dia para a execução da tarefa) - Urgentíssimo (8 horas para a execução da tarefa) + + Normal (4 dias para a execução da tarefa) + Urgente (2 dias para a execução da tarefa) + Muito Urgente (1 dia para a execução da tarefa) + Urgentíssimo (8 horas para a execução da tarefa) diff --git a/src/app/modals/create-process/create-process.page.ts b/src/app/modals/create-process/create-process.page.ts index bc178d265..8298ebf53 100644 --- a/src/app/modals/create-process/create-process.page.ts +++ b/src/app/modals/create-process/create-process.page.ts @@ -184,7 +184,7 @@ export class CreateProcessPage implements OnInit { Priority: new FormControl(this.postData.Priority, [ Validators.required, ]), - participantes: new FormControl(this.taskParticipantsCc.concat(this.taskParticipants), [ + participantes: new FormControl(this.taskParticipantsCc, [ // Validators.required ]), selectedTypes: new FormControl(this.selectedTypes, [ 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; 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..24adc235f 100644 --- a/src/app/pages/publications/publications.page.html +++ b/src/app/pages/publications/publications.page.html @@ -35,9 +35,10 @@
- - +
@@ -51,12 +52,12 @@
- - + + @@ -78,9 +79,10 @@ --> - -
@@ -96,7 +98,16 @@
- Apagar + + + + + +