mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 21:35:50 +00:00
Merge branch 'developer' of https://bitbucket.org/equilibriumito/gabinete-digital into developer
This commit is contained in:
@@ -115,7 +115,7 @@
|
|||||||
<div class="ion-icon-class">
|
<div class="ion-icon-class">
|
||||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="ion-input-class width-100">
|
<div class="ion-input-class width-100" [class.input-error]="Form?.get('Date')?.invalid && validateFrom ">
|
||||||
<ion-datetime
|
<ion-datetime
|
||||||
placeholder="Início"
|
placeholder="Início"
|
||||||
[(ngModel)]="postEvent.StartDate"
|
[(ngModel)]="postEvent.StartDate"
|
||||||
@@ -136,7 +136,7 @@
|
|||||||
<div class="ion-icon-class">
|
<div class="ion-icon-class">
|
||||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="ion-input-class">
|
<div class="ion-input-class" [class.input-error]="Form?.get('Date')?.invalid && validateFrom ">
|
||||||
<ion-datetime
|
<ion-datetime
|
||||||
placeholder="Fim"
|
placeholder="Fim"
|
||||||
[(ngModel)]="postEvent.EndDate"
|
[(ngModel)]="postEvent.EndDate"
|
||||||
|
|||||||
@@ -168,10 +168,13 @@ export class EditEventPage implements OnInit {
|
|||||||
IsRecurring: new FormControl(this.postEvent.IsRecurring, [
|
IsRecurring: new FormControl(this.postEvent.IsRecurring, [
|
||||||
Validators.required
|
Validators.required
|
||||||
]),
|
]),
|
||||||
|
Date: new FormControl(new Date(this.postEvent.StartDate).toLocaleString() < new Date(this.postEvent.EndDate).toLocaleString()? 'ok': null,[
|
||||||
|
Validators.required
|
||||||
|
]),
|
||||||
|
|
||||||
// participantes: new FormControl(this.taskParticipantsCc.concat(this.taskParticipants), [
|
participantes: new FormControl(this.taskParticipants, [
|
||||||
// Validators.required
|
Validators.required
|
||||||
// ]),
|
]),
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
+48
-2
@@ -35,7 +35,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="Form && validateFrom" >
|
<!-- <div *ngIf="Form && validateFrom" >
|
||||||
<div *ngIf="Form.get('Location').invalid " class="input-errror-message">
|
<div *ngIf="Form.get('Location').invalid " class="input-errror-message">
|
||||||
<div *ngIf="Form.get('Location').errors?.required">
|
<div *ngIf="Form.get('Location').errors?.required">
|
||||||
Campo obrigatório.
|
Campo obrigatório.
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
O campo deve ter pelo menos 4 caracteres.
|
O campo deve ter pelo menos 4 caracteres.
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
|
|
||||||
<div class="container-div">
|
<div class="container-div">
|
||||||
<div class="ion-item-class-2">
|
<div class="ion-item-class-2">
|
||||||
@@ -78,6 +78,49 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="container-div">
|
||||||
|
<div class="ion-item-class-2">
|
||||||
|
<div class="ion-icon-class">
|
||||||
|
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||||
|
</div>
|
||||||
|
<div class="ion-input-class" [class.input-error]="Form?.get('Categories')?.invalid && validateFrom ">
|
||||||
|
|
||||||
|
<ion-select placeholder="Selecione tipo de evento*"
|
||||||
|
class="d-block d-md-none"
|
||||||
|
[(ngModel)]="postData.Categories[0]"
|
||||||
|
interface="action-sheet"
|
||||||
|
Cancel-text="Cancelar" required>
|
||||||
|
<ion-select-option value="Reunião">Reunião</ion-select-option>
|
||||||
|
<ion-select-option value="Viagem">Viagem</ion-select-option>
|
||||||
|
<ion-select-option value="Conferência">Conferência</ion-select-option>
|
||||||
|
<ion-select-option value="Encontro">Encontro</ion-select-option>
|
||||||
|
</ion-select>
|
||||||
|
|
||||||
|
|
||||||
|
<mat-form-field class="d-none d-md-block" appearance="none" class="width-100" placeholder="Sample Type" required>
|
||||||
|
<!-- <input matInput type="text" > -->
|
||||||
|
<mat-select [(ngModel)]="postData.Categories[0]" >
|
||||||
|
<mat-option value="Reunião">
|
||||||
|
Reunião
|
||||||
|
</mat-option>
|
||||||
|
<mat-option value="Viagem">
|
||||||
|
Viagem
|
||||||
|
</mat-option>
|
||||||
|
<mat-option value="Conferência">
|
||||||
|
Conferência
|
||||||
|
</mat-option>
|
||||||
|
<mat-option value="Encontro">
|
||||||
|
Encontro
|
||||||
|
</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="container-div">
|
<div class="container-div">
|
||||||
<div class="ion-item-class-2">
|
<div class="ion-item-class-2">
|
||||||
<div class="ion-icon-class">
|
<div class="ion-icon-class">
|
||||||
@@ -201,6 +244,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="container-div">
|
<div class="container-div">
|
||||||
<div class="ion-item-class-2">
|
<div class="ion-item-class-2">
|
||||||
<div class="ion-icon-class">
|
<div class="ion-icon-class">
|
||||||
|
|||||||
+8
-3
@@ -1,5 +1,5 @@
|
|||||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||||
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { AnimationController, ModalController, NavParams } from '@ionic/angular';
|
import { AnimationController, ModalController, NavParams } from '@ionic/angular';
|
||||||
import { Event } from 'src/app/models/event.model'
|
import { Event } from 'src/app/models/event.model'
|
||||||
import { EventBody } from 'src/app/models/eventbody.model';
|
import { EventBody } from 'src/app/models/eventbody.model';
|
||||||
@@ -70,7 +70,6 @@ export class BookMeetingModalPage implements OnInit {
|
|||||||
Form: FormGroup;
|
Form: FormGroup;
|
||||||
validateFrom = false
|
validateFrom = false
|
||||||
|
|
||||||
|
|
||||||
showLoader = false
|
showLoader = false
|
||||||
|
|
||||||
get dateStart () {
|
get dateStart () {
|
||||||
@@ -145,6 +144,9 @@ export class BookMeetingModalPage implements OnInit {
|
|||||||
|
|
||||||
this.dateControlStart = new FormControl(moment(new Date()));
|
this.dateControlStart = new FormControl(moment(new Date()));
|
||||||
this.dateControlEnd = new FormControl(moment(new Date(new Date().getTime() + 15 * 60000)));
|
this.dateControlEnd = new FormControl(moment(new Date(new Date().getTime() + 15 * 60000)));
|
||||||
|
|
||||||
|
|
||||||
|
this.postData.Categories = ['Reunião']
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
@@ -206,6 +208,9 @@ export class BookMeetingModalPage implements OnInit {
|
|||||||
participantes: new FormControl(this.taskParticipants, [
|
participantes: new FormControl(this.taskParticipants, [
|
||||||
Validators.required
|
Validators.required
|
||||||
]),
|
]),
|
||||||
|
Categories: new FormControl(this.postData.Categories[0], [
|
||||||
|
Validators.required
|
||||||
|
]),
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -244,7 +249,7 @@ export class BookMeetingModalPage implements OnInit {
|
|||||||
AppointmentState: 0,
|
AppointmentState: 0,
|
||||||
TimeZone: 'UTC',
|
TimeZone: 'UTC',
|
||||||
Organizer: null,
|
Organizer: null,
|
||||||
Categories: null,
|
Categories: ['Reunião'],
|
||||||
HasAttachments: true,
|
HasAttachments: true,
|
||||||
EventRecurrence: null,
|
EventRecurrence: null,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -151,6 +151,7 @@
|
|||||||
(goBacktoPublicationDetails)="goBacktoPublicationDetails()"
|
(goBacktoPublicationDetails)="goBacktoPublicationDetails()"
|
||||||
(goBackToViewPublications)="goBackToViewPublications()"
|
(goBackToViewPublications)="goBackToViewPublications()"
|
||||||
(closeDesktopComponent)="closeDesktopComponent($event)"
|
(closeDesktopComponent)="closeDesktopComponent($event)"
|
||||||
|
(getActions)="getActions()"
|
||||||
>
|
>
|
||||||
</app-view-publications>
|
</app-view-publications>
|
||||||
|
|
||||||
@@ -164,6 +165,7 @@
|
|||||||
(closeDesktopComponent)="closeDesktopComponent($event)"
|
(closeDesktopComponent)="closeDesktopComponent($event)"
|
||||||
(goBacktoPublicationDetails)="goBacktoPublicationDetails()"
|
(goBacktoPublicationDetails)="goBacktoPublicationDetails()"
|
||||||
(goBackToViewPublications)="goBackToViewPublications()"
|
(goBackToViewPublications)="goBackToViewPublications()"
|
||||||
|
(getActions)="getActions()"
|
||||||
>
|
>
|
||||||
</app-new-publication>
|
</app-new-publication>
|
||||||
|
|
||||||
@@ -176,12 +178,14 @@
|
|||||||
(closeDesktopComponent)="closeDesktopComponent($event)"
|
(closeDesktopComponent)="closeDesktopComponent($event)"
|
||||||
(goBacktoPublicationDetails)="goBacktoPublicationDetails()"
|
(goBacktoPublicationDetails)="goBacktoPublicationDetails()"
|
||||||
(goBackToViewPublications)="goBackToViewPublications()"
|
(goBackToViewPublications)="goBackToViewPublications()"
|
||||||
|
(getActions)="getActions()"
|
||||||
></app-publication-detail-shared>
|
></app-publication-detail-shared>
|
||||||
|
|
||||||
<app-new-action
|
<app-new-action
|
||||||
*ngIf="desktopComponent.showAddActions"
|
*ngIf="desktopComponent.showAddActions"
|
||||||
class="height-100 d-flex flex-column overflow-hidden background-white flex-grow-1"
|
class="height-100 d-flex flex-column overflow-hidden background-white flex-grow-1"
|
||||||
(closeDesktopComponent)="closeDesktopComponent($event)"
|
(closeDesktopComponent)="closeDesktopComponent($event)"
|
||||||
|
(getActions)="getActions()"
|
||||||
></app-new-action>
|
></app-new-action>
|
||||||
|
|
||||||
<app-edit-action
|
<app-edit-action
|
||||||
@@ -190,6 +194,7 @@
|
|||||||
class="height-100 d-flex flex-column overflow-hidden background-white flex-grow-1"
|
class="height-100 d-flex flex-column overflow-hidden background-white flex-grow-1"
|
||||||
(closeDesktopComponent)="closeDesktopComponent($event)"
|
(closeDesktopComponent)="closeDesktopComponent($event)"
|
||||||
(updateDesktopComponent)="updateDesktopComponent($event)"
|
(updateDesktopComponent)="updateDesktopComponent($event)"
|
||||||
|
(getActions)="getActions()"
|
||||||
>
|
>
|
||||||
</app-edit-action>
|
</app-edit-action>
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import { Component, OnInit } from '@angular/core';
|
|||||||
import { Router, NavigationEnd } from '@angular/router';
|
import { Router, NavigationEnd } from '@angular/router';
|
||||||
import { ModalController, PopoverController } from '@ionic/angular';
|
import { ModalController, PopoverController } from '@ionic/angular';
|
||||||
import { PublicationFolder } from 'src/app/models/publicationfolder';
|
import { PublicationFolder } from 'src/app/models/publicationfolder';
|
||||||
import { ProcessesService } from 'src/app/services/processes.service';
|
|
||||||
import { PublicationsService } from 'src/app/services/publications.service';
|
import { PublicationsService } from 'src/app/services/publications.service';
|
||||||
import { NewActionPage } from './new-action/new-action.page';
|
import { NewActionPage } from './new-action/new-action.page';
|
||||||
import { ViewPublicationsPage } from './view-publications/view-publications.page';
|
import { ViewPublicationsPage } from './view-publications/view-publications.page';
|
||||||
@@ -13,7 +12,7 @@ import { LoadingService } from 'src/app/services/loading.service';
|
|||||||
import { Publication } from 'src/app/models/publication';
|
import { Publication } from 'src/app/models/publication';
|
||||||
import { ActionsOptionsPage } from 'src/app/shared/popover/actions-options/actions-options.page';
|
import { ActionsOptionsPage } from 'src/app/shared/popover/actions-options/actions-options.page';
|
||||||
import { EditActionPage } from './edit-action/edit-action.page';
|
import { EditActionPage } from './edit-action/edit-action.page';
|
||||||
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-publications',
|
selector: 'app-publications',
|
||||||
@@ -61,6 +60,7 @@ export class PublicationsPage implements OnInit {
|
|||||||
private loading: LoadingService,
|
private loading: LoadingService,
|
||||||
private publications: PublicationsService,
|
private publications: PublicationsService,
|
||||||
private popoverController:PopoverController,
|
private popoverController:PopoverController,
|
||||||
|
private toastService: ToastService
|
||||||
) {
|
) {
|
||||||
this.months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
|
this.months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
|
||||||
this.days = ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"];
|
this.days = ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"];
|
||||||
@@ -118,7 +118,7 @@ export class PublicationsPage implements OnInit {
|
|||||||
return window.innerWidth
|
return window.innerWidth
|
||||||
}
|
}
|
||||||
|
|
||||||
getActions(){
|
getActions() {
|
||||||
this.showLoader = true;
|
this.showLoader = true;
|
||||||
this.publications.GetPublicationFolderList().subscribe(res=>{
|
this.publications.GetPublicationFolderList().subscribe(res=>{
|
||||||
this.publicationFolderList = res;
|
this.publicationFolderList = res;
|
||||||
@@ -136,7 +136,7 @@ export class PublicationsPage implements OnInit {
|
|||||||
DateEnd: this.theEndDate.getDate() +" de " + ( this.months[this.theEndDate.getMonth()])+" de " +this.theEndDate.getFullYear(),
|
DateEnd: this.theEndDate.getDate() +" de " + ( this.months[this.theEndDate.getMonth()])+" de " +this.theEndDate.getFullYear(),
|
||||||
ActionType: data.ActionType,
|
ActionType: data.ActionType,
|
||||||
}
|
}
|
||||||
if(data.ActionType == "Evento"){
|
if(data.ActionType == "Evento") {
|
||||||
this.publicationsEventFolderList.push(folder);
|
this.publicationsEventFolderList.push(folder);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@@ -163,15 +163,27 @@ export class PublicationsPage implements OnInit {
|
|||||||
//this.refreshing()
|
//this.refreshing()
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteAction(id?: string){
|
async deleteAction(id?: string){
|
||||||
this.publications.DeletePresidentialAction(id).toPromise();
|
|
||||||
|
const loader = this.toastService.loading();
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.publications.DeletePresidentialAction(id).toPromise();
|
||||||
|
this.toastService.successMessage()
|
||||||
|
} catch(e) {
|
||||||
|
this.toastService.badRequest()
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
|
||||||
this.refreshing()
|
this.refreshing()
|
||||||
}
|
}
|
||||||
|
|
||||||
async AddPublicationFolder(item?:any) {
|
async AddPublicationFolder(item?:any) {
|
||||||
|
|
||||||
this.closeDesktopComponent();
|
this.closeDesktopComponent();
|
||||||
if(window.innerWidth <= 1024){
|
if(window.innerWidth <= 1024) {
|
||||||
|
|
||||||
const modal = await this.modalController.create({
|
const modal = await this.modalController.create({
|
||||||
component: NewActionPage,
|
component: NewActionPage,
|
||||||
@@ -188,7 +200,6 @@ export class PublicationsPage implements OnInit {
|
|||||||
} else {
|
} else {
|
||||||
this.desktopComponent.showAddActions = true;
|
this.desktopComponent.showAddActions = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -360,6 +371,10 @@ export class PublicationsPage implements OnInit {
|
|||||||
if(res['data']=='edit'){
|
if(res['data']=='edit'){
|
||||||
this.closeDesktopComponent();
|
this.closeDesktopComponent();
|
||||||
this.desktopComponent.showEditActions = true;
|
this.desktopComponent.showEditActions = true;
|
||||||
|
} else if (res['data']=='delete') {
|
||||||
|
setTimeout(()=>{
|
||||||
|
this.getActions();
|
||||||
|
},1000)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ export class EditEventPage implements OnInit {
|
|||||||
public alertController: AlertController,
|
public alertController: AlertController,
|
||||||
private attachmentsService: AttachmentsService,
|
private attachmentsService: AttachmentsService,
|
||||||
private toastService: ToastService ) {
|
private toastService: ToastService ) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
@@ -268,8 +268,13 @@ export class EditEventPage implements OnInit {
|
|||||||
"EventId": this.postEvent.EventId,
|
"EventId": this.postEvent.EventId,
|
||||||
"CalendarDestinationName": this.postEvent.CalendarName,
|
"CalendarDestinationName": this.postEvent.CalendarName,
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(body);
|
console.log(body);
|
||||||
await this.eventsService.changeAgenda(body).toPromise();
|
|
||||||
|
try {
|
||||||
|
await this.eventsService.changeAgenda(body).toPromise();
|
||||||
|
} catch (e) {}
|
||||||
|
|
||||||
}
|
}
|
||||||
this.showLoader = false;
|
this.showLoader = false;
|
||||||
this.toastService.successMessage()
|
this.toastService.successMessage()
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { ModalController, NavParams } from '@ionic/angular';
|
import { ModalController, NavParams } from '@ionic/angular';
|
||||||
import { PublicationsService } from 'src/app/services/publications.service';
|
import { PublicationsService } from 'src/app/services/publications.service';
|
||||||
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-actions-options',
|
selector: 'app-actions-options',
|
||||||
@@ -15,6 +16,7 @@ export class ActionsOptionsPage implements OnInit {
|
|||||||
private modalController: ModalController,
|
private modalController: ModalController,
|
||||||
private navParams: NavParams,
|
private navParams: NavParams,
|
||||||
private publicationsService: PublicationsService,
|
private publicationsService: PublicationsService,
|
||||||
|
private toastService: ToastService
|
||||||
) {
|
) {
|
||||||
this.id = this.navParams.get('id');
|
this.id = this.navParams.get('id');
|
||||||
}
|
}
|
||||||
@@ -30,9 +32,21 @@ export class ActionsOptionsPage implements OnInit {
|
|||||||
this.modalController.dismiss('edit');
|
this.modalController.dismiss('edit');
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteAction(){
|
async deleteAction() {
|
||||||
this.publicationsService.DeletePresidentialAction(this.id).toPromise();
|
|
||||||
this.close();
|
const loader = this.toastService.loading();
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.publicationsService.DeletePresidentialAction(this.id).toPromise();
|
||||||
|
this.modalController.dismiss('delete');
|
||||||
|
} catch(e) {
|
||||||
|
this.toastService.badRequest()
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
loader.remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ export class EditActionPage implements OnInit {
|
|||||||
@Input() folderId: string;
|
@Input() folderId: string;
|
||||||
@Output() closeDesktopComponent= new EventEmitter<any>();
|
@Output() closeDesktopComponent= new EventEmitter<any>();
|
||||||
@Output() updateDesktopComponent= new EventEmitter<any>();
|
@Output() updateDesktopComponent= new EventEmitter<any>();
|
||||||
|
@Output() getActions= new EventEmitter<any>();
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private publicationsService: PublicationsService,
|
private publicationsService: PublicationsService,
|
||||||
@@ -103,6 +104,8 @@ export class EditActionPage implements OnInit {
|
|||||||
this.close();
|
this.close();
|
||||||
this.updateDesktopComponent.emit();
|
this.updateDesktopComponent.emit();
|
||||||
this.toastService.successMessage('Acção presidencial atualizada')
|
this.toastService.successMessage('Acção presidencial atualizada')
|
||||||
|
this.getActions.emit()
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.toastService.badRequest('Não foi possivel atualizar a acção presidencial')
|
this.toastService.badRequest('Não foi possivel atualizar a acção presidencial')
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
<mat-form-field appearance="none" class="width-100 date-hour-picker d-md-block">
|
<mat-form-field appearance="none" class="width-100 date-hour-picker d-md-block">
|
||||||
<input matInput [ngxMatDatetimePicker]="picker1"
|
<input matInput [ngxMatDatetimePicker]="picker1"
|
||||||
placeholder="Choose a date*"
|
placeholder="Choose a date*"
|
||||||
[formControl]="dateControlStart"
|
[(ngModel)]="folder.DateBegin"
|
||||||
[min]="minDate"
|
[min]="minDate"
|
||||||
[disabled]="disabled"
|
[disabled]="disabled"
|
||||||
>
|
>
|
||||||
@@ -81,14 +81,14 @@
|
|||||||
</ion-datetime>
|
</ion-datetime>
|
||||||
|
|
||||||
<mat-form-field appearance="none" class="width-100 date-hour-picker d-md-block">
|
<mat-form-field appearance="none" class="width-100 date-hour-picker d-md-block">
|
||||||
<input matInput [ngxMatDatetimePicker]="picker1"
|
<input matInput [ngxMatDatetimePicker]="picker2"
|
||||||
placeholder="Choose a date*"
|
placeholder="Choose a date*"
|
||||||
[formControl]="dateControlEnd"
|
[(ngModel)]="folder.DateEnd"
|
||||||
[min]="minDate"
|
[min]="minDate"
|
||||||
[disabled]="disabled"
|
[disabled]="disabled"
|
||||||
>
|
>
|
||||||
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1"></mat-datepicker-toggle>
|
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker2"></mat-datepicker-toggle>
|
||||||
<ngx-mat-datetime-picker #picker1
|
<ngx-mat-datetime-picker #picker2
|
||||||
[showSpinners]="showSpinners"
|
[showSpinners]="showSpinners"
|
||||||
[showSeconds]="showSeconds"
|
[showSeconds]="showSeconds"
|
||||||
[stepHour]="stepHour" [stepMinute]="stepMinute"
|
[stepHour]="stepHour" [stepMinute]="stepMinute"
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ export class NewActionPage implements OnInit {
|
|||||||
|
|
||||||
|
|
||||||
@Output() closeDesktopComponent= new EventEmitter<any>();
|
@Output() closeDesktopComponent= new EventEmitter<any>();
|
||||||
|
@Output() getActions= new EventEmitter<any>();
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private publication: PublicationsService,
|
private publication: PublicationsService,
|
||||||
@@ -46,8 +47,11 @@ export class NewActionPage implements OnInit {
|
|||||||
) {
|
) {
|
||||||
this.folder = new PublicationFolder();
|
this.folder = new PublicationFolder();
|
||||||
|
|
||||||
this.dateControlStart = new FormControl(moment(new Date()));
|
|
||||||
this.dateControlEnd = new FormControl(moment(new Date(new Date().getTime() + 15 * 60000)));
|
this.folder = Object.assign(this.folder, {
|
||||||
|
DateBegin: moment(new Date()),
|
||||||
|
DateEnd: moment(new Date(new Date().getTime() + 15 * 60000)),
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,7 +73,7 @@ export class NewActionPage implements OnInit {
|
|||||||
|
|
||||||
get dateValid() {
|
get dateValid() {
|
||||||
if (window.innerWidth >= 800) {
|
if (window.innerWidth >= 800) {
|
||||||
return this.folder.DateBegin < this.folder.DateEnd? ['ok']: []
|
return new Date(this.folder.DateBegin).toLocaleString('pt') < new Date(this.folder.DateEnd).toLocaleString("pt")? ['ok'] : []
|
||||||
} else {
|
} else {
|
||||||
return ['ok']
|
return ['ok']
|
||||||
}
|
}
|
||||||
@@ -81,6 +85,8 @@ export class NewActionPage implements OnInit {
|
|||||||
|
|
||||||
injectValidation() {
|
injectValidation() {
|
||||||
|
|
||||||
|
console.log(this.dateValid)
|
||||||
|
|
||||||
this.Form = new FormGroup({
|
this.Form = new FormGroup({
|
||||||
Subject: new FormControl(this.folder.Description, [
|
Subject: new FormControl(this.folder.Description, [
|
||||||
Validators.required,
|
Validators.required,
|
||||||
@@ -98,7 +104,13 @@ export class NewActionPage implements OnInit {
|
|||||||
this.injectValidation()
|
this.injectValidation()
|
||||||
this.runValidation()
|
this.runValidation()
|
||||||
|
|
||||||
if(this.Form.invalid) return false
|
if(this.Form.invalid) {
|
||||||
|
return false
|
||||||
|
} else {
|
||||||
|
console.log ('not passded')
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('pass')
|
||||||
|
|
||||||
this.folder = {
|
this.folder = {
|
||||||
ProcessId: null,
|
ProcessId: null,
|
||||||
@@ -116,6 +128,8 @@ export class NewActionPage implements OnInit {
|
|||||||
await this.publication.CreatePublicationFolder(this.folder).toPromise()
|
await this.publication.CreatePublicationFolder(this.folder).toPromise()
|
||||||
this.close();
|
this.close();
|
||||||
this.toastService.successMessage('Acção presidencial criada')
|
this.toastService.successMessage('Acção presidencial criada')
|
||||||
|
|
||||||
|
this.getActions.emit()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.toastService.badRequest('Não foi possivel criar a acção presidencial')
|
this.toastService.badRequest('Não foi possivel criar a acção presidencial')
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<div class="div-title flex-grow-1">
|
<div class="div-title flex-grow-1">
|
||||||
<ion-label class="title">{{item.Description}}</ion-label>
|
<ion-label class="title">{{item.Description}}</ion-label>
|
||||||
<p class="item-content-detail">{{item.Detail}}</p>
|
<p class="item-content-detail">{{item.Detail}}</p>
|
||||||
<p class="item-content-date">{{item.DateBegin}}</p>
|
<p class="item-content-date">{{ item.DateBegin | date: 'dd-MM-yy | hh:mm'}}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="actions-icon">
|
<div class="actions-icon">
|
||||||
<!-- <ion-icon (click)="AddPublication('1',item.ProcessId)" slot="end" src='assets/images/icons-add-photo.svg'></ion-icon> -->
|
<!-- <ion-icon (click)="AddPublication('1',item.ProcessId)" slot="end" src='assets/images/icons-add-photo.svg'></ion-icon> -->
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
<div class="post-title">
|
<div class="post-title">
|
||||||
<ion-label>{{publication.Title}}</ion-label>
|
<ion-label>{{publication.Title}}</ion-label>
|
||||||
</div>
|
</div>
|
||||||
<div class="post-data">{{publication.DatePublication | date: 'dd-MM-yy | h:mm'}}</div>
|
<div class="post-data">{{publication.DatePublication | date: 'dd-MM-yy | hh:mm'}}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="post-description">
|
<div class="post-description">
|
||||||
<p>{{publication.Message}}</p>
|
<p>{{publication.Message}}</p>
|
||||||
|
|||||||
Reference in New Issue
Block a user