mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
chage file path
This commit is contained in:
@@ -23,7 +23,31 @@ const routes: Routes = [
|
||||
{
|
||||
path: 'edit-group',
|
||||
loadChildren: () => import('./modal/edit-group/edit-group.module').then( m => m.EditGroupPageModule)
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'chat-options-popover',
|
||||
loadChildren:() => import('./modal/chat-options-popover/chat-options-popover.module').then( m => m.ChatOptionsPopoverPageModule)
|
||||
},
|
||||
{
|
||||
path: 'chat-debugging',
|
||||
loadChildren: () => import('./modal/chat-debugging/chat-debugging.module').then( m => m.ChatDebuggingPageModule)
|
||||
},
|
||||
{
|
||||
path: 'chat-message-debugging',
|
||||
loadChildren: () => import('./modal/chat-message-debugging/chat-message-debugging.module').then( m => m.ChatMessageDebuggingPageModule)
|
||||
},
|
||||
{
|
||||
path: 'add-user',
|
||||
loadChildren: () => import('./component/add-user/add-user.module').then( m => m.AddUserPageModule)
|
||||
},
|
||||
{
|
||||
path: 'empty-chat',
|
||||
loadChildren: () => import('./component/empty-chat/empty-chat.module').then( m => m.EmptyChatPageModule)
|
||||
},
|
||||
{
|
||||
path: 'edit-group',
|
||||
loadChildren: () => import('./component/edit-group/edit-group.module').then( m => m.EditGroupPageModule)
|
||||
},
|
||||
|
||||
];
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import {MatMenuModule} from '@angular/material/menu';
|
||||
import { LettersAvatarModule } from "ngx-letters-avatar";
|
||||
import { PipesModule } from 'src/app/pipes/pipes.module';
|
||||
import { SafehtmlPipe } from 'src/app/pipes/safehtml.pipe';
|
||||
import { ChatPopoverPageModule } from 'src/app/shared/popover/chat-popover/chat-popover.module';
|
||||
import { ChatPopoverPageModule } from '../../modal/chat-popover/chat-popover.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
|
||||
@@ -2,7 +2,6 @@ import { Component, OnChanges, OnInit, Input, SimpleChanges, Output, EventEmitte
|
||||
import { AnimationController, ModalController, PopoverController, Platform } from '@ionic/angular';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { ChatService } from 'src/app/services/chat.service';
|
||||
import { ChatPopoverPage } from 'src/app/shared/popover/chat-popover/chat-popover.page';
|
||||
import { GroupContactsPage } from './group-contacts/group-contacts.page';
|
||||
import { ChatOptionsFeaturesPage } from 'src/app/modals/chat-options-features/chat-options-features.page';
|
||||
import { TimeService } from 'src/app/services/functions/time.service';
|
||||
@@ -29,7 +28,8 @@ import { SessionStore } from 'src/app/store/session.service';
|
||||
import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { FileValidatorService } from "src/app/services/file/file-validator.service"
|
||||
import { ChatOptionsPopoverPage } from 'src/app/shared/popover/chat-options-popover/chat-options-popover.page';
|
||||
import { ChatOptionsPopoverPage } from '../../modal/chat-options-popover/chat-options-popover.page';
|
||||
import { ChatPopoverPage } from '../../modal/chat-popover/chat-popover.page';
|
||||
@Component({
|
||||
selector: 'app-group-messages',
|
||||
templateUrl: './group-messages.page.html',
|
||||
|
||||
@@ -41,8 +41,8 @@ import { FilePickerWebService } from 'src/app/infra/file-picker/web/file-picker-
|
||||
import { FilePickerService } from 'src/app/infra/file-picker/file-picker.service'
|
||||
import { allowedDocExtension } from 'src/app/utils/allowedDocExtension';
|
||||
import { SpeakerService, StartRecordingResultError, StopRecordingResultError } from 'src/app/infra/speaker/speaker.service'
|
||||
import { ChatPopoverPage } from 'src/app/shared/popover/chat-popover/chat-popover.page';
|
||||
import { compressImageBase64 } from 'src/app/utils/imageCompressore';
|
||||
import { ChatPopoverPage } from '../../modal/chat-popover/chat-popover.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-messages',
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { ChatDebuggingPage } from './chat-debugging.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: ChatDebuggingPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class ChatDebuggingPageRoutingModule {}
|
||||
@@ -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 { ChatDebuggingPageRoutingModule } from './chat-debugging-routing.module';
|
||||
|
||||
import { ChatDebuggingPage } from './chat-debugging.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
ChatDebuggingPageRoutingModule
|
||||
],
|
||||
declarations: [ChatDebuggingPage]
|
||||
})
|
||||
export class ChatDebuggingPageModule {}
|
||||
@@ -0,0 +1,9 @@
|
||||
<!-- <ion-content>
|
||||
<ul>
|
||||
<li>Chat login</li>
|
||||
<li>Chat user list {{ ChatSystemService.users | json }}</li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li *ngFor="let room of ChatSystemService._dm">chat Name: {{room.name}}; subcribe: {{room.status.receive.message}}; </li>
|
||||
</ul>
|
||||
</ion-content> -->
|
||||
@@ -0,0 +1,24 @@
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { ChatDebuggingPage } from './chat-debugging.page';
|
||||
|
||||
describe('ChatDebuggingPage', () => {
|
||||
let component: ChatDebuggingPage;
|
||||
let fixture: ComponentFixture<ChatDebuggingPage>;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ChatDebuggingPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(ChatDebuggingPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,17 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
// import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-chat-debugging',
|
||||
templateUrl: './chat-debugging.page.html',
|
||||
styleUrls: ['./chat-debugging.page.scss'],
|
||||
})
|
||||
export class ChatDebuggingPage implements OnInit {
|
||||
|
||||
constructor(
|
||||
// public ChatSystemService: ChatSystemService
|
||||
) { }
|
||||
|
||||
ngOnInit() {}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { ChatMessageDebuggingPage } from './chat-message-debugging.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: ChatMessageDebuggingPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class ChatMessageDebuggingPageRoutingModule {}
|
||||
@@ -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 { ChatMessageDebuggingPageRoutingModule } from './chat-message-debugging-routing.module';
|
||||
|
||||
import { ChatMessageDebuggingPage } from './chat-message-debugging.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
ChatMessageDebuggingPageRoutingModule
|
||||
],
|
||||
declarations: [ChatMessageDebuggingPage]
|
||||
})
|
||||
export class ChatMessageDebuggingPageModule {}
|
||||
@@ -0,0 +1,10 @@
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-title>chatMessageDebugging</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
<button (click)="loadHistory()">Load History</button>
|
||||
</ion-content>
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { ChatMessageDebuggingPage } from './chat-message-debugging.page';
|
||||
|
||||
describe('ChatMessageDebuggingPage', () => {
|
||||
let component: ChatMessageDebuggingPage;
|
||||
let fixture: ComponentFixture<ChatMessageDebuggingPage>;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ChatMessageDebuggingPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(ChatMessageDebuggingPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,29 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { NavParams } from '@ionic/angular';
|
||||
// import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-chat-message-debugging',
|
||||
templateUrl: './chat-message-debugging.page.html',
|
||||
styleUrls: ['./chat-message-debugging.page.scss'],
|
||||
})
|
||||
export class ChatMessageDebuggingPage implements OnInit {
|
||||
|
||||
roomId: string
|
||||
|
||||
constructor(
|
||||
// public ChatSystemService: ChatSystemService,
|
||||
private navParams: NavParams
|
||||
) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.roomId = this.navParams.get('roomId')
|
||||
|
||||
|
||||
}
|
||||
|
||||
loadHistory() {
|
||||
// this.ChatSystemService.getDmRoom(this.roomId).loadHistory({});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { ChatOptionsPopoverPage } from './chat-options-popover.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: ChatOptionsPopoverPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class ChatOptionsPopoverPageRoutingModule {}
|
||||
@@ -0,0 +1,21 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { ChatOptionsPopoverPageRoutingModule } from './chat-options-popover-routing.module';
|
||||
|
||||
import { ChatOptionsPopoverPage } from './chat-options-popover.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
ChatOptionsPopoverPageRoutingModule
|
||||
],
|
||||
declarations: [ChatOptionsPopoverPage],
|
||||
exports: [ChatOptionsPopoverPage]
|
||||
})
|
||||
export class ChatOptionsPopoverPageModule {}
|
||||
@@ -0,0 +1,19 @@
|
||||
<ion-content class="container">
|
||||
<div class="arrow-right">
|
||||
<button class="btn-no-color" (click)="close()">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' "slot="end" class="arrow-right-icon" src='assets/images/icons-arrow-arrow-right.svg'></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="end" class="arrow-right-icon" src='assets/images/theme/gov/icons-calendar-arrow-right.svg'></ion-icon>
|
||||
</button>
|
||||
</div>
|
||||
<div class="buttons">
|
||||
<button (click)="takePicture()" full class="btn-ok" shape="round" >Tirar Fotografia</button>
|
||||
<button (click)="addFile()" class="btn-ok" shape="round" >Anexar Documento</button>
|
||||
<button (click)="anexarFoto()" full class="btn-ok" shape="round" >Anexar Fotografia</button>
|
||||
<button (click)="addDocGestaoDocumental()" class="btn-ok" shape="round" >Gestão Documental</button>
|
||||
<div class="solid"></div>
|
||||
|
||||
<!-- <button *ngIf="p.userPermission([p.permissionList.Agenda.access]) == true " (click)="bookMeeting()" class="btn-ok" shape="round" >Novo Evento</button> -->
|
||||
<button (click)="close()" full class="btn-cancel" shape="round" >Cancelar</button>
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
@@ -0,0 +1,50 @@
|
||||
@import '~src/function.scss';
|
||||
|
||||
|
||||
.container{
|
||||
--padding-top:20px !important;
|
||||
--padding-bottom:20px !important;
|
||||
--padding-start:20px !important;
|
||||
--padding-end:20px !important;
|
||||
}
|
||||
.arrow-right{
|
||||
display: none;
|
||||
margin-bottom: 20px;
|
||||
.arrow-right-icon{
|
||||
width: 37px;
|
||||
float: right;
|
||||
font-size: rem(35);
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
.buttons{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
|
||||
.btn-ok, .btn-cancel, .btn-delete{
|
||||
margin-bottom: 10px !important;
|
||||
}
|
||||
}
|
||||
.solid {
|
||||
display: none;
|
||||
width: 90%;
|
||||
border-top: 1px solid #bbb;
|
||||
margin: 0 auto !important;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
@media only screen and (min-width: 1024px) {
|
||||
.arrow-right{
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.btn-cancel{
|
||||
display: none;
|
||||
}
|
||||
.btn-ok{
|
||||
width: 100% !important;
|
||||
}
|
||||
.mobile-only{
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { ChatOptionsPopoverPage } from './chat-options-popover.page';
|
||||
|
||||
describe('ChatOptionsPopoverPage', () => {
|
||||
let component: ChatOptionsPopoverPage;
|
||||
let fixture: ComponentFixture<ChatOptionsPopoverPage>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ChatOptionsPopoverPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(ChatOptionsPopoverPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,133 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { SearchList } from 'src/app/models/search-document';
|
||||
import { NewEventPage } from 'src/app/pages/agenda/new-event/new-event.page';
|
||||
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-chat-options-popover',
|
||||
templateUrl: './chat-options-popover.page.html',
|
||||
styleUrls: ['./chat-options-popover.page.scss'],
|
||||
})
|
||||
export class ChatOptionsPopoverPage implements OnInit {
|
||||
|
||||
documents:SearchList[] = [];
|
||||
members: any;
|
||||
attendees: EventPerson[] = [];
|
||||
|
||||
constructor(
|
||||
private popoverController: PopoverController,
|
||||
private modalController: ModalController,
|
||||
private navParams: NavParams,
|
||||
public ThemeService: ThemeService,
|
||||
public p: PermissionService,
|
||||
) {
|
||||
|
||||
this.members = this.navParams.get('members');
|
||||
|
||||
if(this.members) {
|
||||
this.attendees = this.navParams.get('members').map((val)=>{
|
||||
return {
|
||||
Name: val.name,
|
||||
EmailAddress: val.username+"@"+environment.domain,
|
||||
IsRequired: "true",
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
|
||||
}
|
||||
|
||||
takePicture(){
|
||||
if( window.innerWidth < 701){
|
||||
this.popoverController.dismiss('take-picture');
|
||||
}
|
||||
else{
|
||||
this.modalController.dismiss('take-picture');
|
||||
}
|
||||
}
|
||||
|
||||
addFile(){
|
||||
if( window.innerWidth < 701){
|
||||
this.popoverController.dismiss('add-document');
|
||||
}
|
||||
else{
|
||||
this.modalController.dismiss('add-document');
|
||||
}
|
||||
}
|
||||
|
||||
anexarFoto(){
|
||||
if( window.innerWidth < 701){
|
||||
this.popoverController.dismiss('add-picture');
|
||||
}
|
||||
else{
|
||||
this.modalController.dismiss('add-picture');
|
||||
}
|
||||
}
|
||||
|
||||
addDocGestaoDocumental(){
|
||||
if( window.innerWidth < 701){
|
||||
this.popoverController.dismiss('documentoGestaoDocumental');
|
||||
}
|
||||
else{
|
||||
this.modalController.dismiss('documentoGestaoDocumental');
|
||||
}
|
||||
}
|
||||
|
||||
close(){
|
||||
if( window.innerWidth < 701){
|
||||
this.popoverController.dismiss();
|
||||
}
|
||||
else{
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
attachDocument(){
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
async getDoc(){
|
||||
const modal = await this.modalController.create({
|
||||
component: SearchPage,
|
||||
cssClass: 'group-messages modal-desktop search-modal search-modal-to-desktop',
|
||||
componentProps: {
|
||||
type: 'AccoesPresidenciais & ArquivoDespachoElect',
|
||||
select: true,
|
||||
showSearchInput: true,
|
||||
}
|
||||
});
|
||||
|
||||
modal.onDidDismiss().then((res)=>{
|
||||
if(res) {
|
||||
const data = res.data;
|
||||
this.documents.push(data.selected);
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
}
|
||||
|
||||
async bookMeeting() {
|
||||
|
||||
if( window.innerWidth < 701){
|
||||
this.popoverController.dismiss('meeting');
|
||||
}
|
||||
else{
|
||||
this.modalController.dismiss('meeting');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { ChatPopoverPage } from './chat-popover.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: ChatPopoverPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class ChatPopoverPageRoutingModule {}
|
||||
@@ -0,0 +1,21 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { ChatPopoverPageRoutingModule } from './chat-popover-routing.module';
|
||||
|
||||
import { ChatPopoverPage } from './chat-popover.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
ChatPopoverPageRoutingModule
|
||||
],
|
||||
exports: [ChatPopoverPage],
|
||||
declarations: [ChatPopoverPage]
|
||||
})
|
||||
export class ChatPopoverPageModule {}
|
||||
@@ -0,0 +1,31 @@
|
||||
<ion-content class="options-container">
|
||||
<div class="arrow-right header-fix">
|
||||
<button class="btn-no-color" (click)="close('cancel')">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="end" class="arrow-right-icon"
|
||||
src='assets/images/icons-arrow-arrow-right.svg'></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="end" class="arrow-right-icon"
|
||||
src='assets/images/theme/gov/icons-calendar-arrow-right.svg'></ion-icon>
|
||||
</button>
|
||||
</div>
|
||||
<div class="buttons">
|
||||
<!-- <button *ngIf="isAdmin" (click)="addUser()" class="btn-cancel" shape="round">Adicionar</button>
|
||||
<button (click)="leaveGroup()" class="btn-cancel" shape="round">Sair do Grupo</button>
|
||||
<button *ngIf="isAdmin" (click)="openChangeGroupName()" class="btn-cancel btn-cancel mt-10" shape="round" style="min-width: 192px;">Alterar
|
||||
nome do grupo</button>
|
||||
<div class="solid"></div>
|
||||
<button (click)="close('cancel')" full class="btn-cancel mobile-only" shape="round">Cancelar</button>
|
||||
<button *ngIf="isAdmin" (click)="deleteGroup()" class="btn-delete" shape="round">Apagar grupo</button>
|
||||
-->
|
||||
|
||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||
<br *ngIf="showLoader">
|
||||
<button (click)="addUser()" class="btn-cancel" shape="round">Adicionar</button>
|
||||
<button (click)="leaveGroup()" class="btn-cancel" shape="round">Sair do Grupo</button>
|
||||
<button (click)="openChangeGroupName()" class="btn-cancel btn-cancel mt-10" shape="round" style="min-width: 192px;">Alterar
|
||||
nome do grupo</button>
|
||||
<button (click)="setRoomOwner()" class="btn-cancel" shape="round">Adicionar admin</button>
|
||||
<div class="solid"></div>
|
||||
<button (click)="close('cancel')" full class="btn-cancel mobile-only" shape="round">Cancelar</button>
|
||||
<button (click)="deleteGroup()" class="btn-delete" shape="round">Apagar grupo</button>
|
||||
</div>
|
||||
</ion-content>
|
||||
@@ -0,0 +1,58 @@
|
||||
.options-container{
|
||||
--padding-top:20px !important;
|
||||
--padding-bottom:20px !important;
|
||||
--padding-start:20px !important;
|
||||
--padding-end:20px !important;
|
||||
}
|
||||
.arrow-right{
|
||||
display: none;
|
||||
margin-bottom: 20px;
|
||||
.arrow-right-icon{
|
||||
width: 37px;
|
||||
float: right;
|
||||
font-size: rem(35);
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
.buttons{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-around;
|
||||
}
|
||||
.solid {
|
||||
display: block;
|
||||
width: 90%;
|
||||
border-top: 1px solid #bbb;
|
||||
margin: 10px auto !important;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 701px) {
|
||||
.arrow-right{
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.btn-cancel{
|
||||
//display: none;
|
||||
width: 100% !important;
|
||||
margin-bottom: 10px !important;
|
||||
}
|
||||
.btn-cancel:hover, .btn-delete:hover{
|
||||
background-color: var(--button-hover);
|
||||
color: #fff !important;
|
||||
}
|
||||
.btn-ok{
|
||||
width: 100% !important;
|
||||
}
|
||||
.btn-delete{
|
||||
width: 100% !important;
|
||||
margin-bottom: 10px !important;
|
||||
}
|
||||
.solid{
|
||||
display: block;
|
||||
}
|
||||
.mobile-only{
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { ChatPopoverPage } from './chat-popover.page';
|
||||
|
||||
describe('ChatPopoverPage', () => {
|
||||
let component: ChatPopoverPage;
|
||||
let fixture: ComponentFixture<ChatPopoverPage>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ChatPopoverPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(ChatPopoverPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,147 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||
import { ChatService } from 'src/app/services/chat.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { SetRoomOwnerPage } from 'src/app/modals/set-room-owner/set-room-owner.page';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { ZodError } from 'zod';
|
||||
import { isHttpResponse } from 'src/app/services/http.service';
|
||||
import { MessageRepositoryService } from 'src/app/module/chat/data/repository/message-respository.service'
|
||||
import { RoomRepositoryService } from 'src/app/module/chat/data/repository/room-repository.service'
|
||||
|
||||
@Component({
|
||||
selector: 'app-chat-popover',
|
||||
templateUrl: './chat-popover.page.html',
|
||||
styleUrls: ['./chat-popover.page.scss'],
|
||||
})
|
||||
export class ChatPopoverPage implements OnInit {
|
||||
roomId:string;
|
||||
room: any;
|
||||
isAdmin = false;
|
||||
isGroupCreated: boolean;
|
||||
showLoader = false
|
||||
|
||||
constructor(
|
||||
private popoverController: PopoverController,
|
||||
private modalController: ModalController,
|
||||
private navParams: NavParams,
|
||||
private toastService: ToastService,
|
||||
public ThemeService: ThemeService,
|
||||
private RoomRepositoryService: RoomRepositoryService
|
||||
) {
|
||||
this.roomId = this.navParams.get('roomId');
|
||||
this.isAdmin = this.navParams.get('isAdmin');
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
// this.chatService.refreshtoken();
|
||||
}
|
||||
|
||||
close(action:any){
|
||||
if( window.innerWidth < 701){
|
||||
this.popoverController.dismiss(action);
|
||||
}
|
||||
else{
|
||||
this.modalController.dismiss(action)
|
||||
}
|
||||
}
|
||||
|
||||
//Top menu options
|
||||
//Close
|
||||
|
||||
async setRoomOwner() {
|
||||
let classs;
|
||||
if (window.innerWidth < 701) {
|
||||
classs = 'modal modal-desktop'
|
||||
} else {
|
||||
classs = 'centered-rounded-modal'
|
||||
}
|
||||
const modal = await this.modalController.create({
|
||||
component: SetRoomOwnerPage,
|
||||
cssClass: classs,
|
||||
backdropDismiss: true,
|
||||
componentProps: {
|
||||
roomId: this.roomId,
|
||||
isAdmin: this.isAdmin
|
||||
}
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then((res)=>{
|
||||
if(res.data == 'success'){
|
||||
this.leaveGroup();
|
||||
//this.ChatSystemService.hidingRoom(this.roomId);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
setAdmin() {
|
||||
this.setRoomOwner();
|
||||
}
|
||||
|
||||
async leaveGroup() {
|
||||
|
||||
//this.setRoomOwner();
|
||||
this.showLoader = true
|
||||
const result = await this.RoomRepositoryService.leaveRoom({
|
||||
id: this.roomId,
|
||||
members: [SessionStore.user.UserId]
|
||||
})
|
||||
|
||||
|
||||
if(result.isOk()) {
|
||||
this.close('leave');
|
||||
// this.openGroupMessage.emit(this.roomId);
|
||||
} else if (isHttpResponse(result.error)) {
|
||||
if(result.error.status == 404) {
|
||||
this.close('leave');
|
||||
}
|
||||
// this.httpErrorHandle.httpStatusHandle(result.error)
|
||||
} else if (result.error instanceof ZodError) {
|
||||
this.toastService._badRequest("Pedimos desculpa mas não foi possível executar a acção. Por favor, contacte o apoio técnico.")
|
||||
console.log(result.error.errors)
|
||||
} else {
|
||||
this.toastService._badRequest("Pedimos desculpa mas não foi possível executar a acção. Por favor, contacte o apoio técnico.")
|
||||
console.log(result.error)
|
||||
}
|
||||
|
||||
this.showLoader = false
|
||||
}
|
||||
|
||||
//Delete
|
||||
async deleteGroup() {
|
||||
this.showLoader = true
|
||||
const result = await this.RoomRepositoryService.deleteRoomById(this.roomId)
|
||||
|
||||
|
||||
if(result.isOk()) {
|
||||
this.close('delete');
|
||||
// this.openGroupMessage.emit(this.roomId);
|
||||
} else if (isHttpResponse(result.error)) {
|
||||
if(result.error.status == 404) {
|
||||
this.close('close');
|
||||
}
|
||||
} else if (result.error instanceof ZodError) {
|
||||
this.toastService._badRequest("Pedimos desculpa mas não foi possível executar a acção. Por favor, contacte o apoio técnico.")
|
||||
console.log(result.error.errors)
|
||||
} else {
|
||||
this.toastService._badRequest("Pedimos desculpa mas não foi possível executar a acção. Por favor, contacte o apoio técnico.")
|
||||
console.log(result.error)
|
||||
}
|
||||
|
||||
this.showLoader = false
|
||||
|
||||
}
|
||||
|
||||
async openChangeGroupName(){
|
||||
this.close('edit');
|
||||
}
|
||||
|
||||
|
||||
async addUser() {
|
||||
this.close('addUser');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { GroupDurationPage } from './group-duration.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: GroupDurationPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class GroupDurationPageRoutingModule {}
|
||||
@@ -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 { GroupDurationPageRoutingModule } from './group-duration-routing.module';
|
||||
|
||||
import { GroupDurationPage } from './group-duration.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
GroupDurationPageRoutingModule
|
||||
],
|
||||
declarations: [GroupDurationPage]
|
||||
})
|
||||
export class GroupDurationPageModule {}
|
||||
@@ -0,0 +1,19 @@
|
||||
<ion-content>
|
||||
<div class="p-header">
|
||||
<h3>Duração</h3>
|
||||
</div>
|
||||
<div class="picker">
|
||||
|
||||
</div>
|
||||
<div class="p-buttons">
|
||||
<ion-row>
|
||||
<ion-col>
|
||||
<button (click)="close()" full class="btn-cancel" shape="round" >Cancelar</button>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<button class="btn-ok" shape="round" >Ok</button>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
@@ -0,0 +1,24 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { GroupDurationPage } from './group-duration.page';
|
||||
|
||||
describe('GroupDurationPage', () => {
|
||||
let component: GroupDurationPage;
|
||||
let fixture: ComponentFixture<GroupDurationPage>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ GroupDurationPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(GroupDurationPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,21 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { PopoverController } from '@ionic/angular';
|
||||
|
||||
@Component({
|
||||
selector: 'app-group-duration',
|
||||
templateUrl: './group-duration.page.html',
|
||||
styleUrls: ['./group-duration.page.scss'],
|
||||
})
|
||||
export class GroupDurationPage implements OnInit {
|
||||
|
||||
constructor(
|
||||
public popoverController: PopoverController,
|
||||
) { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
close(){
|
||||
this.popoverController.dismiss();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,12 +9,12 @@ import { GroupMessagesPageRoutingModule } from './group-messages-routing.module'
|
||||
|
||||
import { GroupMessagesPage } from './group-messages.page';
|
||||
|
||||
import { ChatPopoverPageModule } from 'src/app/shared/popover/chat-popover/chat-popover.module';
|
||||
import { BtnModalDismissPageModule } from 'src/app/shared/btn-modal-dismiss/btn-modal-dismiss.module';
|
||||
|
||||
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
||||
import { LettersAvatarModule } from "ngx-letters-avatar";
|
||||
import { PipesModule } from 'src/app/pipes/pipes.module';
|
||||
import { ChatPopoverPageModule } from '../chat-popover/chat-popover.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
|
||||
@@ -2,8 +2,6 @@ import { Component, ElementRef, OnInit, ViewChild, AfterViewInit, OnDestroy, Cha
|
||||
import { ModalController, NavParams, PopoverController, Platform } from '@ionic/angular';
|
||||
import { AlertService } from 'src/app/services/alert.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 { GroupContactsPage } from './group-contacts/group-contacts.page';
|
||||
import { Router } from '@angular/router'
|
||||
import { EditGroupPage } from '../edit-group/edit-group.page';
|
||||
@@ -36,6 +34,8 @@ import { sanitize } from "sanitize-filename-ts";
|
||||
import { FilePicker } from '@capawesome/capacitor-file-picker';
|
||||
import { ViewDocumentSecondOptionsPage } from 'src/app/modals/view-document-second-options/view-document-second-options.page';
|
||||
import { NewEventPage } from 'src/app/pages/agenda/new-event/new-event.page';
|
||||
import { ChatPopoverPage } from '../chat-popover/chat-popover.page';
|
||||
import { ChatOptionsPopoverPage } from '../chat-options-popover/chat-options-popover.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-group-messages',
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { MessagesOptionsPage } from './messages-options.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: MessagesOptionsPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class MessagesOptionsPageRoutingModule {}
|
||||
@@ -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 { MessagesOptionsPageRoutingModule } from './messages-options-routing.module';
|
||||
|
||||
import { MessagesOptionsPage } from './messages-options.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
MessagesOptionsPageRoutingModule
|
||||
],
|
||||
declarations: [MessagesOptionsPage]
|
||||
})
|
||||
export class MessagesOptionsPageModule {}
|
||||
@@ -0,0 +1,10 @@
|
||||
<ion-content class="container">
|
||||
<div class="arrow-right">
|
||||
<button class="btn-no-color" (click)="close()">
|
||||
<ion-icon src='assets/images/theme/gov/icons-calendar-arrow-right.svg'></ion-icon>
|
||||
</button>
|
||||
</div>
|
||||
<div class="buttons">
|
||||
<button (click)="closeChatRoom()" full class="btn-delete" shape="round" >Apagar conversa</button>
|
||||
</div>
|
||||
</ion-content>
|
||||
@@ -0,0 +1,60 @@
|
||||
@import '~src/function.scss';
|
||||
|
||||
.container{
|
||||
--padding-top:20px !important;
|
||||
--padding-bottom:20px !important;
|
||||
--padding-start:20px !important;
|
||||
--padding-end:20px !important;
|
||||
}
|
||||
.arrow-right{
|
||||
display: none;
|
||||
margin-bottom: 20px;
|
||||
.arrow-right-icon{
|
||||
width: 37px;
|
||||
float: right;
|
||||
font-size: rem(35);
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
.buttons{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-around;
|
||||
}
|
||||
.solid {
|
||||
display: block;
|
||||
width: 90%;
|
||||
border-top: 1px solid #bbb;
|
||||
margin: 10px auto !important;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 701px) {
|
||||
.arrow-right{
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.btn-cancel{
|
||||
//display: none;
|
||||
width: 100% !important;
|
||||
margin-bottom: 10px !important;
|
||||
}
|
||||
.btn-cancel:hover, .btn-delete:hover{
|
||||
background-color: var(--button-hover);
|
||||
color: #fff !important;
|
||||
}
|
||||
.btn-ok{
|
||||
width: 100% !important;
|
||||
}
|
||||
.btn-delete{
|
||||
width: 100% !important;
|
||||
margin-bottom: 10px !important;
|
||||
}
|
||||
.solid{
|
||||
display: block;
|
||||
}
|
||||
.mobile-only{
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { MessagesOptionsPage } from './messages-options.page';
|
||||
|
||||
describe('MessagesOptionsPage', () => {
|
||||
let component: MessagesOptionsPage;
|
||||
let fixture: ComponentFixture<MessagesOptionsPage>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ MessagesOptionsPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(MessagesOptionsPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,49 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||
import { ChatService } from 'src/app/services/chat.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-messages-options',
|
||||
templateUrl: './messages-options.page.html',
|
||||
styleUrls: ['./messages-options.page.scss'],
|
||||
})
|
||||
export class MessagesOptionsPage implements OnInit {
|
||||
|
||||
roomId:string;
|
||||
|
||||
constructor(
|
||||
private popoverController: PopoverController,
|
||||
private modalController: ModalController,
|
||||
private chatService: ChatService,
|
||||
private navParams: NavParams,
|
||||
public ThemeService: ThemeService,
|
||||
)
|
||||
{
|
||||
this.roomId = this.navParams.get('roomId');
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
// this.chatService.refreshtoken();
|
||||
}
|
||||
|
||||
close(){
|
||||
if( window.innerWidth <= 701){
|
||||
this.modalController.dismiss();
|
||||
this.popoverController.dismiss();
|
||||
}
|
||||
else{
|
||||
this.modalController.dismiss();
|
||||
this.popoverController.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
closeChatRoom(){
|
||||
let body = { "roomId": this.roomId }
|
||||
this.chatService.removeChatRoom(body).subscribe(res=>{
|
||||
|
||||
});
|
||||
this.close();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,8 +8,6 @@ import { ContactsPage } from 'src/app/ui/chat/modal/messages/contacts/contacts.p
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { FileService } from 'src/app/services/functions/file.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { ChatOptionsPopoverPage } from 'src/app/shared/popover/chat-options-popover/chat-options-popover.page';
|
||||
import { MessagesOptionsPage } from 'src/app/shared/popover/messages-options/messages-options.page';
|
||||
import { ChatMessageStore } from 'src/app/store/chat/chat-message.service';
|
||||
import { ChatUserStorage } from 'src/app/store/chat/chat-user.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
@@ -48,6 +46,8 @@ import { FilePickerService } from 'src/app/infra/file-picker/file-picker.service
|
||||
import { FilePickerMobileService } from 'src/app/infra/file-picker/mobile/file-picker-mobile.service'
|
||||
import { RecordingData } from 'capacitor-voice-recorder';
|
||||
import { Logger } from 'src/app/services/logger/main/service';
|
||||
import { MessagesOptionsPage } from '../messages-options/messages-options.page';
|
||||
import { ChatOptionsPopoverPage } from '../chat-options-popover/chat-options-popover.page';
|
||||
|
||||
const IMAGE_DIR = 'stored-images';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user