> git show --textconv :src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts

This commit is contained in:
Tiago Kayaya
2020-12-16 15:07:28 +01:00
parent be03b9c0d3
commit c720767774
25 changed files with 329 additions and 122 deletions
+8
View File
@@ -21,6 +21,14 @@ const routes: Routes = [
{
path: 'header',
loadChildren: () => import('./shared/header/header.module').then( m => m.HeaderPageModule)
},
{
path: 'header',
loadChildren: () => import('./shared/header/header.module').then( m => m.HeaderPageModule)
},
{
path: 'header-pr',
loadChildren: () => import('./shared/header-pr/header-pr.module').then( m => m.HeaderPrPageModule)
},
+9 -18
View File
@@ -112,24 +112,6 @@ const routes: Routes = [
}
]
},
/* {
path: 'expediente',
children: [
{
path:'',
loadChildren: ()=> import('../pages/gabinete-digital/expediente/expediente.module').then(m => m.ExpedientePageModule)
}
]
}, */
{
path: 'chat',
children: [
{
path:'',
loadChildren: ()=> import('../pages/chat/chat.module').then(m => m.ChatPageModule)
}
]
},
{
path: 'publications',
children: [
@@ -158,6 +140,15 @@ const routes: Routes = [
},
]
},
{
path: 'chat',
children: [
{
path:'',
loadChildren: ()=> import('../pages/chat/chat.module').then(m => m.ChatPageModule)
}
]
},
]
},
{
+1 -1
View File
@@ -27,7 +27,7 @@
<ion-label>Pesquisa</ion-label>
</ion-tab-button> -->
<!-- <ion-tab-button tab="chat">
<ion-icon name="chatbubbles"></ion-icon>
<ion-icon class="nav-icon" src="assets/images/icons-nav-chat-inactive.svg"></ion-icon>
<ion-label>Chat</ion-label>
</ion-tab-button> -->
</ion-tab-bar>
+6 -3
View File
@@ -1,4 +1,4 @@
import { NgModule } from '@angular/core';
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
@@ -7,14 +7,17 @@ import { IonicModule } from '@ionic/angular';
import { ChatPageRoutingModule } from './chat-routing.module';
import { ChatPage } from './chat.page';
import { SharedModule } from 'src/app/shared/shared.module';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
ChatPageRoutingModule
SharedModule,
ChatPageRoutingModule,
],
declarations: [ChatPage]
declarations: [ChatPage],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class ChatPageModule {}
+21 -6
View File
@@ -1,12 +1,24 @@
<ion-header>
<ion-toolbar>
<ion-title>Chat</ion-title>
<ion-icon slot="end" src="assets/images/icons-chat-new-group.svg" class="iconschatnew-group"></ion-icon>
<ion-icon slot="end" src="assets/images/icons-chat-new-conversation.svg" class="iconschatnew-conversation" [routerLink]="['/home/chat/newchat']"></ion-icon>
<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">Chat</ion-label>
</div>
<div class="div-icon">
<ion-icon slot="end" src="assets/images/icons-chat-new-group.svg" ></ion-icon>
<ion-icon slot="end" src="assets/images/icons-chat-new-conversation.svg" [routerLink]="['/home/chat/newchat']"></ion-icon>
</div>
</div>
</div>
</ion-toolbar>
</ion-header>
<ion-content>
<div class="main-content">
<ion-toolbar >
<ion-segment [(ngModel)]="segment" (ionChange)="onSegmentChange()">
<ion-segment-button value="Contactos">
@@ -17,8 +29,11 @@
</ion-segment-button>
</ion-segment>
</ion-toolbar>
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
</ion-refresher>
<div [ngSwitch]="segment">
<ion-list *ngSwitchCase="'Contactos'" >
<ion-list *ngSwitchCase="'Contactos'">
<ion-item-group>
<ion-item-sliding>
<ion-item *ngFor="let user of userConnectedList" (click)="starConversation(user)">
@@ -46,6 +61,6 @@
</ion-list>
</div>
</div>
</ion-content>
+47
View File
@@ -20,4 +20,51 @@
width: 40px;
height: 40px;
object-fit: contain;
}
.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;
}
.div-title{
padding: 0!important;
float: left;
}
.title{
font-size: 25px;
}
.div-icon{
width: 112px;
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;
}
+14 -8
View File
@@ -10,6 +10,7 @@ import { ConversationPage } from './conversation/conversation.page';
styleUrls: ['./chat.page.scss'],
})
export class ChatPage implements OnInit {
showLoader: boolean;
loggedUser: any;
/* Set segment variable */
segment:string;
@@ -24,28 +25,33 @@ export class ChatPage implements OnInit {
ngOnInit() {
this.segment = "Contactos";
this.authService.userData$.subscribe((res:any)=>{
this.loggedUser=res;
});
this.doRefresh();
}
onSegmentChange(){
this.doRefresh();
}
doRefresh(){
this.getGroups();
this.getConnectedUsers();
}
onSegmentChange(){
this.RefreshEvents();
}
RefreshEvents(){}
getGroups(){
this.showLoader = true;
this.result = this.chatService.getAllPrivateGroups().subscribe((res:any)=>{
this.groupList = res.groups;
/* console.log(this.groupList); */
this.showLoader = false;
});
}
getConnectedUsers(){
this.showLoader = true;
this.result = this.chatService.getAllConnectedUsers().subscribe((res:any)=>{
this.userConnectedList = res.users;
console.log(this.userConnectedList);
this.showLoader = false;
});
}
async starConversation(selectedUser) {
const modal = await this.modalController.create({
component: ConversationPage,
+9 -25
View File
@@ -55,28 +55,15 @@ export class LoginPage implements OnInit {
await alert.present();
}
loginAction(){
if(this.validateInput()){
/* this.authService.loginChat2(this.postData).subscribe((res: any) =>{
if(res.data){
this.storageService.store(AuthConnstants.AUTH, res.data);
console.log('Log RockectChat OK');
//console.log(res.data);
}
else{
console.log("Invalid username or password!");
}
},
(error:any) =>{
console.log('Network error');
}) */
}
else{
this.presentAlert('Por favor, insira o seu nome de utilizador e palavra-passe.');
}
loginRocketChat(){
this.authService.loginChat(this.postData).subscribe((res: any) =>{
console.log('Login to Rocket chat OK');
},(error:any) =>{
console.log('Network error');
});
}
async Login(){
try {
@@ -90,7 +77,7 @@ export class LoginPage implements OnInit {
BasicAuthKey: ""
}
if (await this.authService.login(this.userattempt)){
this.loginAction();
this.loginRocketChat();
console.log('Log Gabinete Digital OK');
this.router.navigate(['/home/events']);
}
@@ -108,7 +95,4 @@ export class LoginPage implements OnInit {
this.presentAlert('Ocorreu um erro ao fazer login. Contacte o administrador de sistema.');
}
}
openCamera(){
this.photoService.takePicture();
}
}
@@ -7,12 +7,14 @@ import { IonicModule } from '@ionic/angular';
import { PublicationsPageRoutingModule } from './publications-routing.module';
import { PublicationsPage } from './publications.page';
import { SharedModule } from 'src/app/shared/shared.module';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
SharedModule,
PublicationsPageRoutingModule
],
declarations: [PublicationsPage]
@@ -1,4 +1,7 @@
<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="div-top-header">
<div class="div-search">
@@ -12,7 +15,7 @@
</div>
</div>
</ion-toolbar>
</ion-header>
</ion-header> -->
<ion-header class="ion-no-border">
<ion-toolbar class="bg-blue">
<div class="main-header">
@@ -36,8 +39,6 @@
</ion-refresher-content>
</ion-refresher>
<div class="main-content">
<!-- [routerLink]="['/home/publications/view-publications', folder.ProcessId]" -->
<div class="item"
*ngFor="let viagem of publicationsTravelFolderList"
@@ -54,7 +54,33 @@ ion-toolbar{
overflow:hidden;
padding: 30px 20px 0px 20px;
color:#000;
transform: translate3d(0, 5px, 0);
transform: translate3d(0, 1px, 0);
.title-content{
width: 360px;
margin: 0px auto;
overflow: auto;
padding: 0 !important;
background: #fff;
}
.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;
}
}
.main-content{
width: 100%; /* 400px */
@@ -65,26 +91,6 @@ ion-toolbar{
overflow:auto;
padding: 15px 20px 0 20px;
}
.title-content{
width: 360px;
margin: 0px auto;
overflow: auto;
padding: 0 !important;
background: #fff;
}
.div-title{
padding: 0!important;
float: left;
}
.title{
font-size: 25px;
}
.div-icon{
width: 40px;
float: right;
font-size: 35px;
overflow: auto;
}
.item{
width: 360px;
padding: 0 0px 0 0px;
@@ -27,6 +27,11 @@
<p class="post-data">{{publication.DatePublication | date: 'dd-MM-yy | h:mm'}}</p>
</div>
</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 class="post-item">
<div *ngIf="publication.FileBase64.length > 30" class="post-img">
<img src="{{publication.FileBase64}}" alt="image" tappable (click)="openPreview(publication.FileBase64)">
@@ -11,7 +11,7 @@ import { NewPublicationPage } from '../../new-publication/new-publication.page';
styleUrls: ['./publication-detail.page.scss'],
})
export class PublicationDetailPage implements OnInit {
showLoader: boolean;
publicationId: string;
folderId: string;
publication: Publication;
@@ -42,6 +42,7 @@ export class PublicationDetailPage implements OnInit {
}
getPublicationDetail(){
this.showLoader = true;
console.log(this.publicationId);
console.log(this.folderId);
this.publications.GetPublicationById(this.folderId,this.publicationId).subscribe(res=>{
@@ -56,7 +57,8 @@ export class PublicationDetailPage implements OnInit {
OriginalFileName: '',
FileExtension: '',
}
})
this.showLoader = false;
});
}
close(){
+1 -7
View File
@@ -44,14 +44,8 @@ export class AuthService {
}
loginChat(){
const body = {"user": "admin","password": "tabteste@006"};
const url = "http://192.168.100.111:3000/api/v1/login";
return this.http.post(url, body);
}
//Login to rocketChat server
loginChat2(postData: any):Observable<any> {
loginChat(postData: any):Observable<any> {
return this.httpService.post('login', postData);
}
@@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { HeaderPrPage } from './header-pr.page';
const routes: Routes = [
{
path: '',
component: HeaderPrPage
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class HeaderPrPageRoutingModule {}
@@ -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 { HeaderPrPageRoutingModule } from './header-pr-routing.module';
import { HeaderPrPage } from './header-pr.page';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
HeaderPrPageRoutingModule
],
declarations: [HeaderPrPage]
})
export class HeaderPrPageModule {}
@@ -0,0 +1,13 @@
<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-pr.svg'></ion-icon>
</div>
</div>
</ion-toolbar>
@@ -0,0 +1,28 @@
.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;
}
}
@@ -0,0 +1,24 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';
import { HeaderPrPage } from './header-pr.page';
describe('HeaderPrPage', () => {
let component: HeaderPrPage;
let fixture: ComponentFixture<HeaderPrPage>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ HeaderPrPage ],
imports: [IonicModule.forRoot()]
}).compileComponents();
fixture = TestBed.createComponent(HeaderPrPage);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-header-pr',
templateUrl: './header-pr.page.html',
styleUrls: ['./header-pr.page.scss'],
})
export class HeaderPrPage implements OnInit {
constructor() { }
ngOnInit() {
}
}
+3 -3
View File
@@ -1,6 +1,5 @@
<ion-header class="ion-no-border">
<ion-toolbar class="ion-no-border">
<div class="div-top-header">
<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>
@@ -12,3 +11,4 @@
</div>
</div>
</ion-toolbar>
+9 -22
View File
@@ -1,21 +1,11 @@
:host{
background: #0782c9;
}
ion-content{
--background: transparent;
}
ion-toolbar{
background: transparent;
border-width: 0 !important;
}
.div-top-header{
width: 400px;
margin: 0 auto;
background-color: #0782c9;
overflow: auto;
padding-top: 15px;
border: 0!important;
}
.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;
@@ -35,7 +25,4 @@
float: right;
margin-right: 10px;
}
ion-content{
--background:#0782c9;
--border: none;
}
}
@@ -2,6 +2,8 @@ import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { IonicModule } from '@ionic/angular';
import { HeaderPage } from './header/header.page';
import { HeaderPrPage } from './header-pr/header-pr.page';
@NgModule({
imports: [
@@ -9,8 +11,8 @@ import { IonicModule } from '@ionic/angular';
FormsModule,
IonicModule,
],
exports: [],
exports: [HeaderPage, HeaderPrPage],
entryComponents:[],
declarations: []
declarations: [HeaderPage, HeaderPrPage]
})
export class SharedModule {}