mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Merge with developer branch
This commit is contained in:
@@ -18,6 +18,18 @@ const routes: Routes = [
|
||||
},
|
||||
{
|
||||
path: 'emend-message-modal',
|
||||
loadChildren: () => import('./emend-message-modal/emend-message-modal.module').then( m => m.EmendMessageModalPageModule)
|
||||
},
|
||||
{
|
||||
path: 'new-event',
|
||||
loadChildren: () => import('./new-event/new-event.module').then( m => m.NewEventPageModule)
|
||||
},
|
||||
{
|
||||
path: 'edit-event',
|
||||
loadChildren: () => import('./edit-event/edit-event.module').then( m => m.EditEventPageModule)
|
||||
},
|
||||
{
|
||||
path: 'view-event',
|
||||
loadChildren: () => import('./view-event/view-event.module').then( m => m.ViewEventPageModule)
|
||||
}
|
||||
|
||||
|
||||
@@ -15,14 +15,23 @@ import { CalModalPageModule } from '../cal-modal/cal-modal.module';
|
||||
import { registerLocaleData } from '@angular/common';
|
||||
import localeDe from '@angular/common/locales/pt';
|
||||
import { CalendarComponent } from 'src/app/components/calendar/calendar.component';
|
||||
import { SharedModule } from 'src/app/shared/shared.module';
|
||||
registerLocaleData(localeDe);
|
||||
|
||||
|
||||
import { CalendarModule, DateAdapter } from 'angular-calendar';
|
||||
import { adapterFactory } from 'angular-calendar/date-adapters/date-fns';
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
/* ComponentsModule, */
|
||||
CalendarModule.forRoot({
|
||||
provide: DateAdapter,
|
||||
useFactory: adapterFactory
|
||||
}),
|
||||
SharedModule,
|
||||
AgendaPageRoutingModule,
|
||||
NgCalendarModule,
|
||||
CalModalPageModule,
|
||||
|
||||
@@ -1,218 +1,223 @@
|
||||
<ion-header class="ion-no-border">
|
||||
<ion-toolbar class="ion-no-border" class="bg-blue">
|
||||
<div class="div-top-header">
|
||||
<div class="div-search">
|
||||
<ion-icon src='assets/images/icons-search.svg'></ion-icon>
|
||||
</div>
|
||||
<div class="div-logo">
|
||||
<img src='assets/images/logo-no-bg.png' alt='logo'>
|
||||
</div>
|
||||
<div class="div-profile">
|
||||
<ion-icon src='assets/images/icons-profile.svg'></ion-icon>
|
||||
</div>
|
||||
</div>
|
||||
</ion-toolbar>
|
||||
<ion-header>
|
||||
<app-header></app-header>
|
||||
</ion-header>
|
||||
<ion-header>
|
||||
<ion-toolbar class="bg-blue">
|
||||
<div class="bg-blue">
|
||||
<div class="main-content">
|
||||
<ion-toolbar>
|
||||
<ion-buttons slot="end">
|
||||
<!-- customized TOGGLE button -->
|
||||
<div class="toggleBox">
|
||||
<div (click)="changeProfile()" class="toggle">
|
||||
<input type="checkbox">
|
||||
<label for="" class="onbtn">PR</label>
|
||||
<label for="" class="ofbtn">MDGPR</label>
|
||||
</div>
|
||||
</div>
|
||||
</ion-buttons>
|
||||
<ion-title class="header-title">Agenda</ion-title>
|
||||
</ion-toolbar>
|
||||
<ion-toolbar>
|
||||
<ion-segment [(ngModel)]="segment">
|
||||
<ion-segment-button value="Combinada">
|
||||
Combinada
|
||||
</ion-segment-button>
|
||||
<ion-segment-button value="Oficial">
|
||||
Oficial
|
||||
</ion-segment-button>
|
||||
<ion-segment-button value="Pessoal">
|
||||
Pessoal
|
||||
</ion-segment-button>
|
||||
</ion-segment>
|
||||
|
||||
</ion-toolbar>
|
||||
</div>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
<!-- Toolbar -->
|
||||
<div>
|
||||
<!-- Calendar is here -->
|
||||
<div [ngSwitch]="segment">
|
||||
<div *ngSwitchCase="'Combinada'">
|
||||
|
||||
<!-- Calendar is here -->
|
||||
<ion-row class="ion-justify-content-between calendar-tool-tip">
|
||||
<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>
|
||||
|
||||
<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>
|
||||
<div [ngSwitch]="segment">
|
||||
<div *ngSwitchCase="'Combinada'">
|
||||
<ion-row>
|
||||
<!-- Move back one screen of the slides -->
|
||||
<ion-col size="2">
|
||||
<ion-button fill="clear" (click)="back()">
|
||||
<ion-icon name="arrow-back" slot="icon-only"></ion-icon>
|
||||
</ion-button>
|
||||
</ion-col>
|
||||
<!-- The title of the calendar in the middle -->
|
||||
<ion-col size="8" class="ion-text-center">
|
||||
<h2 class="capitaliseText">{{ viewTitle }}</h2>
|
||||
</ion-col>
|
||||
|
||||
<!-- Move forward one screen of the slides -->
|
||||
<ion-col size="2">
|
||||
<ion-button fill="clear" (click)="next()">
|
||||
<ion-icon name="arrow-forward" slot="icon-only"></ion-icon>
|
||||
</ion-button>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
|
||||
<calendar
|
||||
[eventSource]="eventSource"
|
||||
[calendarMode]="calendar.mode"
|
||||
[currentDate]="calendar.currentDate"
|
||||
(onEventSelected)="onEventSelected($event)"
|
||||
(onTitleChanged)="onViewTitleChanged($event)"
|
||||
(onRangeChanged)="onRangeChanged($event)"
|
||||
(onCurrentDateChanged)="onCurrentChanged($event)"
|
||||
queryMode="remote"
|
||||
startHour="6"
|
||||
endHour="20"
|
||||
step="30"
|
||||
startingDayMonth="1"
|
||||
noEventsLabel="Sem Eventos"
|
||||
allDayLabel="Todo o dia"
|
||||
[monthviewDisplayEventTemplate]="template"
|
||||
>
|
||||
</calendar>
|
||||
<!-- Move forward one screen of the slides -->
|
||||
<h2 class="capitaliseText">{{ viewTitle }}</h2>
|
||||
<div class="drop-down">
|
||||
<ion-icon slot="icon-only" class="arrow-down" src="assets/images/icons-arrow-arrow-down.svg"></ion-icon>
|
||||
<div class="drop-down-container">
|
||||
<ul>
|
||||
<li *ngFor="let month of monthList" (click)="dropDownChangeDate(month.id)" >{{ month.name }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Move forward one screen of the slides -->
|
||||
<div (click)="next()" class="arrow">
|
||||
<ion-icon slot="icon-only" src="assets/images/icons-calendar-arrow-right.svg"></ion-icon>
|
||||
</div>
|
||||
|
||||
<!-- Adding a customized ng-template -->
|
||||
<ng-template #template let-view="view" let-row="row" let-col="col">
|
||||
<div [class.with-event]="view.dates[row*7+col].events.length">
|
||||
{{view.dates[row*7+col].label}}
|
||||
<div class="indicator-container">
|
||||
<!-- <div class="event-indicator" *ngFor="let e of view.dates[row*7+col].events"></div> -->
|
||||
</ion-row>
|
||||
<ion-row class="ion-align-items-center">
|
||||
<ion-icon class="right-icons" name="add-circle-outline"></ion-icon>
|
||||
<ion-icon class="right-icons" src="assets/images/icons-received-event.svg"></ion-icon>
|
||||
<ion-icon class="right-icons" src="assets/images/icons-add-new-event.svg" (click)="openCalModal()" ></ion-icon>
|
||||
</ion-row>
|
||||
</ion-row>
|
||||
|
||||
<calendar
|
||||
[eventSource]="eventSource"
|
||||
[calendarMode]="calendar.mode"
|
||||
[currentDate]="calendar.currentDate"
|
||||
(onEventSelected)="onEventSelected($event)"
|
||||
(onTitleChanged)="onViewTitleChanged($event)"
|
||||
(onRangeChanged)="onRangeChanged($event)"
|
||||
(onCurrentDateChanged)="onCurrentChanged($event)"
|
||||
queryMode="remote"
|
||||
startHour="6"
|
||||
endHour="20"
|
||||
step="30"
|
||||
startingDayMonth="1"
|
||||
noEventsLabel="Sem Eventos"
|
||||
allDayLabel="Todo o dia"
|
||||
[monthviewDisplayEventTemplate]="template"
|
||||
>
|
||||
</calendar>
|
||||
|
||||
<!-- Adding a customized ng-template -->
|
||||
<ng-template #template let-view="view" let-row="row" let-col="col">
|
||||
<div [className]="currentDayEventDisplayBorder(view.dates, row*7+col)" [class.with-event]="view.dates[row*7+col].events.length">
|
||||
{{ view.dates[row*7+col].label }}
|
||||
<div class="indicator-container">
|
||||
<!-- <div class="event-indicator" *ngFor="let e of view.dates[row*7+col].events"></div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ng-template>
|
||||
</div>
|
||||
<div *ngSwitchCase="'Pessoal'">
|
||||
<ion-row>
|
||||
<!-- Move back one screen of the slides -->
|
||||
<ion-col size="2">
|
||||
<ion-button fill="clear" (click)="back()">
|
||||
<ion-icon name="arrow-back" slot="icon-only"></ion-icon>
|
||||
</ion-button>
|
||||
</ion-col>
|
||||
<!-- The title of the calendar in the middle -->
|
||||
<ion-col size="8" class="ion-text-center">
|
||||
<h2 class="capitaliseText">{{ viewTitle }}</h2>
|
||||
</ion-col>
|
||||
|
||||
<!-- Move forward one screen of the slides -->
|
||||
<ion-col size="2">
|
||||
<ion-button fill="clear" (click)="next()">
|
||||
<ion-icon name="arrow-forward" slot="icon-only"></ion-icon>
|
||||
</ion-button>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
|
||||
<calendar
|
||||
[eventSource]="eventSource"
|
||||
[calendarMode]="calendar.mode"
|
||||
[currentDate]="calendar.currentDate"
|
||||
(onEventSelected)="onEventSelected($event)"
|
||||
(onTitleChanged)="onViewTitleChanged($event)"
|
||||
(onRangeChanged)="onRangeChanged($event)"
|
||||
(onCurrentDateChanged)="onCurrentChanged($event)"
|
||||
queryMode="remote"
|
||||
startHour="6"
|
||||
endHour="20"
|
||||
step="30"
|
||||
startingDayMonth="1"
|
||||
noEventsLabel="Sem Eventos"
|
||||
allDayLabel="Todo o dia"
|
||||
[monthviewDisplayEventTemplate]="template"
|
||||
>
|
||||
</calendar>
|
||||
<!-- (onTimeSelected)="onTimeSelected($event)" -->
|
||||
|
||||
<!-- Adding a customized ng-template -->
|
||||
<ng-template #template let-view="view" let-row="row" let-col="col">
|
||||
<div [class.with-event]="view.dates[row*7+col].events.length">
|
||||
{{view.dates[row*7+col].label}}
|
||||
<div class="indicator-container">
|
||||
<!-- <div class="event-indicator" *ngFor="let e of view.dates[row*7+col].events"></div> -->
|
||||
</ng-template>
|
||||
</div>
|
||||
<div *ngSwitchCase="'Pessoal'">
|
||||
<ion-row>
|
||||
<!-- Move back one screen of the slides -->
|
||||
<ion-col size="2">
|
||||
<ion-button fill="clear" (click)="back()">
|
||||
<ion-icon name="arrow-back" slot="icon-only"></ion-icon>
|
||||
</ion-button>
|
||||
</ion-col>
|
||||
<!-- The title of the calendar in the middle -->
|
||||
<ion-col size="8" class="ion-text-center">
|
||||
<h2 class="capitaliseText">{{ viewTitle }}</h2>
|
||||
</ion-col>
|
||||
|
||||
<!-- Move forward one screen of the slides -->
|
||||
<ion-col size="2">
|
||||
<ion-button fill="clear" (click)="next()">
|
||||
<ion-icon name="arrow-forward" slot="icon-only"></ion-icon>
|
||||
</ion-button>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
|
||||
<calendar
|
||||
[eventSource]="eventSource"
|
||||
[calendarMode]="calendar.mode"
|
||||
[currentDate]="calendar.currentDate"
|
||||
(onEventSelected)="onEventSelected($event)"
|
||||
(onTitleChanged)="onViewTitleChanged($event)"
|
||||
(onRangeChanged)="onRangeChanged($event)"
|
||||
(onCurrentDateChanged)="onCurrentChanged($event)"
|
||||
queryMode="remote"
|
||||
startHour="6"
|
||||
endHour="20"
|
||||
step="30"
|
||||
startingDayMonth="1"
|
||||
noEventsLabel="Sem Eventos"
|
||||
allDayLabel="Todo o dia"
|
||||
[monthviewDisplayEventTemplate]="template"
|
||||
>
|
||||
</calendar>
|
||||
<!-- (onTimeSelected)="onTimeSelected($event)" -->
|
||||
|
||||
<!-- Adding a customized ng-template -->
|
||||
<ng-template #template let-view="view" let-row="row" let-col="col">
|
||||
<div [class.with-event]="view.dates[row*7+col].events.length">
|
||||
{{view.dates[row*7+col].label}}
|
||||
<div class="indicator-container">
|
||||
<!-- <div class="event-indicator" *ngFor="let e of view.dates[row*7+col].events"></div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ng-template>
|
||||
|
||||
</div>
|
||||
<div *ngSwitchCase="'Oficial'">
|
||||
<ion-row>
|
||||
<!-- Move back one screen of the slides -->
|
||||
<ion-col size="2">
|
||||
<ion-button fill="clear" (click)="back()">
|
||||
<ion-icon name="arrow-back" slot="icon-only"></ion-icon>
|
||||
</ion-button>
|
||||
</ion-col>
|
||||
<!-- The title of the calendar in the middle -->
|
||||
<ion-col size="8" class="ion-text-center">
|
||||
<h2 class="capitaliseText">{{ viewTitle }}</h2>
|
||||
</ion-col>
|
||||
|
||||
<!-- Move forward one screen of the slides -->
|
||||
<ion-col size="2">
|
||||
<ion-button fill="clear" (click)="next()">
|
||||
<ion-icon name="arrow-forward" slot="icon-only"></ion-icon>
|
||||
</ion-button>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
|
||||
<calendar
|
||||
[eventSource]="eventSource"
|
||||
[calendarMode]="calendar.mode"
|
||||
[currentDate]="calendar.currentDate"
|
||||
(onEventSelected)="onEventSelected($event)"
|
||||
(onTitleChanged)="onViewTitleChanged($event)"
|
||||
(onRangeChanged)="onRangeChanged($event)"
|
||||
(onCurrentDateChanged)="onCurrentChanged($event)"
|
||||
queryMode="remote"
|
||||
startHour="6"
|
||||
endHour="20"
|
||||
step="30"
|
||||
startingDayMonth="1"
|
||||
noEventsLabel="Sem Eventos"
|
||||
allDayLabel="Todo o dia"
|
||||
[monthviewDisplayEventTemplate]="template"
|
||||
>
|
||||
</calendar>
|
||||
|
||||
<!-- Adding a customized ng-template -->
|
||||
<ng-template #template let-view="view" let-row="row" let-col="col">
|
||||
<div [class.with-event]="view.dates[row*7+col].events.length">
|
||||
{{view.dates[row*7+col].label}}
|
||||
<div class="indicator-container">
|
||||
<!-- <div class="event-indicator" *ngFor="let e of view.dates[row*7+col].events"></div> -->
|
||||
</ng-template>
|
||||
|
||||
</div>
|
||||
<div *ngSwitchCase="'Oficial'">
|
||||
<ion-row>
|
||||
<!-- Move back one screen of the slides -->
|
||||
<ion-col size="2">
|
||||
<ion-button fill="clear" (click)="back()">
|
||||
<ion-icon name="arrow-back" slot="icon-only"></ion-icon>
|
||||
</ion-button>
|
||||
</ion-col>
|
||||
<!-- The title of the calendar in the middle -->
|
||||
<ion-col size="8" class="ion-text-center">
|
||||
<h2 class="capitaliseText">{{ viewTitle }}</h2>
|
||||
</ion-col>
|
||||
|
||||
<!-- Move forward one screen of the slides -->
|
||||
<ion-col size="2">
|
||||
<ion-button fill="clear" (click)="next()">
|
||||
<ion-icon name="arrow-forward" slot="icon-only"></ion-icon>
|
||||
</ion-button>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
|
||||
<calendar
|
||||
[eventSource]="eventSource"
|
||||
[calendarMode]="calendar.mode"
|
||||
[currentDate]="calendar.currentDate"
|
||||
(onEventSelected)="onEventSelected($event)"
|
||||
(onTitleChanged)="onViewTitleChanged($event)"
|
||||
(onRangeChanged)="onRangeChanged($event)"
|
||||
(onCurrentDateChanged)="onCurrentChanged($event)"
|
||||
queryMode="remote"
|
||||
startHour="6"
|
||||
endHour="20"
|
||||
step="30"
|
||||
startingDayMonth="1"
|
||||
noEventsLabel="Sem Eventos"
|
||||
allDayLabel="Todo o dia"
|
||||
[monthviewDisplayEventTemplate]="template"
|
||||
>
|
||||
</calendar>
|
||||
|
||||
<!-- Adding a customized ng-template -->
|
||||
<ng-template #template let-view="view" let-row="row" let-col="col">
|
||||
<div [class.with-event]="view.dates[row*7+col].events.length">
|
||||
{{view.dates[row*7+col].label}}
|
||||
<div class="indicator-container">
|
||||
<!-- <div class="event-indicator" *ngFor="let e of view.dates[row*7+col].events"></div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ng-template>
|
||||
|
||||
</ng-template>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<ion-fab vertical="bottom" horizontal="end" slot="fixed" (click)="openCalModal()">
|
||||
<ion-fab-button>
|
||||
<ion-icon name="add" ></ion-icon>
|
||||
</ion-fab-button>
|
||||
</ion-fab>
|
||||
</div>
|
||||
</ion-content>
|
||||
</div>
|
||||
</div>
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
|
||||
<!-- 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>
|
||||
|
||||
<!-- Calendar currente date -->
|
||||
|
||||
<ion-row class="ion-justify-content-between ion-align-items-center currente-date-timelien">
|
||||
<ion-row class="timeline-date">
|
||||
Hoje, {{ timelineDate }}
|
||||
</ion-row>
|
||||
<ion-row class="filter ion-align-items-center">
|
||||
<div class="filter-name">Todos</div>
|
||||
<ion-icon class="arrow-down" src="assets/images/icons-arrow-arrow-down.svg"></ion-icon>
|
||||
</ion-row>
|
||||
</ion-row>
|
||||
|
||||
<!-- Timeline -->
|
||||
<div *ngIf="showTimeline">
|
||||
<mwl-demo-utils-calendar-header class="timeline"
|
||||
[(view)]="view"
|
||||
[(viewDate)]="viewDate"
|
||||
[dayStartHour]="0"
|
||||
[dayEndHour]="23">
|
||||
</mwl-demo-utils-calendar-header>
|
||||
|
||||
<div [ngSwitch]="view">
|
||||
<mwl-calendar-day-view
|
||||
*ngSwitchCase="'day'"
|
||||
[viewDate]="viewDate"
|
||||
[events]="events"
|
||||
(eventClicked)="eventClicked($event)"
|
||||
>
|
||||
</mwl-calendar-day-view>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</ion-content>
|
||||
@@ -11,11 +11,15 @@
|
||||
display: table-cell;
|
||||
}
|
||||
|
||||
|
||||
:host ::ng-deep {
|
||||
.monthview-primary-with-event {
|
||||
background-color: white !important;
|
||||
}
|
||||
|
||||
|
||||
.monthview-current{
|
||||
background-color: red;
|
||||
}
|
||||
.monthview-selected {
|
||||
background-color: lightskyblue !important;
|
||||
}
|
||||
@@ -32,10 +36,54 @@
|
||||
}
|
||||
|
||||
.with-event {
|
||||
background-color: #ccc;
|
||||
border-radius: 15px;
|
||||
background-color: #fff;
|
||||
border-radius: 21px;
|
||||
border-left: 3px solid #ffb703;
|
||||
border-bottom: none;
|
||||
border-right: 3px solid #f05d5e;
|
||||
color: black;
|
||||
margin: 0px auto;
|
||||
width: 35px;
|
||||
}
|
||||
|
||||
.main-header{
|
||||
width: 100%; /* 400px */
|
||||
height: 100%;
|
||||
font-family: Roboto;
|
||||
border-top-left-radius: 25px;
|
||||
border-top-right-radius: 25px;
|
||||
background-color: #fff;
|
||||
overflow:hidden;
|
||||
padding: 15px 5px 0px 5px;
|
||||
color:#000;
|
||||
transform: translate3d(0, 1px, 0);
|
||||
|
||||
.title-content{
|
||||
width: 360px;
|
||||
margin: 0px auto;
|
||||
overflow: auto;
|
||||
padding: 0 !important;
|
||||
background: #ecf8ff;
|
||||
}
|
||||
.div-title{
|
||||
padding: 0!important;
|
||||
float: left;
|
||||
}
|
||||
.title{
|
||||
font-size: 25px;
|
||||
}
|
||||
.div-icon{
|
||||
width: 40px;
|
||||
float: right;
|
||||
font-size: 35px;
|
||||
overflow: auto;
|
||||
padding: 1px;
|
||||
}
|
||||
.div-icon ion-icon{
|
||||
float: right;
|
||||
padding-left: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* TOGGLE button */
|
||||
@@ -182,9 +230,9 @@ input:checked[type="checkbox"]::before{
|
||||
}
|
||||
.toggle{
|
||||
position: relative;
|
||||
display: inline;
|
||||
display: block;
|
||||
font-family: 'Montserrat', sans-serif;
|
||||
display: grid;
|
||||
/* display: grid; */
|
||||
text-align: center;
|
||||
}
|
||||
label{
|
||||
@@ -260,3 +308,100 @@ label{
|
||||
color: #000 !important;
|
||||
}
|
||||
|
||||
.segment {
|
||||
|
||||
}
|
||||
|
||||
/* Timeline */
|
||||
|
||||
.cal-hour-segment {
|
||||
border-bottom: none !important;
|
||||
}
|
||||
|
||||
.cal-current-time-marker {
|
||||
background-color: #42b9fe !important;
|
||||
}
|
||||
|
||||
.calendar-tool-tip{
|
||||
ion-icon{
|
||||
font-size: 35px;
|
||||
}
|
||||
.arrow-down{
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.currente-date-timelien{
|
||||
padding: 10px 20px;
|
||||
.timeline-date{
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.filter{
|
||||
font-size: 15px;
|
||||
font-weight: normal;
|
||||
.filter-name{
|
||||
color: #0d89d1;
|
||||
}
|
||||
ion-icon{
|
||||
font-size: 35px;
|
||||
color: #0d89d1;
|
||||
}
|
||||
.filter-name{
|
||||
font-family: Roboto;
|
||||
font-size: 15px;
|
||||
margin-left: 10px;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
.drop-down{
|
||||
|
||||
.drop-down-container{
|
||||
display: none;
|
||||
border-top: 2px solid #42b9fe;
|
||||
position: absolute;
|
||||
background: white;
|
||||
z-index: 100000;
|
||||
box-shadow: 0 4px 9px 0 rgba(0, 0, 0, 0.3);
|
||||
border-bottom-right-radius: 5px;
|
||||
border-bottom-left-radius: 5px;
|
||||
margin-left: -122px;
|
||||
padding: 4px 15px;
|
||||
ul{
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
li{
|
||||
list-style: none;
|
||||
height: 35px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.capitaliseText{
|
||||
min-width: 159px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.arrow{
|
||||
padding: 0px 6px;
|
||||
}
|
||||
|
||||
.right-icons{
|
||||
padding: 0px 4px;
|
||||
}
|
||||
|
||||
|
||||
.capitaliseText{
|
||||
font-size: 20px;
|
||||
}
|
||||
@@ -7,14 +7,84 @@ import { EventsService } from 'src/app/services/events.service';
|
||||
import { Event } from '../../models/event.model';
|
||||
import { Router, NavigationEnd } from '@angular/router';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { NewEventPage } from './new-event/new-event.page';
|
||||
import { ViewEventPage } from './view-event/view-event.page';
|
||||
|
||||
// showTimeline
|
||||
import { setHours, setMinutes } from 'date-fns';
|
||||
import {
|
||||
CalendarDateFormatter,
|
||||
CalendarEvent,
|
||||
CalendarView,
|
||||
DAYS_OF_WEEK,
|
||||
} from 'angular-calendar';
|
||||
import { CustomDateFormatter } from './custom-date-formatter.provider';
|
||||
|
||||
@Component({
|
||||
selector: 'app-agenda',
|
||||
templateUrl: './agenda.page.html',
|
||||
styleUrls: ['./agenda.page.scss'],
|
||||
providers: [
|
||||
/* {
|
||||
provide: CalendarDateFormatter,
|
||||
useClass: CustomDateFormatter,
|
||||
}, */
|
||||
],
|
||||
})
|
||||
export class AgendaPage implements OnInit {
|
||||
|
||||
view: CalendarView = CalendarView.Day;
|
||||
|
||||
viewDate: Date = new Date();
|
||||
|
||||
weekStartsOn: number = DAYS_OF_WEEK.MONDAY;
|
||||
|
||||
weekendDays: number[] = [DAYS_OF_WEEK.FRIDAY, DAYS_OF_WEEK.SATURDAY];
|
||||
|
||||
CalendarView = CalendarView;
|
||||
|
||||
timelineDate: string;
|
||||
|
||||
setView(view: CalendarView) {
|
||||
this.view = view;
|
||||
}
|
||||
|
||||
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' }
|
||||
]
|
||||
|
||||
showTimeline: boolean= false;
|
||||
|
||||
events: CalendarEvent[] = [
|
||||
/* {
|
||||
title: '123',
|
||||
start: setHours(setMinutes(new Date(), 0), 3),
|
||||
color: {
|
||||
primary: 'red',
|
||||
secondary: 'yellow'
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '123123',
|
||||
start: setHours(setMinutes(new Date(), 0), 5),
|
||||
color: {
|
||||
primary: 'red',
|
||||
secondary: 'yellow'
|
||||
},
|
||||
}, */
|
||||
];
|
||||
|
||||
/* List of events of our calendar */
|
||||
eventSource = [];
|
||||
/* The title of the calendar */
|
||||
@@ -58,7 +128,28 @@ export class AgendaPage implements OnInit {
|
||||
private eventService: EventsService,
|
||||
private router: Router,
|
||||
private alertCrontroller: AlertService
|
||||
) {}
|
||||
) {
|
||||
this.timelineDate = formatDate(new Date,'dd MMMM yyyy', 'pt');
|
||||
|
||||
setTimeout(()=>{
|
||||
// console.log(JSON.stringify(this.events));
|
||||
// console.log(this.events);
|
||||
},5000)
|
||||
|
||||
// console.log(setHours(setMinutes(new Date(), 0), 12))
|
||||
|
||||
function setCookie(cname, cvalue, exdays) {
|
||||
var d = new Date();
|
||||
d.setTime(d.getTime() + (exdays*24*60*60*1000));
|
||||
var expires = "expires="+ d.toUTCString();
|
||||
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
|
||||
}
|
||||
|
||||
// AccoesPresidenciais = Correspondencia = 0
|
||||
setCookie('searchModalAPPType','0', 99999999);
|
||||
|
||||
this.showLoader = false;
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.profile = "mdgpr";
|
||||
@@ -93,15 +184,66 @@ export class AgendaPage implements OnInit {
|
||||
onViewTitleChanged(title){
|
||||
this.viewTitle = title;
|
||||
}
|
||||
//Show information of the event
|
||||
async onEventSelected(ev: { event: Event}){
|
||||
this.router.navigate(["/home/agenda", ev.event.EventId, 'agenda']);
|
||||
|
||||
currentDayEventDisplayBorder(day: any, id: any){
|
||||
|
||||
const events = day[id].events;
|
||||
if (events.length == 0) {
|
||||
return "";
|
||||
} else if (events.length >= 1) {
|
||||
|
||||
/** @description store all event type */
|
||||
let eventType = {};
|
||||
let eventTypeNum: number;
|
||||
|
||||
events.forEach(element => {
|
||||
eventType[element.calendarName] = 1;
|
||||
});
|
||||
|
||||
eventTypeNum = (Object.keys(eventType)).length
|
||||
|
||||
if (eventTypeNum == 2) {
|
||||
return 'calendar-event-type-both';
|
||||
} else {
|
||||
return 'calendar-event-type-'+(Object.keys(eventType))[0];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
// Show information of the event for timeline
|
||||
eventClicked({ event }: { event: CalendarEvent }): void {
|
||||
console.log('Event clicked', event);
|
||||
this.eventSelectedDate = event.start;
|
||||
this.router.navigate(["/home/agenda", event.id, 'agenda']);
|
||||
}
|
||||
|
||||
//Show information of the event
|
||||
async onEventSelected(ev: { event: Event}){
|
||||
this.viewEventDetail(ev.event.EventId);
|
||||
/* this.router.navigate(["/home/agenda", ev.event.EventId, 'agenda']); */
|
||||
}
|
||||
|
||||
|
||||
onCurrentChanged = (ev: Date) => {
|
||||
this.eventSelectedDate = ev;
|
||||
// timeline change date
|
||||
this.timelineDate = formatDate(ev,'dd MMMM yyyy', 'pt');
|
||||
this.viewDate = new Date(formatDate(ev,'yyyy-MM-dd', 'pt'));
|
||||
// calendar change date
|
||||
console.log('!!this!!')
|
||||
this.eventSelectedDate = new Date(ev);
|
||||
};
|
||||
|
||||
// changedate
|
||||
dropDownChangeDate(id: string){
|
||||
|
||||
const currentCandarDayYear = formatDate(this.eventSelectedDate,'dd -- yyyy', 'pt');
|
||||
const newDate = new Date(currentCandarDayYear.replace('--',id));
|
||||
this.onCurrentChanged(newDate);
|
||||
}
|
||||
|
||||
/* onTimeSelected = (ev: { selectedTime: Date, events: any[] }) => {
|
||||
console.log('Selected time: ' + ev.selectedTime + ', hasEvents: ' + (ev.events !== undefined && ev.events.length !== 0));
|
||||
this.eventSelectedDate2 = ev.selectedTime;
|
||||
@@ -110,6 +252,7 @@ export class AgendaPage implements OnInit {
|
||||
onRangeChanged (ev: { startTime: Date, endTime: Date }) {
|
||||
this.rangeStartDate = ev.startTime;
|
||||
this.rangeEndDate = ev.endTime;
|
||||
console.log('!!!')
|
||||
|
||||
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
||||
};
|
||||
@@ -139,37 +282,83 @@ export class AgendaPage implements OnInit {
|
||||
allDay: false,
|
||||
event: postEvent
|
||||
});
|
||||
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
timeLineTemplate(startTime: string, eventlocation: string, eventDiscription: any, calendarName: string): string{
|
||||
return `
|
||||
<div class="timeline-box timeline-box-${calendarName}">
|
||||
<div>
|
||||
<span class="timeline-start-time">${startTime}</span><span class="timeline-location">${eventlocation}</span>
|
||||
</div>
|
||||
<div class="timeline-event-discription">
|
||||
${eventDiscription.Text}
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
async loadRangeEvents(startTime: Date, endTime: Date){
|
||||
loadRangeEvents(startTime: Date, endTime: Date){
|
||||
|
||||
console.log('Update date');
|
||||
console.log('start ',startTime,' end', endTime)
|
||||
|
||||
this.showTimeline = false;
|
||||
this.showLoader = true;
|
||||
|
||||
switch (this.segment)
|
||||
{
|
||||
case "Combinada":
|
||||
//Inicializa o array eventSource
|
||||
this.eventSource=[];
|
||||
this.events=[];
|
||||
|
||||
|
||||
if(this.profile == "mdgpr"){
|
||||
this.eventService.getAllMdEvents(formatDate(startTime, 'yyyy-MM-dd HH:mm:ss', 'pt'), formatDate(endTime, 'yyyy-MM-dd HH:mm:ss', 'pt')).subscribe(
|
||||
this.eventService.getAllMdEvents(formatDate(startTime, 'yyyy-MM-dd', 'pt'), formatDate(endTime, 'yyyy-MM-dd', 'pt')).subscribe(
|
||||
response => {
|
||||
this.eventsList = response;
|
||||
// loop
|
||||
this.eventsList.forEach(element => {
|
||||
|
||||
this.eventSource.push({
|
||||
title: element.Subject,
|
||||
startTime: new Date(element.StartDate),
|
||||
endTime: new Date(element.EndDate),
|
||||
allDay: false,
|
||||
event: element
|
||||
event: element,
|
||||
calendarName: element.CalendarName
|
||||
});
|
||||
|
||||
const startHours = formatDate(new Date(element.StartDate), 'HH', 'pt');
|
||||
const EndHours = formatDate(new Date(element.EndDate), 'HH', 'pt');
|
||||
|
||||
this.events.push({
|
||||
title: this.timeLineTemplate(startHours, element.Location, element.Body, element.CalendarName),
|
||||
start: setHours(setMinutes(new Date(element.StartDate), 0), parseInt(startHours)),
|
||||
end: setHours(setMinutes(new Date(element.EndDate), 0), parseInt(EndHours)),
|
||||
color: {
|
||||
primary: 'white',
|
||||
secondary: 'white'
|
||||
},
|
||||
id: element.EventId
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
|
||||
this.showLoader = false;
|
||||
this.showTimeline = true;
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
else{
|
||||
this.eventService.getAllPrEvents(formatDate(startTime, 'yyyy-MM-dd HH:mm:ss', 'pt'), formatDate(endTime, 'yyyy-MM-dd HH:mm:ss', 'pt')).subscribe(
|
||||
@@ -213,7 +402,7 @@ export class AgendaPage implements OnInit {
|
||||
}
|
||||
else{
|
||||
this.eventService.getAllPrEvents(formatDate(startTime, 'yyyy-MM-dd HH:mm:ss', 'pt'), formatDate(endTime, 'yyyy-MM-dd HH:mm:ss', 'pt')).subscribe(response => {
|
||||
this.eventsListPessoal = response.filter(data => data.CalendarName == "Pessoal");;
|
||||
this.eventsListPessoal = response.filter(data => data.CalendarName == "Pessoal");
|
||||
this.eventsListPessoal.forEach(element => {
|
||||
this.eventSource.push({
|
||||
title: element.Subject,
|
||||
@@ -267,9 +456,14 @@ export class AgendaPage implements OnInit {
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
actions(){
|
||||
|
||||
}
|
||||
|
||||
doRefresh(ev: any){
|
||||
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
||||
setTimeout(() => {
|
||||
@@ -292,5 +486,56 @@ export class AgendaPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
async openAddEvent() {
|
||||
const modal = await this.modalCtrl.create({
|
||||
component: NewEventPage,
|
||||
componentProps:{
|
||||
segment: this.segment,
|
||||
profile: this.profile,
|
||||
eventSelectedDate: this.eventSelectedDate,
|
||||
},
|
||||
cssClass: 'modal',
|
||||
backdropDismiss: false
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then((data) => {
|
||||
let postEvent: Event = data['data'];
|
||||
if (postEvent.Subject != null)
|
||||
{
|
||||
this.eventSource.push({
|
||||
title: postEvent.Subject,
|
||||
startTime: new Date(postEvent.StartDate),
|
||||
endTime: new Date(postEvent.EndDate),
|
||||
allDay: false,
|
||||
event: postEvent
|
||||
});
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async viewEventDetail(eventId:any) {
|
||||
console.log(this.profile);
|
||||
|
||||
const modal = await this.modalCtrl.create({
|
||||
component: ViewEventPage,
|
||||
componentProps:{
|
||||
eventId: eventId,
|
||||
},
|
||||
cssClass: 'modal',
|
||||
backdropDismiss: false
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then((res)=>{
|
||||
if(res){
|
||||
console.log(res);
|
||||
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -37,48 +37,52 @@ ion-menu{
|
||||
margin-left: 50px;
|
||||
overflow: auto;
|
||||
font-size: 18px;
|
||||
}
|
||||
.content-location{
|
||||
width: 360px;
|
||||
margin: 0 auto;
|
||||
padding: 0;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.location-detail{
|
||||
width: 210px;
|
||||
font-weight: 700;
|
||||
font-size: 18px;
|
||||
float: left;
|
||||
margin: 5px 5px 5px 0px;
|
||||
}
|
||||
.button-calendar-type{
|
||||
width: 91px;
|
||||
--border-radius: 12.5px;
|
||||
--background: #ffb703;
|
||||
margin-left: 5px;
|
||||
.content-location{
|
||||
width: 360px;
|
||||
margin: 0 auto;
|
||||
padding: 0;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.location-detail{
|
||||
width: 210px;
|
||||
font-weight: 700;
|
||||
font-size: 18px;
|
||||
float: left;
|
||||
}
|
||||
.button-calendar-type ion-button{
|
||||
height: 25px;
|
||||
}
|
||||
.button-edit-event {
|
||||
width: 140px;
|
||||
height: 44px;
|
||||
border-radius: 22.5px;
|
||||
--background: #e0e9ee;
|
||||
--color:#061b52;
|
||||
margin: 5px 5px 5px 0px;
|
||||
}
|
||||
.button-calendar-type{
|
||||
width: 91px;
|
||||
--border-radius: 12.5px;
|
||||
--background: #ffb703;
|
||||
margin-left: 5px;
|
||||
float: left;
|
||||
}
|
||||
.button-calendar-type ion-button{
|
||||
height: 25px;
|
||||
}
|
||||
.button-edit-event {
|
||||
width: 140px;
|
||||
height: 44px;
|
||||
border-radius: 22.5px;
|
||||
--background: #e0e9ee;
|
||||
--color:#061b52;
|
||||
}
|
||||
.content-details p{
|
||||
font-size: 16px;
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
.middle-conten{
|
||||
.middle-content h3, .middle-content p{
|
||||
font-size: 16px;
|
||||
}
|
||||
.bottom-content{
|
||||
width: 360px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
}
|
||||
|
||||
.bottom-content{
|
||||
width: 360px;
|
||||
margin: 0 auto;
|
||||
|
||||
.bottom-content h3{
|
||||
font-size: 16px;
|
||||
margin: 0 0 0 10px;
|
||||
@@ -110,6 +114,8 @@ ion-menu{
|
||||
float: right;
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
|
||||
.buttons{
|
||||
width: 360px;
|
||||
margin: 0 auto;
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import { CalendarDateFormatter, DateFormatterParams } from 'angular-calendar';
|
||||
import { formatDate } from '@angular/common';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
@Injectable()
|
||||
export class CustomDateFormatter extends CalendarDateFormatter {
|
||||
// you can override any of the methods defined in the parent class
|
||||
|
||||
public dayViewHour({ date, locale }: DateFormatterParams): string {
|
||||
return formatDate(date, 'HH', locale);
|
||||
}
|
||||
|
||||
public weekViewHour({ date, locale }: DateFormatterParams): string {
|
||||
return this.dayViewHour({ date, locale });
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { EditEventPage } from './edit-event.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: EditEventPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class EditEventPageRoutingModule {}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { EditEventPageRoutingModule } from './edit-event-routing.module';
|
||||
|
||||
import { EditEventPage } from './edit-event.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
EditEventPageRoutingModule
|
||||
],
|
||||
declarations: [EditEventPage]
|
||||
})
|
||||
export class EditEventPageModule {}
|
||||
@@ -0,0 +1,225 @@
|
||||
<ion-header class="ion-no-border">
|
||||
<ion-toolbar class="header-toolbar">
|
||||
<div class="main-header">
|
||||
<div class="title-content">
|
||||
<div class="middle">
|
||||
<ion-label class="title">Editar Evento</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
<div class="main-content">
|
||||
<div class="ion-item-container">
|
||||
<ion-input placeholder="Assunto" [(ngModel)]="postEvent.Subject"></ion-input>
|
||||
</div>
|
||||
<div class="container-div">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-location.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class">
|
||||
<ion-input placeholder="Localização" [(ngModel)]="postEvent.Location"></ion-input>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Error messages -->
|
||||
<!-- <span class="error ion-padding" >
|
||||
Campo obrigatório
|
||||
</span> -->
|
||||
|
||||
</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">
|
||||
<ion-select placeholder="Selecione agenda"
|
||||
selectedText="{{postEvent.CalendarName}}"
|
||||
[(ngModel)]="postEvent.CalendarName"
|
||||
interface="action-sheet" Cancel-text="Cancelar"
|
||||
required>
|
||||
<ion-select-option value="Oficial">Oficial</ion-select-option>
|
||||
<ion-select-option value="Pessoal">Pessoal</ion-select-option>
|
||||
</ion-select>
|
||||
</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">
|
||||
<ion-select placeholder="Selecione tipo"
|
||||
[(ngModel)]="postEvent.EventType"
|
||||
selectedText="{{postEvent.EventType}}"
|
||||
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>
|
||||
</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">
|
||||
<ion-datetime
|
||||
placeholder="Início"
|
||||
[(ngModel)]="postEvent.StartDate"
|
||||
displayFormat="D MMM YYYY H:mm"
|
||||
minuteValues="0,15,30,45"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||
min="2018"
|
||||
max="2022"
|
||||
>
|
||||
</ion-datetime>
|
||||
<!-- <ion-input placeholder="Data início" [(ngModel)]="postData.StartDate"></ion-input> -->
|
||||
</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">
|
||||
<ion-datetime
|
||||
placeholder="Fim"
|
||||
[(ngModel)]="postEvent.EndDate"
|
||||
displayFormat="D MMM YYYY H:mm"
|
||||
minuteValues="0,15,30,45"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||
min="2018"
|
||||
max="2022"
|
||||
>
|
||||
</ion-datetime>
|
||||
<!-- <ion-input placeholder="Data fim" [(ngModel)]="postData.EndDate"></ion-input> -->
|
||||
</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-refresh.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class">
|
||||
<ion-select placeholder="Selecione repetição"
|
||||
[(ngModel)]="postEvent.IsRecurring"
|
||||
selectedText="{{isRecurring}}"
|
||||
interface="action-sheet"
|
||||
Cancel-text="Cancelar" required>
|
||||
<ion-select-option value="false">Não se repete</ion-select-option>
|
||||
<ion-select-option value="true">Repete</ion-select-option>
|
||||
</ion-select>
|
||||
</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-person.svg"></ion-icon>
|
||||
</div>
|
||||
<div (click)="openAttendees()" 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-list>
|
||||
</ion-item>
|
||||
</div>
|
||||
<div class="add-people">
|
||||
<ion-icon slot="start" src="assets/images/icons-arrow-forward.svg"></ion-icon>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div hidden class="container-div">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-people-cc.svg"></ion-icon>
|
||||
</div>
|
||||
<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-list>
|
||||
</ion-item>
|
||||
</div>
|
||||
<div class="add-people">
|
||||
<ion-icon slot="start" src="assets/images/icons-arrow-forward.svg"></ion-icon>
|
||||
</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-description.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class">
|
||||
<ion-input placeholder="Detalhes" [(ngModel)]="postEvent.Body.Text"></ion-input>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div hidden class="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>
|
||||
</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>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
</div>
|
||||
</ion-content>
|
||||
<ion-footer class="ion-no-border">
|
||||
<ion-toolbar class="btn-div">
|
||||
<ion-buttons slot="start">
|
||||
<ion-button class="btn-cancel" fill="clear" color="#061b52" (click)="close()">
|
||||
<ion-label>Cancelar</ion-label>
|
||||
</ion-button>
|
||||
</ion-buttons>
|
||||
<ion-title></ion-title>
|
||||
<ion-buttons slot="end">
|
||||
<ion-button class="btn-ok" fill="clear" color="#fff" (click)="save()">
|
||||
<ion-label>Gravar</ion-label>
|
||||
</ion-button>
|
||||
</ion-buttons>
|
||||
</ion-toolbar>
|
||||
</ion-footer>
|
||||
@@ -0,0 +1,177 @@
|
||||
ion-content{
|
||||
--background:transparent;
|
||||
}
|
||||
.header-toolbar{
|
||||
--background:transparent;
|
||||
--opacity: 1;
|
||||
}
|
||||
.main-header{
|
||||
width: 100%; /* 400px */
|
||||
height: 100%;
|
||||
font-family: Roboto;
|
||||
border-top-left-radius: 25px;
|
||||
border-top-right-radius: 25px;
|
||||
background-color: #fff;
|
||||
overflow:hidden;
|
||||
padding: 30px 20px 0px 20px;
|
||||
color:#000;
|
||||
transform: translate3d(0, 1px, 0);
|
||||
|
||||
.title-content{
|
||||
width: 360px;
|
||||
margin: 0px auto;
|
||||
overflow: auto;
|
||||
padding: 0 !important;
|
||||
background: #fff;
|
||||
.middle{
|
||||
padding: 0!important;
|
||||
float: left;
|
||||
width: 221px;
|
||||
margin: 2.5px 0 0 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.title{
|
||||
font-size: 25px;
|
||||
}
|
||||
|
||||
}
|
||||
.main-content{
|
||||
width: 100%; /* 400px */
|
||||
height: 100%;
|
||||
font-family: Roboto;
|
||||
margin: 0 auto;
|
||||
background-color: #fff;
|
||||
overflow:auto;
|
||||
padding: 15px 20px 0 20px;
|
||||
|
||||
.ion-item-container{
|
||||
width: 360px;
|
||||
margin: 15px auto;
|
||||
border: 1px solid #ebebeb;
|
||||
border-radius: 5px;
|
||||
padding-left: 10px;
|
||||
}
|
||||
.ion-item-container-no-border{
|
||||
width: 100%;
|
||||
margin: 0px auto;
|
||||
padding: 0 !important;
|
||||
overflow: auto;
|
||||
}
|
||||
.container-div{
|
||||
margin-bottom: 15px;
|
||||
overflow: auto;
|
||||
}
|
||||
.ion-item-class-2{
|
||||
width: 360px;
|
||||
margin: 0px auto;
|
||||
}
|
||||
.ion-icon-class{
|
||||
width: 45px;
|
||||
height: 45px;
|
||||
float: left;
|
||||
padding: 10px;
|
||||
font-size: 25px;
|
||||
}
|
||||
ion-select{
|
||||
padding-left: 5px;
|
||||
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;
|
||||
}
|
||||
.ion-input-class-no-height{
|
||||
border: 1px solid #ebebeb;
|
||||
border-radius: 5px;
|
||||
overflow: auto;
|
||||
}
|
||||
.list-people{
|
||||
width: 256px;
|
||||
float: left;
|
||||
|
||||
}
|
||||
.add-people{
|
||||
width: 45px;
|
||||
float: right;
|
||||
overflow: auto;
|
||||
font-size: 25px;
|
||||
padding: 10px;
|
||||
}
|
||||
.list-people-title{
|
||||
/* font-size: 13px; */
|
||||
color: #797979;
|
||||
}
|
||||
.attach-document{
|
||||
font-size: 15px;
|
||||
color: #0d89d1;
|
||||
margin: 5px 5px 5px 10px;
|
||||
padding: 5px;
|
||||
float: left;
|
||||
}
|
||||
.attach-icon{
|
||||
width: 37px;
|
||||
font-size: 35px;
|
||||
float: left;
|
||||
}
|
||||
.attach-title-item{
|
||||
width: 100%;
|
||||
font-size: 15px;
|
||||
color:#0d89d1;
|
||||
}
|
||||
/* SPAN */
|
||||
.span-left{
|
||||
float: left;
|
||||
font-size: 15x;
|
||||
}
|
||||
.span-right{
|
||||
text-align: right;
|
||||
float: right;
|
||||
font-size: 13px;
|
||||
}
|
||||
.container-footer{
|
||||
margin:0 auto;
|
||||
overflow: auto;
|
||||
}
|
||||
.button-cancel {
|
||||
width: 170px;
|
||||
height: 44px;
|
||||
border-radius: 22.5px;
|
||||
--background: #e0e9ee;
|
||||
--color: #061b52;
|
||||
margin:10px;
|
||||
}
|
||||
.button-save {
|
||||
width: 170px;
|
||||
height: 44px;
|
||||
border-radius: 22.5px;
|
||||
--background: #42b9fe;
|
||||
--color:#ffffff;
|
||||
margin:10px;
|
||||
}
|
||||
|
||||
.text-input{
|
||||
width: 100%;
|
||||
border: 1px solid #ebebeb;
|
||||
margin: 0px 15px 15px 0px;
|
||||
padding: 0 !important;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
/* Error Messages */
|
||||
.error{
|
||||
color:red;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
.span-color{
|
||||
color:red;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { EditEventPage } from './edit-event.page';
|
||||
|
||||
describe('EditEventPage', () => {
|
||||
let component: EditEventPage;
|
||||
let fixture: ComponentFixture<EditEventPage>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ EditEventPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(EditEventPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,95 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { AlertController, ModalController, NavParams } from '@ionic/angular';
|
||||
import { AuthConnstants } from 'src/app/config/auth-constants';
|
||||
import { Attachment } from 'src/app/models/attachment.model';
|
||||
import { EventBody } from 'src/app/models/eventbody.model';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { Event } from '../../../models/event.model';
|
||||
import { AttendeesPage } from '../../events/attendees/attendees.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-edit-event',
|
||||
templateUrl: './edit-event.page.html',
|
||||
styleUrls: ['./edit-event.page.scss'],
|
||||
})
|
||||
export class EditEventPage implements OnInit {
|
||||
|
||||
postEvent: Event;
|
||||
isRecurring:string;
|
||||
isEventEdited: boolean;
|
||||
loadedEvent: Event;
|
||||
eventBody: EventBody;
|
||||
segment:string = "true";
|
||||
profile:string;
|
||||
eventAttendees: EventPerson[];
|
||||
selectedSegment: string;
|
||||
selectedDate: Date;
|
||||
minDate: string;
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
private navParams: NavParams,
|
||||
private eventsService: EventsService,
|
||||
private alertService: AlertService,
|
||||
public alertController: AlertController,
|
||||
) {
|
||||
this.isEventEdited = false;
|
||||
this.postEvent = this.navParams.get('event');
|
||||
if(this.postEvent.IsRecurring == false){
|
||||
this.isRecurring = "Não se repete";
|
||||
}
|
||||
else{
|
||||
this.isRecurring = "Repete";
|
||||
}
|
||||
this.profile = this.navParams.get('profile');
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
console.log(this.profile);
|
||||
console.log(this.postEvent);
|
||||
|
||||
}
|
||||
close(){
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
save(){
|
||||
console.log(this.postEvent);
|
||||
|
||||
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.isEventEdited = true;
|
||||
this.modalController.dismiss(this.isEventEdited);
|
||||
}
|
||||
|
||||
async openAttendees()
|
||||
{
|
||||
const modal = await this.modalController.create({
|
||||
component: AttendeesPage,
|
||||
componentProps: {
|
||||
eventAttendees: this.postEvent.Attendees
|
||||
},
|
||||
cssClass: 'attendee',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then((data) => {
|
||||
if (data['data'] != null)
|
||||
{
|
||||
let newattendees: EventPerson[] = data['data'];
|
||||
this.postEvent.Attendees = newattendees;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { NewEventPage } from './new-event.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: NewEventPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class NewEventPageRoutingModule {}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { NewEventPageRoutingModule } from './new-event-routing.module';
|
||||
|
||||
import { NewEventPage } from './new-event.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
NewEventPageRoutingModule
|
||||
],
|
||||
declarations: [NewEventPage]
|
||||
})
|
||||
export class NewEventPageModule {}
|
||||
@@ -0,0 +1,220 @@
|
||||
<ion-header class="ion-no-border">
|
||||
<ion-toolbar class="header-toolbar">
|
||||
<div class="main-header">
|
||||
<div class="title-content">
|
||||
<div class="middle">
|
||||
<ion-label class="title">Novo Evento</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
<div class="main-content">
|
||||
<div class="ion-item-container">
|
||||
<ion-input placeholder="Assunto" [(ngModel)]="postEvent.Subject"></ion-input>
|
||||
</div>
|
||||
<div class="container-div">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-location.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class">
|
||||
<ion-input placeholder="Localização" [(ngModel)]="postEvent.Location"></ion-input>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Error messages -->
|
||||
<!-- <span class="error ion-padding" >
|
||||
Campo obrigatório
|
||||
</span> -->
|
||||
|
||||
</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">
|
||||
<ion-select placeholder="Selecione agenda"
|
||||
selectedText="{{postEvent.CalendarName}}"
|
||||
[(ngModel)]="postEvent.CalendarName"
|
||||
interface="action-sheet" Cancel-text="Cancelar"
|
||||
required>
|
||||
<ion-select-option value="Oficial">Oficial</ion-select-option>
|
||||
<ion-select-option value="Pessoal">Pessoal</ion-select-option>
|
||||
</ion-select>
|
||||
</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">
|
||||
<ion-select placeholder="Selecione tipo"
|
||||
[(ngModel)]="postEvent.EventType"
|
||||
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>
|
||||
</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">
|
||||
<ion-datetime
|
||||
placeholder="Início"
|
||||
[(ngModel)]="postEvent.StartDate"
|
||||
displayFormat="D MMM YYYY H:mm"
|
||||
minuteValues="0,15,30,45"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||
min="2018"
|
||||
max="2022"
|
||||
>
|
||||
</ion-datetime>
|
||||
<!-- <ion-input placeholder="Data início" [(ngModel)]="postData.StartDate"></ion-input> -->
|
||||
</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">
|
||||
<ion-datetime
|
||||
placeholder="Fim"
|
||||
[(ngModel)]="postEvent.EndDate"
|
||||
displayFormat="D MMM YYYY H:mm"
|
||||
minuteValues="0,15,30,45"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||
min="2018"
|
||||
max="2022"
|
||||
>
|
||||
</ion-datetime>
|
||||
<!-- <ion-input placeholder="Data fim" [(ngModel)]="postData.EndDate"></ion-input> -->
|
||||
</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-refresh.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class">
|
||||
<ion-select placeholder="Selecione repetição" value="false" interface="action-sheet" Cancel-text="Cancelar" required>
|
||||
<ion-select-option value="false">Não se repete</ion-select-option>
|
||||
<ion-select-option value="true">Repete</ion-select-option>
|
||||
</ion-select>
|
||||
</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-person.svg"></ion-icon>
|
||||
</div>
|
||||
<div (click)="openAttendees()" class="ion-input-class-no-height">
|
||||
<div class="list-people">
|
||||
<ion-item lines="none">
|
||||
<ion-list>
|
||||
<ion-label class="list-people-title">Adicionar participantes</ion-label>
|
||||
<ion-label hidden >Text</ion-label>
|
||||
</ion-list>
|
||||
</ion-item>
|
||||
</div>
|
||||
<div class="add-people">
|
||||
<ion-icon slot="start" src="assets/images/icons-arrow-forward.svg"></ion-icon>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div hidden class="container-div">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-people-cc.svg"></ion-icon>
|
||||
</div>
|
||||
<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-list>
|
||||
</ion-item>
|
||||
</div>
|
||||
<div class="add-people">
|
||||
<ion-icon slot="start" src="assets/images/icons-arrow-forward.svg"></ion-icon>
|
||||
</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-description.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class">
|
||||
<ion-input placeholder="Detalhes" [(ngModel)]="postEvent.Body.Text"></ion-input>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div hidden class="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>
|
||||
</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>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
</div>
|
||||
</ion-content>
|
||||
<ion-footer class="ion-no-border">
|
||||
<ion-toolbar class="btn-div">
|
||||
<ion-buttons slot="start">
|
||||
<ion-button class="btn-cancel" fill="clear" color="#061b52" (click)="close()">
|
||||
<ion-label>Cancelar</ion-label>
|
||||
</ion-button>
|
||||
</ion-buttons>
|
||||
<ion-title></ion-title>
|
||||
<ion-buttons slot="end">
|
||||
<ion-button class="btn-ok" fill="clear" color="#fff" (click)="save()">
|
||||
<ion-label>Gravar</ion-label>
|
||||
</ion-button>
|
||||
</ion-buttons>
|
||||
</ion-toolbar>
|
||||
</ion-footer>
|
||||
@@ -0,0 +1,178 @@
|
||||
ion-content{
|
||||
--background:transparent;
|
||||
}
|
||||
.header-toolbar{
|
||||
--background:transparent;
|
||||
--opacity: 1;
|
||||
}
|
||||
.main-header{
|
||||
width: 100%; /* 400px */
|
||||
height: 100%;
|
||||
font-family: Roboto;
|
||||
border-top-left-radius: 25px;
|
||||
border-top-right-radius: 25px;
|
||||
background-color: #fff;
|
||||
overflow:hidden;
|
||||
padding: 30px 20px 0px 20px;
|
||||
color:#000;
|
||||
transform: translate3d(0, 1px, 0);
|
||||
|
||||
.title-content{
|
||||
width: 360px;
|
||||
margin: 0px auto;
|
||||
overflow: auto;
|
||||
padding: 0 !important;
|
||||
background: #fff;
|
||||
.middle{
|
||||
padding: 0!important;
|
||||
float: left;
|
||||
width: 221px;
|
||||
margin: 2.5px 0 0 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.title{
|
||||
font-size: 25px;
|
||||
}
|
||||
|
||||
}
|
||||
.main-content{
|
||||
width: 100%; /* 400px */
|
||||
height: 100%;
|
||||
font-family: Roboto;
|
||||
margin: 0 auto;
|
||||
background-color: #fff;
|
||||
overflow:auto;
|
||||
padding: 15px 20px 0 20px;
|
||||
|
||||
.ion-item-container{
|
||||
width: 360px;
|
||||
margin: 15px auto;
|
||||
border: 1px solid #ebebeb;
|
||||
border-radius: 5px;
|
||||
padding-left: 10px;
|
||||
}
|
||||
.ion-item-container-no-border{
|
||||
width: 100%;
|
||||
margin: 0px auto;
|
||||
padding: 0 !important;
|
||||
overflow: auto;
|
||||
}
|
||||
.container-div{
|
||||
margin-bottom: 15px;
|
||||
overflow: auto;
|
||||
}
|
||||
.ion-item-class-2{
|
||||
width: 360px;
|
||||
margin: 0px auto;
|
||||
}
|
||||
.ion-icon-class{
|
||||
width: 45px;
|
||||
height: 45px;
|
||||
float: left;
|
||||
padding: 10px;
|
||||
font-size: 25px;
|
||||
}
|
||||
ion-select{
|
||||
padding-left: 5px;
|
||||
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;
|
||||
}
|
||||
.ion-input-class-no-height{
|
||||
border: 1px solid #ebebeb;
|
||||
border-radius: 5px;
|
||||
overflow: auto;
|
||||
}
|
||||
.list-people{
|
||||
width: 256px;
|
||||
float: left;
|
||||
|
||||
}
|
||||
.add-people{
|
||||
width: 45px;
|
||||
float: right;
|
||||
overflow: auto;
|
||||
font-size: 25px;
|
||||
padding: 10px;
|
||||
}
|
||||
.list-people-title{
|
||||
/* font-size: 13px; */
|
||||
color: #797979;
|
||||
}
|
||||
.attach-document{
|
||||
font-size: 15px;
|
||||
color: #0d89d1;
|
||||
margin: 5px 5px 5px 10px;
|
||||
padding: 5px;
|
||||
float: left;
|
||||
}
|
||||
.attach-icon{
|
||||
width: 37px;
|
||||
font-size: 35px;
|
||||
float: left;
|
||||
}
|
||||
.attach-title-item{
|
||||
width: 100%;
|
||||
font-size: 15px;
|
||||
color:#0d89d1;
|
||||
}
|
||||
/* SPAN */
|
||||
.span-left{
|
||||
float: left;
|
||||
font-size: 15x;
|
||||
}
|
||||
.span-right{
|
||||
text-align: right;
|
||||
float: right;
|
||||
font-size: 13px;
|
||||
}
|
||||
.container-footer{
|
||||
margin:0 auto;
|
||||
overflow: auto;
|
||||
}
|
||||
.button-cancel {
|
||||
width: 170px;
|
||||
height: 44px;
|
||||
border-radius: 22.5px;
|
||||
--background: #e0e9ee;
|
||||
--color: #061b52;
|
||||
margin:10px;
|
||||
}
|
||||
.button-save {
|
||||
width: 170px;
|
||||
height: 44px;
|
||||
border-radius: 22.5px;
|
||||
--background: #42b9fe;
|
||||
--color:#ffffff;
|
||||
margin:10px;
|
||||
}
|
||||
|
||||
.text-input{
|
||||
width: 100%;
|
||||
border: 1px solid #ebebeb;
|
||||
margin: 0px 15px 15px 0px;
|
||||
padding: 0 !important;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
/* Error Messages */
|
||||
.error{
|
||||
color:red;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
.span-color{
|
||||
color:red;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { NewEventPage } from './new-event.page';
|
||||
|
||||
describe('NewEventPage', () => {
|
||||
let component: NewEventPage;
|
||||
let fixture: ComponentFixture<NewEventPage>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ NewEventPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(NewEventPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,130 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController, NavParams } from '@ionic/angular';
|
||||
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 { Event } from '../../../models/event.model';
|
||||
import { AttendeesPage } from '../../events/attendees/attendees.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-new-event',
|
||||
templateUrl: './new-event.page.html',
|
||||
styleUrls: ['./new-event.page.scss'],
|
||||
})
|
||||
export class NewEventPage implements OnInit {
|
||||
postEvent: Event;
|
||||
eventBody: EventBody;
|
||||
segment:string = "true";
|
||||
profile:string;
|
||||
eventAttendees: EventPerson[];
|
||||
selectedSegment: string;
|
||||
selectedDate: Date;
|
||||
minDate: string;
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
private navParams: NavParams,
|
||||
private eventService: EventsService,
|
||||
) {
|
||||
this.postEvent = new Event();
|
||||
this.eventBody = { BodyType : "1", Text : ""};
|
||||
this.postEvent.Body = this.eventBody;
|
||||
this.profile = this.navParams.get('profile');
|
||||
|
||||
this.selectedSegment = this.navParams.get('segment');
|
||||
this.selectedDate = this.navParams.get('eventSelectedDate');
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
console.log(this.profile);
|
||||
|
||||
let selectedStartdDate = this.selectedDate;
|
||||
let selectedEndDate = new Date(this.selectedDate);
|
||||
/* Set + 30minutes to seleted datetime */
|
||||
selectedEndDate.setMinutes(this.selectedDate.getMinutes() + 30) ;
|
||||
this.minDate = this.selectedDate.toString();
|
||||
|
||||
if(this.selectedSegment != "Combinada"){
|
||||
this.postEvent ={
|
||||
EventId: '',
|
||||
Subject: '',
|
||||
Body: this.eventBody,
|
||||
Location: '',
|
||||
CalendarId: '',
|
||||
CalendarName: this.selectedSegment,
|
||||
StartDate: selectedStartdDate,
|
||||
EndDate: new Date(selectedEndDate),
|
||||
EventType: 'Reunião',
|
||||
Attendees: null,
|
||||
IsMeeting: false,
|
||||
IsRecurring: false,
|
||||
AppointmentState: 0,
|
||||
TimeZone: '',
|
||||
Organizer: '',
|
||||
Categories: null,
|
||||
HasAttachments: false,
|
||||
};
|
||||
}
|
||||
else{
|
||||
this.postEvent ={
|
||||
EventId: '',
|
||||
Subject: '',
|
||||
Body: this.eventBody,
|
||||
Location: '',
|
||||
CalendarId: '',
|
||||
CalendarName: 'Oficial',
|
||||
StartDate: selectedStartdDate,
|
||||
EndDate: new Date(selectedEndDate),
|
||||
EventType: 'Reunião',
|
||||
Attendees: null,
|
||||
IsMeeting: false,
|
||||
IsRecurring: false,
|
||||
AppointmentState: 0,
|
||||
TimeZone: '',
|
||||
Organizer: '',
|
||||
Categories: null,
|
||||
HasAttachments: false,
|
||||
};
|
||||
}
|
||||
}
|
||||
close(){
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
save(){
|
||||
console.log(this.postEvent);
|
||||
console.log(this.profile);
|
||||
|
||||
|
||||
if(this.profile=='mdgpr'){
|
||||
this.eventService.postEventMd(this.postEvent, this.postEvent.CalendarName).subscribe();
|
||||
}
|
||||
else if(this.profile=='pr'){
|
||||
this.eventService.postEventPr(this.postEvent, this.postEvent.CalendarName).subscribe();
|
||||
}
|
||||
this.modalController.dismiss(this.postEvent);
|
||||
}
|
||||
|
||||
async openAttendees()
|
||||
{
|
||||
const modal = await this.modalController.create({
|
||||
component: AttendeesPage,
|
||||
componentProps: {
|
||||
eventAttendees: this.postEvent.Attendees
|
||||
},
|
||||
cssClass: 'attendee',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then((data) => {
|
||||
if (data['data'] != null)
|
||||
{
|
||||
let newattendees: EventPerson[] = data['data'];
|
||||
this.postEvent.Attendees = newattendees;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { ViewEventPage } from './view-event.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: ViewEventPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class ViewEventPageRoutingModule {}
|
||||
@@ -0,0 +1,22 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { ViewEventPageRoutingModule } from './view-event-routing.module';
|
||||
|
||||
import { ViewEventPage } from './view-event.page';
|
||||
import { SharedModule } from 'src/app/shared/shared.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
SharedModule,
|
||||
ViewEventPageRoutingModule
|
||||
],
|
||||
declarations: [ViewEventPage]
|
||||
})
|
||||
export class ViewEventPageModule {}
|
||||
@@ -0,0 +1,69 @@
|
||||
<ion-header class="ion-no-border">
|
||||
<ion-toolbar class="header-toolbar">
|
||||
<div class="main-header">
|
||||
<div class="title-content">
|
||||
<div class="left">
|
||||
<ion-icon (click)="close()" slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
|
||||
</div>
|
||||
<div class="middle">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
<div class="main-content">
|
||||
<div class="upper-content">
|
||||
<div class="content-location">
|
||||
<div class="location-detail">
|
||||
<ion-label >{{loadedEvent.Location}}</ion-label>
|
||||
</div>
|
||||
<div class="button-{{profile}}-{{loadedEvent.CalendarName}}">
|
||||
<ion-button class="button-{{profile}}-{{loadedEvent.CalendarName}}" slot="end">{{loadedEvent.CalendarName}}</ion-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-details">
|
||||
<ion-label>
|
||||
<p>{{customDate}}</p>
|
||||
<p>das {{loadedEvent.StartDate | date: 'hh:mm'}} às {{loadedEvent.EndDate | date: 'hh:mm'}}</p>
|
||||
<p *ngIf="!loadedEvent.IsRecurring">(Não se repete)</p>
|
||||
<p *ngIf="loadedEvent.IsRecurring">Repete</p>
|
||||
</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="middle-content">
|
||||
<ion-item class="ion-no-margin ion-no-padding">
|
||||
<ion-label>
|
||||
<h3>Intervenientes</h3>
|
||||
<div *ngFor="let attendee of loadedEvent.Attendees">
|
||||
<p>{{attendee.Name}}</p>
|
||||
</div>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
<ion-item class="ion-no-margin ion-no-padding">
|
||||
<ion-label>
|
||||
<h3>Detalhes</h3>
|
||||
<p>{{loadedEvent.Body.Text}}</p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</div>
|
||||
|
||||
<div *ngIf="loadedAttachments" class="bottom-content">
|
||||
<ion-list>
|
||||
<h3>Documentos Anexados</h3>
|
||||
<ion-item class="ion-no-margin ion-no-padding">
|
||||
<ion-label *ngFor="let attach of loadedAttachments">
|
||||
<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>
|
||||
</ion-content>
|
||||
@@ -0,0 +1,192 @@
|
||||
ion-content{
|
||||
--background:transparent;
|
||||
--padding-top:0px;
|
||||
--padding-start: 20px;
|
||||
--padding-end: 20px;
|
||||
font-size: 18px;
|
||||
}
|
||||
ion-menu{
|
||||
--height: 225px;
|
||||
}
|
||||
.header-toolbar{
|
||||
--background:transparent;
|
||||
--opacity: 1;
|
||||
}
|
||||
.main-header{
|
||||
width: 100%; /* 400px */
|
||||
height: 100%;
|
||||
font-family: Roboto;
|
||||
border-top-left-radius: 25px;
|
||||
border-top-right-radius: 25px;
|
||||
background-color: #fff;
|
||||
overflow:hidden;
|
||||
padding: 30px 0px 0px 0px;
|
||||
color:#000;
|
||||
transform: translate3d(0, 1px, 0);
|
||||
|
||||
.title-content{
|
||||
width: 360px;
|
||||
margin: 0px auto;
|
||||
overflow: auto;
|
||||
padding: 0 !important;
|
||||
background: #fff;
|
||||
|
||||
.left{
|
||||
width: 37px;
|
||||
float: left;
|
||||
font-size: 35px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.middle{
|
||||
width: 230px;
|
||||
padding: 0!important;
|
||||
float: left;
|
||||
margin: 2.5px 0 0 0;
|
||||
}
|
||||
.header-icon-right{
|
||||
width: 45px;
|
||||
font-size: 45px;
|
||||
float: right;
|
||||
overflow: auto;
|
||||
}
|
||||
.div-icon{
|
||||
width: 92px;
|
||||
float: right;
|
||||
overflow: auto;
|
||||
padding: 1px;
|
||||
}
|
||||
.div-icon .edit{
|
||||
font-size: 35px;
|
||||
float: left;
|
||||
}
|
||||
.div-icon .delete{
|
||||
padding: 7px;
|
||||
font-size: 21px;
|
||||
color:#fff;
|
||||
background: #d30606;
|
||||
border-radius: 20px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.title{
|
||||
font-size: 25px;
|
||||
}
|
||||
|
||||
}
|
||||
.main-content{
|
||||
width: 100%; /* 400px */
|
||||
height: 100%;
|
||||
font-family: Roboto;
|
||||
margin: 0 auto;
|
||||
background-color: #fff;
|
||||
overflow:auto;
|
||||
padding: 15px 0px 0 0px;
|
||||
|
||||
.upper-content{
|
||||
margin-left: 50px;
|
||||
overflow: auto;
|
||||
font-size: 18px;
|
||||
|
||||
.content-location{
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
padding: 0;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.location-detail{
|
||||
width: 210px;
|
||||
font-weight: 700;
|
||||
font-size: 18px;
|
||||
float: left;
|
||||
margin: 5px 5px 5px 0px;
|
||||
}
|
||||
.button-mdgpr-Oficial{
|
||||
width: 91px;
|
||||
--border-radius: 20px;
|
||||
--background: #ffb703;
|
||||
margin-left: 5px;
|
||||
float: left;
|
||||
}
|
||||
.button-mdgpr-Pessoal{
|
||||
width: 91px;
|
||||
--border-radius: 20px;
|
||||
--background: #f05d5e;
|
||||
margin-left: 5px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.button-pr-Oficial{
|
||||
width: 91px;
|
||||
--border-radius: 20px;
|
||||
--background: #cbeecb;
|
||||
margin-left: 5px;
|
||||
float: left;
|
||||
}
|
||||
.button-pr-Pessoal{
|
||||
width: 91px;
|
||||
--border-radius: 20px;
|
||||
--background: #cab0dc;
|
||||
margin-left: 5px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
|
||||
.button-calendar-type ion-button{
|
||||
height: 25px;
|
||||
}
|
||||
.button-edit-event {
|
||||
width: 140px;
|
||||
height: 44px;
|
||||
border-radius: 22.5px;
|
||||
--background: #e0e9ee;
|
||||
--color:#061b52;
|
||||
}
|
||||
.content-details p{
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
.middle-conten{
|
||||
.middle-content h3, .middle-content p{
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.bottom-content{
|
||||
width: 360px;
|
||||
margin: 0 auto;
|
||||
|
||||
.bottom-content h3{
|
||||
font-size: 16px;
|
||||
margin: 0 0 0 10px;
|
||||
}
|
||||
.attach-document{
|
||||
font-size: 15px;
|
||||
color: #0d89d1;
|
||||
margin: 5px 5px 5px 10px;
|
||||
padding: 5px;
|
||||
float: left;
|
||||
}
|
||||
.attach-icon{
|
||||
width: 37px;
|
||||
font-size: 35px;
|
||||
float: left;
|
||||
}
|
||||
.attach-title-item{
|
||||
width: 100%;
|
||||
font-size: 15px;
|
||||
color:#0d89d1;
|
||||
}
|
||||
/* SPAN */
|
||||
.span-left{
|
||||
float: left;
|
||||
font-size: 15x;
|
||||
}
|
||||
.span-right{
|
||||
text-align: right;
|
||||
float: right;
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { ViewEventPage } from './view-event.page';
|
||||
|
||||
describe('ViewEventPage', () => {
|
||||
let component: ViewEventPage;
|
||||
let fixture: ComponentFixture<ViewEventPage>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ViewEventPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(ViewEventPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,124 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { AlertController, ModalController, NavParams } from '@ionic/angular';
|
||||
import { AuthConnstants } from 'src/app/config/auth-constants';
|
||||
import { Attachment } from 'src/app/models/attachment.model';
|
||||
import { EventBody } from 'src/app/models/eventbody.model';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { Event } from '../../../models/event.model';
|
||||
import { EditEventPage } from '../edit-event/edit-event.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-view-event',
|
||||
templateUrl: './view-event.page.html',
|
||||
styleUrls: ['./view-event.page.scss'],
|
||||
})
|
||||
export class ViewEventPage implements OnInit {
|
||||
|
||||
loadedEvent: Event;
|
||||
isEventEdited: boolean;
|
||||
eventBody: EventBody;
|
||||
loadedAttachments:any;
|
||||
loadedEventAttachments: Attachment[];
|
||||
pageId: string;
|
||||
showLoader: boolean;
|
||||
|
||||
minDate: Date;
|
||||
|
||||
profile:string;
|
||||
eventId:string;
|
||||
customDate:any;
|
||||
today:any;
|
||||
|
||||
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"];
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
private navParams: NavParams,
|
||||
private eventsService: EventsService,
|
||||
private attachmentsService: AttachmentsService,
|
||||
public alertController: AlertController,
|
||||
)
|
||||
{
|
||||
this.profile = this.navParams.get('profile');
|
||||
this.isEventEdited = false;
|
||||
this.loadedEvent = new Event();
|
||||
this.eventBody = { BodyType : "1", Text : ""};
|
||||
this.loadedEvent.Body = this.eventBody;
|
||||
this.eventId = this.navParams.get('eventId');
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
/* console.log(this.eventId); */
|
||||
this.loadEvent();
|
||||
this.getAttachments();
|
||||
|
||||
}
|
||||
close(){
|
||||
console.log(this.isEventEdited);
|
||||
this.modalController.dismiss(this.isEventEdited);
|
||||
}
|
||||
|
||||
loadEvent(){
|
||||
this.eventsService.getEvent(this.eventId).subscribe(res => {
|
||||
this.loadedEvent = res;
|
||||
|
||||
console.log(res);
|
||||
|
||||
this.today = new Date(res.StartDate);
|
||||
console.log(new Date(this.today));
|
||||
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]);
|
||||
});
|
||||
}
|
||||
deleteEvent(){
|
||||
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0).subscribe(async () =>
|
||||
{
|
||||
const alert = await this.alertController.create({
|
||||
cssClass: 'my-custom-class',
|
||||
header: 'Evento removido',
|
||||
buttons: ['OK']
|
||||
});
|
||||
|
||||
await alert.present();
|
||||
this.close();
|
||||
});
|
||||
}
|
||||
|
||||
getAttachments(){
|
||||
this.attachmentsService.getAttachmentsById(this.eventId).subscribe(res=>{
|
||||
this.loadedAttachments = res;
|
||||
console.log(res);
|
||||
});
|
||||
}
|
||||
|
||||
async editEvent() {
|
||||
/* this.close(); */
|
||||
console.log(this.profile);
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: EditEventPage,
|
||||
componentProps:{
|
||||
event: this.loadedEvent,
|
||||
profile: this.profile,
|
||||
},
|
||||
cssClass: 'modal',
|
||||
backdropDismiss: false
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then((res) => {
|
||||
console.log(res);
|
||||
|
||||
if(res){
|
||||
setTimeout(() => {
|
||||
/* this.loadEvent(); */
|
||||
this.getAttachments();
|
||||
}, 250);
|
||||
this.isEventEdited = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -71,7 +71,8 @@
|
||||
</span> -->
|
||||
<ion-item>
|
||||
<ion-label position="floating">Data Início <span class="span-color">*</span></ion-label>
|
||||
<ion-datetime placeholder="{{postEvent.StartDate | date: 'dd MMM yyyy H:mm'}}" formControlName="startdate" [(ngModel)]="postEvent.StartDate" min="2020" max="2100"
|
||||
<ion-datetime placeholder="{{postEvent.StartDate | date: 'dd MMM yyyy H:mm'}}"
|
||||
formControlName="startdate" [(ngModel)]="postEvent.StartDate" min="2020" max="2100"
|
||||
displayFormat="D MMM YYYY H:mm" minuteValues="0,15,30,45"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||
required>
|
||||
@@ -83,7 +84,8 @@
|
||||
</span> -->
|
||||
<ion-item>
|
||||
<ion-label position="floating">Data Fim <span class="span-color">*</span></ion-label>
|
||||
<ion-datetime placeholder="{{postEvent.EndDate | date: 'dd MMM yyyy H:mm'}}" formControlName="enddate" [(ngModel)]="postEvent.EndDate" min="2020" max="2100"
|
||||
<ion-datetime placeholder="{{postEvent.EndDate | date: 'dd MMM yyyy H:mm'}}"
|
||||
formControlName="enddate" [(ngModel)]="postEvent.EndDate" min="2020" max="2100"
|
||||
displayFormat="D MMM YYYY H:mm" minuteValues="0,15,30,45"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||
required></ion-datetime>
|
||||
|
||||
@@ -46,14 +46,19 @@ export class CalModalPage implements OnInit {
|
||||
|
||||
profile:string;
|
||||
|
||||
constructor(public formBuilder: FormBuilder, private modalCtrl: ModalController, private eventService: EventsService, private alertController:AlertService,
|
||||
private navParams: NavParams) {
|
||||
constructor(
|
||||
public formBuilder: FormBuilder,
|
||||
private modalCtrl: ModalController,
|
||||
private eventService: EventsService,
|
||||
private alertController:AlertService,
|
||||
private navParams: NavParams
|
||||
)
|
||||
{
|
||||
this.postEvent = new Event();
|
||||
this.eventBody = { BodyType : "1", Text : ""};
|
||||
this.postEvent.Body = this.eventBody;
|
||||
this.profile = this.navParams.get('profile');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
|
||||
@@ -26,6 +26,10 @@ const routes: Routes = [
|
||||
},
|
||||
{
|
||||
path: 'messages',
|
||||
loadChildren: () => import('./messages/messages.module').then( m => m.MessagesPageModule)
|
||||
},
|
||||
{
|
||||
path: 'edit-group',
|
||||
loadChildren: () => import('./edit-group/edit-group.module').then( m => m.EditGroupPageModule)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<ion-header>
|
||||
<app-header></app-header>
|
||||
<!-- <app-header></app-header> -->
|
||||
<app-header-no-search></app-header-no-search>
|
||||
</ion-header>
|
||||
<ion-header class="ion-no-border">
|
||||
<ion-toolbar class="bg-blue">
|
||||
@@ -18,11 +19,16 @@
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
<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>
|
||||
<div class="main-content">
|
||||
<ion-toolbar >
|
||||
<ion-segment [(ngModel)]="segment" (ionChange)="onSegmentChange()">
|
||||
<ion-segment-button value="Contactos">
|
||||
Contactos
|
||||
Conversas
|
||||
</ion-segment-button>
|
||||
<ion-segment-button value="Grupos">
|
||||
Grupos
|
||||
@@ -36,13 +42,6 @@
|
||||
<ion-list *ngSwitchCase="'Contactos'">
|
||||
<ion-item-group>
|
||||
<ion-item-sliding>
|
||||
<!-- <ion-item *ngFor="let user of userConnectedList" (click)="openMessages()">
|
||||
<ion-icon slot="start" src="assets/images/icons-chat-chat-40.svg" class="iconschatchat-40"></ion-icon>
|
||||
<div>
|
||||
<h3>{{user.name}}</h3>
|
||||
<p>Podemos marcar reunião para amanha</p>
|
||||
</div>
|
||||
</ion-item> -->
|
||||
<div *ngFor="let dm of userDirectMessages" class="item">
|
||||
<div class="item-icon">
|
||||
<ion-icon class="icon" slot="start" src="assets/images/icons-chat-chat-40.svg"></ion-icon>
|
||||
@@ -56,90 +55,35 @@
|
||||
</span>
|
||||
</ion-label>
|
||||
</div>
|
||||
<div class="item-date">{{dm.lastMessage._updatedAt | date: 'HH:mm'}}</div>
|
||||
<div class="item-date">{{dm._updatedAt | date: 'HH:mm'}}</div>
|
||||
</div>
|
||||
<div class="item-description">
|
||||
<ion-label>{{dm.lastMessage.msg}}</ion-label>
|
||||
<ion-label *ngIf="dm.lastMessage">{{dm.lastMessage.msg}}</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="item">
|
||||
<div class="item-icon">
|
||||
<ion-icon class="icon" slot="start" src="assets/images/icons-chat-chat-40.svg"></ion-icon>
|
||||
</div>
|
||||
<div (click)="openMessages()" class="item-content">
|
||||
<div class="item-title-time">
|
||||
<div class="item-title">
|
||||
<ion-label>Secretário para o sector Agricola</ion-label>
|
||||
</div>
|
||||
<div class="item-date">15:00</div>
|
||||
</div>
|
||||
<div class="item-description">
|
||||
<p>Podemos marcar reunião para amanha</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="item-icon">
|
||||
<ion-icon class="icon" slot="start" src="assets/images/icons-chat-chat-40.svg"></ion-icon>
|
||||
</div>
|
||||
<div (click)="openMessages()" class="item-content">
|
||||
<div class="item-title-time">
|
||||
<div class="item-title">
|
||||
<ion-label>Secretário para o sector Adminstrativo</ion-label>
|
||||
</div>
|
||||
<div class="item-date">15:00</div>
|
||||
</div>
|
||||
<div class="item-description">
|
||||
<p>Podemos marcar reunião para amanha</p>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</ion-item-sliding>
|
||||
</ion-item-group>
|
||||
</ion-list>
|
||||
<ion-list *ngSwitchCase="'Grupos'" >
|
||||
<ion-item-group>
|
||||
<ion-item-sliding>
|
||||
<!-- <ion-item *ngFor="let group of allGroups">
|
||||
<ion-icon slot="start" src="assets/images/icons-chat-group-chat-40.svg" class="iconschatgroup-chat-40"></ion-icon>
|
||||
<div>
|
||||
<h3>{{group.name}}</h3>
|
||||
<p>Grande momento.</p>
|
||||
</div>
|
||||
</ion-item> -->
|
||||
<div *ngFor="let group of allGroups" class="item">
|
||||
<div class="item-icon">
|
||||
<ion-icon class="icon" slot="start" src="assets/images/icons-chat-group-chat-40.svg"></ion-icon>
|
||||
</div>
|
||||
<div (click)="openGroupMessages()" class="item-content">
|
||||
<div (click)="openGroupMessages(group)" class="item-content">
|
||||
<div class="item-title-time">
|
||||
<div class="item-title">
|
||||
<ion-label>{{group.name}}</ion-label>
|
||||
<ion-label>{{group.name.split('-').join(' ')}}</ion-label>
|
||||
</div>
|
||||
<div class="item-date">{{group.lastMessage._updatedAt | date: 'HH:mm'}}</div>
|
||||
<div class="item-date" *ngIf="group.lastMessage">{{group.lastMessage._updatedAt | date: 'HH:mm'}}</div>
|
||||
</div>
|
||||
<div class="item-description">
|
||||
<div class="item-description" *ngIf="group.lastMessage">
|
||||
<ion-label>{{group.lastMessage.u.name}}: {{group.lastMessage.msg}}</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="item">
|
||||
<div class="item-icon">
|
||||
<ion-icon class="icon" slot="start" src="assets/images/icons-chat-group-chat-40.svg"></ion-icon>
|
||||
</div>
|
||||
<div (click)="openGroupMessages()" class="item-content">
|
||||
<div class="item-title-time">
|
||||
<div class="item-title">
|
||||
<ion-label>Secretário para o sector Produtivo</ion-label>
|
||||
</div>
|
||||
<div class="item-date">15:00</div>
|
||||
</div>
|
||||
<div class="item-description">
|
||||
<p>Podemos marcar reunião para amanha</p>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</ion-item-sliding>
|
||||
</ion-item-group>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
@@ -17,12 +17,13 @@ import { NewchatPage } from './newchat/newchat.page';
|
||||
})
|
||||
export class ChatPage implements OnInit {
|
||||
|
||||
showLoader: boolean;
|
||||
|
||||
headers: HttpHeaders;
|
||||
options:any;
|
||||
X_User_Id:any;
|
||||
X_Auth_Token:any;
|
||||
|
||||
showLoader: boolean;
|
||||
loggedUser: any;
|
||||
/* Set segment variable */
|
||||
segment:string;
|
||||
@@ -55,22 +56,55 @@ export class ChatPage implements OnInit {
|
||||
console.log(this.loggedUser);
|
||||
|
||||
});
|
||||
this.doRefresh();
|
||||
this.loadJoinedRooms();
|
||||
this.load();
|
||||
}
|
||||
loadJoinedRooms(){
|
||||
this.chatService.loadJoinedRooms().subscribe(res => {
|
||||
|
||||
onSegmentChange(){
|
||||
this.load();
|
||||
}
|
||||
doRefresh(ev:any){
|
||||
this.load();
|
||||
ev.target.complete();
|
||||
}
|
||||
load(){
|
||||
switch (this.segment)
|
||||
{
|
||||
case "Contactos":
|
||||
this.getDirectMessages();
|
||||
break;
|
||||
|
||||
case "Grupos":
|
||||
this.getGroups();
|
||||
break;
|
||||
}
|
||||
}
|
||||
customRoom(){
|
||||
let params = new HttpParams();
|
||||
params = params.set("types", "c");
|
||||
this.chatService.customsRooms(params).subscribe(res=>{
|
||||
console.log(res);
|
||||
});
|
||||
}
|
||||
onSegmentChange(){
|
||||
this.doRefresh();
|
||||
|
||||
getDirectMessages(){
|
||||
this.showLoader = true;
|
||||
|
||||
this.chatService.getAllDirectMessages().subscribe((res:any)=>{
|
||||
console.log(res.ims);
|
||||
|
||||
this.userDirectMessages = res.ims.sort((a,b)=>{
|
||||
var dateA = new Date(a._updatedAt).getTime();
|
||||
var dateB = new Date(b._updatedAt).getTime();
|
||||
this.showLoader = false;
|
||||
return dateB - dateA;
|
||||
});
|
||||
console.log(this.userDirectMessages);
|
||||
});
|
||||
}
|
||||
doRefresh(){
|
||||
setInterval(()=>{
|
||||
this.getDirectMessages();
|
||||
this.getGroups();
|
||||
}, 2000);
|
||||
getChatMembers(){
|
||||
this.chatService.getMembers(this.userDirectMessages[0]._id).subscribe(res=> {
|
||||
this.dmUsers = res['members'].filter(data => data.username != this.loggedUser.me.username)
|
||||
});
|
||||
}
|
||||
getGroups(){
|
||||
this.showLoader = true;
|
||||
@@ -78,67 +112,18 @@ export class ChatPage implements OnInit {
|
||||
this.privateGroups = res.groups;
|
||||
this.result = this.chatService.getAllUserChannels().subscribe((res:any)=>{
|
||||
this.publicGroups = res.channels;
|
||||
this.allGroups = this.privateGroups.concat(this.publicGroups);
|
||||
this.showLoader = false;
|
||||
let all = this.privateGroups.concat(this.publicGroups);
|
||||
this.allGroups = all.sort((a,b)=>{
|
||||
var dateA = new Date(a._updatedAt).getTime();
|
||||
var dateB = new Date(b._updatedAt).getTime();
|
||||
this.showLoader = false;
|
||||
return dateB - dateA;
|
||||
});
|
||||
console.log(this.allGroups);
|
||||
});
|
||||
});
|
||||
}
|
||||
getDirectMessages(){
|
||||
this.showLoader = true;
|
||||
|
||||
/* this.result = */
|
||||
this.chatService.getAllDirectMessages().subscribe((res:any)=>{
|
||||
console.log(res.ims);
|
||||
|
||||
this.userDirectMessages = res.ims.sort((a,b)=>{
|
||||
var dateA = new Date(a.lastMessage._updatedAt).getTime();
|
||||
var dateB = new Date(b.lastMessage._updatedAt).getTime();
|
||||
return dateB - dateB;
|
||||
});
|
||||
console.log(this.userDirectMessages);
|
||||
|
||||
this.showLoader = false;
|
||||
});
|
||||
}
|
||||
getChatMembers(){
|
||||
this.chatService.getMembers(this.userDirectMessages[0]._id).subscribe(res=> {
|
||||
this.dmUsers = res['members'].filter(data => data.username != this.loggedUser.me.username)
|
||||
/* console.log(res);
|
||||
console.log(this.dmUsers); */
|
||||
});
|
||||
}
|
||||
/* getConnectedChannels(){
|
||||
this.showLoader = true;
|
||||
|
||||
this.result = this.chatService.getAllUserChannels().subscribe((res:any)=>{
|
||||
this.userChannels = res.channels;
|
||||
console.log(res);
|
||||
|
||||
this.showLoader = false;
|
||||
});
|
||||
} */
|
||||
|
||||
/* getConnectedRooms(){
|
||||
this.showLoader = true;
|
||||
|
||||
this.result = this.chatService.getAllRooms().subscribe((res:any)=>{
|
||||
this.userRooms = res.update;
|
||||
console.log(res.update);
|
||||
|
||||
this.showLoader = false;
|
||||
});
|
||||
} */
|
||||
|
||||
/* getConnectedUsers(){
|
||||
this.showLoader = true;
|
||||
|
||||
this.result = this.chatService.getAllConnectedUsers().subscribe((res:any)=>{
|
||||
this.userConnectedList = res.users;
|
||||
|
||||
this.showLoader = false;
|
||||
});
|
||||
} */
|
||||
|
||||
|
||||
async startConversation(selectedUser) {
|
||||
const modal = await this.modalController.create({
|
||||
component: ConversationPage,
|
||||
@@ -183,13 +168,15 @@ export class ChatPage implements OnInit {
|
||||
await modal.present();
|
||||
modal.onDidDismiss();
|
||||
}
|
||||
async openGroupMessages(user:any){
|
||||
async openGroupMessages(room:any){
|
||||
console.log(room);
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: GroupMessagesPage,
|
||||
cssClass: 'group-messages',
|
||||
backdropDismiss: false,
|
||||
componentProps: {
|
||||
user: user,
|
||||
room: room,
|
||||
},
|
||||
});
|
||||
await modal.present();
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { EditGroupPage } from './edit-group.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: EditGroupPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class EditGroupPageRoutingModule {}
|
||||
@@ -0,0 +1,22 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { EditGroupPageRoutingModule } from './edit-group-routing.module';
|
||||
|
||||
import { EditGroupPage } from './edit-group.page';
|
||||
import { SharedModule } from 'src/app/shared/shared.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
SharedModule,
|
||||
EditGroupPageRoutingModule
|
||||
],
|
||||
declarations: [EditGroupPage]
|
||||
})
|
||||
export class EditGroupPageModule {}
|
||||
@@ -0,0 +1,40 @@
|
||||
<ion-header class="ion-no-border">
|
||||
<ion-toolbar class="header-toolbar">
|
||||
<div class="main-header">
|
||||
<div class="title-content">
|
||||
<div class="left">
|
||||
<ion-icon (click)="close()" slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
|
||||
</div>
|
||||
<div class="middle">
|
||||
<ion-label class="title">Alterar assunto</ion-label>
|
||||
</div>
|
||||
<app-btn-seguinte *ngIf="groupName" (click)="changeGroupName()"></app-btn-seguinte>
|
||||
</div>
|
||||
</div>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
<div class="main-content">
|
||||
<div class="item-container">
|
||||
<ion-input [(ngModel)]="groupName" placeholder="Título"></ion-input>
|
||||
</div>
|
||||
<div *ngIf="false" class="item-container-no-border">
|
||||
<ion-checkbox (ionChange)="_ionChange($event)" color="primary"></ion-checkbox>
|
||||
<ion-label>Grupo Ultra-secreto</ion-label>
|
||||
</div>
|
||||
|
||||
<div *ngIf="showDuration" class="container-div">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-duration.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class">
|
||||
<ion-input (click)="showPicker()" [(ngModel)]="displayDuration" placeholder="Duração"></ion-input>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</ion-content>
|
||||
|
||||
@@ -0,0 +1,151 @@
|
||||
ion-content{
|
||||
--background:transparent;
|
||||
}
|
||||
.header-toolbar{
|
||||
--background:transparent;
|
||||
--opacity: 1;
|
||||
}
|
||||
.div-top-header{
|
||||
width: 400px;
|
||||
margin: 0 auto;
|
||||
background-color: #0782c9;
|
||||
overflow: auto;
|
||||
padding-top: 15px;
|
||||
border: 0!important;
|
||||
|
||||
.div-search{
|
||||
font-size: 45px;
|
||||
float: left;
|
||||
margin: 0 0 0 10px
|
||||
}
|
||||
.div-logo{
|
||||
background: transparent;
|
||||
width: 140px;
|
||||
margin: 5px 0 0px 71px;
|
||||
float: left;
|
||||
}
|
||||
.div-logo img{
|
||||
width: 100%;
|
||||
}
|
||||
.div-profile{
|
||||
font-size: 45px;
|
||||
float: right;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
}
|
||||
.main-header{
|
||||
width: 100%; /* 400px */
|
||||
height: 100%;
|
||||
font-family: Roboto;
|
||||
border-top-left-radius: 25px;
|
||||
border-top-right-radius: 25px;
|
||||
background-color: #fff;
|
||||
overflow:hidden;
|
||||
padding: 30px 20px 0px 20px;
|
||||
color:#000;
|
||||
transform: translate3d(0, 1px, 0);
|
||||
|
||||
.title-content{
|
||||
width: 360px;
|
||||
margin: 0px auto;
|
||||
overflow: auto;
|
||||
padding: 0 !important;
|
||||
background: #fff;
|
||||
|
||||
.left{
|
||||
width: 37px;
|
||||
float: left;
|
||||
font-size: 35px;
|
||||
overflow: auto;
|
||||
}
|
||||
.middle{
|
||||
padding: 0!important;
|
||||
float: left;
|
||||
width: 221px;
|
||||
margin: 2.5px 0 0 5px;
|
||||
}
|
||||
.right{
|
||||
padding: 0!important;
|
||||
float: right;
|
||||
font-size: 15px;
|
||||
color: #0782c9;
|
||||
margin: 8px 0 0 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.title{
|
||||
font-size: 25px;
|
||||
}
|
||||
.div-icon{
|
||||
width: 40px;
|
||||
float: right;
|
||||
font-size: 35px;
|
||||
overflow: auto;
|
||||
padding: 1px;
|
||||
}
|
||||
.div-icon ion-icon{
|
||||
float: right;
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
.main-content{
|
||||
width: 100%; /* 400px */
|
||||
height: 100%;
|
||||
font-family: Roboto;
|
||||
margin: 0 auto;
|
||||
background-color: #fff;
|
||||
overflow:auto;
|
||||
padding: 15px 20px 0 20px;
|
||||
|
||||
.item-container{
|
||||
width: 360px;
|
||||
margin: 15px auto;
|
||||
border: 1px solid #ebebeb;
|
||||
border-radius: 5px;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.item-container-no-border{
|
||||
display: flex;
|
||||
width: 360px;
|
||||
margin: 25px auto;
|
||||
border-radius: 5px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.item-container-no-border ion-label{
|
||||
padding-left: 10px;
|
||||
font-size: 12px;
|
||||
color: #000;
|
||||
}
|
||||
}
|
||||
|
||||
.container-div{
|
||||
margin-bottom: 15px;
|
||||
overflow: auto;
|
||||
|
||||
.ion-item-class-2{
|
||||
width: 360px;
|
||||
margin: 0px auto;
|
||||
|
||||
.ion-icon-class{
|
||||
width: 45px;
|
||||
height: 45px;
|
||||
float: left;
|
||||
padding: 10px;
|
||||
font-size: 25px;
|
||||
}
|
||||
}
|
||||
.ion-input-class{
|
||||
width: 315px;
|
||||
height: 45px;
|
||||
border: 1px solid #ebebeb;
|
||||
border-radius: 5px;
|
||||
padding-left: 5px;
|
||||
padding-right: 10px;
|
||||
float: left;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { EditGroupPage } from './edit-group.page';
|
||||
|
||||
describe('EditGroupPage', () => {
|
||||
let component: EditGroupPage;
|
||||
let fixture: ComponentFixture<EditGroupPage>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ EditGroupPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(EditGroupPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,169 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController, NavParams, PickerController } from '@ionic/angular';
|
||||
import { ChatService } from 'src/app/services/chat.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-edit-group',
|
||||
templateUrl: './edit-group.page.html',
|
||||
styleUrls: ['./edit-group.page.scss'],
|
||||
})
|
||||
export class EditGroupPage implements OnInit {
|
||||
showLoader: boolean;
|
||||
displayDuration: any;
|
||||
showDuration: boolean;
|
||||
selectedDuration = ['','',''];
|
||||
groupName:string;
|
||||
room:any;
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
private pickerController: PickerController,
|
||||
private chatService: ChatService,
|
||||
private navParams: NavParams,
|
||||
) {
|
||||
this.room = this.navParams.get('room');
|
||||
this.groupName = this.room.name.split('-').join(' ');
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
console.log(this.room);
|
||||
}
|
||||
|
||||
close(){
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
|
||||
changeGroupName(){
|
||||
if(this.groupName.trim().length > 1){
|
||||
let name = this.groupName.split(' ').join('-');
|
||||
let body = {
|
||||
"roomId": this.room._id,
|
||||
"name": name,
|
||||
}
|
||||
this.chatService.renameGroup(body).subscribe(res=>{
|
||||
this.modalController.dismiss(res['group']);
|
||||
});
|
||||
}
|
||||
else{
|
||||
console.log("Invalid name!");
|
||||
}
|
||||
}
|
||||
_ionChange(event){
|
||||
this.showDuration = event.detail.checked;
|
||||
}
|
||||
async showPicker(){
|
||||
const picker = await this.pickerController.create({
|
||||
cssClass: '',
|
||||
buttons: [
|
||||
{
|
||||
text: 'Cancelar', role: 'cancel', cssClass: 'btn-cancel'
|
||||
},
|
||||
{
|
||||
text: 'Ok',
|
||||
cssClass: 'btn-cancel',
|
||||
handler:(value:any)=>{
|
||||
console.log('button done pressed');
|
||||
this.selectedDuration = [
|
||||
value.days.value,
|
||||
value.hours.value,
|
||||
value.minutes.value,
|
||||
]
|
||||
console.log(this.selectedDuration);
|
||||
if(value.days.value != null && value.hours.value != null && value.minutes.value != null){
|
||||
if(value.days.value > 0){
|
||||
if(value.days.value == 1){
|
||||
if(value.hours.value == 1){
|
||||
this.displayDuration = value.days.value + " day " +
|
||||
value.hours.value + " hora " +
|
||||
value.minutes.value + " minutos";
|
||||
}
|
||||
else{
|
||||
this.displayDuration = value.days.value + " days " +
|
||||
value.hours.value + " horas " +
|
||||
value.minutes.value + " minutos";
|
||||
}
|
||||
}
|
||||
else{
|
||||
if(value.hours.value == 1){
|
||||
this.displayDuration = value.days.value + " days " +
|
||||
value.hours.value + " hora " +
|
||||
value.minutes.value + " minutos";
|
||||
}
|
||||
else{
|
||||
this.displayDuration = value.days.value + " days " +
|
||||
value.hours.value + " horas " +
|
||||
value.minutes.value + " minutos";
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
if(value.hours.value == 1){
|
||||
this.displayDuration = value.hours.value + " hora " +
|
||||
value.minutes.value + " minutos";
|
||||
}
|
||||
else{
|
||||
this.displayDuration = value.hours.value + " horas " +
|
||||
value.minutes.value + " minutos";
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
columns: [
|
||||
{
|
||||
name: 'days',
|
||||
prefix: 'Dias',
|
||||
options: [
|
||||
{ text: '0', value: 0 },
|
||||
{ text: '1', value: 1 },
|
||||
{ text: '2', value: 2 },
|
||||
{ text: '3', value: 3 },
|
||||
{ text: '4', value: 4 },
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'hours',
|
||||
prefix: 'Horas',
|
||||
options: [
|
||||
{ text: '0', value: 0 },
|
||||
{ text: '1', value: 1 },
|
||||
{ text: '2', value: 2 },
|
||||
{ text: '3', value: 3 },
|
||||
{ text: '4', value: 4 },
|
||||
{ text: '5', value: 5 },
|
||||
{ text: '6', value: 6 },
|
||||
{ text: '7', value: 7 },
|
||||
{ text: '8', value: 8 },
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'minutes',
|
||||
prefix: 'Minutos',
|
||||
selectedIndex: 3,
|
||||
options: [
|
||||
{ text: '0', value: 0 },
|
||||
{ text: '5', value: 5 },
|
||||
{ text: '10', value: 10 },
|
||||
{ text: '15', value: 15 },
|
||||
{ text: '20', value: 20 },
|
||||
{ text: '25', value: 25 },
|
||||
{ text: '30', value: 30 },
|
||||
{ text: '35', value: 35 },
|
||||
{ text: '45', value: 45 },
|
||||
{ text: '50', value: 50 },
|
||||
{ text: '55', value: 55 },
|
||||
]
|
||||
}
|
||||
]
|
||||
});
|
||||
await picker.present();
|
||||
picker.onDidDismiss().then(async data =>{
|
||||
let day = await picker.getColumn('days');
|
||||
let hour = await picker.getColumn('hours');
|
||||
let minutes = await picker.getColumn('minutes');
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import { GroupContactsPageRoutingModule } from './group-contacts-routing.module'
|
||||
|
||||
import { GroupContactsPage } from './group-contacts.page';
|
||||
import { SharedModule } from 'src/app/shared/shared.module';
|
||||
import { PipesModule } from 'src/app/pipes/pipes.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -15,6 +16,7 @@ import { SharedModule } from 'src/app/shared/shared.module';
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
SharedModule,
|
||||
PipesModule,
|
||||
GroupContactsPageRoutingModule
|
||||
],
|
||||
declarations: [GroupContactsPage]
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
<div class="div-title">
|
||||
<ion-label class="title">Contactos</ion-label>
|
||||
</div>
|
||||
<app-btn-seguinte (click)="groupMessages()"></app-btn-seguinte>
|
||||
<app-btn-seguinte (click)="createGroup()"></app-btn-seguinte>
|
||||
</div>
|
||||
</div>
|
||||
</ion-toolbar>
|
||||
<ion-toolbar class="toolbar-search">
|
||||
<div class="search">
|
||||
<ion-searchbar (ionChange)="onChange($event)" placeholder="Pesquisar por cantacto" ></ion-searchbar>
|
||||
<ion-searchbar debounce="500" (ionChange)="onChange($event)" placeholder="Pesquisar por cantacto" ></ion-searchbar>
|
||||
</div>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
@@ -25,23 +25,31 @@
|
||||
<ion-refresher-content>
|
||||
</ion-refresher-content>
|
||||
</ion-refresher>
|
||||
<div class="main-content">
|
||||
|
||||
<!-- <ion-list>
|
||||
<ion-item *ngFor="let user of searchedItem">
|
||||
{{user.name}}
|
||||
</ion-item>
|
||||
</ion-list> -->
|
||||
|
||||
|
||||
|
||||
<ion-virtual-scroll [items]="users" approxItemHeight="70px" [headerFn]="separateLetter">
|
||||
<div class="main-content">
|
||||
<div *ngIf="members">
|
||||
<ion-label class="members-label">Contactos selecção:</ion-label>
|
||||
<ion-list class="members-list" *ngFor="let user of members">
|
||||
<div class="members-checkbox">
|
||||
<ion-checkbox checked color="primary"></ion-checkbox>
|
||||
<p>{{user.name}}</p>
|
||||
<ion-icon name="ellipse"></ion-icon>
|
||||
</div>
|
||||
</ion-list>
|
||||
</div>
|
||||
|
||||
<ion-virtual-scroll [items]="users | filter:textSearch: 'name'" approxItemHeight="70px" [headerFn]="separateLetter">
|
||||
|
||||
<div class="item-divider" *virtualHeader="let header">
|
||||
<ion-label>{{header}}</ion-label>
|
||||
</div>
|
||||
|
||||
<div *virtualItem="let user" class="item-checkbox">
|
||||
<ion-checkbox color="primary"></ion-checkbox>
|
||||
<p>{{user.first}} {{user.last}}</p>
|
||||
<ion-checkbox (ionChange)="selectedContact(user)" color="primary"></ion-checkbox>
|
||||
<p>{{user.name}}</p>
|
||||
<ion-icon name="ellipse"></ion-icon>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -84,14 +84,28 @@
|
||||
background-color: #fff;
|
||||
overflow:auto;
|
||||
padding: 0 0 0 0;
|
||||
|
||||
.item-divider{
|
||||
background: #ebebeb;
|
||||
font-size: 15px;
|
||||
margin: 10px 0 10px 0;
|
||||
padding:5px 0 5px 20px;
|
||||
|
||||
.members-label{
|
||||
margin: 10px 20px 10px 20px !important;
|
||||
/* font-size: 15px; */
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.members-checkbox{
|
||||
display: flex;
|
||||
margin: .5px 20px .5px 20px !important;
|
||||
overflow: auto;
|
||||
align-items: center;
|
||||
|
||||
}
|
||||
|
||||
.item-divider{
|
||||
background: #ebebeb;
|
||||
font-size: 15px;
|
||||
margin: 10px 0 10px 0;
|
||||
padding:5px 0 5px 20px;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.item-checkbox{
|
||||
display: flex;
|
||||
@@ -101,13 +115,13 @@
|
||||
|
||||
}
|
||||
|
||||
.item-checkbox ion-checkbox{
|
||||
.item-checkbox ion-checkbox, .members-checkbox ion-checkbox{
|
||||
--border-color: #0d89d1;
|
||||
--background-checked:#0d89d1;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.item-checkbox p{
|
||||
.item-checkbox p, .members-checkbox p{
|
||||
display: block;
|
||||
margin: 0 !important;
|
||||
width: 330px;
|
||||
@@ -116,7 +130,7 @@
|
||||
color: #0d89d1;
|
||||
float: left;
|
||||
}
|
||||
.item-checkbox ion-icon{
|
||||
.item-checkbox ion-icon, .members-checkbox ion-icon{
|
||||
font-size: 10px;
|
||||
float: left;
|
||||
color:#99e47b;
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { ModalController, NavParams } from '@ionic/angular';
|
||||
import * as _ from 'lodash';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { ChatService } from 'src/app/services/chat.service';
|
||||
import { NewGroupPage } from '../../new-group/new-group.page';
|
||||
import { GroupMessagesPage } from '../group-messages.page';
|
||||
|
||||
@Component({
|
||||
@@ -10,112 +14,83 @@ import { GroupMessagesPage } from '../group-messages.page';
|
||||
})
|
||||
export class GroupContactsPage implements OnInit {
|
||||
showLoader: boolean;
|
||||
loggedUser: any;
|
||||
users = [];
|
||||
|
||||
contact: string[] = [" Ana M.", "Andre F.", "Bruno G.", "Catarina T", "Tiago"];
|
||||
|
||||
headers: HttpHeaders;
|
||||
options:any;
|
||||
|
||||
contacts: Contact[] = [
|
||||
{
|
||||
first: 'Ana',
|
||||
last: 'Manuel',
|
||||
url: 'https://randomuser.me/api/portraits/med/women/54.jpg',
|
||||
},
|
||||
{
|
||||
first: 'Abdullah',
|
||||
last: 'Hill',
|
||||
url: 'https://randomuser.me/api/portraits/med/women/54.jpg',
|
||||
},
|
||||
{
|
||||
first: 'Batur',
|
||||
last: 'Oymen',
|
||||
url: 'https://randomuser.me/api/portraits/med/women/54.jpg',
|
||||
},
|
||||
{
|
||||
first: 'Bianca',
|
||||
last: 'Costa',
|
||||
url: 'https://randomuser.me/api/portraits/med/women/54.jpg',
|
||||
},
|
||||
{
|
||||
first: 'Zaya',
|
||||
last: 'Mary',
|
||||
url: 'https://randomuser.me/api/portraits/med/women/54.jpg',
|
||||
},
|
||||
{
|
||||
first: 'Tiago',
|
||||
last: 'Kayaya',
|
||||
url: 'https://randomuser.me/api/portraits/med/women/54.jpg',
|
||||
}
|
||||
];
|
||||
listContacts: any[];
|
||||
contacts: any;
|
||||
textSearch:string;
|
||||
room:any;
|
||||
members:any;
|
||||
dm:any;
|
||||
isGroupCreated:boolean;
|
||||
groupName:string;
|
||||
selectedUserList:any;
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
private http: HttpClient,
|
||||
private chatService: ChatService,
|
||||
private authService: AuthService,
|
||||
private navParams: NavParams,
|
||||
)
|
||||
{
|
||||
this.headers = new HttpHeaders();
|
||||
this.headers = this.headers.set('Access-Control-Allow-Origin' , '*');
|
||||
this.headers = this.headers.set('Access-Control-Allow-Methods', 'POST, GET, OPTIONS, PUT');
|
||||
this.headers = this.headers.set('Accept','application/json');
|
||||
this.headers = this.headers.set('content-type','application/json');
|
||||
|
||||
|
||||
{
|
||||
this.authService.userData$.subscribe((res:any)=>{
|
||||
this.loggedUser=res;
|
||||
});
|
||||
this.textSearch="";
|
||||
this.dm=null;
|
||||
this.room=null;
|
||||
this.isGroupCreated = this.navParams.get('isCreated');
|
||||
this.groupName = this.navParams.get('name');
|
||||
this.room = this.navParams.get('room');
|
||||
this.members = this.navParams.get('members');
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.loadUsers();
|
||||
|
||||
console.log(this.groupName);
|
||||
console.log(this.isGroupCreated);
|
||||
}
|
||||
|
||||
loadUsers(){
|
||||
this.options = {
|
||||
headers: this.headers,
|
||||
};
|
||||
/* this.http.get('https://randomuser.me/api/?results=100', this.options)
|
||||
.subscribe(res => {
|
||||
this.users = res['results'].sort((a,b) => {
|
||||
if(a.name.first < b.name.first){
|
||||
this.chatService.getAllUsers().subscribe((res:any)=>{
|
||||
if(this.members){
|
||||
this.contacts = res.users.filter(f => !this.members.some(item => item._id === f._id));
|
||||
}
|
||||
else{
|
||||
this.contacts = res.users.filter(data => data.username != this.loggedUser.me.username);
|
||||
}
|
||||
|
||||
this.users = this.contacts.sort((a,b) => {
|
||||
if(a.name < b.name){
|
||||
return -1;
|
||||
}
|
||||
if(a.name.first > b.name.first){
|
||||
if(a.name > b.name){
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
console.log(res);
|
||||
console.log(this.users);
|
||||
}); */
|
||||
this.users = this.contacts.sort((a,b) => {
|
||||
if(a.first < b.first){
|
||||
return -1;
|
||||
}
|
||||
if(a.first > b.first){
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
||||
this.showLoader = false;
|
||||
});
|
||||
}
|
||||
|
||||
separateLetter(record, recordIndex, records){
|
||||
/* if(recordIndex == 0){
|
||||
return record.name.first[0];
|
||||
}
|
||||
|
||||
let first_prev = records[recordIndex - 1].name.first[0];
|
||||
let first_current = record.name.first[0];
|
||||
|
||||
if(first_prev != first_current){
|
||||
return first_current;
|
||||
}
|
||||
return null; */
|
||||
if(recordIndex == 0){
|
||||
return record.first[0];
|
||||
return record.name[0];
|
||||
}
|
||||
|
||||
let first_prev = records[recordIndex - 1].first[0];
|
||||
let first_current = record.first[0];
|
||||
let first_prev = records[recordIndex - 1].name[0];
|
||||
let first_current = record.name[0];
|
||||
|
||||
if(first_prev != first_current){
|
||||
return first_current;
|
||||
@@ -126,26 +101,110 @@ export class GroupContactsPage implements OnInit {
|
||||
doRefresh(event){
|
||||
|
||||
}
|
||||
close(){
|
||||
|
||||
async close(){
|
||||
this.modalController.dismiss();
|
||||
if(this.isGroupCreated){
|
||||
console.log('go to conversa');
|
||||
}
|
||||
else{
|
||||
this.modalController.dismiss();
|
||||
console.log('go to new group page');
|
||||
const modal = await this.modalController.create({
|
||||
component: NewGroupPage,
|
||||
componentProps: {
|
||||
name:this.groupName,
|
||||
duration:'',
|
||||
},
|
||||
cssClass: 'new-group',
|
||||
backdropDismiss: false,
|
||||
});
|
||||
await modal.present();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
onChange(event){
|
||||
|
||||
this.textSearch = event.detail.value;
|
||||
}
|
||||
clicked(){
|
||||
console.log('clicked');
|
||||
|
||||
}
|
||||
async groupMessages(){
|
||||
selectedContact(user:any){
|
||||
/* this.groupName = this.room.name; */
|
||||
user.isChecked = !user.isChecked;
|
||||
|
||||
|
||||
}
|
||||
addContacts(room:any){
|
||||
console.log(room);
|
||||
this.selectedUserList = this.users.filter(function(contact) {
|
||||
return contact.isChecked == true;
|
||||
});
|
||||
console.log( this.selectedUserList);
|
||||
this.selectedUserList.forEach(user=>{
|
||||
let body ={
|
||||
"roomId":room._id,
|
||||
"userId":user._id,
|
||||
|
||||
}
|
||||
this.chatService.addUserToGroup(body).subscribe(res=>{
|
||||
console.log(res['success']);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
createGroup(){
|
||||
if(!this.isGroupCreated){
|
||||
/* this.close(); */
|
||||
let body = { "name":this.groupName, }
|
||||
this.chatService.addGroup(body).subscribe(res=>{
|
||||
console.log('group created');
|
||||
console.log(res['group']);
|
||||
this.addContacts(res['group']);
|
||||
this.openGroupMessages(res['group']);
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
else{
|
||||
this.addContacts(this.room);
|
||||
this.close();
|
||||
/* this.openGroupMessages(this.room); */
|
||||
/* this.chatService.getGroupInfo(this.room._id).subscribe(res=>{
|
||||
console.log(res);
|
||||
|
||||
this.addContacts(res['group']);
|
||||
this.openGroupMessages(res['group']);
|
||||
}) */
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
async newGroup(){
|
||||
this.close();
|
||||
const modal = await this.modalController.create({
|
||||
component: NewGroupPage,
|
||||
cssClass: 'new-group',
|
||||
backdropDismiss: false,
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss();
|
||||
}
|
||||
|
||||
async openGroupMessages(room:any){
|
||||
this.close();
|
||||
const modal = await this.modalController.create({
|
||||
component: GroupMessagesPage,
|
||||
componentProps: {},
|
||||
cssClass: 'contacts',
|
||||
componentProps: {
|
||||
room: room,
|
||||
},
|
||||
cssClass: 'group-messages',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss();
|
||||
}
|
||||
|
||||
|
||||
@@ -4,19 +4,19 @@
|
||||
<div class="header-top">
|
||||
<app-btn-modal-dismiss></app-btn-modal-dismiss>
|
||||
<div class="middle">
|
||||
<ion-label class="title">Grupo de Trabalho A</ion-label>
|
||||
<ion-label class="title">{{roomName}}</ion-label>
|
||||
</div>
|
||||
<div class="right">
|
||||
<ion-icon (click)="openOptions()" src="assets/images/icons-menu.svg"></ion-icon>
|
||||
</div>
|
||||
</div>
|
||||
<div class="header-bottom">
|
||||
<div (click)="addContacts()" class="header-bottom">
|
||||
<div class="header-bottom-icon">
|
||||
<ion-icon (click)="addContacts()" src="assets/icon/icons-user.svg"></ion-icon>
|
||||
<ion-icon src="assets/icon/icons-user.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="header-bottom-contacts">
|
||||
<ion-label *ngFor="let contact of contacts" >
|
||||
{{contact}}
|
||||
<ion-label *ngFor="let member of members" >
|
||||
{{member.name}},
|
||||
</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
@@ -26,65 +26,27 @@
|
||||
|
||||
|
||||
<ion-content>
|
||||
<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>
|
||||
<div class="welcome-text">
|
||||
<ion-label>Esta conversa passou a grupo</ion-label><br />
|
||||
<ion-label>A conversa original mantêm-se como chat individual</ion-label>
|
||||
</div>
|
||||
<div class="messages">
|
||||
<div class="incoming">
|
||||
<div *ngFor="let msg of messages" class="messages">
|
||||
<div *ngIf="msg.t != 'r'" class='incoming-{{msg.u.username!=loggedUser.me.username}}'>
|
||||
<div class="title">
|
||||
<ion-label>Secretário Assuntos sociais</ion-label>
|
||||
<span class="time">14:23</span>
|
||||
<ion-label>{{msg.u.name}}</ion-label>
|
||||
<span class="time">{{msg._updatedAt | date: 'HH:mm' }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<img src='assets/images/1.jpg' tappable>
|
||||
<ion-label hidden >Investidura Filipe Nyusi</ion-label>
|
||||
<ion-label>{{msg.msg}}</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="incoming">
|
||||
<div class="title">
|
||||
<ion-label>Secretário Assuntos sociais</ion-label>
|
||||
<span class="time">14:23</span>
|
||||
</div>
|
||||
<div>
|
||||
<ion-label>Caros colegas, partilho o momento de confraternização do presidente Filipe Nyusi e de dua excelência, o presidente da república</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="incoming">
|
||||
<div class="title">
|
||||
<ion-label>Presidente da República</ion-label>
|
||||
<span class="time">14:23</span>
|
||||
</div>
|
||||
<div>
|
||||
<ion-label>Pois é, momentos históricos</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="outgoing">
|
||||
<div class="title">
|
||||
<ion-label>Ministro do interior</ion-label>
|
||||
<span class="time">16:23</span>
|
||||
</div>
|
||||
<div>
|
||||
<ion-label>Grande momento</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="incoming">
|
||||
<div class="title">
|
||||
<ion-label>Secretário Assuntos sociais</ion-label>
|
||||
<span class="time">14:23</span>
|
||||
</div>
|
||||
<div>
|
||||
<ion-label>Caros colegas, partilho o momento de confraternização do presidente Filipe Nyusi e de dua excelência, o presidente da república</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="outgoing">
|
||||
<div class="title">
|
||||
<ion-label>Secretário Assuntos sociais</ion-label>
|
||||
<span class="time">14:23</span>
|
||||
</div>
|
||||
<div>
|
||||
<ion-label>Caros colegas, partilho o momento de confraternização do presidente Filipe Nyusi e de dua excelência, o presidente da república</ion-label>
|
||||
</div>
|
||||
<div *ngIf="msg.t == 'r'" class="info-text">
|
||||
<ion-label>Alterou o assunto de para "{{msg.msg.split('-').join(' ')}}"</ion-label><br />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -106,7 +68,7 @@
|
||||
<ion-col size="2">
|
||||
<!-- [disabled]="message === ''" -->
|
||||
<ion-label>
|
||||
<ion-icon class="chat-icon-send" src="assets/icon/icons-chat-send.svg"></ion-icon>
|
||||
<ion-icon (click)="sendMessage()" class="chat-icon-send" src="assets/icon/icons-chat-send.svg"></ion-icon>
|
||||
</ion-label>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
|
||||
@@ -90,25 +90,37 @@
|
||||
margin: 20px 39px 25px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
.info-text{
|
||||
/* width: 322px; */
|
||||
width: em(422px);
|
||||
background: #fef4c5;
|
||||
text-align: center;
|
||||
font-size: 13px;
|
||||
color: #262420;
|
||||
padding: 10px;
|
||||
margin: 10px auto;
|
||||
line-height: 1.2rem;
|
||||
/* margin: 15px 0px 15px 0px; */
|
||||
border-radius: 8px;
|
||||
}
|
||||
.messages{
|
||||
font-size: 13px;
|
||||
font-family: Roboto;
|
||||
overflow: auto;
|
||||
|
||||
.incoming, .outgoing{
|
||||
.incoming-true, .incoming-false{
|
||||
width: 305px;
|
||||
padding: 15px 20px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.incoming{
|
||||
.incoming-true{
|
||||
margin: 10px 75px 10px 20px;
|
||||
background: #ebebeb;
|
||||
float: left;
|
||||
|
||||
}
|
||||
}
|
||||
.outgoing{
|
||||
.incoming-false{
|
||||
margin: 10px 20px 10px 75px;
|
||||
background: #e4f4fe;
|
||||
float: right;
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActionSheetController, MenuController, ModalController, PopoverController } from '@ionic/angular';
|
||||
import { ActionSheetController, MenuController, ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { ChatService } from 'src/app/services/chat.service';
|
||||
import { ChatOptionsPopoverPage } from 'src/app/shared/popover/chat-options-popover/chat-options-popover.page';
|
||||
import { ChatPopoverPage } from 'src/app/shared/popover/chat-popover/chat-popover.page';
|
||||
import { ContactsPage } from '../new-group/contacts/contacts.page';
|
||||
import { NewGroupPage } from '../new-group/new-group.page';
|
||||
import { GroupContactsPage } from './group-contacts/group-contacts.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-group-messages',
|
||||
@@ -11,8 +14,16 @@ import { NewGroupPage } from '../new-group/new-group.page';
|
||||
styleUrls: ['./group-messages.page.scss'],
|
||||
})
|
||||
export class GroupMessagesPage implements OnInit {
|
||||
|
||||
showLoader: boolean;
|
||||
isGroupCreated:boolean;
|
||||
loggedUser: any;
|
||||
message:any;
|
||||
messages:any;
|
||||
|
||||
|
||||
room:any;
|
||||
roomName:any;
|
||||
members:any;
|
||||
contacts: string[] = [" Ana M.", "Andre F.", "Bruno G.", "Catarina T", "Tiago"];
|
||||
|
||||
constructor(
|
||||
@@ -20,12 +31,147 @@ export class GroupMessagesPage implements OnInit {
|
||||
private modalController: ModalController,
|
||||
private actionSheetController: ActionSheetController,
|
||||
public popoverController: PopoverController,
|
||||
) { }
|
||||
|
||||
ngOnInit() {
|
||||
private chatService: ChatService,
|
||||
private navParams: NavParams,
|
||||
private authService: AuthService,
|
||||
) {
|
||||
this.isGroupCreated = true;
|
||||
this.room = this.navParams.get('room');
|
||||
this.roomName = this.room.name.split('-').join(' ');
|
||||
}
|
||||
|
||||
async actionSheet() {
|
||||
ngOnInit() {
|
||||
this.authService.userData$.subscribe((res:any)=>{
|
||||
this.loggedUser=res;
|
||||
console.log(this.loggedUser);
|
||||
});
|
||||
this.load();
|
||||
}
|
||||
load(){
|
||||
this.getGroupContacts();
|
||||
this.loadGroupMessages();
|
||||
}
|
||||
|
||||
close(){
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
|
||||
doRefresh(ev:any){
|
||||
this.load();
|
||||
ev.target.complete();
|
||||
}
|
||||
|
||||
getGroupContacts(){
|
||||
this.showLoader = true;
|
||||
//If group is private call getGroupMembers
|
||||
if(this.room.t === 'p'){
|
||||
this.chatService.getGroupMembers(this.room._id).subscribe(res=>{
|
||||
console.log(res);
|
||||
this.members = res['members'];
|
||||
this.showLoader = false;
|
||||
});
|
||||
}
|
||||
//Otherwise call getChannelMembers for públic groups
|
||||
else{
|
||||
this.chatService.getChannelMembers(this.room._id).subscribe(res=>{
|
||||
console.log(res);
|
||||
this.members = res['members'];
|
||||
this.showLoader = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
loadGroupMessages(){
|
||||
this.showLoader = true;
|
||||
//If group is private call getGroupMembers
|
||||
if(this.room.t === 'p'){
|
||||
this.chatService.getPrivateGroupMessages(this.room._id).subscribe(res=>{
|
||||
console.log(res);
|
||||
let msgOnly = res['messages'].filter(data => data.t != 'au');
|
||||
this.messages = msgOnly.reverse();
|
||||
this.showLoader = false;
|
||||
});
|
||||
}
|
||||
//Otherwise call getChannelMembers for públic groups
|
||||
else{
|
||||
this.chatService.getPublicGroupMessages(this.room._id).subscribe(res=>{
|
||||
console.log(res);
|
||||
this.messages = res['messages'].reverse();
|
||||
});
|
||||
}
|
||||
}
|
||||
sendMessage(){
|
||||
|
||||
let body = {
|
||||
"message":
|
||||
{
|
||||
"rid": this.room._id, "msg": this.message
|
||||
}
|
||||
}
|
||||
|
||||
this.chatService.sendMessage(body).subscribe(res=> {
|
||||
this.loadGroupMessages();
|
||||
});
|
||||
this.message = "";
|
||||
}
|
||||
|
||||
async openOptions(ev: any) {
|
||||
const popover = await this.popoverController.create({
|
||||
component: ChatPopoverPage,
|
||||
cssClass: 'chat-popover',
|
||||
event: ev,
|
||||
componentProps: {
|
||||
room: this.room,
|
||||
},
|
||||
translucent: true
|
||||
});
|
||||
await popover.present();
|
||||
popover.onDidDismiss().then(res=>{
|
||||
console.log(res);
|
||||
if(res.data){
|
||||
this.roomName = res.data.name.split('-').join(' ');
|
||||
console.log(this.roomName);
|
||||
|
||||
this.load();
|
||||
/* this.modalController.dismiss(); */
|
||||
};
|
||||
|
||||
});
|
||||
}
|
||||
async openChatOptions(ev: any) {
|
||||
const popover = await this.popoverController.create({
|
||||
component: ChatOptionsPopoverPage,
|
||||
cssClass: 'chat-options-popover',
|
||||
event: ev,
|
||||
componentProps: {
|
||||
room: this.room,
|
||||
},
|
||||
translucent: true
|
||||
});
|
||||
return await popover.present();
|
||||
}
|
||||
async addContacts(){
|
||||
console.log(this.members);
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: GroupContactsPage,
|
||||
componentProps: {
|
||||
isCreated: this.isGroupCreated,
|
||||
room: this.room,
|
||||
members: this.members,
|
||||
name: this.room.name,
|
||||
},
|
||||
cssClass: 'contacts',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then(()=>{
|
||||
this.load();
|
||||
});
|
||||
}
|
||||
|
||||
/* async actionSheet() {
|
||||
const actionSheet = await this.actionSheetController.create({
|
||||
cssClass: 'my-custom-class',
|
||||
buttons: [{
|
||||
@@ -34,9 +180,10 @@ export class GroupMessagesPage implements OnInit {
|
||||
console.log('Delete clicked');
|
||||
}
|
||||
}, {
|
||||
text: 'Alterar nome do grupo',
|
||||
text: 'Alterar nome do grupo1',
|
||||
handler: () => {
|
||||
console.log('Share clicked');
|
||||
console.log('Alterar nome do grupo');
|
||||
this.openChangeGroupName()
|
||||
}
|
||||
}, {
|
||||
text: 'Apagar o grupo',
|
||||
@@ -48,37 +195,6 @@ export class GroupMessagesPage implements OnInit {
|
||||
});
|
||||
await actionSheet.present();
|
||||
}
|
||||
|
||||
async openOptions(ev: any) {
|
||||
const popover = await this.popoverController.create({
|
||||
component: ChatPopoverPage,
|
||||
cssClass: 'chat-popover',
|
||||
event: ev,
|
||||
translucent: true
|
||||
});
|
||||
return await popover.present();
|
||||
}
|
||||
async openChatOptions(ev: any) {
|
||||
const popover = await this.popoverController.create({
|
||||
component: ChatOptionsPopoverPage,
|
||||
cssClass: 'chat-options-popover',
|
||||
event: ev,
|
||||
translucent: true
|
||||
});
|
||||
return await popover.present();
|
||||
}
|
||||
async addContacts(){
|
||||
const modal = await this.modalController.create({
|
||||
component: ContactsPage,
|
||||
componentProps: {},
|
||||
cssClass: 'contacts',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss();
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
<div class="main-header">
|
||||
<div class="header-top">
|
||||
<app-btn-modal-dismiss></app-btn-modal-dismiss>
|
||||
<div class="middle">
|
||||
<ion-label class="title" *ngFor="let users of dmUsers">{{users.name}}</ion-label>
|
||||
<span *ngIf="userPresence =='online'"><ion-icon class="user-status-online" name="ellipse"></ion-icon></span>
|
||||
<div class="middle" *ngFor="let users of dmUsers">
|
||||
<ion-label class="title">{{users.name}}</ion-label>
|
||||
<span><ion-icon class="{{users.status}}" name="ellipse"></ion-icon></span>
|
||||
</div>
|
||||
<div class="right">
|
||||
<ion-icon (click)="openMessagesOptions()" src="assets/images/icons-menu.svg"></ion-icon>
|
||||
@@ -24,6 +24,11 @@
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
<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>
|
||||
<div class="messages" #scrollMe>
|
||||
<!-- <ion-infinite-scroll position="top" threshold="25%" (ionInfinite)="loadMoreMessages($event)">
|
||||
<ion-infinite-scroll-content loadindSpiniter="crescent" loadingText="Carregando...">
|
||||
@@ -49,42 +54,6 @@
|
||||
<ion-label>{{msg.msg}}</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="incoming">
|
||||
<div class="title">
|
||||
<ion-label>Presidente da República</ion-label>
|
||||
<span class="time">14:23</span>
|
||||
</div>
|
||||
<div>
|
||||
<ion-label>Pois é, momentos históricos</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="outgoing">
|
||||
<div class="title">
|
||||
<ion-label>Ministro do interior</ion-label>
|
||||
<span class="time">16:23</span>
|
||||
</div>
|
||||
<div>
|
||||
<ion-label>Grande momento</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="incoming">
|
||||
<div class="title">
|
||||
<ion-label>Secretário Assuntos sociais</ion-label>
|
||||
<span class="time">14:23</span>
|
||||
</div>
|
||||
<div>
|
||||
<ion-label>Caros colegas, partilho o momento de confraternização do presidente Filipe Nyusi e de dua excelência, o presidente da república</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="outgoing">
|
||||
<div class="title">
|
||||
<ion-label>Secretário Assuntos sociais</ion-label>
|
||||
<span class="time">14:23</span>
|
||||
</div>
|
||||
<div>
|
||||
<ion-label>Caros colegas, partilho o momento de confraternização do presidente Filipe Nyusi e de dua excelência, o presidente da república</ion-label>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
|
||||
@@ -116,14 +116,12 @@
|
||||
width: 305px;
|
||||
padding: 15px 20px;
|
||||
border-radius: 10px;
|
||||
|
||||
}
|
||||
|
||||
.incoming-true{
|
||||
margin: 10px 75px 10px 20px;
|
||||
background: #ebebeb;
|
||||
float: left;
|
||||
|
||||
}
|
||||
}
|
||||
.incoming-false{
|
||||
@@ -177,6 +175,7 @@
|
||||
align-self: center;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.text-color-blue{
|
||||
@@ -191,4 +190,34 @@
|
||||
color:#99e47b;
|
||||
padding-left: 10px;
|
||||
}
|
||||
.online{
|
||||
display: block;
|
||||
float: left;
|
||||
color:#99e47b;
|
||||
padding-left: 10px;
|
||||
}
|
||||
.offline{
|
||||
color:#cbced1;
|
||||
display: block;
|
||||
float: left;
|
||||
padding-left: 10px;
|
||||
}
|
||||
.away{
|
||||
color:#ffd21f;
|
||||
display: block;
|
||||
float: left;
|
||||
padding-left: 10px;
|
||||
}
|
||||
.invisible{
|
||||
color:#cbced1;
|
||||
display: block;
|
||||
float: left;
|
||||
padding-left: 10px;
|
||||
}
|
||||
.busy{
|
||||
color:#f5455c;
|
||||
display: block;
|
||||
float: left;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import { ContactsPage } from '../new-group/contacts/contacts.page';
|
||||
styleUrls: ['./messages.page.scss'],
|
||||
})
|
||||
export class MessagesPage implements OnInit, AfterViewChecked {
|
||||
showLoader: boolean;
|
||||
|
||||
@ViewChild('scrollMe') private myScrollContainer: ElementRef;
|
||||
|
||||
@@ -43,22 +44,21 @@ export class MessagesPage implements OnInit, AfterViewChecked {
|
||||
this.loggedUser=res;
|
||||
console.log(this.loggedUser);
|
||||
});
|
||||
|
||||
/* console.log(this.dm); */
|
||||
|
||||
setInterval(()=>{
|
||||
this.checkUserPresence();
|
||||
this.loadMessages();
|
||||
}, 2000);
|
||||
|
||||
/* setInterval(()=>{ */
|
||||
this.load();
|
||||
/* }, 9000); */
|
||||
|
||||
}
|
||||
load(){
|
||||
this.loadMessages();
|
||||
this.getChatMembers();
|
||||
|
||||
|
||||
}
|
||||
loadUser(){
|
||||
console.log('working');
|
||||
|
||||
doRefresh(ev:any){
|
||||
this.load();
|
||||
ev.target.complete();
|
||||
}
|
||||
|
||||
ngAfterViewChecked() {
|
||||
this.scrollToBottom();
|
||||
}
|
||||
@@ -71,11 +71,6 @@ export class MessagesPage implements OnInit, AfterViewChecked {
|
||||
|
||||
}
|
||||
|
||||
checkUserPresence(){
|
||||
this.chatService.getUserPresence(this.dm.lastMessage.u._id).subscribe(res=>{
|
||||
this.userPresence = res['presence'];
|
||||
});
|
||||
}
|
||||
sendMessage(){
|
||||
|
||||
let body = {
|
||||
@@ -92,16 +87,21 @@ export class MessagesPage implements OnInit, AfterViewChecked {
|
||||
}
|
||||
|
||||
loadMessages(){
|
||||
this.showLoader = true;
|
||||
this.chatService.getRoomMessages(this.dm._id).subscribe(res => {
|
||||
/* console.log(res); */
|
||||
this.messages = res['messages'].reverse();
|
||||
console.log(this.messages);
|
||||
|
||||
})
|
||||
}
|
||||
getChatMembers(){
|
||||
this.showLoader = true;
|
||||
this.chatService.getMembers(this.dm._id).subscribe(res=> {
|
||||
this.dmUsers = res['members'].filter(data => data.username != this.loggedUser.me.username)
|
||||
console.log(res);
|
||||
console.log(this.dmUsers);
|
||||
this.showLoader = false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<div class="middle">
|
||||
<ion-label class="title">Novo Grupo</ion-label>
|
||||
</div>
|
||||
<app-btn-seguinte (click)="addContacts()"></app-btn-seguinte>
|
||||
<app-btn-seguinte *ngIf="groupName" (click)="addContacts()"></app-btn-seguinte>
|
||||
</div>
|
||||
</div>
|
||||
</ion-toolbar>
|
||||
@@ -17,9 +17,9 @@
|
||||
<ion-content>
|
||||
<div class="main-content">
|
||||
<div class="item-container">
|
||||
<ion-input placeholder="Título"></ion-input>
|
||||
<ion-input [(ngModel)]="groupName" placeholder="Título"></ion-input>
|
||||
</div>
|
||||
<div class="item-container-no-border">
|
||||
<div *ngIf="false" class="item-container-no-border">
|
||||
<ion-checkbox (ionChange)="_ionChange($event)" color="primary"></ion-checkbox>
|
||||
<ion-label>Grupo Ultra-secreto</ion-label>
|
||||
</div>
|
||||
|
||||
@@ -149,6 +149,3 @@ ion-content{
|
||||
float: left;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { analyzeAndValidateNgModules } from '@angular/compiler';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController, PickerController, PopoverController } from '@ionic/angular';
|
||||
import { ModalController, NavParams, PickerController, PopoverController } from '@ionic/angular';
|
||||
import { GroupDurationPage } from 'src/app/shared/popover/group-duration/group-duration.page';
|
||||
import { ContactsPage } from './contacts/contacts.page';
|
||||
import { GroupContactsPage } from '../group-messages/group-contacts/group-contacts.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-new-group',
|
||||
@@ -10,17 +10,22 @@ import { ContactsPage } from './contacts/contacts.page';
|
||||
styleUrls: ['./new-group.page.scss'],
|
||||
})
|
||||
export class NewGroupPage implements OnInit {
|
||||
isGroupCreated:boolean;
|
||||
showLoader: boolean;
|
||||
displayDuration: any;
|
||||
showDuration: boolean;
|
||||
selectedDuration = ['','',''];
|
||||
groupName:string;
|
||||
|
||||
constructor(
|
||||
private pickerController: PickerController,
|
||||
private popoverController: PopoverController,
|
||||
private modalController: ModalController,
|
||||
) {
|
||||
|
||||
private modalController: ModalController,
|
||||
private navParams: NavParams,
|
||||
)
|
||||
{
|
||||
this.isGroupCreated = false;
|
||||
this.groupName = this.navParams.get('name');
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -34,15 +39,23 @@ export class NewGroupPage implements OnInit {
|
||||
}
|
||||
|
||||
async addContacts(){
|
||||
this.close();
|
||||
|
||||
let name = this.groupName.split(' ').join('-');
|
||||
console.log(name);
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: ContactsPage,
|
||||
componentProps: {},
|
||||
component: GroupContactsPage,
|
||||
componentProps: {
|
||||
isCreated:this.isGroupCreated,
|
||||
name: name,
|
||||
duration:'',
|
||||
},
|
||||
cssClass: 'contacts',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss();
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<ion-toolbar>
|
||||
<ion-title>Adicionar intervenientes</ion-title>
|
||||
</ion-toolbar>
|
||||
<ion-searchbar [(ngModel)]="searchCountryString" (ionChange)="onChange($event)" placeholder="Pesquisar"></ion-searchbar>
|
||||
<ion-searchbar (ionChange)="onChange($event)" placeholder="Pesquisar"></ion-searchbar><!-- [(ngModel)]="searchCountryString" -->
|
||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||
</ion-header>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<ion-list>
|
||||
<ion-item-sliding>
|
||||
<ion-item *ngFor="let attendee of contacts">
|
||||
<ion-checkbox slot="end" [disabled]="isCheckboxDisabled" (ionChange)="selectContact(attendee)"></ion-checkbox>
|
||||
<ion-checkbox slot="end" (ionChange)="selectContact(attendee)"></ion-checkbox><!-- [disabled]="isCheckboxDisabled" -->
|
||||
<ion-label>
|
||||
<h3>{{ attendee.Name }}</h3>
|
||||
<p>{{ attendee.EmailAddress }}</p>
|
||||
|
||||
@@ -22,9 +22,11 @@ export class AttendeeModalPage implements OnInit {
|
||||
}
|
||||
|
||||
save(){
|
||||
this.modalCtrl.dismiss(this.contacts.filter(function(contact) {
|
||||
this.modalCtrl.dismiss(
|
||||
this.contacts.filter(function(contact) {
|
||||
return contact.IsRequired == true;
|
||||
}));
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
close(){
|
||||
|
||||
@@ -1,91 +1,97 @@
|
||||
<ion-header class="ion-no-border">
|
||||
<app-header></app-header>
|
||||
<app-header-no-search></app-header-no-search>
|
||||
</ion-header>
|
||||
|
||||
<ion-content class="main bg-blue">
|
||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||
<!-- Default Refresher -->
|
||||
|
||||
<ion-content class="main bg-blue" ng-controller="AppController">
|
||||
<ion-refresher slot="fixed" (ionRefresh)="doRefresh($event)">
|
||||
<ion-refresher-content>
|
||||
</ion-refresher-content>
|
||||
</ion-refresher>
|
||||
|
||||
<ion-label>
|
||||
<p class="time ion-text-center">{{customDate}}</p>
|
||||
</ion-label>
|
||||
<ion-label>
|
||||
<p class="event-number p-small ion-text-center"> <strong>{{totalEvent}}</strong> eventos agendados para hoje</p>
|
||||
</ion-label>
|
||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||
|
||||
<ion-label>
|
||||
<p class="time ion-text-center">{{customDate}}</p>
|
||||
</ion-label>
|
||||
<ion-label>
|
||||
<p class="event-number p-small ion-text-center"> <strong>{{totalEvent}}</strong> eventos agendados para hoje</p>
|
||||
</ion-label>
|
||||
|
||||
<div class="next-meeting">
|
||||
<div class="meeting-time">{{hoursMinutes}}</div>
|
||||
<div class="meeting-description"> "{{currentEvent}}"</div>
|
||||
</div>
|
||||
<div class="next-meeting">
|
||||
<div class="meeting-time">{{hoursMinutes}}</div>
|
||||
<div class="meeting-description"> "{{currentEvent}}"</div>
|
||||
</div>
|
||||
|
||||
<div class="conteiner-box">
|
||||
<div class="schedule">
|
||||
<div class="schedule-header">
|
||||
<div class="title">
|
||||
<ion-icon class="icon" slot="end" src="assets/images/icons-default-agenda.svg" ></ion-icon>
|
||||
<div class="text">A sua Agenda</div>
|
||||
</div>
|
||||
<ion-icon class="icon-next" slot="end" src="assets/images/icons-arrow-circle-arrow-right.svg" ></ion-icon>
|
||||
|
||||
</div>
|
||||
<div class="content">
|
||||
<ul>
|
||||
<li *ngFor="let event of eventsList"
|
||||
[routerLink]="['/home/events', event.EventId, 'events']">
|
||||
<div class="d-flex content-{{profile}}-{{event.CalendarName}}">
|
||||
<div class="schedule-time">
|
||||
<div class="time-start">{{event.StartDate | date: 'hh:mm'}}</div>
|
||||
<div class="time-end">{{event.EndDate | date: 'hh:mm'}}</div>
|
||||
</div>
|
||||
<div class="schedule-details">
|
||||
<div class="location">{{event.Location}}</div>
|
||||
<div class="description">{{event.Subject}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<!--
|
||||
<div class="resume">
|
||||
<div class="conteiner-box" ng-swipe-up="swipe($event)">
|
||||
<div class="schedule">
|
||||
<div class="schedule-header">
|
||||
<div class="title">
|
||||
Resumo para Amnahã
|
||||
<ion-icon class="icon" slot="end" src="assets/images/icons-default-agenda.svg" ></ion-icon>
|
||||
<div class="text">A sua Agenda</div>
|
||||
</div>
|
||||
<div class="event-num">4 eventos ageandados para amanhã</div>
|
||||
<div class="first-event-time">08:30 "Reunião Staff" no Palácio Presidencial</div>
|
||||
<ion-icon class="icon-next" slot="end" src="assets/images/icons-arrow-circle-arrow-right.svg" ></ion-icon>
|
||||
|
||||
</div>
|
||||
<div class="content">
|
||||
<ul>
|
||||
<li *ngFor="let event of eventsList"
|
||||
(click)="viewEventDetail(event.EventId)">
|
||||
<div class="d-flex content-{{profile}}-{{event.CalendarName}}">
|
||||
<div class="schedule-time">
|
||||
<div class="time-start">{{event.StartDate | date: 'hh:mm'}}</div>
|
||||
<div class="time-end">{{event.EndDate | date: 'hh:mm'}}</div>
|
||||
</div>
|
||||
<div class="schedule-details">
|
||||
<div class="location">{{event.Location}}</div>
|
||||
<div class="description">{{event.Subject}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<!--
|
||||
<div class="resume">
|
||||
<div class="title">
|
||||
Resumo para Amnahã
|
||||
</div>
|
||||
<div class="event-num">4 eventos ageandados para amanhã</div>
|
||||
<div class="first-event-time">08:30 "Reunião Staff" no Palácio Presidencial</div>
|
||||
</div>
|
||||
-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="schedule">
|
||||
<div class="schedule-header">
|
||||
<div class="title">
|
||||
<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" ></ion-icon>
|
||||
|
||||
</div>
|
||||
<div class="content">
|
||||
<ul>
|
||||
<li *ngFor = "let task of taskslist"
|
||||
[routerLink]="['/home/gabinete-digital/expediente',task.SerialNumber]">
|
||||
<div class="d-flex">
|
||||
<div class="schedule-date">
|
||||
<div class="time-end">{{task.CreateDate | date: 'd/M/yy'}}</div>
|
||||
<div class="time-start">{{task.CreateDate | date: 'hh:mm'}}</div>
|
||||
</div>
|
||||
<div class="schedule-details pointer">
|
||||
<div class="description">{{ task.Folio }}</div>
|
||||
<div class="location">{{ task.Remetente }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="schedule">
|
||||
<div class="schedule-header">
|
||||
<div class="title">
|
||||
<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" ></ion-icon>
|
||||
|
||||
</div>
|
||||
<div class="content">
|
||||
<ul>
|
||||
<li *ngFor = "let task of taskslist"
|
||||
[routerLink]="['/home/gabinete-digital/expediente',task.SerialNumber]">
|
||||
<div class="d-flex">
|
||||
<div class="schedule-date">
|
||||
<div class="time-end">{{task.CreateDate | date: 'd/M/yy'}}</div>
|
||||
<div class="time-start">{{task.CreateDate | date: 'hh:mm'}}</div>
|
||||
</div>
|
||||
<div class="schedule-details pointer">
|
||||
<div class="description">{{ task.Remetente }}</div>
|
||||
<div class="location">{{ task.Folio }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</ion-content>
|
||||
@@ -296,6 +296,7 @@ ion-toolbar{
|
||||
text-align: center;
|
||||
color: var(--white);
|
||||
line-height: unset;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.next-meeting{
|
||||
@@ -394,6 +395,7 @@ ion-toolbar{
|
||||
}
|
||||
}
|
||||
.schedule-date{
|
||||
margin-right: 10px;
|
||||
width: 22%;
|
||||
color: #797979 !important;
|
||||
font-size: 13px;
|
||||
|
||||
@@ -14,6 +14,8 @@ import { EventDetailPage } from './event-detail/event-detail.page';
|
||||
import { EventDetailModalPage } from './event-detail-modal/event-detail-modal.page';
|
||||
import { ProcessesService } from '../../services/processes.service';
|
||||
import { DailyWorkTask } from '../../models/dailyworktask.model';
|
||||
import { ViewEventPage } from '../agenda/view-event/view-event.page';
|
||||
import { ExpedientePage } from '../gabinete-digital/expediente/expediente.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-events',
|
||||
@@ -76,6 +78,11 @@ export class EventsPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
|
||||
swipe(){
|
||||
console.log('!!!!');
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
//Inicializar segment
|
||||
this.segment = "Combinada";
|
||||
@@ -101,7 +108,6 @@ export class EventsPage implements OnInit {
|
||||
|
||||
this.storageService.get(AuthConnstants.USER).then(res=>{
|
||||
console.log(res);
|
||||
|
||||
});
|
||||
|
||||
this.showGreeting();
|
||||
@@ -136,9 +142,11 @@ export class EventsPage implements OnInit {
|
||||
if(this.profile == "mdgpr"){
|
||||
this.eventService.getAllMdEvents(formatDate(new Date(), 'yyyy-MM-dd HH:mm:ss', 'pt') /* + ' 00:00:00' */, formatDate(new Date(), 'yyyy-MM-dd', 'pt') + ' 23:59:59').subscribe(res => {
|
||||
this.eventsList = res;
|
||||
|
||||
if(res.length > 0){
|
||||
this.currentEvent = res[0].Subject;
|
||||
}
|
||||
|
||||
this.totalEvent = this.eventsList.length;
|
||||
this.showLoader = false;
|
||||
});
|
||||
@@ -146,6 +154,8 @@ export class EventsPage implements OnInit {
|
||||
this.eventService.getAllPrEvents(formatDate(new Date(), 'yyyy-MM-dd', 'pt') + ' 00:00:00', formatDate(new Date(), 'yyyy-MM-dd', 'pt') + ' 23:59:59').subscribe(res => {
|
||||
this.eventsList = res;
|
||||
console.log(this.eventsList);
|
||||
console.log(res)
|
||||
console.log(res[0])
|
||||
this.currentEvent = res[0].Subject;
|
||||
this.totalEvent = this.eventsList.length;
|
||||
this.showLoader = false;
|
||||
@@ -257,7 +267,9 @@ export class EventsPage implements OnInit {
|
||||
LoadList()
|
||||
{
|
||||
this.processes.GetTasksList("Expediente", false).subscribe(result => {
|
||||
this.taskslist = new Array();
|
||||
|
||||
const AllResult = new Array();
|
||||
|
||||
result.forEach(element => {
|
||||
let task: DailyWorkTask = {
|
||||
"SerialNumber": element.serialNumber,
|
||||
@@ -267,9 +279,67 @@ export class EventsPage implements OnInit {
|
||||
"DocumentURL": element.formURL,
|
||||
"Remetente": element.workflowInstanceDataFields.Remetente
|
||||
}
|
||||
this.taskslist.push(task);
|
||||
// CreateDate
|
||||
AllResult.push(task);
|
||||
});
|
||||
|
||||
console.log(AllResult);
|
||||
|
||||
this.taskslist = this.sortArrayISODate(AllResult).reverse()
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
sortArrayISODate(myArray: any){
|
||||
return myArray.sort(function(a, b) {
|
||||
return (a.CreateDate < b.CreateDate) ? -1 : ((a.CreateDate > b.CreateDate) ? 1 : 0);
|
||||
});
|
||||
}
|
||||
|
||||
async viewEventDetail(eventId:any) {
|
||||
console.log(this.profile);
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: ViewEventPage,
|
||||
componentProps:{
|
||||
eventId: eventId,
|
||||
profile: this.profile,
|
||||
},
|
||||
cssClass: 'modal',
|
||||
backdropDismiss: false
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then((res)=>{
|
||||
if(res){
|
||||
console.log(res);
|
||||
this.RefreshEvents();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async viewExpedient(serialNumber:any) {
|
||||
console.log(this.profile);
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: ExpedientePage,
|
||||
componentProps:{
|
||||
serialNumber: serialNumber,
|
||||
profile: this.profile,
|
||||
},
|
||||
cssClass: 'modal',
|
||||
backdropDismiss: false
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then((res)=>{
|
||||
if(res){
|
||||
console.log(res);
|
||||
this.RefreshEvents();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
+5
-4
@@ -17,10 +17,7 @@ ion-content{
|
||||
--padding-start: 15px;
|
||||
--padding-end: 20px;
|
||||
}
|
||||
.container-div{
|
||||
margin-bottom: 15px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.ion-item-container{
|
||||
width: 360px;
|
||||
margin: 15px auto;
|
||||
@@ -34,6 +31,10 @@ ion-content{
|
||||
padding: 0 !important;
|
||||
overflow: auto;
|
||||
}
|
||||
.container-div{
|
||||
margin-bottom: 15px;
|
||||
overflow: auto;
|
||||
}
|
||||
.ion-item-class-2{
|
||||
width: 360px;
|
||||
margin: 0px auto;
|
||||
|
||||
+1
-2
@@ -84,8 +84,7 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
viewDocument()
|
||||
{
|
||||
viewDocument(){
|
||||
const url: string = this.task.DocumentURL.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
|
||||
const browser = this.iab.create(url,"_blank");
|
||||
browser.show();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { ModalController, NavParams } from '@ionic/angular';
|
||||
import { CalendarComponent } from 'ionic2-calendar';
|
||||
|
||||
import { DailyWorkTask } from '../../../models/dailyworktask.model';
|
||||
@@ -20,10 +20,14 @@ export class ExpedientePage implements OnInit {
|
||||
@ViewChild(CalendarComponent) myCal: CalendarComponent;
|
||||
|
||||
taskslist:DailyWorkTask[];
|
||||
serialNumber:string;
|
||||
|
||||
constructor(
|
||||
private modalCtrl: ModalController,
|
||||
private processes:ProcessesService) { }
|
||||
private navParams: NavParams,
|
||||
private processes:ProcessesService) {
|
||||
this.serialNumber = this.navParams.get('serialNumber');
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
//Inicializar segment
|
||||
|
||||
@@ -7,6 +7,7 @@ import { IonicModule } from '@ionic/angular';
|
||||
import { GabineteDigitalPageRoutingModule } from './gabinete-digital-routing.module';
|
||||
|
||||
import { GabineteDigitalPage } from './gabinete-digital.page';
|
||||
import { SharedModule } from 'src/app/shared/shared.module';
|
||||
/* import { ComponentsModule } from 'src/app/components/components.module'; */
|
||||
|
||||
@NgModule({
|
||||
@@ -14,7 +15,7 @@ import { GabineteDigitalPage } from './gabinete-digital.page';
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
/* ComponentsModule, */
|
||||
SharedModule,
|
||||
GabineteDigitalPageRoutingModule
|
||||
],
|
||||
declarations: [GabineteDigitalPage],
|
||||
|
||||
@@ -1,4 +1,21 @@
|
||||
<ion-header class="ion-no-border">
|
||||
<ion-header>
|
||||
<app-header></app-header>
|
||||
</ion-header>
|
||||
<ion-header class="ion-no-border">
|
||||
<ion-toolbar class="bg-blue">
|
||||
<div class="main-header">
|
||||
<div class="title-content">
|
||||
<div class="div-title">
|
||||
<ion-label class="title">Gabinete Digital</ion-label>
|
||||
</div>
|
||||
<div class="div-icon">
|
||||
<ion-icon slot="end" src='assets/images/icons-add.svg'></ion-icon>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
<!-- <ion-header class="ion-no-border">
|
||||
<ion-toolbar class="ion-no-border" class="bg-blue">
|
||||
<div class="div-top-header">
|
||||
<div class="div-search">
|
||||
@@ -12,23 +29,15 @@
|
||||
</div>
|
||||
</div>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
</ion-header> -->
|
||||
|
||||
<ion-content>
|
||||
<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>
|
||||
<div class="main-content">
|
||||
<div class="title-content">
|
||||
<div class="div-title">
|
||||
<ion-label class="title">Gabinete Digital</ion-label>
|
||||
</div>
|
||||
<div class="div-icon">
|
||||
<ion-icon slot="end" src='assets/images/icons-add.svg'></ion-icon>
|
||||
</div>
|
||||
<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>
|
||||
</div>
|
||||
<div class="exp-card" (click)="openEventsToApproveList('MDGPR')">
|
||||
<div class="exp-card-icon">
|
||||
<ion-icon src="assets/images/icons-agenda.svg"></ion-icon>
|
||||
|
||||
@@ -12,24 +12,24 @@ ion-content{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
ion-card{
|
||||
background-color: #d4d5ca;
|
||||
border-radius: 20px;
|
||||
}
|
||||
ion-item{
|
||||
--ion-background-color:#dae3f3;
|
||||
margin-bottom: 10px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
ion-button{
|
||||
color: #000;
|
||||
--background:none;
|
||||
--border-color: none;
|
||||
--box-shadow:none;
|
||||
}
|
||||
ion-label{
|
||||
padding: 10px;
|
||||
}
|
||||
ion-card{
|
||||
background-color: #d4d5ca;
|
||||
border-radius: 20px;
|
||||
}
|
||||
ion-item{
|
||||
--ion-background-color:#dae3f3;
|
||||
margin-bottom: 10px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
ion-button{
|
||||
color: #000;
|
||||
--background:none;
|
||||
--border-color: none;
|
||||
--box-shadow:none;
|
||||
}
|
||||
ion-label{
|
||||
padding: 10px;
|
||||
}
|
||||
}
|
||||
.ion-item-change-color{
|
||||
--ion-background-color:#fff2cc !important;
|
||||
@@ -65,14 +65,51 @@ ion-label{
|
||||
}
|
||||
}
|
||||
|
||||
.main-header{
|
||||
width: 100%; /* 400px */
|
||||
height: 100%;
|
||||
font-family: Roboto;
|
||||
border-top-left-radius: 25px;
|
||||
border-top-right-radius: 25px;
|
||||
background-color: #ecf8ff;
|
||||
overflow:hidden;
|
||||
padding: 30px 20px 0px 20px;
|
||||
color:#000;
|
||||
transform: translate3d(0, 1px, 0);
|
||||
|
||||
.title-content{
|
||||
width: 360px;
|
||||
margin: 0px auto;
|
||||
overflow: auto;
|
||||
padding: 0 !important;
|
||||
background: #ecf8ff;
|
||||
}
|
||||
.div-title{
|
||||
padding: 0!important;
|
||||
float: left;
|
||||
}
|
||||
.title{
|
||||
font-size: 25px;
|
||||
}
|
||||
.div-icon{
|
||||
width: 40px;
|
||||
float: right;
|
||||
font-size: 35px;
|
||||
overflow: auto;
|
||||
padding: 1px;
|
||||
}
|
||||
.div-icon ion-icon{
|
||||
float: right;
|
||||
padding-left: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
/* NEW CSS */
|
||||
.main-content{
|
||||
width: 100%; /* 400px */
|
||||
height: 100%;
|
||||
font-family: Roboto;
|
||||
margin: 0 auto;
|
||||
border-top-left-radius: 25px;
|
||||
border-top-right-radius: 25px;
|
||||
background:#ecf8ff;;
|
||||
overflow:auto;
|
||||
padding: 25px 15px 15px 15px;
|
||||
|
||||
@@ -19,7 +19,17 @@ export class GabineteDigitalPage implements OnInit {
|
||||
private processesbackend:ProcessesService,
|
||||
private modalController: ModalController,
|
||||
private eventService: EventsService,
|
||||
private alertService: AlertService) { }
|
||||
private alertService: AlertService) {
|
||||
function setCookie(cname, cvalue, exdays) {
|
||||
var d = new Date();
|
||||
d.setTime(d.getTime() + (exdays*24*60*60*1000));
|
||||
var expires = "expires="+ d.toUTCString();
|
||||
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
|
||||
}
|
||||
|
||||
// AccoesPresidenciais = Correspondencia = 8
|
||||
setCookie('searchModalAPPType','8,361', 99999999);
|
||||
}
|
||||
|
||||
count_exp_dailywork=0;
|
||||
count_exp_pp : string;
|
||||
|
||||
@@ -27,9 +27,6 @@ export class LoginPage implements OnInit {
|
||||
password: string = environment.defaultuserpwd;
|
||||
userattempt: User;
|
||||
|
||||
public body = { "user": this.username, "password": this.password };
|
||||
public postData = { "user": this.username, "password": this.password };
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
private authService: AuthService,
|
||||
@@ -60,14 +57,21 @@ export class LoginPage implements OnInit {
|
||||
await alert.present();
|
||||
}
|
||||
|
||||
/* loginRocketChat(){
|
||||
this.authService.loginChat(this.postData).subscribe((res: any) =>{
|
||||
loginRocketChat(user:any){
|
||||
|
||||
let postData = {
|
||||
"user": user.username,
|
||||
"password": user.password,
|
||||
}
|
||||
this.authService.loginChat(postData).subscribe((res: any) =>{
|
||||
console.log(res.data);
|
||||
this.storageService.store(AuthConnstants.AUTH, res.data);
|
||||
console.log('Login to Rocket chat OK');
|
||||
},(error:any) =>{
|
||||
console.log('Network error');
|
||||
this.presentAlert('Network error '+error);
|
||||
});
|
||||
} */
|
||||
}
|
||||
|
||||
storeUserIdANdToken() {
|
||||
|
||||
|
||||
@@ -1,21 +1,6 @@
|
||||
<ion-header>
|
||||
<app-header></app-header>
|
||||
</ion-header>
|
||||
<!-- <ion-header class="ion-no-border">
|
||||
<ion-toolbar class="bg-blue">
|
||||
<div class="div-top-header">
|
||||
<div class="div-search">
|
||||
<ion-icon src='assets/images/icons-search.svg'></ion-icon>
|
||||
</div>
|
||||
<div class="div-logo">
|
||||
<img src='assets/images/logo-no-bg.png' alt='logo'>
|
||||
</div>
|
||||
<div class="div-profile">
|
||||
<ion-icon src='assets/images/icons-profile.svg'></ion-icon>
|
||||
</div>
|
||||
</div>
|
||||
</ion-toolbar>
|
||||
</ion-header> -->
|
||||
<ion-header class="ion-no-border">
|
||||
<ion-toolbar class="bg-blue">
|
||||
<div class="main-header">
|
||||
@@ -26,7 +11,6 @@
|
||||
<div class="div-icon">
|
||||
<ion-icon (click)="AddPublicationFolder()" slot="end" src='assets/images/icons-add.svg'></ion-icon>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</ion-toolbar>
|
||||
|
||||
@@ -39,9 +39,19 @@ export class PublicationsPage implements OnInit {
|
||||
private animationController: AnimationController,
|
||||
private loading: LoadingService,
|
||||
private publications: PublicationsService,
|
||||
) {
|
||||
) {
|
||||
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"];
|
||||
|
||||
function setCookie(cname, cvalue, exdays) {
|
||||
var d = new Date();
|
||||
d.setTime(d.getTime() + (exdays*24*60*60*1000));
|
||||
var expires = "expires="+ d.toUTCString();
|
||||
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
|
||||
}
|
||||
|
||||
// AccoesPresidenciais = AccoesPresidenciais = 386,,
|
||||
setCookie('searchModalAPPType','386', 99999999);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { OrganicEntityPage } from './organic-entity.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: OrganicEntityPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class OrganicEntityPageRoutingModule {}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { OrganicEntityPageRoutingModule } from './organic-entity-routing.module';
|
||||
|
||||
import { OrganicEntityPage } from './organic-entity.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
OrganicEntityPageRoutingModule
|
||||
],
|
||||
declarations: [OrganicEntityPage]
|
||||
})
|
||||
export class OrganicEntityPageModule {}
|
||||
@@ -0,0 +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>Remetentes</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
<div class="main-container">
|
||||
<div class="input-text d-flex ion-align-items-center">
|
||||
<ion-input [(ngModel)]='findEntity' class="search-input" type="search" placeholder="Pesquisar" (ngModelChange)="filterContact($event)" ></ion-input>
|
||||
</div>
|
||||
<ul>
|
||||
<li *ngFor="let organicEntity of showOrganicEntities" (click)="selectOrganicEntidy(organicEntity.Description)">
|
||||
{{ organicEntity.Description }}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</ion-content>
|
||||
@@ -0,0 +1,39 @@
|
||||
.main-header{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.icon{
|
||||
color: #797979;
|
||||
width: 45px;
|
||||
height: 45px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
font-size: 25px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.main-container{
|
||||
padding: 0px 20px;
|
||||
.input-text {
|
||||
margin-top: 20px;
|
||||
width: 100%;
|
||||
height: 45px;
|
||||
border-radius: 5px;
|
||||
border: 1px solid #ebebeb;
|
||||
}
|
||||
ul{
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
padding-top: 10px;
|
||||
li{
|
||||
padding-top: 5px;
|
||||
padding-bottom: 10px;
|
||||
margin: 0px;
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 1px solid #ebebeb;
|
||||
list-style: none;
|
||||
font-family: Roboto;
|
||||
font-size: 15px;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { OrganicEntityPage } from './organic-entity.page';
|
||||
|
||||
describe('OrganicEntityPage', () => {
|
||||
let component: OrganicEntityPage;
|
||||
let fixture: ComponentFixture<OrganicEntityPage>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ OrganicEntityPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(OrganicEntityPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,58 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { from } from 'rxjs';
|
||||
import { OrganicEntityService } from 'src/app/services/organic-entity.service';
|
||||
import { OrganicEntity } from 'src/app/models/organic-entity.model';
|
||||
|
||||
@Component({
|
||||
selector: 'app-organic-entity',
|
||||
templateUrl: './organic-entity.page.html',
|
||||
styleUrls: ['./organic-entity.page.scss'],
|
||||
})
|
||||
export class OrganicEntityPage implements OnInit {
|
||||
|
||||
organicEntities: OrganicEntity[];
|
||||
showOrganicEntities: OrganicEntity[];
|
||||
findEntity: string;
|
||||
|
||||
|
||||
constructor(private modalController:ModalController,
|
||||
private OrganicEntityService: OrganicEntityService) {
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.getOrganicEntity();
|
||||
}
|
||||
|
||||
|
||||
getOrganicEntity(){
|
||||
this.OrganicEntityService.getOrganicEntity().subscribe(res=>{
|
||||
console.log(res)
|
||||
this.organicEntities = res;
|
||||
});
|
||||
}
|
||||
|
||||
filterContact(){
|
||||
|
||||
const findEntity = this.findEntity.toLowerCase();
|
||||
|
||||
const entities = this.organicEntities.filter((Entity) => {
|
||||
|
||||
if (Entity.Description.toLowerCase().indexOf(findEntity) == 0){
|
||||
return true;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
this.showOrganicEntities = entities;
|
||||
}
|
||||
|
||||
selectOrganicEntidy(selectedOraganicEntit: string){
|
||||
this.close(selectedOraganicEntit)
|
||||
}
|
||||
|
||||
close(username: string){
|
||||
this.modalController.dismiss(username);
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,14 @@ const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: SearchPage
|
||||
},
|
||||
{
|
||||
path: 'sender',
|
||||
loadChildren: () => import('./sender/sender.module').then( m => m.SenderPageModule)
|
||||
},
|
||||
{
|
||||
path: 'organic-entity',
|
||||
loadChildren: () => import('./organic-entity/organic-entity.module').then( m => m.OrganicEntityPageModule)
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
@@ -8,12 +8,14 @@ import { SearchPageRoutingModule } from './search-routing.module';
|
||||
|
||||
import { SearchPage } from './search.page';
|
||||
/* import { ComponentsModule } from 'src/app/components/components.module'; */
|
||||
/* import { TagCloudModule } from 'angular-tag-cloud-module'; */
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
/* TagCloudModule, */
|
||||
/* ComponentsModule, */
|
||||
SearchPageRoutingModule
|
||||
],
|
||||
|
||||
@@ -1,141 +1,137 @@
|
||||
|
||||
<!-- HEADER-->
|
||||
<ion-header class="ion-no-border header-main d-flex ion-justify-content-between">
|
||||
<ion-progress-bar type="indeterminate" class="loader" *ngIf="showLoader"></ion-progress-bar>
|
||||
<ion-form>
|
||||
<div class="d-flex search-input-container">
|
||||
<div class="icon">
|
||||
<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>
|
||||
<div class="input-text d-flex ion-align-items-center">
|
||||
<ion-input class="search-input" type="search" placeholder="Pesquisar"></ion-input>
|
||||
<ion-input [(ngModel)]='searchSubject' class="search-input" type="search" placeholder="Pesquisar"></ion-input>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<div class="icon" (click)="clearSearchInput()">
|
||||
<ion-icon name="restaurant-outline" src="assets/images/icons-search-close.svg"></ion-icon>
|
||||
</div>
|
||||
</div>
|
||||
</ion-form>
|
||||
<div class="icon-z icon-most-searched-word-open">
|
||||
<!-- 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>
|
||||
<div *ngIf="showAdvanceSearch" class="icon-z icon-most-searched-word-open" (click)="showHideAdvanceSearch(false)" >
|
||||
<ion-icon src="assets/images/advance-search-show-modal.svg" class="icon" slot="end"></ion-icon>
|
||||
</div>
|
||||
|
||||
<div class="profile">
|
||||
<ion-icon class="icon" src="assets/images/icons-profile.svg"></ion-icon>
|
||||
</div>
|
||||
</ion-header>
|
||||
|
||||
<ion-content class="content">
|
||||
<ion-content class="main-content">
|
||||
|
||||
<!-- search result type-->
|
||||
<div class="options">
|
||||
<div class="container ion-justify-content-between ion-align-items-center">
|
||||
<div class="d-flex ion-justify-content-center ion-text-center">
|
||||
<div class="button">
|
||||
<p>Relatório</p>
|
||||
<ion-label class="label">10</ion-label>
|
||||
</div>
|
||||
<div class="button">
|
||||
<p>Relatório</p>
|
||||
<ion-label class="label">10</ion-label>
|
||||
</div>
|
||||
<div class="button">
|
||||
<p>Relatório</p>
|
||||
<ion-label class="label">10</ion-label>
|
||||
</div>
|
||||
<div class="button">
|
||||
<p>Relatório</p>
|
||||
<ion-label class="label">10</ion-label>
|
||||
</div>
|
||||
<div class="button">
|
||||
<p>Relatório</p>
|
||||
<ion-label class="label">10</ion-label>
|
||||
</div>
|
||||
<div class="button">
|
||||
<p>Relatório</p>
|
||||
<ion-label class="label">10</ion-label>
|
||||
<!-- Search drop down -->
|
||||
<div class="advance-search" *ngIf="showAdvanceSearch">
|
||||
<!-- -->
|
||||
<li class="d-flex date-container ion-justify-content-between">
|
||||
<div class="icon-mer icon">
|
||||
<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>
|
||||
<div class="icon" (click)="clearInputDocumentDate()">
|
||||
<ion-icon name="restaurant-outline" src="assets/images/icons-search-close.svg"></ion-icon>
|
||||
</div>
|
||||
</div>
|
||||
<div class="icon-z icon-most-searched-word-open">
|
||||
<ion-icon src="assets/images/icons-most-searched-words-open.svg" class="icon" slot="end"></ion-icon>
|
||||
</li>
|
||||
<!-- Sender -->
|
||||
<li class="d-flex date-container ion-justify-content-between">
|
||||
<div class="icon-mer icon">
|
||||
<ion-icon name="restaurant-outline" src="assets/images/icons-advance-search-sender.svg"></ion-icon>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="input-container d-flex ion-align-items-center">
|
||||
<ion-input [(ngModel)]='searchSender' class="search-input" (click)="openAdvanceSearchSelection()" type="search" placeholder="Remetentes"></ion-input>
|
||||
<div class="icon" (click)="clearInputRemetente()" >
|
||||
<ion-icon name="restaurant-outline" src="assets/images/icons-search-close.svg"></ion-icon>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<!-- Organic entity -->
|
||||
<li class="d-flex date-container ion-justify-content-between">
|
||||
<div class="icon-mer icon">
|
||||
<ion-icon name="restaurant-outline" src="assets/images/icons-arrow-arrow-down-25-copy.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="input-container d-flex ion-align-items-center">
|
||||
<ion-input [(ngModel)]='searchOrganicEntiry' class="search-input" type="search" placeholder="Entidade Orgânica" (click)="openOrganicEntitySelection()"></ion-input>
|
||||
<div class="icon" (click)="clearInputOrganicEntity()" >
|
||||
<ion-icon name="restaurant-outline" src="assets/images/icons-search-close.svg"></ion-icon>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</div>
|
||||
|
||||
<div class="d-flex">
|
||||
<!-- search result categories-->
|
||||
<div class="options" *ngIf="showDocuments">
|
||||
<div class="container ion-justify-content-between ion-align-items-center">
|
||||
<div class="d-flex ion-justify-content-center ion-text-center">
|
||||
<!-- 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}" -->
|
||||
<p>{{ category.Name }}</p>
|
||||
<ion-label class="label">{{ category.Qtd }}</ion-label>
|
||||
</div>
|
||||
</ion-slide>
|
||||
</ion-slides>
|
||||
</div>
|
||||
|
||||
<button class="icon-z icon-most-searched-word-open" ion-button icon-only >
|
||||
<ion-icon src="assets/images/icons-most-searched-words-open.svg" class="icon" slot="end"></ion-icon>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex ion-wrap word-searh-result-container">
|
||||
<!-- most searched word-->
|
||||
<div class="most-searched-words">
|
||||
<p>Palavas mais pesquisdas</p>
|
||||
<div class="most-searched-words" *ngIf="!showDocuments">
|
||||
<p class="title ion-text-center">Palavras mais pesquisadas</p>
|
||||
<div>
|
||||
<angular-tag-cloud class="world-cloud"
|
||||
[data]="data"
|
||||
[width]=width
|
||||
[height]=height
|
||||
[overflow]=true>
|
||||
</angular-tag-cloud>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- search result-->
|
||||
<div class="search-result">
|
||||
<!-- search result document-->
|
||||
<div class="search-result" *ngIf="showDocuments">
|
||||
<div class="header">
|
||||
<div class="d-flex ion-justify-content-between ion-align-items-center">
|
||||
<div class="d-flex sort-by ion-justify-content-center">
|
||||
<p><span class="order">Order por:</span><span class="order-labal">Mais Recente</span></p>
|
||||
<p>
|
||||
<span class="order">Order por:</span>
|
||||
<span *ngIf="ordinance == 'recent'" class="order-labal">Mais Recente</span>
|
||||
<span *ngIf="ordinance == 'old'" class="order-labal">Mais Antigo</span>
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<ion-icon src="assets/images/icons-arrow-arrow-down-25.svg"></ion-icon>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<ul>
|
||||
<li class="d-flex">
|
||||
<li *ngFor="let searchDocument of showSearchDocuments" class="d-flex">
|
||||
<div class="icon">
|
||||
<ion-icon src="assets/images/icons-search-document.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="content ion-align-items-center">
|
||||
<p class="result-name">title</p>
|
||||
<p class="result-name">{{ searchDocument.Assunto}}</p>
|
||||
<div class="d-flex ion-justify-content-between ">
|
||||
<span>MINEC, MINFIN</span>
|
||||
<span>13/04/2020</span>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="d-flex">
|
||||
<div class="icon">
|
||||
<ion-icon src="assets/images/icons-search-document.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="content">
|
||||
<p class="result-name">title</p>
|
||||
<div class="d-flex ion-justify-content-between">
|
||||
<span>MINEC, MINFIN</span>
|
||||
<span>13/04/2020</span>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="d-flex">
|
||||
<div class="icon">
|
||||
<ion-icon src="assets/images/icons-search-document.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="content">
|
||||
<p class="result-name">title</p>
|
||||
<div class="d-flex ion-justify-content-between">
|
||||
<span>MINEC, MINFIN</span>
|
||||
<span>13/04/2020</span>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="d-flex">
|
||||
<div class="icon">
|
||||
<ion-icon src="assets/images/icons-search-document.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="content">
|
||||
<p class="result-name">title</p>
|
||||
<div class="d-flex ion-justify-content-between">
|
||||
<span>MINEC, MINFIN</span>
|
||||
<span>13/04/2020</span>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="d-flex">
|
||||
<div class="icon">
|
||||
<ion-icon src="assets/images/icons-search-document.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="content">
|
||||
<p class="result-name">title</p>
|
||||
<div class="d-flex ion-justify-content-between">
|
||||
<span>MINEC, MINFIN</span>
|
||||
<span>13/04/2020</span>
|
||||
<span class="organic-entity">{{ searchDocument.EntidadeOrganicaNome }}</span>
|
||||
<span class="documente-date">{{ formateIsoDate(searchDocument.Data) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
@@ -144,4 +140,4 @@
|
||||
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
</ion-content>
|
||||
@@ -2,8 +2,11 @@
|
||||
padding: 5px 18px;
|
||||
padding-bottom: 2px;
|
||||
padding-top: 25px;
|
||||
ion-form{
|
||||
width: 100%;
|
||||
padding-right: 10px;
|
||||
}
|
||||
.search-input-container{
|
||||
max-width: 309px;
|
||||
background-color: white;
|
||||
border-radius: 27.5px;
|
||||
border: solid 1px #ebebeb;
|
||||
@@ -16,8 +19,11 @@
|
||||
font-size: 25px;
|
||||
align-items: center;
|
||||
}
|
||||
.input-text{
|
||||
width: 100%;
|
||||
}
|
||||
.icon-z{
|
||||
width: 15px;
|
||||
width: 20px;
|
||||
}
|
||||
}
|
||||
.icon-z{
|
||||
@@ -33,6 +39,10 @@
|
||||
|
||||
}
|
||||
|
||||
ion-slide{
|
||||
padding-top: 5px
|
||||
}
|
||||
|
||||
// search result type
|
||||
.options{
|
||||
margin-top: 10px;
|
||||
@@ -44,19 +54,27 @@
|
||||
width: 100%;
|
||||
flex-wrap: wrap;
|
||||
.button{
|
||||
width: 116px;
|
||||
min-width: 116px;
|
||||
border: solid 1px #e9e9e9;
|
||||
margin: 0px 5px;
|
||||
margin-bottom: 10px;
|
||||
padding: 5px 20px;
|
||||
height: 100%;
|
||||
box-sizing: 100%;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
p{
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
font-family: Roboto;
|
||||
color: #0d89d1;
|
||||
font-size: 15px;
|
||||
width: 100%;
|
||||
}
|
||||
.label{
|
||||
width: 100%;
|
||||
font-family: Roboto;
|
||||
font-size: 13px;
|
||||
font-weight: 300;
|
||||
@@ -65,7 +83,7 @@
|
||||
border-radius: 15px;
|
||||
}
|
||||
|
||||
.button:hover{
|
||||
.active-category{
|
||||
background-color: #42b9fe;
|
||||
color: white;
|
||||
p{
|
||||
@@ -92,9 +110,14 @@
|
||||
}
|
||||
|
||||
|
||||
|
||||
.d-flex{
|
||||
display: flex;
|
||||
}
|
||||
|
||||
// document
|
||||
.word-searh-result-container{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
// search result
|
||||
.search-result{
|
||||
width: 100%;
|
||||
@@ -148,21 +171,26 @@
|
||||
line-height: 1.67;
|
||||
}
|
||||
span{
|
||||
height: 15px;
|
||||
font-family: Roboto;
|
||||
font-size: 13px;
|
||||
font-weight: 300;
|
||||
color: #797979;
|
||||
}
|
||||
span.documente-date{
|
||||
|
||||
}
|
||||
span.organic-entity{
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// most searched word
|
||||
.most-searched-words{
|
||||
width: 400px;
|
||||
display: none;
|
||||
p{
|
||||
width: 100%;
|
||||
p.title{
|
||||
width: 100%;
|
||||
height: 24px;
|
||||
font-family: Roboto;
|
||||
font-size: 20px;
|
||||
@@ -177,34 +205,91 @@
|
||||
|
||||
@media only screen and (min-width: 1024px) {
|
||||
|
||||
.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;
|
||||
}
|
||||
// .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;
|
||||
// }
|
||||
|
||||
|
||||
.most-searched-words{
|
||||
display: inline-block !important;
|
||||
|
||||
// .search-result{
|
||||
// border-left: 1px solid #d8d8d8;
|
||||
// .header{
|
||||
// border-top: unset !important;
|
||||
// }
|
||||
// }
|
||||
|
||||
// .most-searched-words{
|
||||
// width: 400px !important;
|
||||
// }
|
||||
|
||||
// .word-searh-result-container{
|
||||
// flex-wrap: wrap;
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* Advance search */
|
||||
.advance-search{
|
||||
padding: 20px 20px;
|
||||
padding-top: 14px;
|
||||
|
||||
.icon{
|
||||
color: #797979;
|
||||
width: 45px;
|
||||
height: 45px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
font-size: 25px;
|
||||
align-items: center;
|
||||
}
|
||||
.search-result{
|
||||
border-left: 1px solid #d8d8d8;
|
||||
.header{
|
||||
border-top: unset !important;
|
||||
.input-container{
|
||||
margin-bottom: 15px;
|
||||
width: 100%;
|
||||
border-radius: 5px;
|
||||
border: solid 1px #ebebeb;
|
||||
}
|
||||
.date-container{
|
||||
.icon-mer{
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
ion-datetime{
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.subject-container{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.loader{
|
||||
position: absolute;
|
||||
margin-top: -14px;
|
||||
width: calc(100% - 39px);
|
||||
}
|
||||
|
||||
|
||||
.swiper-container{
|
||||
width: 100%;
|
||||
}
|
||||
@@ -1,6 +1,15 @@
|
||||
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 { NgModel } from '@angular/forms';
|
||||
@Component({
|
||||
selector: 'app-search',
|
||||
templateUrl: './search.page.html',
|
||||
@@ -8,12 +17,308 @@ import { ModalController } from '@ionic/angular';
|
||||
})
|
||||
export class SearchPage implements OnInit {
|
||||
|
||||
constructor(private modalController: ModalController) { }
|
||||
// https params
|
||||
searchSubject: string;
|
||||
searchDocumentDate: string;
|
||||
searchSender: string;
|
||||
searchOrganicEntiry: string;
|
||||
searchDocTypeId: string;
|
||||
ordinance: string;
|
||||
|
||||
searchCategories: SearchCategory[];
|
||||
showSearchDocuments: SearchDocument[];
|
||||
showCategory: string;
|
||||
searchDocuments: SearchDocument[];
|
||||
|
||||
showDocuments = false;
|
||||
showAdvanceSearch = false;
|
||||
|
||||
showLoader: boolean;
|
||||
|
||||
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 = {
|
||||
slidesPerView: 3,
|
||||
initialSlide: 0,
|
||||
speed: 400,
|
||||
}
|
||||
|
||||
constructor(private modalController: ModalController,
|
||||
private search: SearchService) {
|
||||
this.ordinance = "recent";
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
close(){
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
reorderList(orderBy: string){
|
||||
|
||||
this.ordinance = orderBy;
|
||||
|
||||
if(this.ordinance == 'recent'){
|
||||
this.showSearchDocuments = this.sortArrayISODate(this.searchDocuments).reverse();
|
||||
} else {
|
||||
this.showSearchDocuments = this.sortArrayISODate(this.searchDocuments)
|
||||
}
|
||||
}
|
||||
|
||||
sortArrayISODate(myArray: any){
|
||||
return myArray.sort(function(a, b) {
|
||||
return (a.Data < b.Data) ? -1 : ((a.Data > b.Data) ? 1 : 0);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @description Basic search
|
||||
*/
|
||||
basicSearch(){
|
||||
|
||||
function getCookie(cname) {
|
||||
var name = cname + "=";
|
||||
var decodedCookie = decodeURIComponent(document.cookie);
|
||||
var ca = decodedCookie.split(';');
|
||||
for(var i = 0; i <ca.length; i++) {
|
||||
var c = ca[i];
|
||||
while (c.charAt(0) == ' ') {
|
||||
c = c.substring(1);
|
||||
}
|
||||
if (c.indexOf(name) == 0) {
|
||||
return c.substring(name.length, c.length);
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
const APPType = getCookie('searchModalAPPType');
|
||||
|
||||
if(APPType == '0'){
|
||||
|
||||
console.log('aplication type 0');
|
||||
|
||||
this.showLoader = true;
|
||||
|
||||
this.search.basicSearch(this.searchSubject, this.searchDocumentDate, this.searchSender
|
||||
,this.searchOrganicEntiry, this.searchDocTypeId, '0').subscribe(res=>{
|
||||
console.log(res);
|
||||
|
||||
res.Categories.forEach( e => {
|
||||
e['Active'] = false;
|
||||
});
|
||||
|
||||
// bind respose
|
||||
this.searchCategories = res.Categories;
|
||||
|
||||
this.searchDocuments = this.sortArrayISODate(res.Documents);
|
||||
|
||||
this.reorderList(this.ordinance);
|
||||
|
||||
// hide show document
|
||||
if(this.searchDocuments.length >= 1){
|
||||
this.showDocuments = true;
|
||||
} else {
|
||||
this.showDocuments = false
|
||||
}
|
||||
|
||||
this.showLoader = false;
|
||||
});
|
||||
} else if (APPType == '8,361'){
|
||||
|
||||
console.log('aplication type 8,361');
|
||||
|
||||
this.showLoader = true;
|
||||
|
||||
this.search.basicSearch(this.searchSubject, this.searchDocumentDate, this.searchSender
|
||||
,this.searchOrganicEntiry, this.searchDocTypeId, '8').subscribe(res=>{
|
||||
console.log(res);
|
||||
|
||||
res.Categories.forEach( e => {
|
||||
e['Active'] = false;
|
||||
});
|
||||
|
||||
// bind respose
|
||||
this.searchCategories = res.Categories;
|
||||
|
||||
this.searchDocuments = this.sortArrayISODate(res.Documents);
|
||||
|
||||
this.reorderList(this.ordinance);
|
||||
|
||||
// hide show document
|
||||
if(this.searchDocuments.length >= 1){
|
||||
this.showDocuments = true;
|
||||
} else {
|
||||
this.showDocuments = false
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
this.search.basicSearch(this.searchSubject, this.searchDocumentDate, this.searchSender
|
||||
,this.searchOrganicEntiry, this.searchDocTypeId, '361').subscribe(res=>{
|
||||
console.log(res);
|
||||
|
||||
res.Categories.forEach( e => {
|
||||
e['Active'] = false;
|
||||
});
|
||||
|
||||
// bind respose
|
||||
this.searchCategories = res.Categories;
|
||||
|
||||
this.searchDocuments = this.sortArrayISODate(res.Documents);
|
||||
|
||||
this.reorderList(this.ordinance);
|
||||
|
||||
// hide show document
|
||||
if(this.searchDocuments.length >= 1){
|
||||
this.showDocuments = true;
|
||||
} else {
|
||||
this.showDocuments = false
|
||||
}
|
||||
|
||||
this.showLoader = false;
|
||||
});
|
||||
} else if (APPType == '386'){
|
||||
|
||||
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);
|
||||
|
||||
res.Categories.forEach( e => {
|
||||
e['Active'] = false;
|
||||
});
|
||||
|
||||
// bind respose
|
||||
this.searchCategories = res.Categories;
|
||||
|
||||
this.searchDocuments = this.sortArrayISODate(res.Documents);
|
||||
|
||||
this.reorderList(this.ordinance);
|
||||
|
||||
// hide show document
|
||||
if(this.searchDocuments.length >= 1){
|
||||
this.showDocuments = true;
|
||||
} else {
|
||||
this.showDocuments = false
|
||||
}
|
||||
|
||||
this.showLoader = false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @description set empty value to searchSubject
|
||||
*/
|
||||
clearSearchInput(){
|
||||
this.searchSubject = ""
|
||||
}
|
||||
|
||||
/**
|
||||
* @param isoDate String Iso date
|
||||
* @returns date in format dd/MM/yyyy
|
||||
* @description convert Iso date to dd/MM/yyyy
|
||||
*/
|
||||
formateIsoDate(isoDate:string): string{
|
||||
const date = new Date(isoDate);
|
||||
return formatDate(date, 'dd/MM/yyyy', 'pt');
|
||||
}
|
||||
|
||||
|
||||
activeCategoty(i){
|
||||
|
||||
this.searchCategories.forEach((e) => {
|
||||
e['Active'] = false;
|
||||
})
|
||||
|
||||
this.searchCategories[i]['Active'] = true;
|
||||
}
|
||||
|
||||
clearInputRemetente(){
|
||||
this.searchSender = "";
|
||||
}
|
||||
|
||||
clearInputDocumentDate(){
|
||||
this.searchDocumentDate = "";
|
||||
}
|
||||
|
||||
clearInputOrganicEntity(){
|
||||
this.searchOrganicEntiry = "";
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Clean inputs
|
||||
*/
|
||||
showHideAdvanceSearch(show:boolean) {
|
||||
this.showAdvanceSearch = show;
|
||||
}
|
||||
|
||||
async openAdvanceSearchSelection() {
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: SenderPage,
|
||||
cssClass: 'sender',
|
||||
componentProps: {
|
||||
}
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then((data) => {
|
||||
this.searchSender = data.data;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
async openOrganicEntitySelection(){
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: OrganicEntityPage,
|
||||
cssClass: 'organicEnity',
|
||||
componentProps: {
|
||||
}
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then((data) => {
|
||||
this.searchOrganicEntiry = data.data;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
async filterDocList(categoryName:string){
|
||||
|
||||
// show all category
|
||||
if(this. showCategory == categoryName ){
|
||||
|
||||
this.showSearchDocuments = this.searchDocuments;
|
||||
|
||||
} else { // filter category
|
||||
this.showSearchDocuments = this.searchDocuments.filter((e) => e.DocTypeDesc == categoryName);
|
||||
}
|
||||
|
||||
this.showCategory = categoryName;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { SenderPage } from './sender.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: SenderPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class SenderPageRoutingModule {}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { SenderPageRoutingModule } from './sender-routing.module';
|
||||
|
||||
import { SenderPage } from './sender.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
SenderPageRoutingModule
|
||||
],
|
||||
declarations: [SenderPage]
|
||||
})
|
||||
export class SenderPageModule {}
|
||||
@@ -0,0 +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>Remetentes</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
<div class="main-container">
|
||||
<div class="input-text d-flex ion-align-items-center">
|
||||
<ion-input [(ngModel)]='sender' class="search-input" type="search" placeholder="Pesquisar" (ngModelChange)="filterContact($event)" ></ion-input>
|
||||
</div>
|
||||
<ul>
|
||||
<li *ngFor="let contact of showContacts" (click)="selectUser(contact.Name)">
|
||||
{{ contact.Name }}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</ion-content>
|
||||
@@ -0,0 +1,40 @@
|
||||
.main-header{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.icon{
|
||||
color: #797979;
|
||||
width: 45px;
|
||||
height: 45px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
font-size: 25px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.main-container{
|
||||
padding: 0px 20px;
|
||||
.input-text {
|
||||
margin-top: 20px;
|
||||
width: 100%;
|
||||
height: 45px;
|
||||
border-radius: 5px;
|
||||
border: 1px solid #ebebeb;
|
||||
}
|
||||
ul{
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
padding-top: 10px;
|
||||
li{
|
||||
padding-top: 5px;
|
||||
padding-bottom: 10px;
|
||||
margin: 0px;
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 1px solid #ebebeb;
|
||||
list-style: none;
|
||||
font-family: Roboto;
|
||||
font-size: 15px;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { SenderPage } from './sender.page';
|
||||
|
||||
describe('SenderPage', () => {
|
||||
let component: SenderPage;
|
||||
let fixture: ComponentFixture<SenderPage>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ SenderPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(SenderPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,58 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { ContactsService } from 'src/app/services/contacts.service';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
|
||||
@Component({
|
||||
selector: 'app-sender',
|
||||
templateUrl: './sender.page.html',
|
||||
styleUrls:
|
||||
['./sender.page.scss'],
|
||||
})
|
||||
export class SenderPage implements OnInit {
|
||||
|
||||
contacts: EventPerson[];
|
||||
showContacts: EventPerson[];
|
||||
sender: string;
|
||||
selectedUser: string;
|
||||
|
||||
constructor(private modalController:ModalController,
|
||||
private ContactsService: ContactsService) {
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.getSender();
|
||||
}
|
||||
|
||||
getSender(){
|
||||
this.ContactsService.getContacts("").subscribe(res=>{
|
||||
this.contacts = res;
|
||||
});
|
||||
}
|
||||
|
||||
filterContact(){
|
||||
|
||||
const findPerson = this.sender.toLowerCase();
|
||||
const persons = this.contacts.filter((person) => {
|
||||
|
||||
if (person.Name.toLowerCase().indexOf(findPerson) == 0){
|
||||
return true;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
this.showContacts = persons;
|
||||
}
|
||||
|
||||
selectUser(username:string){
|
||||
console.log(username);
|
||||
this.selectedUser = username;
|
||||
this.close(this.selectedUser);
|
||||
}
|
||||
|
||||
close(username: string){
|
||||
this.modalController.dismiss(username);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user