Merge branch 'feature/calendar' of https://bitbucket.org/equilibriumito/gabinete-digital into developer-c

This commit is contained in:
tiago.kayaya
2021-02-25 10:55:12 +01:00
22 changed files with 538 additions and 142 deletions
+5 -3
View File
@@ -5,6 +5,7 @@
<div class="bg-blue">
<div class="main-content">
<!-- Toolbar -->
<ion-progress-bar class="calendar-progress-bar" type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
<div>
<!-- Calendar is here -->
<div [ngSwitch]="segment">
@@ -224,10 +225,11 @@
<!-- Calendar currente date -->
<ion-row class="timeline-header ion-justify-content-between ion-align-items-center currente-date-timelien">
<ion-row class="timeline-date align-center">
<ion-icon *ngIf="showCalendar" (click)="calendarHeight='75px';showCalendar=false" class="collaps" src="assets/images/icons-collaps-up.svg" ></ion-icon>
<ion-icon *ngIf="!showCalendar" (click)="calendarHeight='347px';showCalendar=true" class="collaps" src="assets/images/icons-collaps-down.svg" ></ion-icon>
</ion-row>
<ion-row class="timeline-date align-center">
<span *ngIf="timelineIsCurrentDate()">Hoje, &nbsp;</span> {{ timelineDate }}
</ion-row>
<ion-row class="filter ion-align-items-center">
@@ -242,15 +244,15 @@
</ul>
</ion-row>
</ion-row>
</div>
</div>
</div>
</ion-header>
<ion-content class="timeline">
<ion-content id="timeline-conteiner" class="timeline">
<!-- Progress bar -->
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
<ion-refresher-content>
</ion-refresher-content>
</ion-refresher>
+7
View File
@@ -479,4 +479,11 @@ td.monthview-primary-with-event {
background: #ebebeb;
margin: 13px 20px;
height: 2px;
}
.calendar-progress-bar{
position: absolute;
width: calc(100% - 20px);
margin-left: 10px;
}
+49 -29
View File
@@ -55,21 +55,6 @@ export class AgendaPage implements OnInit {
showCalendar: boolean;
calendarHeight: string;
// timeline
monthList = [
{ name: 'Janeiro', id: 'Jan' },
{ name: 'Fevereiro', id: 'Feb' },
{ name: 'Março', id: 'Mar' },
{ name: 'Abril', id: 'Apr' },
{ name: 'Maio', id: 'May' },
{ name: 'Junho', id: 'June' },
{ name: 'Julho', id: 'July' },
{ name: 'Agosto', id: 'Aug' },
{ name: 'Setembro', id: 'Sept' },
{ name: 'Outubro', id: 'Oct' },
{ name: 'Novembro', id: 'Nov' },
{ name: 'Dezembro', id: 'Dec' }
]
// for timeline
events: CalendarEvent[] = [];
@@ -155,10 +140,12 @@ export class AgendaPage implements OnInit {
//Go to the next view of the calendar month/week/day
next(){
this.myCal.slideNext();
this.centralizeTimeline(500);
}
//Go to the previous view of the calendar
back(){
this.myCal.slidePrev();
this.centralizeTimeline(500);
}
//Shows the title of your view
onViewTitleChanged(title){
@@ -276,20 +263,39 @@ export class AgendaPage implements OnInit {
// auto scroll timeline
setTimeout(() => {
const timelineMarker = document.querySelector('.cal-current-time-marker');
const timelineContainer = document.querySelectorAll('ion-content')[2];
const timelineContainer = document.querySelector('ion-content#timeline-conteiner');
const shadowRoot = timelineContainer.shadowRoot;
const scrollContainer = shadowRoot.querySelector('main');
<<<<<<< HEAD
scrollContainer.scrollTop = timelineMarker['offsetTop'] - ((scrollContainer.offsetHeight/2) - 60);
=======
try {
scrollContainer.scroll({
top: timelineMarker['offsetTop'] - ((scrollContainer.offsetHeight/2) - 60),
left: 0,
behavior: 'smooth'
})
} catch (error) {
//
}
>>>>>>> 23f5e954c97e86ebfe04040bd90bbf2a7461da2d
}, timeout);
}
// for timeline
timelineIsCurrentDate(): Boolean {
<<<<<<< HEAD
return true;
//return formatDate(new Date(),'dd MMMM yyyy', 'pt') == formatDate(this.eventSelectedDate,'dd MMMM yyyy', 'pt');
=======
return momentG(new Date(),'dd MMMM yyyy', 'pt') == momentG(this.eventSelectedDate,'dd MMMM yyyy', 'pt');
>>>>>>> 23f5e954c97e86ebfe04040bd90bbf2a7461da2d
}
// for timeline
@@ -408,6 +414,9 @@ export class AgendaPage implements OnInit {
if(this.profile == "mdgpr"){
this.eventService.getAllMdEvents( momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59') ).subscribe(
response => {
this.eventSource=[];
this.eventsList = response;
// loop
this.eventsList.forEach((element, eventIndex) => {
@@ -439,6 +448,9 @@ export class AgendaPage implements OnInit {
else{
this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(
response => {
this.eventSource=[];
this.eventsList = response;
this.eventsList.forEach((element, eventIndex) => {
this.eventSource.push({
@@ -471,23 +483,29 @@ export class AgendaPage implements OnInit {
this.eventSource=[];
if(this.profile == "mdgpr"){
this.eventService.getAllMdEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(response => {
this.eventsListPessoal = response.filter(data => data.CalendarName == "Pessoal");
this.eventsListPessoal.forEach(element => {
this.eventSource.push({
title: element.Subject,
startTime: new Date(element.StartDate),
endTime: new Date(element.EndDate),
allDay: false,
event: element
});
this.eventSource=[];
this.eventsListPessoal = response.filter(data => data.CalendarName == "Pessoal");
this.eventsListPessoal.forEach(element => {
this.eventSource.push({
title: element.Subject,
startTime: new Date(element.StartDate),
endTime: new Date(element.EndDate),
allDay: false,
event: element
});
this.myCal.update();
this.myCal.loadEvents();
this.showLoader = false;
});
this.myCal.update();
this.myCal.loadEvents();
this.showLoader = false;
});
}
else{
this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(response => {
this.eventSource=[];
this.eventsListPessoal = response.filter(data => data.CalendarName == "Pessoal");
this.eventsListPessoal.forEach(element => {
this.eventSource.push({
@@ -510,7 +528,8 @@ export class AgendaPage implements OnInit {
this.eventSource=[];
if(this.profile == "mdgpr"){
this.eventService.getAllMdEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(res => {
this.eventsListOficial = res.filter(data => data.CalendarName == "Oficial");
this.eventSource=[];
this.eventsListOficial = res.filter(data => data.CalendarName == "Oficial");
this.eventsListOficial.forEach(element => {
this.eventSource.push({
title: element.Subject,
@@ -526,6 +545,7 @@ export class AgendaPage implements OnInit {
});
}else{
this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(res => {
this.eventSource=[];
this.eventsListOficial = res.filter(data => data.CalendarName == "Oficial");
this.eventsListOficial.forEach(element => {
this.eventSource.push({
+3 -3
View File
@@ -65,9 +65,9 @@ export class EventsPage implements OnInit {
private storageService:StorageService,
public activatedRoute: ActivatedRoute,
private alertController: AlertService,
private modalController: ModalController,
private authService: AuthService,
private processes:ProcessesService) {
private processes:ProcessesService,
private modalController:ModalController) {
this.prEventList = null;
// list
@@ -317,7 +317,7 @@ export class EventsPage implements OnInit {
}
}
@@ -106,7 +106,7 @@ export class PublicationsPage implements OnInit {
async viewPublications(folderId: string) {
console.log('FOLDER', folderId)
/* const enterAnimation = (baseEl: any) => {
const enterAnimation = (baseEl: any) => {
const backdropAnimation = this.animationController.create()
.addElement(baseEl.querySelector('ion-backdrop')!)
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
@@ -128,14 +128,13 @@ export class PublicationsPage implements OnInit {
const leaveAnimation = (baseEl: any) => {
return enterAnimation(baseEl).direction('reverse');
}
*/
/* let item = this.publicationFolderList; */
const modal = await this.modalController.create({
component: ViewPublicationsPage,
/* enterAnimation,
leaveAnimation, */
enterAnimation,
leaveAnimation,
componentProps:{
folderId:folderId,
},
@@ -1,14 +1,23 @@
<ion-header class="main-header">
<div class="icon" (click)="close()">
<ion-icon name="chevron-back" slot="start"></ion-icon>
</div>
<ion-toolbar>
<ion-title>Entidade Orgânica</ion-title>
</ion-toolbar>
</ion-header>
<ion-toolbar class="main-header d-flex">
<div class="d-flex align-center">
<div class="icon" (click)="close()">
<ion-icon style="font-size:35px;" src="assets/images/icons-arrow-arrow-left.svg"></ion-icon>
</div>
<div>
<ion-title>Entidade Orgânica</ion-title>
</div>
</div>
</ion-toolbar>
<ion-content>
<div class="main-container">
<div class="input-text d-flex ion-align-items-center">
+10 -5
View File
@@ -15,7 +15,7 @@
</div>
</div>
</ion-form>
<!-- search -->
<!-- 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>
</div>
@@ -38,7 +38,7 @@
<ion-icon name="restaurant-outline" src="assets/images/icons-advance-search-document.svg"></ion-icon>
</div>
<div class="input-container d-flex ion-align-items-center">
<ion-datetime [(ngModel)]='searchDocumentDate' display-timezone="utc"></ion-datetime>
<ion-datetime [(ngModel)]='searchDocumentDate' placeholder="Data" display-timezone="utc"></ion-datetime>
<div class="icon" (click)="clearInputDocumentDate()">
<ion-icon name="restaurant-outline" src="assets/images/icons-search-close.svg"></ion-icon>
</div>
@@ -77,7 +77,7 @@
<!-- SLIDE -->
<ion-slides class="slide" pager="false" [options]="slideOpts">
<ion-slide *ngFor="let category of searchCategories; index as i;">
<div class="button" (click)="filterDocList(category.Name)" (click)="activeCategoty(i)" ><!-- [ngClass]="{'active-category': category.Active}" -->
<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>
@@ -117,9 +117,14 @@
</div>
</div>
<ul>
<li *ngFor="let searchDocument of showSearchDocuments" class="d-flex">
<li *ngFor="let searchDocument of showSearchDocuments" (click)="viewDetail(searchDocument.Id)" class="d-flex">
<div class="icon">
<ion-icon src="assets/images/icons-search-document.svg"></ion-icon>
<ion-icon *ngIf="itemIcons() == '/home/gabinete-digital' "
src="assets/images/icons-search-document.svg"></ion-icon>
<ion-icon *ngIf="itemIcons() == '/home/agenda' "
src="assets/images/icons-default-agenda.svg"></ion-icon>
<ion-icon *ngIf="itemIcons() == '/home/publications' "
src="assets/images/icons-viagem.svg"></ion-icon>
</div>
<div class="content ion-align-items-center">
<p class="result-name">{{ searchDocument.Assunto}}</p>
+30 -31
View File
@@ -199,7 +199,6 @@ ion-slide{
}
.most-searched-word-container{
width: 441px;
height: 400px;
}
}
@@ -211,42 +210,42 @@ ion-slide{
@media only screen and (min-width: 1024px) {
// .header-main {
// background-color: #0782c9;
// .profile{
// display: inline-block;
// }
// .icon-most-searched-word-open{
// display: none !important;
// }
// }
.header-main {
background-color: #0782c9;
.profile{
display: inline-block;
}
.icon-most-searched-word-open{
display: none !important;
}
}
// .options{
// .container{
// border-bottom: 1px solid #ebebeb;
// .icon{
// display: flex;
// }
// }
// padding: 0px 20px;
// }
.options{
.container{
border-bottom: 1px solid #ebebeb;
.icon{
display: flex;
}
}
padding: 0px 20px;
}
// .search-result{
// border-left: 1px solid #d8d8d8;
// .header{
// border-top: unset !important;
// }
// }
.search-result{
border-left: 1px solid #d8d8d8;
.header{
border-top: unset !important;
}
}
// .most-searched-words{
// width: 400px !important;
// }
.most-searched-words{
width: 400px !important;
}
// .word-searh-result-container{
// flex-wrap: wrap;
// }
.word-searh-result-container{
flex-wrap: wrap;
}
}
+106 -33
View File
@@ -1,17 +1,14 @@
import { Component, OnInit } from '@angular/core';
import { ModalController } from '@ionic/angular';
import { ProcessesService } from 'src/app/services/processes.service';
import { SearchService } from "../../services/search.service";
import { SearchCategory } from "src/app/models/search-category";
import { SearchDocument } from "src/app/models/search-document";
import { formatDate } from '@angular/common';
import { CloudData, CloudOptions } from 'angular-tag-cloud-module';
import { SenderPage } from 'src/app/pages/search/sender/sender.page';
import { OrganicEntityPage } from 'src/app/pages/search/organic-entity/organic-entity.page';
import WordCloud from 'src/plugin/wordcloud2.js'
import { TopSearch } from 'src/app/models/top-search';
import { NgModel } from '@angular/forms';
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';
@Component({
selector: 'app-search',
templateUrl: './search.page.html',
@@ -39,15 +36,6 @@ export class SearchPage implements OnInit {
height: number = 411;
width: number = 411;
data: CloudData[] = [
{text: 'Docents', weight: 0.1, color: '#ffaaee'},
{text: '1232', weight: 0.2, tooltip: 'display a tooltip'},
{text: 'Dcuments', weight: 0.1, color: '#ffaaee'},
{text: 'Cat', weight: 0.3, color: '#ffaaee'},
{text: 'Dogs', weight: 0.1, tooltip: 'display a tooltip'},
{text: 'cars', weight: 0.2, color: '#ffaaee'},
];
// See http://idangero.us/swiper/api/ for valid options.
slideOpts = {
@@ -56,28 +44,51 @@ export class SearchPage implements OnInit {
speed: 400,
}
loadedAttachments:any;
list = []
constructor(private modalController: ModalController,
private search: SearchService) {
private search: SearchService,
private modalCtrl: ModalController,) {
this.ordinance = "recent";
}
ngOnInit() {
this.search.mostSeachWord("10").subscribe(res=>{
this.wordCloud()
}
let list = []
wordCloud(){
res.forEach(element => {
list.push(Object.values(element))
this.search.mostSeachWord("15").subscribe(res=>{
const container = document.querySelector('.most-searched-word-container');
container.setAttribute('style',`width: ${window.innerWidth}px`);
const highest= res[0].Hits;
const lowest = res[res.length-1].Hits;
const range = highest - lowest;
const perPercent = range / 100;
let list = [];
// minimum font sixe
// Editable -----------------------------------
const minimumSize = 9;
// Editable ------------------------------------
const maximum = 64;
res.forEach(e => {
const array: any = Object.values(e);
array[1] = (((array[1] - lowest) / perPercent) * (maximum - minimumSize)/ 100 ) + minimumSize;
list.push(array)
});
this.list = list
const elem = document.documentElement.querySelector('.most-searched-word-container');
const elem = document.documentElement.querySelector('.most-searched-word-container');
WordCloud(
elem,
@@ -89,7 +100,6 @@ export class SearchPage implements OnInit {
);
});
}
close(){
@@ -123,7 +133,6 @@ export class SearchPage implements OnInit {
if(window.location.pathname == '/home/agenda'){
console.log('aplication type 0');
this.showLoader = true;
@@ -153,7 +162,6 @@ export class SearchPage implements OnInit {
});
} else if (window.location.pathname =='/home/gabinete-digital'){
console.log('aplication type 8,361');
this.showLoader = true;
@@ -209,8 +217,6 @@ export class SearchPage implements OnInit {
this.showLoader = true;
console.log('aplication type 386');
this.search.basicSearch(this.searchSubject, this.searchDocumentDate, this.searchSender
,this.searchOrganicEntiry, this.searchDocTypeId, '386').subscribe(res=>{
console.log(res);
@@ -245,6 +251,13 @@ export class SearchPage implements OnInit {
*/
clearSearchInput(){
this.searchSubject = ""
this.searchCategories = [];
this.searchDocuments = [];
this.showDocuments = false;
this.wordCloud();
}
/**
@@ -260,11 +273,18 @@ export class SearchPage implements OnInit {
activeCategoty(i){
this.searchCategories.forEach((e) => {
e['Active'] = false;
this.searchCategories.forEach((e, j) => {
if(i != j){
e['Active'] = false;
}
})
this.searchCategories[i]['Active'] = true;
if (this.searchCategories[i]['Active']){
this.searchCategories[i]['Active'] = false;
} else {
this.searchCategories[i]['Active'] = true
}
}
clearInputRemetente(){
@@ -290,7 +310,7 @@ export class SearchPage implements OnInit {
const modal = await this.modalController.create({
component: SenderPage,
cssClass: 'sender',
cssClass: 'modal modal-desktop',
componentProps: {
}
});
@@ -308,7 +328,7 @@ export class SearchPage implements OnInit {
const modal = await this.modalController.create({
component: OrganicEntityPage,
cssClass: 'organicEnity',
cssClass: 'modal modal-desktop',
componentProps: {
}
});
@@ -334,4 +354,57 @@ export class SearchPage implements OnInit {
this.showCategory = categoryName;
}
}
itemIcons(): string{
return window.location.pathname
}
viewDocument(){
const url: string = this.loadedAttachments.DocumentURL.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
// const browser = this.iab.create(url,"_blank");
// browser.show();
}
async viewDetail(id:any) {
if(window.location.pathname == '/home/agenda'){
const modal = await this.modalCtrl.create({
component: ViewEventPage,
componentProps:{
eventId: id
},
cssClass: 'modal',
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss().then((res)=>{});
} else if(window.location.pathname == '/home/publications'){
this.viewPublicationDetail(id);
}
}
async viewPublicationDetail(publicationId:string) {
const modal = await this.modalController.create({
component: PublicationDetailPage,
componentProps:{
publicationId: publicationId,
},
cssClass: 'publication-detail',
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss().then(()=>{});
}
}
+10 -8
View File
@@ -1,13 +1,15 @@
<ion-header class="main-header">
<div class="icon" (click)="close()">
<ion-icon name="chevron-back" slot="start"></ion-icon>
<ion-toolbar class="main-header d-flex">
<div class="d-flex align-center">
<div class="icon" (click)="close()">
<ion-icon style="font-size:35px;" src="assets/images/icons-arrow-arrow-left.svg"></ion-icon>
</div>
<div>
<ion-title>Remetentes</ion-title>
</div>
</div>
<ion-toolbar>
<ion-title>Remetentes</ion-title>
</ion-toolbar>
</ion-header>
</ion-toolbar>
<ion-content>
<div class="main-container">