This commit is contained in:
tiago.kayaya
2021-04-21 09:36:00 +01:00
32 changed files with 508 additions and 161 deletions
+1 -1
View File
@@ -20,7 +20,7 @@
</ion-tab-button>
<ion-tab-button tab="publications">
<ion-icon class="nav-icon" src="assets/images/icons-nav-actions.svg"></ion-icon>
<ion-label>Acções</ion-label>
<ion-label class="overflow-visible">Ações</ion-label>
</ion-tab-button>
<ion-tab-button tab="chat">
<ion-icon class="nav-icon" src="assets/images/icons-nav-chat-inactive.svg"></ion-icon>
+15
View File
@@ -2,6 +2,7 @@ export class Attachment {
Id: number;
ParentId: string;
Sources: Sources;
Source?: Sources;
SourceId: string;
Description: string;
SourceName: string;
@@ -18,4 +19,18 @@ export enum Sources
K2 = 2,
Exchange = 3,
File = 4
}
export class EventAttachment {
Id?: string; // id do evento
ParentId: string;
Source: string;
SourceId: string;
Link?: string;
SerialNumber?: string;
ApplicationId: string;
SourceTitle: string;
}
+2
View File
@@ -1,5 +1,6 @@
import { EventBody } from './eventbody.model';
import { EventPerson } from './eventperson.model';
import { SearchDocument } from './search-document';
export class Event{
EventId: string;
@@ -19,4 +20,5 @@ export class Event{
Organizer: string;
Categories: string[];
HasAttachments: boolean;
// documents?: SearchDocument[]
}
+1
View File
@@ -466,6 +466,7 @@
>
</app-event-list>
<app-approve-event class="d-flex flex-column" *ngIf="mobileComponent.showEventToApprove" [class.transparent]="mobileComponent.transparentEventToApprove"
[serialNumber] = "eventToaprove.serialNumber"
(cloneAllmobileComponent)="viewEventDetailDismiss($event)"
@@ -220,8 +220,8 @@
</div>
</div>
</ion-content>
<ion-footer class="ion-no-border d-flex justify-center">
<ion-toolbar class="btn-div ">
<ion-footer class="ion-no-border d-flex justify-center px-20">
<ion-toolbar class=" ">
<ion-buttons slot="start">
<ion-button class="btn-cancel" fill="clear" color="#061b52" (click)="close()">
<ion-label>Cancelar</ion-label>
@@ -18,7 +18,6 @@ ion-content{
transform: translate3d(0, 1px, 0);
.title-content{
padding: 0px 20px;
margin: 0px auto;
overflow: auto;
background: #fff;
@@ -45,7 +44,8 @@ ion-content{
padding: 15px 20px 0 20px;
.ion-item-container{
width: 360px;
flex: 1;
width: 100%;
margin: 15px auto;
border: 1px solid #ebebeb;
border-radius: 5px;
@@ -62,7 +62,7 @@ ion-content{
overflow: auto;
}
.ion-item-class-2{
width: 360px;
display: flex;
margin: 0px auto;
}
.ion-icon-class{
@@ -77,18 +77,18 @@ ion-content{
margin-left: 0;
}
.ion-input-class{
width: 315px;
height: 45px;
border: 1px solid #ebebeb;
border-radius: 5px;
padding-left: 5px;
padding-right: 10px;
float: left;
flex: 1;
}
.ion-input-class-no-height{
border: 1px solid #ebebeb;
border-radius: 5px;
overflow: auto;
flex: 1;
}
.list-people{
width: 256px;
@@ -5,6 +5,7 @@ import { EventPerson } from 'src/app/models/eventperson.model';
import { EventsService } from 'src/app/services/events.service';
import { Event } from '../../../models/event.model';
import { AttendeesPage } from '../../events/attendees/attendees.page';
import { SearchPage } from '../../search/search.page';
@Component({
selector: 'app-new-event',
@@ -43,7 +44,7 @@ export class NewEventPage implements OnInit {
ngOnInit() {
console.log(this.profile);
/* console.log(this.profile); */
let selectedStartdDate = this.selectedDate;
let selectedEndDate = new Date(this.selectedDate);
@@ -118,6 +119,8 @@ export class NewEventPage implements OnInit {
this.modalController.dismiss(this.postEvent);
}
async openAttendees() {
const modal = await this.modalController.create({
component: AttendeesPage,
@@ -126,7 +129,7 @@ export class NewEventPage implements OnInit {
adding: this.adding,
taskParticipants: this.taskParticipants
},
cssClass: 'attendee',
cssClass: 'attendee modal modal-desktop',
backdropDismiss: false
});
@@ -70,7 +70,7 @@ export class ViewEventPage implements OnInit {
}
close(){
console.log(this.isEventEdited);
/* console.log(this.isEventEdited); */
this.modalController.dismiss(this.isEventEdited);
}
@@ -78,10 +78,10 @@ export class ViewEventPage implements OnInit {
this.eventsService.getEvent(this.eventId).subscribe(res => {
this.loadedEvent = res;
console.log(res);
/* console.log(res); */
this.today = new Date(res.StartDate);
console.log(new Date(this.today));
/* console.log(new Date(this.today)); */
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]);
});
}
@@ -154,7 +154,7 @@ export class ViewEventPage implements OnInit {
viewDocument(sourceId){
this.processes.GetDocumentUrl(sourceId, '8').subscribe(res=>{
console.log(res);
/* console.log(res); */
const url: string = res.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
const browser = this.iab.create(url,"_blank");
browser.show();
@@ -10,7 +10,7 @@
<ion-item-group>
<ion-list>
<ion-item-sliding>
<ion-item *ngFor="let attendee of contacts">
<ion-item lines="none" *ngFor="let attendee of contacts">
<ion-checkbox slot="end" (ionChange)="selectContact(attendee)"></ion-checkbox><!-- [disabled]="isCheckboxDisabled" -->
<ion-label>
<h3>{{ attendee.Name }}</h3>
@@ -12,7 +12,7 @@
<ion-list lines="none" class="flex-grow-1 overflow-y-auto height-100" >
<ion-item-sliding class="px-20">
<div *ngFor="let attendee of contacts;">
<ion-item lines="none" (click)="selectContact(attendee)" *ngIf="filterSearchList(attendee)" >
<ion-item lines="none" *ngIf="filterSearchList(attendee)" >
<div class="pr-10">
<ion-icon class="font-35" src="assets/images/icons-userprofile.svg"></ion-icon>
</div>
@@ -20,6 +20,9 @@
<h3>{{ attendee.Name }}</h3>
<p>{{ attendee.EmailAddress }}</p>
</ion-label>
<div (click)="selectContact(attendee)">
<ion-icon class="font-35" src="assets/images/icons-add-25.svg"></ion-icon>
</div>
</ion-item>
</div>
@@ -38,8 +41,8 @@
<h3>{{ attendee.Name }}</h3>
<p>{{ attendee.EmailAddress }}</p>
</ion-label>
<div style="color:red" (click)="remove(attendee)">
X
<div (click)="remove(attendee)">
<ion-icon class="font-35" src="assets/images/icons-delete-25.svg"></ion-icon>
</div>
</ion-item>
</ion-item-sliding>
@@ -56,8 +59,8 @@
<h3>{{ attendee.Name }}</h3>
<p>{{ attendee.EmailAddress }}</p>
</ion-label>
<div style="color:red" (click)="remove(attendee)">
X
<div (click)="remove(attendee)">
<ion-icon class="font-35" src="assets/images/icons-delete-25.svg"></ion-icon>
</div>
</ion-item>
</ion-item-sliding>
@@ -1,6 +1,3 @@
ion-item-group{
margin: 15px;
}
ion-item{
border-bottom:1px solid #ccc;
}
@@ -41,12 +41,12 @@ export class EventListPage implements OnInit {
}
this.LoadToApproveEvents();
// this.LoadToApproveEvents();
this.router.events.forEach((event) => {
if(event instanceof NavigationEnd && event.url == this.router.url) {
this.LoadToApproveEvents();
// this.LoadToApproveEvents();
}
});
@@ -123,10 +123,15 @@
<!-- Aside right -->
<div class="aside-content d-none flex-column height-100">
<!--
<app-empty-container [texto]="emptyTextDescription" *ngIf="showEmptyContainer" class="d-flex height-100 flex-column"></app-empty-container>
<app-events-to-approve [profile]="'MDGPR'" *ngIf="showEventsToApprove" class="d-flex height-100 flex-column"></app-events-to-approve>
<app-expedients (openExpedientDetail)="openExpedientPage($event)" [profile]="profile" class="d-flex height-100 flex-column" *ngIf="showExpedients"></app-expedients>
<app-expediente (openExpedientList)="openExpedientListPage()" [profile]="profile" [serialNumber]="serialNumber" class="d-flex height-100 flex-column" *ngIf="showExpedientDetail"></app-expediente>
<app-expedients (openExpedientDetail)="openExpedientPage($event)" [profile]="profile" class="d-flex height-100 flex-column" *ngIf="showExpedients"></app-expedients>
<app-expediente (openExpedientList)="openExpedientListPage()" [profile]="profile" [serialNumber]="serialNumber" class="d-flex height-100 flex-column" *ngIf="showExpedientDetail"></app-expediente>
-->
</div>
</div>
</ion-content>
@@ -56,15 +56,14 @@ export class GabineteDigitalPage implements OnInit {
if( window.innerWidth <= 1024){
this.modalController.dismiss();
}
};
this.activatedRoute.queryParams.subscribe(params => {
if(params["show"]){
this.openExpedientListPage();
// this.openExpedientListPage();
}
else if(params["events"]){
this.openEventsToApprovePage("MDGPR");
// this.openEventsToApprovePage("MDGPR");
}
});
@@ -84,23 +83,21 @@ export class GabineteDigitalPage implements OnInit {
this.router.events.forEach((event) => {
if(event instanceof NavigationEnd && event.url == this.router.url) {
this.LoadCounts();
//this.LoadCounts();
}
});
this.LoadCounts();
// this.LoadCounts();
/* this.eventService.getAllMdEvents.subscribe(res=>{
console.log(res);
});
console.log(this.eventService.getAllPrEvents.length);
*/
this.processesbackend.GetActionsList().subscribe(res=>{
console.log(res);
});
console.log(this.eventService.getAllPrEvents.length);
*/
// this.processesbackend.GetActionsList().subscribe(res=>{
// console.log(res);
//});
}
@@ -190,7 +187,7 @@ this.processesbackend.GetActionsList().subscribe(res=>{
}
openExpedientPage(data){
console.log(data);
/* console.log(data); */
this.closeAllDesktopComponents();
if( window.innerWidth <= 1024){
+24 -20
View File
@@ -4,7 +4,7 @@
<ion-progress-bar type="indeterminate" class="loader" *ngIf="showLoader"></ion-progress-bar>
<div class="d-flex ion-justify-content-between">
<ion-form class="d-md-none">
<ion-form [class.d-md-none]="!select">
<div class="d-flex search-input-container ion-justify-content-between" >
<div class="icon">
<button class="btn-no-color" (click)="basicSearch()">
@@ -20,7 +20,8 @@
</button>
</div>
</div>
</ion-form>
</ion-form>
<!-- search -->
<div *ngIf="!showAdvanceSearch" class="icon-z icon-most-searched-word-open" (click)="showHideAdvanceSearch(true)">
<ion-icon src="assets/images/icons-most-searched-words-open.svg" class="icon" slot="end"></ion-icon>
@@ -76,19 +77,18 @@
<!-- search result categories-->
<div class="options flex-md-grow-1 " *ngIf="showDocuments"
style="border-bottom: 1px solid #f3f3f3;"
style="border-bottom: 1px solid #f3f3f3;width: unset"
>
<div class="container ">
<div class="d-flex width-100">
<div class="d-flex overflow-x-auto">
<!-- SLIDE -->
<ion-slides class="slide width-100" pager="false" [options]="slideOpts">
<ion-slide *ngFor="let category of searchCategories; index as i;">
<div [ngClass]="{'active-category': category.Active}" class="button" (click)="filterDocList(category.Name)" (click)="activeCategoty(i)" >
<p>{{ category.Name }}</p>
<ion-label class="label">{{ category.Qtd }}</ion-label>
</div>
</ion-slide>
</ion-slides>
<div *ngFor="let category of searchCategories; index as i;" class="d-flex py-10" style="width:0px" [ngClass]="{'active-category': category.Active}" class="button" (click)="filterDocList(category.Name)" (click)="activeCategoty(i)">
<span>{{ category.Name }}</span>
<ion-label class="label">{{ category.Qtd }}</ion-label>
</div>
</div>
<button class="icon-z icon-most-searched-word-open " ion-button icon-only >
@@ -130,26 +130,31 @@
</p>
</div>
<div>
<ion-icon *ngIf="ordinance == 'old'" (click)="reorderList('recent')" src="assets/images/icons-arrow-arrow-up.svg"></ion-icon>
<ion-icon *ngIf="ordinance == 'recent'" (click)="reorderList('old')" src="assets/images/icons-arrow-arrow-down-25.svg"></ion-icon>
<div *ngIf="ordinance == 'old'" (click)="reorderList('recent')">
<ion-icon src="assets/images/icons-arrow-arrow-up.svg"></ion-icon>
</div>
<div *ngIf="ordinance == 'recent'" (click)="reorderList('old')">
<ion-icon src="assets/images/icons-arrow-arrow-down-25.svg"></ion-icon>
</div>
</div>
</div>
</div>
<ul>
<li *ngFor="let searchDocument of showSearchDocuments" (click)="viewDetail(searchDocument.Id)" class="d-flex">
<li *ngFor="let searchDocument of showSearchDocuments" (click)="viewDetail(searchDocument.Id); selectItem(searchDocument)" class="d-flex">
<div class="icon">
<ion-icon *ngIf="itemIcons() == '/home/gabinete-digital' "
<ion-icon *ngIf="itemIcons() == 'AccoesPresidenciais & ArquivoDespachoElect' "
src="assets/images/icons-search-document.svg"></ion-icon>
<ion-icon *ngIf="itemIcons() == '/home/agenda' "
<ion-icon *ngIf="itemIcons() == 'Agenda' "
src="assets/images/icons-default-agenda.svg"></ion-icon>
<ion-icon *ngIf="itemIcons() == '/home/publications' "
<ion-icon *ngIf="itemIcons() == 'AccoesPresidenciais' "
src="assets/images/icons-viagem.svg"></ion-icon>
</div>
<div class="content ion-align-items-center">
<div class="d-flex ion-justify-content-between ">
<span class="result-name">{{ searchDocument.Assunto}}</span>
<span class="app-name" *ngIf="currentPath == '/home/gabinete-digital' ">{{ searchDocument.appName}}</span>
<span class="app-name" *ngIf="itemIcons() == 'AccoesPresidenciais & ArquivoDespachoElect' ">{{ searchDocument.appName}}</span>
</div>
<div class="d-flex ion-justify-content-between ">
<span class="organic-entity">{{ searchDocument.EntidadeOrganicaNome }}</span>
@@ -167,5 +172,4 @@
</div>
</div>
</ion-content>
+5 -5
View File
@@ -55,19 +55,18 @@ ion-slide{
margin: 0px 5px;
margin-bottom: 10px;
padding: 5px 20px;
height: 100%;
box-sizing: 100%;
box-sizing: border-box;
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
p{
span{
padding: 0px;
margin: 0px;
font-family: Roboto;
color: #0d89d1;
font-size: 15px;
width: 100%;
text-align: center;
}
.label{
width: 100%;
@@ -75,6 +74,7 @@ ion-slide{
font-size: 13px;
font-weight: 300;
color: #797979;
text-align: center;
}
border-radius: 15px;
}
@@ -82,7 +82,7 @@ ion-slide{
.active-category{
background-color: #42b9fe;
color: white;
p{
span{
color: white;
}
.label{
+66 -30
View File
@@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { ModalController } from '@ionic/angular';
import { ModalController, NavParams } from '@ionic/angular';
import { SearchService } from "../../services/search.service";
import { SearchCategory } from "src/app/models/search-category";
import { SearchDocument } from "src/app/models/search-document";
@@ -9,8 +9,9 @@ import { OrganicEntityPage } from 'src/app/pages/search/organic-entity/organic-e
import WordCloud from 'src/plugin/wordcloud2.js';
import { ViewEventPage } from 'src/app/pages/agenda/view-event/view-event.page';
import { PublicationDetailPage } from '../publications/view-publications/publication-detail/publication-detail.page';
import { ExpedienteDetailPage } from '../gabinete-digital/expediente/expediente-detail/expediente-detail.page';
import { DocumentDetailPage } from 'src/app/modals/document-detail/document-detail.page';
@Component({
selector: 'app-search',
templateUrl: './search.page.html',
@@ -51,13 +52,47 @@ export class SearchPage implements OnInit {
windowWidth: number;
type : "Agenda" | "Correspondencia" | "AccoesPresidenciais" | "ArquivoDespachoElect" | "AccoesPresidenciais & ArquivoDespachoElect" = "Agenda";
select: boolean = false;
constructor(private modalController: ModalController,
private search: SearchService,
private modalCtrl: ModalController,) {
private modalCtrl: ModalController,
private navParams: NavParams) {
this.ordinance = "recent";
this.currentPath= window.location.pathname;
this.type = this.navParams.get('type');
if(this.type == null || this.type == undefined) {
this.select = false;
if(this.currentPath == '/home/agenda') {
this.type = "Agenda"
} else if (this.currentPath =='/home/gabinete-digital') {
this.type = "AccoesPresidenciais & ArquivoDespachoElect"
} else if (this.currentPath == '/home/publications') {
this.type = "AccoesPresidenciais"
} else {
this.select = false
}
} else {
this.select = true;
}
}
selectItem(item: SearchDocument) {
if(this.select){
this.modalController.dismiss({
selected: item
});
}
}
ngOnInit() {
@@ -172,9 +207,9 @@ export class SearchPage implements OnInit {
/**
* @description Basic search
*/
basicSearch(){
basicSearch(){
if(window.location.pathname == '/home/agenda'){
if(this.type == "Agenda" ){
this.showLoader = true;
@@ -205,7 +240,7 @@ export class SearchPage implements OnInit {
this.loadWordCloud();
});
} else if (window.location.pathname =='/home/gabinete-digital'){
} else if ( this.type == "AccoesPresidenciais & ArquivoDespachoElect"){
this.showLoader = true;
@@ -267,7 +302,7 @@ export class SearchPage implements OnInit {
this.loadWordCloud();
});
} else if (window.location.pathname == '/home/publications'){
} else if (this.type == "AccoesPresidenciais"){
this.showLoader = true;
@@ -297,7 +332,7 @@ export class SearchPage implements OnInit {
this.loadWordCloud();
});
}
}
/**
@@ -424,7 +459,7 @@ export class SearchPage implements OnInit {
itemIcons(): string{
return window.location.pathname
return this.type
}
viewDocument(){
@@ -437,27 +472,28 @@ export class SearchPage implements OnInit {
async viewDetail(id:any) {
console.log(id);
if(window.location.pathname == '/home/agenda'){
if(!this.selectItem){
if(window.location.pathname == '/home/agenda'){
const modal = await this.modalCtrl.create({
component: ViewEventPage,
componentProps:{
eventId: id
},
cssClass: 'modal modal-desktop',
});
await modal.present();
modal.onDidDismiss().then((res)=>{});
} else if(window.location.pathname == '/home/publications'){
const modal = await this.modalCtrl.create({
component: ViewEventPage,
componentProps:{
eventId: id
},
cssClass: 'modal modal-desktop',
});
await modal.present();
modal.onDidDismiss().then((res)=>{});
this.viewPublicationDetail(id);
}
else if(window.location.pathname == '/home/gabinete-digital'){
console.log('OPEN DOC');
this.viewDocumentDetail(id,'');
} else if(window.location.pathname == '/home/publications'){
this.viewPublicationDetail(id);
}
else if(window.location.pathname == '/home/gabinete-digital'){
console.log('OPEN DOC');
this.viewDocumentDetail(id,'');
}
}
}
@@ -480,7 +516,7 @@ export class SearchPage implements OnInit {
async viewDocumentDetail(docId:string, applicationId:string) {
let classs;
if( window.innerWidth <= 800){
classs = 'modal'
classs = 'modal modal-desktop'
} else {
classs = 'modal modal-desktop showAsideOptions'
}
+33 -4
View File
@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { Attachment } from '../models/attachment.model';
import { Attachment, EventAttachment } from '../models/attachment.model';
import { Observable } from 'rxjs';
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { environment } from 'src/environments/environment';
@@ -33,7 +33,7 @@ export class AttachmentsService {
return this.http.get<Attachment[]>(`${geturl}`, options);
}
getAttachments(source: number, sourceid: string): Observable<Attachment[]>{
getAttachments(source: number, sourceid: string): Observable<Attachment[]> {
let geturl = environment.apiURL + 'attachments/GetSourceName';
let params = new HttpParams();
@@ -47,18 +47,47 @@ export class AttachmentsService {
return this.http.get<Attachment[]>(`${geturl}`, options);
}
getAttachmentsById(eventId: string): Observable<Attachment[]>{
getAttachmentsById(eventId: string): Observable<Attachment[]> {
let geturl = environment.apiURL + 'attachments/GetAttachmentsByEventId';
let params = new HttpParams();
params = params.set("ParentId", eventId);
/* params = params.set("SourceId", sourceid); */
let options = {
let options = {
headers: this.headers,
params: params
};
return this.http.get<Attachment[]>(`${geturl}`, options);
}
setEventAttachmentById(body: EventAttachment) {
let geturl = environment.apiURL + 'Attachments/Create';
let options = {
headers: this.headers,
}
return this.http.post(`${geturl}`, body, options);
}
deleteEventAttachmentById(attachmentId) {
let geturl = environment.apiURL + `Attachments/Delete?attachmentId=${attachmentId}`;
let params = new HttpParams();
params = params.set("attachmentId", attachmentId);
let options = {
headers: this.headers,
params: params
}
return this.http.delete(`${geturl}`, options);
}
}
+2 -2
View File
@@ -158,7 +158,7 @@ export class EventsService {
params: params
};
return this.http.post<Event>(`${puturl}`, event, options)
return this.http.post<string>(`${puturl}`, event, options)
}
postEventPr(event:Event, calendarName:string)
@@ -173,7 +173,7 @@ export class EventsService {
params: params
};
return this.http.post<Event>(`${puturl}`, event, options)
return this.http.post<string>(`${puturl}`, event, options)
}
deleteEvent(eventid:string, deletemode:number)
@@ -187,30 +187,37 @@
</div>
</div>
<div hidden class="ion-item-container-no-border">
<div (click)="getDoc()" class="d-flex container-div width-100 ion-item-container-no-border" >
<ion-label>
<div class="attach-icon">
<ion-icon src="assets/images/icons-attach-doc.svg"></ion-icon>
</div>
<div class="attach-document">
<ion-label>Anexar Documentos</ion-label>
<ion-label>Adicionar documentos</ion-label>
</div>
</ion-label>
</div>
<div hidden>
<ion-item>
<ion-label>Documentos Anexados</ion-label>
</ion-item>
<ion-list>
<ion-item>
<ion-label>
<h4 class="attach-title-item">Text</h4>
<p><span class="span-left">Text</span><span class="span-right"> Text </span></p>
<div class="d-flex container-div width-100" *ngFor="let document of loadedEventAttachments" >
<ion-list class="width-100 list">
<ion-item class="width-100">
<ion-label class="width-100">
<p class="d-flex ion-justify-content-between">
<span class="attach-title-item">{{document.SourceName}}</span>
<span class="app-name" *ngIf="document.ApplicationId == 8"> Correspondencia </span>
<span class="app-name" *ngIf="document.ApplicationId == 386"> AccoesPresidenciais </span>
<span class="app-name" *ngIf="document.ApplicationId == 361 "> ArquivoDespachoElect </span>
<span class="close-button text-black" (click)="deleteAttachment(document.Id)" >
<ion-icon class="font-20" src="assets/images/icons-delete-25.svg"></ion-icon>
</span>
</p>
<p><span class="span-left">{{document.Stakeholders}}</span><span class="span-right"> {{document.CreateDate | date: 'dd-MM-yy'}} </span></p>
</ion-label>
</ion-item>
</ion-list>
</div>
</div>
</ion-content>
<ion-footer class="ion-no-border">
@@ -167,4 +167,38 @@ ion-content{
color:red;
}
}
}
.app-name{
background: #42b9f2;
border-radius: 18px;
text-align: center;
display: flex;
align-items: center;
padding: 0px 5px;
color: white;
font-size: 9pt;
font-weight: 500;
height: 19px;
-webkit-border-radius: 18px;
-moz-border-radius: 18px;
-ms-border-radius: 18px;
-o-border-radius: 18px;
}
.close-button {
display: none;
}
.list:hover {
.app-name {
display: none;
}
.close-button {
display: block !important;
}
}
@@ -6,6 +6,9 @@ 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'
import { SearchPage } from 'src/app/pages/search/search.page';
import { AttachmentsService } from 'src/app/services/attachments.service';
import { Attachment } from 'src/app/models/attachment.model';
@Component({
selector: 'app-edit-event',
templateUrl: './edit-event.component.html',
@@ -21,6 +24,7 @@ export class EditEventComponent implements OnInit {
segment:string = "true";
eventAttendees: EventPerson[];
minDate: string;
loadedEventAttachments: Attachment[];
@Input() taskParticipants: EventPerson[];
@Input() taskParticipantsCc: EventPerson[];
@@ -40,8 +44,11 @@ export class EditEventComponent implements OnInit {
private modalController: ModalController,
private eventsService: EventsService,
public alertController: AlertController,
private attachmentsService: AttachmentsService,
) {
}
ngOnInit() {
@@ -49,7 +56,11 @@ export class EditEventComponent implements OnInit {
if(!this.restoreTemporaryData()){
if(this.postEvent){
this.postEvent.Body.Text = this.postEvent.Body.Text.replace(/<[^>]+>/g, '');
if( this.postEvent.Body){
if(typeof(this.postEvent.Body.Text) == 'string'){
this.postEvent.Body.Text = this.postEvent.Body.Text.replace(/<[^>]+>/g, '');
}
}
}
// attendees list
@@ -78,6 +89,10 @@ export class EditEventComponent implements OnInit {
this.isRecurring = "Repete";
}
}
this.getAttachments(this.postEvent.EventId);
}
@@ -90,6 +105,9 @@ export class EditEventComponent implements OnInit {
this.deleteTemporaryData();
}
async save(){
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
@@ -120,6 +138,7 @@ export class EditEventComponent implements OnInit {
this.clearContact.emit();
}
async addParticipantsCc() {
this.saveTemporaryData();
@@ -150,15 +169,65 @@ export class EditEventComponent implements OnInit {
this.eventBody = restoredData.eventBody
this.segment = restoredData.segment
return true;
return true;
} else {
return false;
}
}
deleteTemporaryData(){
window['temp.path:/home/agenda/edit-event.component.ts'] = {}
}
getAttachments(eventId: string){
this.attachmentsService.getAttachmentsById(eventId).subscribe(res=>{
this.loadedEventAttachments = res;
console.log('res', res);
});
}
deleteAttachment(attachmentID: string) {
this.attachmentsService.deleteEventAttachmentById(attachmentID).subscribe(
res=>{
this.loadedEventAttachments = this.loadedEventAttachments.filter(e=> e.Id.toString() != attachmentID);
})
}
async getDoc() {
const modal = await this.modalController.create({
component: SearchPage,
cssClass: 'group-messages modal-desktop search-modal search-modal-to-desktop',
componentProps: {
type: 'AccoesPresidenciais & ArquivoDespachoElect'
}
});
await modal.present();
modal.onDidDismiss().then( async (res)=>{
if(res){
const data = res.data;
//data.selected
const DocumentToSave = {
SourceTitle: data.selected.Assunto,
ParentId: this.postEvent.EventId,
Source: '1',
SourceId: data.selected.Id,
ApplicationId: data.selected.ApplicationType.toString(),
Id: '0',
Link: '',
SerialNumber: '',
};
await this.attachmentsService.setEventAttachmentById(DocumentToSave).subscribe(()=>{
this.getAttachments(this.postEvent.EventId);
});
}
});
}
}
@@ -44,11 +44,11 @@ export class EventListComponent implements OnInit {
this.profile = 'PR'
}
this.LoadToApproveEvents();
// this.LoadToApproveEvents();
this.router.events.forEach((event) => {
if(event instanceof NavigationEnd && event.url == this.router.url) {
this.LoadToApproveEvents();
// this.LoadToApproveEvents();
}
});
}
@@ -183,26 +183,29 @@
</div>
</div>
<div hidden class="ion-item-container-no-border">
<div class="ion-item-container-no-border" (click)="getDoc()">
<ion-label>
<div class="attach-icon">
<ion-icon src="assets/images/icons-attach-doc.svg"></ion-icon>
</div>
<div class="attach-document">
<ion-label>Anexar Documentos</ion-label>
<ion-label>Adicionar documentos</ion-label>
</div>
</ion-label>
</div>
<div hidden>
<ion-item>
<ion-label>Documentos Anexados</ion-label>
</ion-item>
<div class="list " *ngFor="let document of documents; let i = index" >
<ion-list>
<ion-item>
<ion-label>
<h4 class="attach-title-item">Text</h4>
<p><span class="span-left">Text</span><span class="span-right"> Text </span></p>
<p class="d-flex ion-justify-content-between">
<span class="attach-title-item">{{document.Assunto}}</span>
<span class="app-name">{{document.appName}}</span>
<span class="close-button text-black" (click)="removeAttachment(i)" >
<ion-icon class="font-20" src="assets/images/icons-delete-25.svg"></ion-icon>
</span>
</p>
<p><span class="span-left">{{document.EntidadeOrganicaNome}}</span><span class="span-right"> {{document.Data | date: 'dd-MM-yy'}} </span></p>
</ion-label>
</ion-item>
</ion-list>
@@ -176,4 +176,38 @@ ion-content{
ion-textarea{
height: 81px;
}
}
.app-name{
background: #42b9f2;
border-radius: 18px;
text-align: center;
display: flex;
align-items: center;
padding: 0px 5px;
color: white;
font-size: 9pt;
font-weight: 500;
height: 19px;
-webkit-border-radius: 18px;
-moz-border-radius: 18px;
-ms-border-radius: 18px;
-o-border-radius: 18px;
}
.close-button {
display: none;
}
.list:hover {
.app-name {
display: none;
}
.close-button {
display: block !important;
}
}
@@ -2,9 +2,13 @@ import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { EventBody } from 'src/app/models/eventbody.model';
import { EventPerson } from 'src/app/models/eventperson.model';
import { EventsService } from 'src/app/services/events.service';
import { AttachmentsService } from 'src/app/services/attachments.service';
import { Event } from 'src/app/models/event.model';
import { ModalController } from '@ionic/angular';
import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
import { SearchPage } from 'src/app/pages/search/search.page';
import { SearchDocument } from "src/app/models/search-document";
import { EventAttachment } from 'src/app/models/attachment.model';
@Component({
selector: 'app-new-event',
templateUrl: './new-event.component.html',
@@ -21,7 +25,6 @@ export class NewEventPage implements OnInit {
@Input() selectedDate: Date;
@Input() taskParticipants: EventPerson[];
@Input() taskParticipantsCc: any = [];
@Output() setIntervenient = new EventEmitter<any>();
@Output() setIntervenientCC = new EventEmitter<any>();
@@ -33,11 +36,14 @@ export class NewEventPage implements OnInit {
@Output() GoBackEditOrAdd = new EventEmitter<any>();
@Output() cloneAllmobileComponent = new EventEmitter<any>();
documents:SearchDocument[] = [];
minDate: string;
constructor(
private modalController: ModalController,
private eventService: EventsService,
private attachmentsService: AttachmentsService
) {}
ngOnInit() {
@@ -121,6 +127,23 @@ export class NewEventPage implements OnInit {
}
async getDoc(){
const modal = await this.modalController.create({
component: SearchPage,
cssClass: 'group-messages modal-desktop search-modal search-modal-to-desktop',
componentProps: {
type: 'AccoesPresidenciais & ArquivoDespachoElect'
}
});
await modal.present();
modal.onDidDismiss().then((res)=>{
if(res){
const data = res.data;
this.documents.push(data.selected);
}
});
}
close(){
this.deleteTemporaryData();
@@ -131,24 +154,73 @@ export class NewEventPage implements OnInit {
this.setIntervenientCC.emit([]);
}
save(){
async save(){
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
if(this.documents.length >= 0){
this.postEvent.HasAttachments = true;
}
if(this.profile=='mdgpr') {
this.eventService.postEventMd(this.postEvent, this.postEvent.CalendarName).subscribe();
this.eventService.postEventMd(this.postEvent, this.postEvent.CalendarName).subscribe(
(id) => {
const eventId: string = id;
const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
return {
SourceTitle: e.Assunto,
ParentId: eventId,
Source: '1',
SourceId: e.Id,
ApplicationId: e.ApplicationType.toString(),
Id: '',
Link: '',
SerialNumber: ''
};
});
DocumentToSave.forEach((attachments) => {
this.attachmentsService.setEventAttachmentById(attachments).subscribe();
});
});
}
else if(this.profile=='pr') {
this.eventService.postEventPr(this.postEvent, this.postEvent.CalendarName).subscribe();
this.eventService.postEventPr(this.postEvent, this.postEvent.CalendarName).subscribe(
(id) => {
const eventId: string = id;
const toDocumentTosSave: EventAttachment[] = this.documents.map((e) => {
return {
SourceTitle: e.Assunto,
ParentId: eventId,
Source: '1',
SourceId: e.Id,
ApplicationId: e.ApplicationType.toString(),
Id: '',
Link: '',
SerialNumber: ''
};
});
toDocumentTosSave.forEach((attachments) => {
this.attachmentsService.setEventAttachmentById(attachments);
});
});
}
this.deleteTemporaryData();
}
this.onAddEvent.emit(this.postEvent);
this.GoBackEditOrAdd.emit();
removeAttachment(index: number){
this.documents = this.documents.filter( (e, i) => index != i);
this.setIntervenient.emit([]);
this.setIntervenientCC.emit([]);
}
@@ -184,11 +256,11 @@ export class NewEventPage implements OnInit {
}
restoreTemporaryData(): boolean{
restoreTemporaryData(): boolean {
const restoredData = window['temp.path:/home/agenda/new-event.component.ts']
if(JSON.stringify(restoredData) != "{}" && undefined != restoredData){
if(JSON.stringify(restoredData) != "{}" && undefined != restoredData) {
this.postEvent = restoredData.postEvent
this.eventBody = restoredData.eventBody
this.segment = restoredData.segment
@@ -55,20 +55,19 @@
<ion-item lines="none" class="ion-no-margin ion-no-padding">
<div [innerHTML]="loadedEvent.Body.Text"></div>
</ion-item>
<div class="line"></div>
</div>
</div>
<div class="line"></div>
<div *ngIf="loadedAttachments" class="bottom-content">
<div *ngIf="loadedAttachments" class="bottom-content width-100">
<h5>Documentos Anexados</h5>
<ion-list>
<ion-item lines="none" class="ion-no-margin ion-no-padding">
<ion-label *ngFor="let attach of loadedAttachments"
(click)="viewDocument(attach.SourceId)">
<p class="attach-title-item">{{attach.SourceName}}</p>
<p><span class="span-left">{{attach.Stakeholders}}</span><span class="span-right">{{ attach.CreateDate | date: 'dd-MM-yy' }}</span></p>
</ion-label>
</ion-item>
<ion-list class="width-100">
<ion-item *ngFor="let attach of loadedAttachments" class="width-100" lines="none" class="ion-no-margin ion-no-padding">
<ion-label class="width-100" (click)="viewDocument(attach.SourceId)">
<p class="attach-title-item">{{attach.SourceName}}</p>
<p><span class="span-left">{{attach.Stakeholders}}</span><span class="span-right">{{ attach.CreateDate | date: 'dd-MM-yy' }}</span></p>
</ion-label>
</ion-item>
</ion-list>
</div>
<!-- <div class="line"></div> -->
@@ -32,6 +32,8 @@ export class ViewEventPage implements OnInit {
months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
days = ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"];
documents: Attachment[] = [];
@Input() profile:string;
@Input() eventId: string;
@@ -76,12 +78,15 @@ export class ViewEventPage implements OnInit {
loadEvent(){
this.eventsService.getEvent(this.eventId).subscribe(res => {
this.loadedEvent = res;
console.log(res);
// console.log(res);
this.today = new Date(res.StartDate);
console.log(new Date(this.today));
// console.log(new Date(this.today));
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]);
this.getAttachments(this.loadedEvent.EventId);
});
}
deleteEvent(){
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0).subscribe(async () =>
@@ -12,7 +12,7 @@
<ion-list lines="none" class="flex-grow-1 overflow-y-auto height-100" >
<ion-item-sliding class="px-20">
<div *ngFor="let attendee of contacts;">
<ion-item (click)="selectContact(attendee)" *ngIf="filterSearchList(attendee)" >
<ion-item *ngIf="filterSearchList(attendee)" >
<div class="pr-10">
<ion-icon class="font-35" src="assets/images/icons-userprofile.svg"></ion-icon>
</div>
@@ -20,6 +20,9 @@
<h3>{{ attendee.Name }}</h3>
<p>{{ attendee.EmailAddress }}</p>
</ion-label>
<div (click)="selectContact(attendee)">
<ion-icon class="font-35" src="assets/images/icons-add-25.svg"></ion-icon>
</div>
</ion-item>
</div>
@@ -27,7 +30,6 @@
</ion-list>
<hr/>
<ion-list lines="none" *ngIf="taskParticipants.length >= 1 && adding == 'intervenient' " class="flex-grow-1 overflow-y-auto height-100 pb-0" >
<div class="px-20 font-15 pt-20" style="border-top:1px solid #ebebeb;font-weight: 500;" *ngIf="taskParticipants.length >= 1 || taskParticipantsCc.length >= 1" > Destinatário</div>
<ion-item-sliding class="px-20">
@@ -39,8 +41,8 @@
<h3>{{ attendee.Name }}</h3>
<p>{{ attendee.EmailAddress }}</p>
</ion-label>
<div style="color:red" (click)="remove(attendee)">
X
<div (click)="remove(attendee)">
<ion-icon class="font-35" src="assets/images/icons-delete-25.svg"></ion-icon>
</div>
</ion-item>
</ion-item-sliding>
@@ -57,8 +59,8 @@
<h3>{{ attendee.Name }}</h3>
<p>{{ attendee.EmailAddress }}</p>
</ion-label>
<div style="color:red" (click)="remove(attendee)">
X
<div (click)="remove(attendee)">
<ion-icon class="font-35" src="assets/images/icons-delete-25.svg"></ion-icon>
</div>
</ion-item>
</ion-item-sliding>
@@ -1,6 +1,4 @@
ion-item-group{
margin: 15px;
}
ion-item{
border-bottom:1px solid #ccc;
}
+16
View File
@@ -0,0 +1,16 @@
<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 25 25">
<g fill="none" fill-rule="evenodd" stroke-linecap="round">
<g stroke="#42B9FE" stroke-width="2">
<g>
<g>
<g>
<g stroke-linejoin="round">
<path d="M1.157 1.45L8.228 8.521" transform="translate(-355 -234) translate(0 99) translate(20 125) translate(335 10) rotate(-45 17.657 -2.364) rotate(180 4.45 4.743)"/>
</g>
<path d="M13 7L13 17" transform="translate(-355 -234) translate(0 99) translate(20 125) translate(335 10)"/>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 757 B

+16
View File
@@ -0,0 +1,16 @@
<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 25 25">
<g fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round">
<g stroke="#D30A0A" stroke-width="2">
<g>
<g>
<g>
<g>
<path d="M8 8L17 17" transform="translate(-355 -471) translate(0 99) translate(20 327) translate(0 35) translate(335 10) rotate(180 12.5 12.5)"/>
<path d="M8 8L17 17" transform="translate(-355 -471) translate(0 99) translate(20 327) translate(0 35) translate(335 10) matrix(-1 0 0 1 25 0)"/>
</g>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 774 B