Merge branch 'developer-c' into mobilefirst

This commit is contained in:
Eudes Inácio
2021-04-08 22:56:35 +01:00
31 changed files with 400 additions and 217 deletions
+32 -13
View File
@@ -21,8 +21,11 @@
<ion-row class="ion-align-items-center">
<!-- Move back one screen of the slides -->
<div (click)="back()" class="arrow">
<ion-icon slot="icon-only" src="assets/images/icons-calendar-arrow-left.svg"></ion-icon>
<div class="arrow">
<button (click)="back()" class="btn-no-color" >
<ion-icon slot="icon-only" src="assets/images/icons-calendar-arrow-left.svg"></ion-icon>
</button>
</div>
<!-- Move forward one screen of the slides -->
@@ -42,10 +45,23 @@
</ion-row>
<ion-row class="ion-align-items-center">
<ion-icon *ngIf="profile == 'mdgpr' " (click)="changeProfile()" class="right-icons d-md-none" src="assets/images/icons-profile-calendar-md.svg">ddddddd</ion-icon>
<ion-icon *ngIf="profile == 'pr' " (click)="changeProfile()" class="right-icons d-md-none" src="assets/images/icons-profile-calendar-pr.svg">dddddddd</ion-icon>
<ion-icon (click)="viewEventsToApprove()" class="right-icons" src="assets/images/icons-received-event.svg"></ion-icon>
<ion-icon (click)="clearContact();openAddEvent()" class="right-icons" src="assets/images/icons-add-new-event.svg" ></ion-icon>
<button *ngIf="profile == 'mdgpr' " (click)="changeProfile()" class="right-icons d-md-none">
<ion-icon src="assets/images/icons-profile-calendar-md.svg">ddddddd</ion-icon>
</button>
<button *ngIf="profile == 'pr' " (click)="changeProfile()" class="btn-no-color">
<ion-icon class="right-icons d-md-none" src="assets/images/icons-profile-calendar-pr.svg">dddddddd</ion-icon>
</button>
<button class="btn-no-color" (click)="viewEventsToApprove()">
<ion-icon class="right-icons" src="assets/images/icons-received-event.svg"></ion-icon>
</button>
<button class="btn-no-color" (click)="clearContact();openAddEvent()">
<ion-icon class="right-icons" src="assets/images/icons-add-new-event.svg" ></ion-icon>
</button>
</ion-row>
</ion-row>
@@ -317,13 +333,13 @@
<div class="event-details bg-blue ">
<div *ngIf="(
mobileComponent.showAddNewEvent == false &&
mobileComponent.showEditEvent == false &&
mobileComponent.showEventDetails == false &&
mobileComponent.showEventList == false &&
mobileComponent.showEventToApprove == false &&
mobileComponent.showAttendees == false &&
mobileComponent.showAttendeeModal == false
mobileComponent.showAddNewEvent == false &&
mobileComponent.showEditEvent == false &&
mobileComponent.showEventDetails == false &&
mobileComponent.showEventList == false &&
mobileComponent.showEventToApprove == false &&
mobileComponent.showAttendees == false &&
mobileComponent.showAttendeeModal == false
)
"
class="text-black nothing-to-show">
@@ -349,9 +365,12 @@
></app-new-event>
<!-- Edit -->
<app-edit-event *ngIf="mobileComponent.showEditEvent"
[taskParticipants]="taskParticipants"
[taskParticipantsCc]="taskParticipantsCc"
[profile]="profile"
[selectedSegment]="segment"
[postEvent]="postEvent"
(clearPostEvent)="clearPostEvent"
(clearContact)="clearContact()"
(openAttendeesComponent)="openAttendeesComponent($event)"
(setContact)="setContact($event)"
+19 -16
View File
@@ -10,7 +10,7 @@ import { AlertService } from 'src/app/services/alert.service';
import { momentG } from 'src/plugin/momentG';
import { DomSanitizer } from "@angular/platform-browser";
import { EventPerson } from 'src/app/models/eventperson.model';
import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
// showTimeline
import { setHours, setMinutes } from 'date-fns';
@@ -94,11 +94,11 @@ export class AgendaPage implements OnInit {
selectedEventId: string | number;
postEvent: any;
// temporary data
taskParticipants: any = [];
taskParticipantsCc: any = [];
adding: "intervenient" | "CC" = "intervenient";
@ViewChild(CalendarComponent) myCal: CalendarComponent;
segment: "Combinado" | "Pessoal" | "Oficial";
@@ -152,7 +152,7 @@ export class AgendaPage implements OnInit {
private router: Router,
private alertController: AlertService,
private sanitizer: DomSanitizer
) {
) {
this.calendarHeight = "333px";
this.showCalendar = true;
@@ -161,13 +161,12 @@ export class AgendaPage implements OnInit {
this.showLoader = false;
this.showTimelineFilterState = false;
this.showTimeline = false;
this.mobileComponent.showEventList = true;
}
ngOnInit() {
this.profile = "mdgpr";
//Inicializar segment
/* localStorage.setItem('test', this.eventSelectedDate.toString()); */
this.router.events.forEach((event) => {
if(event instanceof NavigationEnd && event.url == "/home/agenda") {
@@ -180,7 +179,6 @@ export class AgendaPage implements OnInit {
}
});
window.onresize = (event) => {
// if not table remove all component
if( window.innerWidth <= 1024){
@@ -209,6 +207,11 @@ export class AgendaPage implements OnInit {
// show information about the clicked event in timeline
eventClicked({ event }: { event: CalendarEvent }): void {
/* console.log('Event clicked', event); */
//clear
this.setIntervenient([]);
this.setIntervenientCC([]);
this.clearPostEvent();
this.IsEvent= "view";
@@ -995,12 +998,7 @@ export class AgendaPage implements OnInit {
// open component
async openAttendeesComponent(data) {
if(Array.isArray(data)){
if(data.length >= 1){
this.contacts = data ;
}
}
this.adding = data.type
this.cloneAllmobileComponent();
this.mobileComponent.showAttendees = true;
@@ -1047,12 +1045,12 @@ export class AgendaPage implements OnInit {
}
async setIntervenient(data) {
this.taskParticipants = data;
this.taskParticipants = removeDuplicate(data)
}
async setIntervenientCC(data) {
this.taskParticipantsCc = data;
this.taskParticipantsCc = removeDuplicate(data)
}
// Emitters
@@ -1061,4 +1059,9 @@ export class AgendaPage implements OnInit {
this.adding = adding;
}
}
async clearPostEvent(){
this.postEvent = false;
}
}
@@ -1,4 +1,5 @@
<ion-content>
<!-- Edit event for Inicio -->
<div class="main-content height-100">
<div class="content d-flex flex-column width-md-100 height-100">
@@ -224,7 +225,7 @@
[taskParticipants]="taskParticipants"
[taskParticipantsCc]="taskParticipantsCc"
[adding]="adding"
(dynamicSetIntervenient)="dynamicSetIntervenient($event)"
></app-attendee-modal>
</div>
@@ -44,17 +44,20 @@ export class EditEventPage implements OnInit {
this.postEvent.Body.Text = this.postEvent.Body.Text.replace(/<[^>]+>/g, '');
}
this.taskParticipants = [];
this.taskParticipantsCc = [];
if(this.postEvent.Attendees == null){
this.taskParticipants = []
} else {
this.taskParticipants = this.postEvent.Attendees;
this.postEvent.Attendees.forEach(e =>{
if(e.IsRequired){
this.taskParticipants.push(e);
} else {
this.taskParticipantsCc.push(e);
}
})
}
this.taskParticipantsCc = [];
if(this.postEvent.IsRecurring == false){
this.isRecurring = "Não se repete";
}
@@ -80,7 +83,9 @@ export class EditEventPage implements OnInit {
}
save(){
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc)
this.eventsService.editEvent(this.postEvent, 2, 3).subscribe(async () => {
const alert = await this.alertController.create({
cssClass: 'my-custom-class',
@@ -122,7 +127,6 @@ export class EditEventPage implements OnInit {
}
});
}
}
setIntervenient(data){
@@ -145,4 +149,10 @@ export class EditEventPage implements OnInit {
this.openAttendees();
}
dynamicSetIntervenient({taskParticipants, taskParticipantsCc}){
this.taskParticipants = taskParticipants;
this.taskParticipantsCc = taskParticipantsCc;
}
}
+3 -7
View File
@@ -90,13 +90,9 @@
<ion-icon class="icon" slot="end" src="assets/images/icons-correspondencias.svg"></ion-icon>
<div class="text">Correspondência por ler</div>
</div>
<ion-icon
class="icon-next"
slot="end"
src="assets/images/icons-arrow-circle-arrow-right.svg"
(click)="viewExpedientListPage()"
></ion-icon>
<button class="btn-no-color" (click)="viewExpedientListPage()">
<ion-icon class="icon-next" slot="end" src="assets/images/icons-arrow-circle-arrow-right.svg"></ion-icon>
</button>
</div>
<div class="content">
<ion-list>
@@ -61,8 +61,8 @@
</ion-list>
</ion-item>
</div>
<div class="add-people">
<ion-icon (click)="addParticipants(); showAttendees='true'" slot="start" src="assets/images/icons-arrow-forward.svg"></ion-icon>
<div class="add-people" (click)="addParticipants(); showAttendees='true'">
<ion-icon slot="start" src="assets/images/icons-arrow-forward.svg"></ion-icon>
</div>
</div>
</div>
@@ -82,8 +82,8 @@
</ion-list>
</ion-item>
</div>
<div class="add-people">
<ion-icon (click)="addParticipantsCc(); showAttendees='true'" slot="start" src="assets/images/icons-arrow-forward.svg"></ion-icon>
<div class="add-people" (click)="addParticipantsCc(); showAttendees='true'">
<ion-icon slot="start" src="assets/images/icons-arrow-forward.svg"></ion-icon>
</div>
</div>
</div>
@@ -114,6 +114,7 @@
</ion-list>
</div>
</div>
<div class="aside-right flex-column height-100">
<app-empty-container
@@ -132,9 +133,7 @@
(setIntervenientCC)="setIntervenientCC($event)"
(setContact)="setContact($event)"
></app-attendee-modal>
</div>
</div>
</div>
</ion-content>
@@ -13,6 +13,7 @@ import { environment } from 'src/environments/environment';
import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart-expedient-modal.page';
import { AttachmentsService } from 'src/app/services/attachments.service';
import { ExpedienteDetailPage } from '../expediente-detail/expediente-detail.page';
import { AlertService } from 'src/app/services/alert.service';
@Component({
selector: 'app-expedient-task-modal',
@@ -58,6 +59,7 @@ export class ExpedientTaskModalPage implements OnInit {
private processes:ProcessesService,
private attachmentsService: AttachmentsService,
private navParams: NavParams,
private alertController: AlertService,
private authService: AuthService) {
this.user = environment.defaultuser +'@'+ environment.domain;
this.task = this.navParams.get('task');
@@ -108,55 +110,65 @@ export class ExpedientTaskModalPage implements OnInit {
}
cancelTask(){
this.modalController.dismiss(null);
//this.viewExpedientDetail();
}
saveTask(){
/* console.log(this.taskType); */
switch (this.taskType)
{
case '0':
this.postData = {
DistributionType: "Paralelo",
CountryCode: 'AO',
Priority: this.postData.Priority,
UserEmail: this.user,
SubjectTypeId: this.postData.SubjectTypeId,
UsersSelected: this.participants,
DispatchFolder: this.dispatchFolder,
}
console.log(this.postData);
this.processes.postDespatcho(this.postData);
break;
case '1':
this.postData = {
DistributionType: "Paralelo",
CountryCode: 'AO',
Priority: this.postData.Priority,
UserEmail: this.user,
SubjectTypeId: this.postData.SubjectTypeId,
UsersSelected: this.participants,
DispatchFolder: this.dispatchFolder,
}
this.processes.postParecer(this.postData);
break;
case '2':
this.postData = {
DistributionType: "Paralelo",
CountryCode: 'AO',
Priority: this.postData.Priority,
UserEmail: this.user,
SubjectTypeId: this.postData.SubjectTypeId,
UsersSelected: this.participants,
DispatchFolder: this.dispatchFolder,
}
this.processes.postDeferimento(this.postData);
break;
}
let attendees = this.taskParticipants.concat(this.taskParticipantsCc);
attendees = attendees.map(function(val) {
return {
UserEmail: val.EmailAddress,
UserType: val.IsRequired?"I": "CC"
};
})
if(this.taskParticipants.length > 0){
switch (this.taskType){
case '0':
this.postData = {
DistributionType: "Paralelo",
CountryCode: 'AO',
Priority: this.postData.Priority,
UserEmail: this.user,
SubjectTypeId: this.postData.SubjectTypeId,
UsersSelected: attendees,
DispatchFolder: this.dispatchFolder,
}
console.log(this.postData);
this.processes.postDespatcho(this.postData);
break;
case '1':
this.postData = {
DistributionType: "Paralelo",
CountryCode: 'AO',
Priority: this.postData.Priority,
UserEmail: this.user,
SubjectTypeId: this.postData.SubjectTypeId,
UsersSelected: attendees,
DispatchFolder: this.dispatchFolder,
}
console.log(this.postData);
this.processes.postParecer(this.postData);
break;
case '2':
this.postData = {
DistributionType: "Paralelo",
CountryCode: 'AO',
Priority: this.postData.Priority,
UserEmail: this.user,
SubjectTypeId: this.postData.SubjectTypeId,
UsersSelected: attendees,
DispatchFolder: this.dispatchFolder,
}
console.log(this.postData);
this.processes.postDeferimento(this.postData);
break;
}
this.modalController.dismiss('openDiscart');
/* this.distartExpedientModal();
this.close(); */
}
else{
this.alertController.presentAlert("Lista de intervenientes vazia. Por favor, adicione 1 ou mais intervenientes.");
}
}
getAttachments(){
@@ -167,6 +179,8 @@ export class ExpedientTaskModalPage implements OnInit {
}
async addParticipants(){
console.log('HERES');
this.adding = "intervenient";
this.contacts = this.taskParticipants;
@@ -242,7 +256,6 @@ export class ExpedientTaskModalPage implements OnInit {
}
async distartExpedientModal(){
console.log(this.task.serialNumber);
const modal = await this.modalController.create({
component: DiscartExpedientModalPage,
componentProps: {
@@ -14,7 +14,9 @@
<div class="aside-wrapper d-flex flex-column pt-25 justify-center width-md-40 ">
<div class="title-container">
<span class="text-center mt-0 aside-title px-20">Gabinete Digital</span>
<ion-icon (click)="doRefresh($event)" class="title-icon" name="reload-circle"></ion-icon>
<button class="btn-no-color" (click)="doRefresh($event)">
<ion-icon class="title-icon" name="reload-circle"></ion-icon>
</button>
</div>
<div class="aside overflow-y-auto d-flex d-md-block flex-wrap justify-center width-100 px-20">
@@ -13,11 +13,15 @@ ion-content{
}
.title-container{
margin-bottom: 15px;
.btn-no-color{
display: flex;
float: right;
}
.title-icon{
float: right;
margin-right: 20px;
font-size: 30px;
color: #0782c9;
color: #42b9fe;
}
}
@@ -33,8 +33,8 @@ export class GabineteDigitalPage implements OnInit {
showExpediente : false
}
showEventsToApprove = false;
showEmptyContainer = true;
showExpedients = false;
showEmptyContainer = false;
showExpedients = true;
showExpedientDetail = false;
emptyTextDescription = 'Sem opção selecionada';
@@ -58,23 +58,13 @@ export class GabineteDigitalPage implements OnInit {
this.adjastModalHeight();
/* this.activatedRoute.queryParams.subscribe(params => {
this.activatedRoute.queryParams.subscribe(params => {
if(params["show"]){
this.openExpedientListPage();
}
else if(params["events-to-approve"]){
else if(params["events"]){
this.openEventsToApprovePage("MDGPR");
}
}); */
this.activatedRoute.paramMap.subscribe(paramMap =>{
if (paramMap.has("show")){
this.openExpedientListPage();
}
else if(paramMap.has("events")){
this.openEventsToApprovePage("MDGPR");
this.LoadCounts();
}
});
}
@@ -161,7 +151,7 @@ this.processesbackend.GetActionsList().subscribe(res=>{
doRefresh(event) {
this.closeAllDesktopComponents();
this.showEmptyContainer = true;
this.showExpedients = true;
this.LoadCounts();
setTimeout(() => {
@@ -2,7 +2,7 @@
<ion-toolbar class="ion-no-border bg-blue">
<div class="div-top-header">
<div class="div-search">
<ion-icon src='assets/images/icons-search.svg'></ion-icon>
<ion-icon tappable src='assets/images/icons-search.svg'></ion-icon>
</div>
<div class="div-logo">
<img src='assets/images/logo-no-bg.png' alt='logo'>
@@ -20,7 +20,7 @@
<div *ngIf="publication.Title != ''">
<div class="title-content">
<div class="back-icon">
<ion-icon (click)="close()" slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
<ion-icon tappable (click)="close()" slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
</div>
<div class="div-title">
<ion-label class="title"> {{publication.Title}}</ion-label>
@@ -85,6 +85,8 @@ export class PublicationDetailPage implements OnInit {
}
async editPost(publicationType:any) {
console.log('HERE');
console.log(this.publication);
const modal = await this.modalController.create({
component: NewPublicationPage,
@@ -21,8 +21,12 @@
<ion-label class="title">Acções Presidenciais</ion-label>
</div>
<div class="div-icon">
<ion-icon (click)="AddPublicationFolder()" slot="end" src='assets/images/icons-add.svg'></ion-icon>
<ion-icon (click)="doRefresh($event)" class="title-icon" name="reload-circle"></ion-icon>
<button class="btn-no-color" (click)="AddPublicationFolder()">
<ion-icon slot="icon-only" src='assets/images/icons-add.svg'></ion-icon>
</button>
<button class="btn-no-color" (click)="doRefresh($event)">
<ion-icon slot="icon-only" class="title-icon" name="reload-circle" title="Actualizar"></ion-icon>
</button>
</div>
</div>
</div>
@@ -87,7 +91,8 @@
class="height-100 d-flex flex-column overflow-hidden background-white flex-grow-1"
[folderId]="folderId"
[publicationType]="publicationType"
[publicationId]="publicationId"
(closeDesktopComponent)="closeDesktopComponent($event)"
(goBacktoPublicationDetails)="goBacktoPublicationDetails($event)"
(goBackToViewPublications)="goBackToViewPublications($event)"
@@ -10,6 +10,7 @@ import { ViewPublicationsPage } from './view-publications/view-publications.page
import { Animation, AnimationController } from '@ionic/angular';
import { LoadingController } from '@ionic/angular';
import { LoadingService } from 'src/app/services/loading.service';
import { Publication } from 'src/app/models/publication';
@Component({
@@ -20,6 +21,7 @@ import { LoadingService } from 'src/app/services/loading.service';
export class PublicationsPage implements OnInit {
showLoader: boolean;
publicationFolder: PublicationFolder;
publication: Publication;
publicationFolderList: PublicationFolder[];
publicationsEventFolderList: PublicationFolder[];
@@ -45,7 +47,7 @@ export class PublicationsPage implements OnInit {
publicationId: string;
// from publication details
publication: object;
//publication: object;
constructor(
private router: Router,
+8 -4
View File
@@ -6,14 +6,18 @@
<ion-form class="d-md-none">
<div class="d-flex search-input-container ion-justify-content-between" >
<div class="icon" (click)="basicSearch()">
<ion-icon class="icon-z" slot="end" name="search"></ion-icon>
<div class="icon">
<button class="btn-no-color" (click)="basicSearch()">
<ion-icon class="icon-z" slot="end" name="search"></ion-icon>
</button>
</div>
<div class="input-text d-flex ion-align-items-center">
<ion-input [(ngModel)]='searchSubject' class="search-input" type="search" placeholder="Pesquisar"></ion-input>
</div>
<div class="icon" (click)="clearSearchInput()">
<ion-icon name="restaurant-outline" src="assets/images/icons-search-close.svg"></ion-icon>
<div class="icon">
<button class="btn-no-color" (click)="clearSearchInput()">
<ion-icon name="restaurant-outline" src="assets/images/icons-search-close.svg"></ion-icon>
</button>
</div>
</div>
</ion-form>
@@ -67,13 +67,11 @@
</div>
<div class="line"></div>
<div class="middle-content">
<div *ngIf="loadedEvent.workflowInstanceDataFields.Participants">
<div *ngIf="loadedEvent.workflowInstanceDataFields.ParticipantsList">
<h5>Intervenientes</h5>
<ion-item class="ion-no-margin ion-no-padding">
<ion-label>
<p>{{loadedEvent.workflowInstanceDataFields.Participants}}</p>
</ion-label>
</ion-item>
<div *ngFor="let att of loadedEvent.workflowInstanceDataFields.ParticipantsList">
<ion-label>{{att.Name}}</ion-label>
</div>
</div>
<h5>Detalhes</h5>
<ion-item class="ion-no-margin ion-no-padding">
@@ -3,7 +3,7 @@
<div class="main-header">
<div class="title-content">
<div class="middle">
<ion-label class="title">Editar Evento</ion-label>
<ion-label class="title">Editar Evento agenda</ion-label>
</div>
</div>
</div>
@@ -130,43 +130,47 @@
</div>
</div>
<div class="container-div d-flex">
<div class="ion-item-class-2 width-100 d-flex">
<div class=" d-flex width-100">
<div class="ion-item-class-2 width-100">
<div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-person.svg"></ion-icon>
</div>
<div (click)="openAttendees()" class="ion-input-class d-flex flex-grow-1 width-100 overflow-hidden ">
<div class="list-people flex-grow-1">
<div class="ion-input-class-no-height">
<div class="list-people">
<ion-item lines="none">
<ion-list>
<ion-label class="list-people-title">Ver ou editar participantes</ion-label>
<ion-label hidden >Text</ion-label>
<ion-label *ngIf="taskParticipants.length == 0" class="list-people-title">Adicionar intervenientes</ion-label>
<ion-label *ngFor="let participant of taskParticipants">{{participant.Name}}</ion-label>
</ion-list>
</ion-item>
</div>
<div class="d-flex justify-center align-center font-35">
<ion-icon slot="start" src="assets/images/icons-arrow-forward.svg"></ion-icon>
<div class="add-people">
<button class="btn-no-color" (click)="addParticipants()">
<ion-icon class="font-35" slot="start" src="assets/images/icons-arrow-forward.svg"></ion-icon>
</button>
</div>
</div>
</div>
</div>
<div hidden class="container-div d-flex">
<div class="ion-item-class-2 width-100 d-flex">
<div class=" d-flex width-100">
<div class="ion-item-class-2 width-100">
<div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-people-cc.svg"></ion-icon>
</div>
<div class="ion-input-class d-flex flex-grow-1 width-100 overflow-hidden">
<div class="list-people flex-grow-1">
<div class="ion-input-class-no-height">
<div class="list-people">
<ion-item lines="none">
<ion-list>
<ion-label class="list-people-title">Com conhecimento</ion-label>
<ion-label hidden >Text</ion-label>
<ion-label *ngIf="taskParticipantsCc.length == 0" class="list-people-title">Como conhecido</ion-label>
<ion-label *ngFor="let participant of taskParticipantsCc">{{participant.Name}}</ion-label>
</ion-list>
</ion-item>
</div>
<div class="d-flex justify-center align-center font-35">
<ion-icon slot="start" src="assets/images/icons-arrow-forward.svg"></ion-icon>
<div class="add-people">
<button class="btn-no-color" (click)="addParticipantsCc()">
<ion-icon class="font-35" slot="start" src="assets/images/icons-arrow-forward.svg"></ion-icon>
</button>
</div>
</div>
</div>
@@ -5,7 +5,7 @@ import { EventPerson } from 'src/app/models/eventperson.model';
import { EventsService } from 'src/app/services/events.service';
import { Event } from 'src/app/models/event.model';
import { AlertController } from '@ionic/angular';
import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
@Component({
selector: 'app-edit-event',
templateUrl: './edit-event.component.html',
@@ -22,34 +22,47 @@ export class EditEventComponent implements OnInit {
eventAttendees: EventPerson[];
minDate: string;
@Input() taskParticipants: EventPerson[];
@Input() taskParticipantsCc: any = [];
@Input() profile:string;
@Input() selectedSegment: string;
@Input() postEvent: any;
@Output() clearContact = new EventEmitter<any>();
@Output() openAttendeesComponent = new EventEmitter<any>();
@Output() closeComponent = new EventEmitter<any>();
@Output() setIntervenient = new EventEmitter<any>();
@Output() setIntervenientCC = new EventEmitter<any>();
@Output() clearPostEvent = new EventEmitter<any>();
constructor(
private modalController: ModalController,
private eventsService: EventsService,
public alertController: AlertController,
)
{
) {
}
ngOnInit() {
if(this.postEvent){
this.postEvent.Body.Text = this.postEvent.Body.Text.replace(/<[^>]+>/g, '');
}
console.log(this.postEvent);
// attendees list
if(this.postEvent.Attendees != null) {
this.postEvent.Attendees.forEach(e =>{
if(e.IsRequired) {
this.taskParticipants.push(e);
} else {
this.taskParticipantsCc.push(e);
}
})
}
this.taskParticipants = removeDuplicate(this.taskParticipants);
this.taskParticipantsCc = removeDuplicate(this.taskParticipantsCc);
this.isEventEdited = false;
if(this.postEvent.IsRecurring == false){
@@ -61,32 +74,45 @@ export class EditEventComponent implements OnInit {
}
close(){
console.log('!!!!!!!!!!!!!!!!! close')
this.closeComponent.emit();
this.setIntervenient.emit([]);
this.setIntervenientCC.emit([]);
this.clearContact.emit();
}
save(){
this.eventsService.editEvent(this.postEvent, 2, 3).subscribe(async () => {
async save(){
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
await this.eventsService.editEvent(this.postEvent, 2, 3).subscribe(async () => {
const alert = await this.alertController.create({
cssClass: 'my-custom-class',
header: 'Evento actualizado',
buttons: ['OK']
});
await alert.present();
});
this.clearPostEvent.emit();
this.closeComponent.emit();
this.clearContact.emit();
this.setIntervenient.emit([]);
this.setIntervenientCC.emit([]);
this.close();
}
async openAttendees() {
async addParticipants() {
this.openAttendeesComponent.emit({
type: "intervenient"
});
this.clearContact.emit();
}
async addParticipantsCc() {
this.openAttendeesComponent.emit({
type: "CC"
});
this.openAttendeesComponent.emit();
this.clearContact.emit();
}
@@ -140,7 +140,7 @@
</ion-item>
</div>
<div class="add-people" (click)="openAttendees()">
<div class="add-people" (click)="addParticipants()">
<ion-icon slot="start" src="assets/images/icons-arrow-forward.svg"></ion-icon>
</div>
</div>
@@ -154,13 +154,16 @@
</div>
<div class="ion-input-class-no-height flex-grow-1">
<div class="list-people">
<ion-item lines="none">
<ion-list>
<ion-label class="list-people-title">Com conhecimento</ion-label>
<ion-label *ngIf="taskParticipantsCc.length ==0" class="list-people-title">Com conhecimento</ion-label>
<ion-label *ngFor="let participant of taskParticipantsCc">{{participant.Name}}</ion-label>
</ion-list>
</ion-item>
</div>
<div class="add-people">
<div class="add-people" (click)="addParticipantsCc()">
<ion-icon slot="start" src="assets/images/icons-arrow-forward.svg"></ion-icon>
</div>
</div>
@@ -132,10 +132,21 @@ export class NewEventPage implements OnInit {
this.setIntervenientCC.emit([]);
}
async openAttendees(){
this.saveTemporaryData();
this.openAttendeesComponent.emit();
async addParticipants() {
this.openAttendeesComponent.emit({
type: "intervenient"
});
this.clearContact.emit();
}
async addParticipantsCc() {
this.openAttendeesComponent.emit({
type: "CC"
});
this.clearContact.emit();
}
saveTemporaryData(){
@@ -3,14 +3,20 @@
<div class="main-header px-20">
<div class="title-content d-flex" >
<div class="left">
<ion-icon (click)="close()" slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
<button class="btn-no-color" (click)="close()">
<ion-icon slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
</button>
</div>
<div class="middle flex-grow-1">
<ion-label class="title">{{loadedEvent.Subject}}</ion-label>
</div>
<div class="div-icon">
<ion-icon class="edit" (click)="editEvent()" slot="end" src="assets/images/icons-edit.svg" ></ion-icon>
<ion-icon class="delete" (click)="deleteEvent()" name="trash-sharp"></ion-icon>
<button class="btn-no-color" (click)="editEvent()">
<ion-icon class="edit" slot="end" src="assets/images/icons-edit.svg" ></ion-icon>
</button>
<button class="btn-no-color" (click)="deleteEvent()">
<ion-icon class="delete" name="trash-sharp"></ion-icon>
</button>
</div>
</div>
</div>
@@ -69,7 +69,7 @@
<!-- Hide footer in gabinete-digital -->
<ion-footer class="ion-no-border" *ngIf="currentPath != '/home/gabinete-digital' ">
<ion-toolbar class="width-100 d-flex justify-space-between px-20">
<ion-toolbar *ngIf="currentPath != '/home/events'" class="width-100 d-flex justify-space-between px-20">
<ion-buttons slot="start">
<ion-button class="btn-cancel" fill="clear" color="#061b52" (click)="close()">
<ion-label>Cancelar</ion-label>
@@ -13,13 +13,16 @@ export class AttendeeModalPage implements OnInit {
// Defined by the API
contacts: EventPerson[];
showLoader: boolean = false;
selectedContact: EventPerson[] =[];
eventPersons: EventPerson[];
@Input() taskParticipants:EventPerson[] = [];
@Input() taskParticipantsCc:EventPerson[] = [];
constructor(private modalCtrl: ModalController, private contactsService: ContactsService) { }
constructor(
private modalCtrl: ModalController,
private contactsService: ContactsService ) {
}
@Output() closeComponent = new EventEmitter<any>();
@@ -31,6 +34,7 @@ export class AttendeeModalPage implements OnInit {
@Input() adding: "intervenient" | "CC";
ngOnInit() {
this.fetchContacts("");
if(this.taskParticipants == null || this.taskParticipants == undefined){
@@ -46,7 +50,6 @@ export class AttendeeModalPage implements OnInit {
ngOnChanges(event){}
save(){
this.setIntervenient.emit(this.taskParticipants);
this.setIntervenientCC.emit(this.taskParticipantsCc);
@@ -61,8 +64,6 @@ export class AttendeeModalPage implements OnInit {
}
close(){
// this.modalCtrl.dismiss(null);
this.selectedContact = [];
this.closeComponent.emit();
}
@@ -72,29 +73,36 @@ export class AttendeeModalPage implements OnInit {
filterSearchList(itm: EventPerson): boolean {
if(this.adding == "intervenient"){
const result = this.taskParticipants.find((contact, index)=>{
if(contact.Name == itm.Name && contact.EmailAddress == itm.EmailAddress){
index = index;
return contact;
}
});
return undefined == result;
} else if (this.adding == "CC") {
const result = this.taskParticipantsCc.find((contact, index)=>{
const result1 = this.taskParticipants.find((contact, index)=>{
if(contact.Name == itm.Name && contact.EmailAddress == itm.EmailAddress){
index = index;
return contact;
}
});
index = index;
return contact;
}
});
return undefined == result;
// if to show
if(undefined != result1){
return false;
}
const result2 = this.taskParticipantsCc.find((contact, index)=>{
if(contact.Name == itm.Name && contact.EmailAddress == itm.EmailAddress){
index = index;
return contact;
}
});
// if to show
if(undefined != result2){
return false;
}
// don't show
return true;
}
remove(itm: EventPerson){
@@ -110,8 +118,6 @@ export class AttendeeModalPage implements OnInit {
});
} else if (this.adding == "CC") {
this.taskParticipantsCc = this.taskParticipantsCc.filter((contact, index) =>{
@@ -138,10 +144,12 @@ export class AttendeeModalPage implements OnInit {
if(this.adding == "intervenient"){
itm.IsRequired = true;
this.taskParticipants.push(itm);
} else if (this.adding == "CC") {
itm.IsRequired = false;
this.taskParticipantsCc.push(itm);
}
+18 -8
View File
@@ -2,15 +2,21 @@
<div class="mobile d-flex div-top-header justify-space-between">
<div (click)="openSearch()" class="div-search">
<ion-icon class="font-45" src='assets/images/icons-search.svg'></ion-icon>
<div class="div-search">
<button class="btn-no-color" (click)="openSearch()">
<ion-icon class="font-45" src='assets/images/icons-search.svg'></ion-icon>
</button>
</div>
<div class="div-logo height-fit-content">
<img src='assets/images/logo-no-bg.png' alt='logo'>
</div>
<div class="div-profile" (click)="openProfile()">
<ion-icon class="font-45" *ngIf="profile == 'mdgpr' " src='assets/images/icons-profile.svg'></ion-icon>
<ion-icon class="font-45" *ngIf="profile == 'pr' " src='assets/images/icons-profile-pr-header.svg'></ion-icon>
<div class="div-profile">
<button class="btn-no-color" (click)="openProfile()">
<ion-icon class="font-45" *ngIf="profile == 'mdgpr' " src='assets/images/icons-profile.svg'></ion-icon>
</button>
<button class="btn-no-color" (click)="openProfile()">
<ion-icon class="font-45" *ngIf="profile == 'pr' " src='assets/images/icons-profile-pr-header.svg'></ion-icon>
</button>
</div>
</div>
@@ -52,8 +58,13 @@
<div class="d-flex">
<div class="mr-10 d-flex align-center">
<ion-icon *ngIf="!showSearch" (click)="showSearch=true" class="font-45" (click)="openSearch()" src='assets/images/icons-search.svg'></ion-icon>
<ion-icon *ngIf="showSearch" (click)="closeSearch()" (click)="showSearch=false" class="font-40" name="restaurant-outline" src="assets/images/icons-search-close.svg"></ion-icon>
<button (click)="openSearch()" *ngIf="!showSearch" class="btn-no-color" (click)="showSearch=true">
<ion-icon class="font-45" src='assets/images/icons-search.svg'></ion-icon>
</button>
<button class="btn-no-color" (click)="closeSearch()" *ngIf="showSearch" (click)="showSearch=false">
<ion-icon class="font-40" name="restaurant-outline" src="assets/images/icons-search-close.svg"></ion-icon>
</button>
<ion-form *ngIf="showSearch">
<div class="d-flex search-input-container ml-10 justify-between" *ngIf="showSearch" >
<div class="icon" (click)="basicSearch()">
@@ -76,7 +87,6 @@
</div>
</div>
</div>
</ion-toolbar>
+1
View File
@@ -40,6 +40,7 @@ export class HeaderPage implements OnInit {
}
async openSearch() {
const modal = await this.modalController.create({
component: SearchPage,
cssClass: 'group-messages modal-desktop search-modal search-modal-to-desktop',
@@ -3,13 +3,17 @@
<ion-content class=" bg-blue">
<div class="profile-content">
<div class="d-flex justify-end" (click)="close()">
<ion-icon class="icon" src="assets/images/icons-search-close.svg"></ion-icon>
<div class="d-flex justify-end">
<button class="btn-no-color" (click)="close()">
<ion-icon class="icon" src="assets/images/icons-search-close.svg"></ion-icon>
</button>
</div>
<div class="go-back d-flex align-center" (click)="close()">
<ion-icon class="icon" src="assets/images/icons-calendar-arrow-left.svg"></ion-icon> <div>Perfil</div>
<div class="go-back d-flex align-center" >
<button class="btn-no-color" (click)="close()">
<ion-icon class="icon" src="assets/images/icons-calendar-arrow-left.svg"></ion-icon> <div>Perfil</div>
</button>
</div>
<div >
@@ -39,6 +39,7 @@ export class NewPublicationPage implements OnInit {
@Input() publicationType: string;
@Input() folderId: string;
@Input() publicationId:string;
@Output() closeDesktopComponent = new EventEmitter<any>();
@Output() openPublicationDetails = new EventEmitter<any>();
@Output() goBackToViewPublications = new EventEmitter<any>();
@@ -59,10 +60,38 @@ export class NewPublicationPage implements OnInit {
}
ngOnInit() {
if(this.publicationType == '3'){
this.getPublicationDetail();
}
this.setTitle();
this.clear();
this.takePicture();
}
getPublicationDetail(){
this.showLoader = true;
console.log(this.publicationId);
/* console.log(this.folderId); */
this.publications.GetPublicationById(this.publicationId).subscribe(res=>{
console.log(res);
/* this.publication = res; */
this.publication = {
DateIndex: res.DateIndex,
DocumentId: res.DocumentId,
ProcessId:res.ProcessId,
Title:res.Title,
Message: res.Message,
DatePublication: res.DatePublication,
FileBase64: "data:image/jpg;base64," + res.FileBase64,
OriginalFileName: res.OriginalFileName,
FileExtension: 'jpeg',
}
this.pub = this.publication;
this.showLoader = false;
});
}
takePicture(){
const options: CameraOptions = {
quality: 90,
@@ -189,7 +218,8 @@ export class NewPublicationPage implements OnInit {
if(this.publicationType == '2'){
this.goBackToViewPublications.emit();
} else {
this.goBacktoPublicationDetails.emit();
this.goBackToViewPublications.emit();
//this.goBacktoPublicationDetails.emit();
}
}
@@ -9,7 +9,10 @@
<div *ngIf="publication.Title != ''">
<div class="title-content d-flex pl-20">
<div class="back-icon " >
<ion-icon (click)="goBack()" slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
<button class="button" (click)="goBack()">
<ion-icon slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
</button>
</div>
<div class="div-title">
<ion-label class="title"> {{publication.Title}}</ion-label>
@@ -13,8 +13,12 @@
</div>
<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('2',item.ProcessId)" src='assets/images/icons-add.svg'></ion-icon>
<ion-icon (click)="doRefresh($event)" class="title-icon" name="reload-circle"></ion-icon>
<button class="btn-no-color" (click)="AddPublication('2',item.ProcessId)">
<ion-icon src='assets/images/icons-add.svg'></ion-icon>
</button>
<button class="btn-no-color" (click)="doRefresh($event)">
<ion-icon class="title-icon" name="reload-circle"></ion-icon>
</button >
</div>
</div>
</div>
+15 -1
View File
@@ -571,6 +571,20 @@ border-top: 1px solid #d8d8d8;
}
.title-icon{
font-size: 40px !important;
color: #0782c9;
color: #42b9fe;
overflow: auto;
}
ion-icon {
pointer-events: none;
}
.btn-no-color{
background: transparent;
margin: 0 !important;
padding: 0 !important;
ion-icon{
font-size: 35px;
}
}
.btn-no-color:focus{
outline: 0;
}
+11
View File
@@ -0,0 +1,11 @@
function removeDuplicate(data){
return [...new Set(data.map(JSON.stringify))].map(JSON.parse)
}
module.exports = {
removeDuplicate: removeDuplicate
};