mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
save
This commit is contained in:
@@ -11,7 +11,11 @@ const routes: Routes = [
|
|||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
loadChildren: () => import('./home/home.module').then( m => m.HomePageModule)
|
loadChildren: () => import('./home/home.module').then( m => m.HomePageModule)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'empty-chat',
|
||||||
loadChildren: () => import('./shared/chat/empty-chat/empty-chat.module').then( m => m.EmptyChatPageModule)
|
loadChildren: () => import('./shared/chat/empty-chat/empty-chat.module').then( m => m.EmptyChatPageModule)
|
||||||
|
},
|
||||||
|
|
||||||
/* {
|
/* {
|
||||||
path: 'chat',
|
path: 'chat',
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ import { SharedModule } from 'src/app/shared/shared.module';
|
|||||||
import { RouterModule } from '@angular/router';
|
import { RouterModule } from '@angular/router';
|
||||||
import { GroupMessagesPage } from 'src/app/shared/chat/group-messages/group-messages.page';
|
import { GroupMessagesPage } from 'src/app/shared/chat/group-messages/group-messages.page';
|
||||||
import { MessagesPage } from 'src/app/shared/chat/messages/messages.page';
|
import { MessagesPage } from 'src/app/shared/chat/messages/messages.page';
|
||||||
|
import { EmptyChatPage } from 'src/app/shared/chat/empty-chat/empty-chat.page';
|
||||||
|
import { ContactsPage } from 'src/app/shared/chat/messages/contacts/contacts.page';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
@@ -24,9 +26,10 @@ import { MessagesPage } from 'src/app/shared/chat/messages/messages.page';
|
|||||||
declarations: [
|
declarations: [
|
||||||
ChatPage,
|
ChatPage,
|
||||||
MessagesPage,
|
MessagesPage,
|
||||||
|
ContactsPage,
|
||||||
GroupMessagesPage,
|
GroupMessagesPage,
|
||||||
],
|
],
|
||||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||||
entryComponents: [MessagesPage, GroupMessagesPage]
|
entryComponents: [MessagesPage,ContactsPage, GroupMessagesPage]
|
||||||
})
|
})
|
||||||
export class ChatPageModule {}
|
export class ChatPageModule {}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="div-icon">
|
<div class="div-icon">
|
||||||
<ion-icon slot="end" (click)="newGroup()" src="assets/images/icons-chat-new-group.svg" ></ion-icon>
|
<ion-icon slot="end" (click)="newGroup()" src="assets/images/icons-chat-new-group.svg" ></ion-icon>
|
||||||
<ion-icon slot="end" (click)="selectContact()" src="assets/images/icons-chat-new-conversation.svg"></ion-icon>
|
<ion-icon slot="end" (click)="openContactsPage()" src="assets/images/icons-chat-new-conversation.svg"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<ion-toolbar>
|
<ion-toolbar>
|
||||||
@@ -90,8 +90,10 @@
|
|||||||
<!-- <ion-button (click)="openMessagesPage()">Messages</ion-button>
|
<!-- <ion-button (click)="openMessagesPage()">Messages</ion-button>
|
||||||
<ion-button (click)="openGroupMessagesPage('MduvQyrQBejb3xMrY')">Groups</ion-button>
|
<ion-button (click)="openGroupMessagesPage('MduvQyrQBejb3xMrY')">Groups</ion-button>
|
||||||
<ion-button (click)="destroyComponent()">Destroy</ion-button> -->
|
<ion-button (click)="destroyComponent()">Destroy</ion-button> -->
|
||||||
|
<app-empty-chat class="d-flex height-100" *ngIf="showEmptyComponent"></app-empty-chat>
|
||||||
<app-messages class="d-flex height-100 flex-column" [roomId]="roomId" *ngIf="showMessages" #messagecontainer></app-messages>
|
<app-messages class="d-flex height-100 flex-column" [roomId]="roomId" *ngIf="showMessages" #messagecontainer></app-messages>
|
||||||
<app-group-messages class="d-flex height-100 flex-column" [roomId]="roomId" *ngIf="showGroupMessages" #messagecontainer></app-group-messages>
|
<app-contacts *ngIf="showContacts" class="d-flex height-100"></app-contacts>
|
||||||
|
<app-group-messages *ngIf="showGroupMessages" class="d-flex height-100 flex-column" [roomId]="roomId" #messagecontainer></app-group-messages>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
|||||||
@@ -57,7 +57,9 @@ export class ChatPage implements OnInit {
|
|||||||
componentRef: any;
|
componentRef: any;
|
||||||
|
|
||||||
roomId:any;
|
roomId:any;
|
||||||
|
showEmptyComponent=true;
|
||||||
showMessages=false;
|
showMessages=false;
|
||||||
|
showContacts=false;
|
||||||
showGroupMessages=false;
|
showGroupMessages=false;
|
||||||
|
|
||||||
@Output() getRoomInfo;
|
@Output() getRoomInfo;
|
||||||
@@ -99,7 +101,9 @@ export class ChatPage implements OnInit {
|
|||||||
}
|
}
|
||||||
closeAllDesktopComponents() {
|
closeAllDesktopComponents() {
|
||||||
this.showMessages=false;
|
this.showMessages=false;
|
||||||
|
this.showContacts=false;
|
||||||
this.showGroupMessages=false;
|
this.showGroupMessages=false;
|
||||||
|
this.showEmptyComponent=false;
|
||||||
}
|
}
|
||||||
openMessagesPage(rid) {
|
openMessagesPage(rid) {
|
||||||
if( window.innerWidth <= 1024){
|
if( window.innerWidth <= 1024){
|
||||||
@@ -107,22 +111,35 @@ export class ChatPage implements OnInit {
|
|||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
this.closeAllDesktopComponents();
|
this.closeAllDesktopComponents();
|
||||||
|
this.showEmptyComponent = false;
|
||||||
this.roomId = rid;
|
this.roomId = rid;
|
||||||
this.showMessages=true;
|
this.showMessages=true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
openContactsPage() {
|
||||||
|
console.log('OK');
|
||||||
|
this.closeAllDesktopComponents();
|
||||||
|
|
||||||
|
if( window.innerWidth <= 1024){
|
||||||
|
//this.selectContact();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
console.log('here');
|
||||||
|
this.showContacts=true;
|
||||||
|
}
|
||||||
|
}
|
||||||
openGroupMessagesPage(rid) {
|
openGroupMessagesPage(rid) {
|
||||||
if( window.innerWidth <= 1024){
|
if( window.innerWidth <= 1024){
|
||||||
this.openGroupMessagesModal(rid);
|
this.openGroupMessagesModal(rid);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
this.closeAllDesktopComponents();
|
this.closeAllDesktopComponents();
|
||||||
|
this.showEmptyComponent = false;
|
||||||
this.roomId = rid;
|
this.roomId = rid;
|
||||||
this.showGroupMessages=true;
|
this.showGroupMessages=true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
onSegmentChange(){
|
onSegmentChange(){
|
||||||
this.load();
|
this.load();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
|
||||||
|
import { EmptyChatPage } from './empty-chat.page';
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: EmptyChatPage
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [RouterModule.forChild(routes)],
|
||||||
|
exports: [RouterModule],
|
||||||
|
})
|
||||||
|
export class EmptyChatPageRoutingModule {}
|
||||||
@@ -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 { EmptyChatPageRoutingModule } from './empty-chat-routing.module';
|
||||||
|
|
||||||
|
import { EmptyChatPage } from './empty-chat.page';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
FormsModule,
|
||||||
|
IonicModule,
|
||||||
|
EmptyChatPageRoutingModule
|
||||||
|
],
|
||||||
|
declarations: [EmptyChatPage]
|
||||||
|
})
|
||||||
|
export class EmptyChatPageModule {}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<ion-content>
|
||||||
|
<div class="center height-100">
|
||||||
|
<p>Sem conversa selecionada</p>
|
||||||
|
</div>
|
||||||
|
</ion-content>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
.center {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||||
|
import { IonicModule } from '@ionic/angular';
|
||||||
|
|
||||||
|
import { EmptyChatPage } from './empty-chat.page';
|
||||||
|
|
||||||
|
describe('EmptyChatPage', () => {
|
||||||
|
let component: EmptyChatPage;
|
||||||
|
let fixture: ComponentFixture<EmptyChatPage>;
|
||||||
|
|
||||||
|
beforeEach(waitForAsync(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ EmptyChatPage ],
|
||||||
|
imports: [IonicModule.forRoot()]
|
||||||
|
}).compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(EmptyChatPage);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
}));
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-empty-chat',
|
||||||
|
templateUrl: './empty-chat.page.html',
|
||||||
|
styleUrls: ['./empty-chat.page.scss'],
|
||||||
|
})
|
||||||
|
export class EmptyChatPage implements OnInit {
|
||||||
|
|
||||||
|
constructor() { }
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -8,7 +8,7 @@ import { ContactsPageRoutingModule } from './contacts-routing.module';
|
|||||||
|
|
||||||
import { ContactsPage } from './contacts.page';
|
import { ContactsPage } from './contacts.page';
|
||||||
import { SharedModule } from 'src/app/shared/shared.module';
|
import { SharedModule } from 'src/app/shared/shared.module';
|
||||||
import { PipesModule } from 'src/app/pipes/pipes.module';
|
import { FilterPipe } from 'src/app/pipes/filter.pipe';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
@@ -16,9 +16,9 @@ import { PipesModule } from 'src/app/pipes/pipes.module';
|
|||||||
FormsModule,
|
FormsModule,
|
||||||
IonicModule,
|
IonicModule,
|
||||||
SharedModule,
|
SharedModule,
|
||||||
PipesModule,
|
|
||||||
ContactsPageRoutingModule
|
ContactsPageRoutingModule
|
||||||
],
|
],
|
||||||
declarations: [ContactsPage]
|
exports: [FilterPipe],
|
||||||
|
declarations: [ContactsPage, FilterPipe]
|
||||||
})
|
})
|
||||||
export class ContactsPageModule {}
|
export class ContactsPageModule {}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { BtnSeguintePage } from './btn-seguinte/btn-seguinte.page';
|
|||||||
import { BtnModalDismissPage } from './btn-modal-dismiss/btn-modal-dismiss.page';
|
import { BtnModalDismissPage } from './btn-modal-dismiss/btn-modal-dismiss.page';
|
||||||
import { ChatPopoverPage } from './popover/chat-popover/chat-popover.page';
|
import { ChatPopoverPage } from './popover/chat-popover/chat-popover.page';
|
||||||
import { HeaderNoSearchPage } from './headers/header-no-search/header-no-search.page';
|
import { HeaderNoSearchPage } from './headers/header-no-search/header-no-search.page';
|
||||||
|
import { EmptyChatPage } from './chat/empty-chat/empty-chat.page';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
@@ -21,6 +22,7 @@ import { HeaderNoSearchPage } from './headers/header-no-search/header-no-search.
|
|||||||
HeaderNoSearchPage,
|
HeaderNoSearchPage,
|
||||||
BtnSeguintePage,
|
BtnSeguintePage,
|
||||||
BtnModalDismissPage,
|
BtnModalDismissPage,
|
||||||
|
EmptyChatPage,
|
||||||
],
|
],
|
||||||
entryComponents:[],
|
entryComponents:[],
|
||||||
declarations: [
|
declarations: [
|
||||||
@@ -29,6 +31,7 @@ import { HeaderNoSearchPage } from './headers/header-no-search/header-no-search.
|
|||||||
HeaderNoSearchPage,
|
HeaderNoSearchPage,
|
||||||
BtnSeguintePage,
|
BtnSeguintePage,
|
||||||
BtnModalDismissPage,
|
BtnModalDismissPage,
|
||||||
|
EmptyChatPage,
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class SharedModule {}
|
export class SharedModule {}
|
||||||
Reference in New Issue
Block a user