git pull made

This commit is contained in:
Eudes Inácio
2021-12-08 19:48:33 +01:00
49 changed files with 501 additions and 146 deletions
+4
View File
@@ -223,6 +223,10 @@ const routes = [
{ {
path: 'custom-image-cache', path: 'custom-image-cache',
loadChildren: () => import('./services/file/custom-image-cache/custom-image-cache.module').then( m => m.CustomImageCachePageModule) loadChildren: () => import('./services/file/custom-image-cache/custom-image-cache.module').then( m => m.CustomImageCachePageModule)
},
{
path: 'view-media',
loadChildren: () => import('./modals/view-media/view-media.module').then( m => m.ViewMediaPageModule)
}, },
@@ -133,6 +133,7 @@
.close-button { .close-button {
display: none; display: none;
height: 20px;
} }
@@ -144,12 +145,13 @@
.close-button { .close-button {
display: block !important; display: block !important;
height: 20px;
} }
} }
.app-name{ .app-name{
background: #42b9f2; background: var(--title-text-color);
border-radius: 18px; border-radius: 18px;
text-align: center; text-align: center;
display: flex; display: flex;
@@ -175,7 +175,7 @@
.app-name{ .app-name{
background: #42b9f2; background: var(--title-text-color);
border-radius: 18px; border-radius: 18px;
text-align: center; text-align: center;
display: flex; display: flex;
@@ -194,6 +194,7 @@
.close-button { .close-button {
display: none; display: none;
height: 20px;
} }
@@ -205,6 +206,7 @@
.close-button { .close-button {
display: block !important; display: block !important;
height: 20px;
} }
} }
@@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { ViewMediaPage } from './view-media.page';
const routes: Routes = [
{
path: '',
component: ViewMediaPage
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class ViewMediaPageRoutingModule {}
@@ -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 { ViewMediaPageRoutingModule } from './view-media-routing.module';
import { ViewMediaPage } from './view-media.page';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
FontAwesomeModule,
ViewMediaPageRoutingModule
],
declarations: [ViewMediaPage]
})
export class ViewMediaPageModule {}
@@ -0,0 +1,22 @@
<ion-header class="ion-no-border" translucent>
<div class="main-header d-flex align-items-center">
<div class= "left cursor-pointer" (click)="close()">
<button class="btn-no-color" (click)="close()">
<fa-icon icon="chevron-left" class="header-top-btn font-awesome-1 font-35"></fa-icon>
</button>
</div>
<div class="middle-container">
<div class="middle">
<ion-label class="title">{{name}}<span class="font-15">, {{_updatedAt | date}}</span>
</ion-label>
</div>
</div>
</div>
</ion-header>
<ion-content fullscreen>
<div class="media d-flex align-items-center justify-center">
<div class="media-content w-100 d-flex align-items-center justify-center">
<img src="{{image}}"/>
</div>
</div>
</ion-content>
@@ -0,0 +1,79 @@
.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 5px 20px;
color:#000;
transform: translate3d(0, 1px, 0);
.left{
width: fit-content;
float: left;
//font-size: 35px;
overflow: hidden;
.header-top-btn{
background: transparent;
font-size: 25px !important;
font-weight: 100 !important;
/* color: #0782c9; */
color: #42b9fe;
}
}
.middle-container{
overflow: auto;
width:calc(100% - 45px);
height: auto;
.middle{
padding: 0!important;
float: left;
width:calc(100% - 77px);
margin: 0px 0 0 10px;
display: flex;
align-items: center;
.title{
font-size: 25px;
white-space: nowrap;
overflow: hidden !important;
text-overflow: ellipsis !important;
float: left;
}
}
}
}
.media {
background-color: #ebebeb;
padding: 10px !important;
height: 100% !important;
overflow: auto !important;
.media-content{
height: fit-content !important;
overflow: auto !important;
img{
width: fit-content !important;
height: 100% !important;
}
}
}
@media only screen and (min-width: 800px) {
.media {
.media-content{
height: 100% !important;
}
}
}
@@ -0,0 +1,24 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';
import { ViewMediaPage } from './view-media.page';
describe('ViewMediaPage', () => {
let component: ViewMediaPage;
let fixture: ComponentFixture<ViewMediaPage>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ ViewMediaPage ],
imports: [IonicModule.forRoot()]
}).compileComponents();
fixture = TestBed.createComponent(ViewMediaPage);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,30 @@
import { Component, OnInit } from '@angular/core';
import { ModalController, NavParams } from '@ionic/angular';
@Component({
selector: 'app-view-media',
templateUrl: './view-media.page.html',
styleUrls: ['./view-media.page.scss'],
})
export class ViewMediaPage implements OnInit {
image: any;
name: string
_updatedAt: string
constructor(
private modalController: ModalController,
private navParams:NavParams,
) {
this.image = this.navParams.get('image')
this.name = this.navParams.get('username')
this._updatedAt = this.navParams.get('_updatedAt')
}
ngOnInit() {
}
close(){
this.modalController.dismiss()
}
}
@@ -169,7 +169,7 @@
.app-name{ .app-name{
background: #42b9f2; background: var(--title-text-color);
border-radius: 18px; border-radius: 18px;
text-align: center; text-align: center;
display: flex; display: flex;
@@ -188,6 +188,7 @@
.close-button { .close-button {
display: none; display: none;
height: 20px;
} }
@@ -199,5 +200,6 @@
.close-button { .close-button {
display: block !important; display: block !important;
height: 20px;
} }
} }
@@ -180,7 +180,7 @@ ion-content{
.app-name{ .app-name{
background: #42b9f2; background: var(--title-text-color);
border-radius: 18px; border-radius: 18px;
text-align: center; text-align: center;
display: flex; display: flex;
@@ -199,6 +199,7 @@ ion-content{
.close-button { .close-button {
display: none; display: none;
height: 20px;
} }
+4 -4
View File
@@ -158,14 +158,14 @@ export class ChatPage implements OnInit {
console.log(t); console.log(t);
this.setStatus('away'); this.setStatus('away');
if (this.dataService.get("newGroup")) { /* if(this.dataService.get("newGroup")){
this.openNewGroupPage(); this.openNewGroupPage();
} } */
this.router.events.forEach((event) => { this.router.events.forEach((event) => {
if (event instanceof NavigationStart && event.url.startsWith('/home/chat')) { if (event instanceof NavigationStart && event.url.startsWith('/home/chat')) {
if (window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/chat')) { if (window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/chat')) {
alert('OIII') //alert('OIII')
} else { } else {
if (this.dataService.get("newGroup")) { if (this.dataService.get("newGroup")) {
this.openNewGroupPage(); this.openNewGroupPage();
@@ -456,7 +456,7 @@ export class ChatPage implements OnInit {
updatedat: element._updatedAt updatedat: element._updatedAt
} }
console.log('TRANSFORM ROOM LIST',roomList ) console.log('TRANSFORM ROOM LIST', roomList)
this.sqlservice.addChatListRoom(roomList); this.sqlservice.addChatListRoom(roomList);
}); });
} }
@@ -19,15 +19,14 @@ import { AngularCropperjsModule } from 'angular-cropperjs';
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, CommonModule,
BrowserModule,
FormsModule, FormsModule,
FontAwesomeModule, FontAwesomeModule,
IonicModule, IonicModule,
GroupMessagesPageRoutingModule, GroupMessagesPageRoutingModule,
ChatPopoverPageModule, ChatPopoverPageModule,
BtnModalDismissPageModule, BtnModalDismissPageModule,
ImageCropperModule, /* ImageCropperModule,
AngularCropperjsModule AngularCropperjsModule */
], ],
declarations: [GroupMessagesPage] declarations: [GroupMessagesPage]
@@ -53,7 +53,7 @@
<div (click)="handleClick()" class="messages overflow-y-auto" #scrollMe> <div (click)="handleClick()" class="messages overflow-y-auto" #scrollMe>
<div class="welcome-text"> <div class="welcome-text">
<ion-label>Esta conversa passou a grupo</ion-label><br /> <ion-label>Esta conversa passou a grupo TIAGO</ion-label><br />
<ion-label>A conversa original mantêm-se como chat individual</ion-label> <ion-label>A conversa original mantêm-se como chat individual</ion-label>
</div> </div>
<div class="messages-list-item-wrapper container-width-100" *ngFor="let msg of messages; let last = last" [class.messages-list-item-wrapper-active]="msg._id == selectedMsgId"> <div class="messages-list-item-wrapper container-width-100" *ngFor="let msg of messages; let last = last" [class.messages-list-item-wrapper-active]="msg._id == selectedMsgId">
@@ -60,7 +60,9 @@
<ion-label>{{msg.msg}}</ion-label> <ion-label>{{msg.msg}}</ion-label>
<div *ngIf="msg.attachments" class="message-attachments"> <div *ngIf="msg.attachments" class="message-attachments">
<div *ngFor="let file of msg.attachments let i = index"> <div *ngFor="let file of msg.attachments let i = index">
<img *ngIf="file.image_url" src="{{file.image_url}}" alt="image" (click)="imageSize(file.image_url)"> <div (click)="openPreview(msg)">
<img *ngIf="file.image_url" src="{{file.image_url}}" alt="image">
</div>
<div> <div>
<div> <div>
<div class="file"> <div class="file">
+2 -3
View File
@@ -26,6 +26,7 @@ import { Haptics, ImpactStyle } from '@capacitor/haptics';
import { PreviewCameraPage } from 'src/app/modals/preview-camera/preview-camera.page'; import { PreviewCameraPage } from 'src/app/modals/preview-camera/preview-camera.page';
import { SqliteService } from 'src/app/services/sqlite.service'; import { SqliteService } from 'src/app/services/sqlite.service';
import { elementAt } from 'rxjs-compat/operator/elementAt'; import { elementAt } from 'rxjs-compat/operator/elementAt';
import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
const IMAGE_DIR = 'stored-images'; const IMAGE_DIR = 'stored-images';
@@ -713,15 +714,13 @@ touchStart(card) {
async openPreview(msg) { async openPreview(msg) {
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: PreviewCameraPage, component: ViewMediaPage,
cssClass: 'modal modal-desktop', cssClass: 'modal modal-desktop',
componentProps: { componentProps: {
image: msg.attachments[0].image_url, image: msg.attachments[0].image_url,
username: msg.u.name, username: msg.u.name,
_updatedAt: msg._updatedAt, _updatedAt: msg._updatedAt,
} }
}); });
modal.present(); modal.present();
} }
@@ -105,7 +105,7 @@
.attach-title-item{ .attach-title-item{
width: 100%; width: 100%;
font-size: 15px; font-size: 15px;
color:#0d89d1; color:var(--title-text-color);
} }
/* SPAN */ /* SPAN */
.span-left{ .span-left{
@@ -144,7 +144,7 @@ ion-menu{
.app-name{ .app-name{
background: #42b9f2; background: var(--title-text-color);
border-radius: 18px; border-radius: 18px;
text-align: center; text-align: center;
display: flex; display: flex;
@@ -163,18 +163,20 @@ ion-menu{
.close-button { .close-button {
display: none; display: none;
height: 20px;
} }
.list:hover { .list:hover {
.app-name { .app-name {
display: none; display: none;
} }
.close-button { .close-button {
display: block !important; display: block !important;
} height: 20px;
}
} }
.attach-title-item{ .attach-title-item{
@@ -174,7 +174,7 @@
.app-name{ .app-name{
background: #42b9f2; background: var(--title-text-color);
border-radius: 18px; border-radius: 18px;
text-align: center; text-align: center;
display: flex; display: flex;
@@ -193,6 +193,7 @@
.close-button { .close-button {
display: none; display: none;
height: 20px;
} }
@@ -154,7 +154,7 @@ font-size: 13px;
.app-name{ .app-name{
background: #42b9f2; background: var(--title-text-color);
border-radius: 18px; border-radius: 18px;
text-align: center; text-align: center;
display: flex; display: flex;
@@ -173,6 +173,7 @@ font-size: 13px;
.close-button { .close-button {
display: none; display: none;
height: 20px;
} }
@@ -189,7 +190,7 @@ font-size: 13px;
.app-name{ .app-name{
background: #42b9f2; background: var(--title-text-color);
border-radius: 18px; border-radius: 18px;
text-align: center; text-align: center;
display: flex; display: flex;
@@ -118,7 +118,7 @@
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button> <button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button> <button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button> <button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
<button (click)="openNewGroupPage()" class="btn-cancel" shape="round" >Iniciar Conversa</button> <button (click)="openNewGroupPage(task)" class="btn-cancel" shape="round" >Iniciar Conversa</button>
<div hidden class="solid"></div> <div hidden class="solid"></div>
<button hidden class="btn-cancel" shape="round" >Delegar</button> <button hidden class="btn-cancel" shape="round" >Delegar</button>
</div> --> </div> -->
@@ -642,8 +642,8 @@ export class ExpedienteDetailPage implements OnInit {
} }
else { else {
this.dataService.set("newGroup", true); this.dataService.set("newGroup", true);
/* this.closeAllDesktopComponents(); this.dataService.set("task", this.task);
this.showNewGroup=true; */ this.dataService.set("newGroupName", this.task.Folio);
} }
} }
@@ -653,6 +653,7 @@ export class ExpedienteDetailPage implements OnInit {
cssClass: 'modal modal-desktop', cssClass: 'modal modal-desktop',
componentProps: { componentProps: {
name: this.task.Folio, name: this.task.Folio,
task: this.task
}, },
}); });
await modal.present(); await modal.present();
@@ -130,6 +130,9 @@
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button> <button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button> <button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
</div> </div>
<div class="buttons">
<button (click)="openNewGroupPage(task)" class="btn-cancel" shape="round" >Iniciar Conversa</button>
</div>
</div> </div>
</div> </div>
</div> </div>
@@ -26,6 +26,8 @@ import { BackgroundService } from 'src/app/services/background.service';
import { PermissionService } from 'src/app/services/worker/permission.service'; import { PermissionService } from 'src/app/services/worker/permission.service';
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page'; import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
import { ThemeService } from 'src/app/services/theme.service' import { ThemeService } from 'src/app/services/theme.service'
import { DataService } from 'src/app/services/data.service';
import { NewGroupPage } from 'src/app/pages/chat/new-group/new-group.page';
@Component({ @Component({
@@ -66,7 +68,8 @@ export class PedidoPage implements OnInit {
private sqliteservice: SqliteService, private sqliteservice: SqliteService,
private backgroundservices: BackgroundService, private backgroundservices: BackgroundService,
private platform: Platform, private platform: Platform,
public ThemeService: ThemeService public ThemeService: ThemeService,
private dataService: DataService,
) { ) {
this.loggeduser = authService.ValidatedUser; this.loggeduser = authService.ValidatedUser;
@@ -477,6 +480,33 @@ export class PedidoPage implements OnInit {
modal.onDidDismiss(); modal.onDidDismiss();
} }
openNewGroupPage(task?:any){
this.router.navigate(['/home/chat']);
this.dataService.set("newGroup", true);
if( window.innerWidth < 801){
this.newGroup();
}
else{
this.dataService.set("newGroup", true);
this.dataService.set("task", this.task);
this.dataService.set("newGroupName", this.task.Folio);
}
}
async newGroup(){
const modal = await this.modalController.create({
component: NewGroupPage,
cssClass: 'modal modal-desktop',
componentProps: {
name: this.task.Folio,
task: this.task
},
});
await modal.present();
modal.onDidDismiss();
}
// async viewEventDetail(eventId: any) { // async viewEventDetail(eventId: any) {
// const modal = await this.modalController.create({ // const modal = await this.modalController.create({
@@ -23,7 +23,7 @@
</div> </div>
<div class="post-item overflow-y-auto"> <div class="post-item overflow-y-auto">
<div *ngIf="publication.FileBase64.length > 30" class="post-img"> <div (click)="openPreview(publication)" *ngIf="publication.FileBase64.length > 30" class="post-img">
<img src="{{publication.FileBase64}}" alt="image" > <img src="{{publication.FileBase64}}" alt="image" >
</div> </div>
<div *ngIf="publication.FileBase64.length < 30" class="post-img"> <div *ngIf="publication.FileBase64.length < 30" class="post-img">
@@ -8,6 +8,7 @@ import { ImageModalPage } from '../../gallery/image-modal/image-modal.page';
import { NewPublicationPage } from '../../new-publication/new-publication.page'; import { NewPublicationPage } from '../../new-publication/new-publication.page';
import { Location } from '@angular/common'; import { Location } from '@angular/common';
import { ThemeService } from 'src/app/services/theme.service' import { ThemeService } from 'src/app/services/theme.service'
import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
@Component({ @Component({
@@ -146,13 +147,17 @@ export class PublicationDetailPage implements OnInit {
}); });
} }
openPreview(imageUrl:string){ async openPreview(item) {
this.modalController.create({ const modal = await this.modalController.create({
component: ImageModalPage, component: ViewMediaPage,
cssClass: 'modal modal-desktop',
componentProps: { componentProps: {
imageUrl:imageUrl, image: item.FileBase64,
username: item.Title,
_updatedAt: item.DatePublication
} }
}).then(modal => modal.present()); });
modal.present();
} }
@@ -45,8 +45,6 @@
width: 100%; /* 400px */ width: 100%; /* 400px */
height: 100%; height: 100%;
font-family: Roboto; font-family: Roboto;
border-top-left-radius: 25px;
border-top-right-radius: 25px;
background-color: #fff; background-color: #fff;
overflow:hidden; overflow:hidden;
padding: 25px 20px 0px 20px; padding: 25px 20px 0px 20px;
@@ -96,9 +94,11 @@
/* padding: 0!important; */ /* padding: 0!important; */
float: left; float: left;
margin: 2.5px 0 0 5px; margin: 2.5px 0 0 5px;
color: #000 !important;
} }
.title{ .title{
font-size: 25px; font-size: 25px;
color: #000 !important;
} }
.actions-icon{ .actions-icon{
@@ -126,7 +126,7 @@
} }
.post-img{ .post-img{
width: 100%; width: 100%;
height: 400px; //height: 400px;
margin: 0 auto; margin: 0 auto;
border-radius: 0px!important; border-radius: 0px!important;
overflow: hidden; overflow: hidden;
@@ -116,18 +116,12 @@ export class ViewPublicationsPage implements OnInit {
} }
getPublicationDetail() { getPublicationDetail() {
this.publications.GetPresidentialAction(this.folderId).subscribe(res=>{
setTimeout(() => { console.log(res);
this.item = res;
let allActions = this.publicationEventFolderStorage.list.concat(this.publicationTravelFolderService.list) });
console.log('ACTION ACTION', this.publicationList)
this.item = allActions.find((e) => e.ProcessId == this.folderId);
this.publicationDitails = this.item
console.log('item', this.item)
}, 100);
} }
// goes to fork // goes to fork
// getPublicationsIds() { // getPublicationsIds() {
@@ -105,7 +105,7 @@
.attach-title-item{ .attach-title-item{
width: 100%; width: 100%;
font-size: 15px; font-size: 15px;
color:#0d89d1; color:var(--title-text-color);
} }
/* SPAN */ /* SPAN */
.span-left{ .span-left{
+51 -25
View File
@@ -10,11 +10,9 @@ import { SearchList } from 'src/app/models/search-document';
import { ProcessesService } from '../processes.service'; import { ProcessesService } from '../processes.service';
import { ToastService } from '../toast.service'; import { ToastService } from '../toast.service';
import { Camera, CameraResultType, CameraSource, Photo} from '@capacitor/camera'; import { Camera, CameraResultType, CameraSource, Photo} from '@capacitor/camera';
import {
FileSharer} from '@byteowls/capacitor-filesharer';
import { Filesystem, Directory } from '@capacitor/filesystem'; import { Filesystem, Directory } from '@capacitor/filesystem';
import { Share } from '@capacitor/share'; import { environment } from 'src/environments/environment';
import { HttpClient } from '@angular/common/http'; import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
const IMAGE_DIR = 'stored-images'; const IMAGE_DIR = 'stored-images';
@@ -40,6 +38,8 @@ export class FileService {
photos: any[] = []; photos: any[] = [];
idroom: any; idroom: any;
headers: HttpHeaders;
constructor( constructor(
private fileLoaderService: FileLoaderService, private fileLoaderService: FileLoaderService,
private fileToBase64Service: FileToBase64Service, private fileToBase64Service: FileToBase64Service,
@@ -50,9 +50,35 @@ export class FileService {
private toastService: ToastService, private toastService: ToastService,
private platform: Platform, private platform: Platform,
private loadingCtrl: LoadingController, private loadingCtrl: LoadingController,
private http: HttpClient private http: HttpClient,
) { } ) { }
uploadFile(formData:any){
alert('OIEE')
//const geturl = environment.apiURL + 'Tasks/DelegateTask';
const geturl = environment.apiURL + 'lakefs/UploadFiles';
let options = {
headers: this.headers
};
return this.http.post(`${geturl}`, formData, options);
}
getFile(guid:any){
const geturl = environment.apiURL + 'lakefs/StreamFile';
let params = new HttpParams();
params = params.set("path", guid);
let options = {
headers: this.headers,
params: params
};
return this.http.get<any>(`${geturl}`, options);
}
async takePicture() { async takePicture() {
const capturedImage = await Camera.getPhoto({ const capturedImage = await Camera.getPhoto({
quality: 90, quality: 90,
@@ -89,9 +115,9 @@ export class FileService {
reader.readAsDataURL(blob); reader.readAsDataURL(blob);
}); });
loadPicture() { async loadPicture() {
const input = this.fileLoaderService.createInput({ const input = this.fileLoaderService.createInput({
accept: ['image/apng', 'image/jpeg', 'image/png'] accept: ['image/apng', 'image/jpeg', 'image/png', '.pdf']
}) })
input.onchange = async () => { input.onchange = async () => {
@@ -236,10 +262,7 @@ export class FileService {
await this.saveImage(image,roomId) await this.saveImage(image,roomId)
} }
await Share.share({ //this.capturedImage = this.capturedImage;
title: 'Check my image',
url: image.path
})
} }
@@ -258,11 +281,6 @@ export class FileService {
await this.saveImage(capturedImage,roomId) await this.saveImage(capturedImage,roomId)
} }
await Share.share({
title: 'Check my image',
url: capturedImage.path
})
/* const response = await fetch(capturedImage.webPath!); /* const response = await fetch(capturedImage.webPath!);
const blob = await response.blob(); const blob = await response.blob();
@@ -304,11 +322,11 @@ export class FileService {
const result = reader.result as string const result = reader.result as string
const base64Data = result.split(',')[1] const base64Data = result.split(',')[1]
FileSharer.share({ /* FileSharer.share({
filename:'any.pdf', filename:'any.pdf',
base64Data, base64Data,
contentType: "application/pdf", contentType: "application/pdf",
}) }) */
reader.readAsDataURL(res) reader.readAsDataURL(res)
} }
@@ -335,10 +353,15 @@ export class FileService {
const file = this.fileLoaderService.getFirstFile(input) const file = this.fileLoaderService.getFirstFile(input)
console.log(file); console.log(file);
const loader = this.toastService.loading();
const imageData = await this.fileToBase64Service.convert(file)
this.capturedImage = imageData; const formData = new FormData();
formData.append("blobFile", file);
let guid: any = await this.uploadFile(formData).toPromise()
console.log(guid.path);
/* const imageData = await this.fileToBase64Service.convert(file)
this.capturedImage = imageData; */
this.capturedImageTitle = file.name; this.capturedImageTitle = file.name;
let body = { let body = {
@@ -350,8 +373,12 @@ export class FileService {
//"title": this.capturedImageTitle , //"title": this.capturedImageTitle ,
//"text": "description", //"text": "description",
"title_link_download": false, "title_link_download": false,
"image_url": this.capturedImage, //"image_url": this.capturedImage,
}] }],
"file":{
"type": "application/img",
"guid": guid.path,
}
} }
} }
@@ -359,10 +386,9 @@ export class FileService {
console.log(this.capturedImage) console.log(this.capturedImage)
this.chatService.sendMessage(body).subscribe(res=> { this.chatService.sendMessage(body).subscribe(res=> {
loader.remove();
//console.log(res); //console.log(res);
},(error) => { },(error) => {
loader.remove();
}); });
//console.log(this.capturedImage) //console.log(this.capturedImage)
}; };
+13
View File
@@ -43,6 +43,19 @@ export class ProcessesService {
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey); this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
} }
uploadFile(formData:any){
alert('OIEE')
//const geturl = environment.apiURL + 'Tasks/DelegateTask';
const geturl = environment.apiURL + 'lakefs/UploadFiles';
let options = {
headers: this.headers
};
return this.http.post(`${geturl}`, formData, options);
}
GetTasksList(processname: typeof GetTasksListType, onlycount:boolean): Observable<fullTaskList[]> GetTasksList(processname: typeof GetTasksListType, onlycount:boolean): Observable<fullTaskList[]>
{ {
const geturl = environment.apiURL + 'tasks/List'; const geturl = environment.apiURL + 'tasks/List';
@@ -105,7 +105,7 @@
.attach-title-item{ .attach-title-item{
width: 100%; width: 100%;
font-size: 15px; font-size: 15px;
color:#0d89d1; color:var(--title-text-color);
} }
/* SPAN */ /* SPAN */
.span-left{ .span-left{
@@ -168,7 +168,7 @@
.app-name{ .app-name{
background: #42b9f2; background: var(--title-text-color);
border-radius: 18px; border-radius: 18px;
text-align: center; text-align: center;
display: flex; display: flex;
@@ -187,6 +187,7 @@
.close-button { .close-button {
display: none; display: none;
height: 20px;
} }
@@ -285,6 +285,7 @@
</ion-label> </ion-label>
</div> </div>
<div class="d-flex container-div width-100" *ngFor="let document of loadedEventAttachments; let i = index" > <div class="d-flex container-div width-100" *ngFor="let document of loadedEventAttachments; let i = index" >
<ion-list class="width-100 list" *ngIf="!document.remove"> <ion-list class="width-100 list" *ngIf="!document.remove">
<ion-item class="width-100"> <ion-item class="width-100">
@@ -172,7 +172,7 @@ ion-content{
.app-name{ .app-name{
background: #42b9f2; background: var(--title-text-color);
border-radius: 18px; border-radius: 18px;
text-align: center; text-align: center;
display: flex; display: flex;
@@ -191,6 +191,7 @@ ion-content{
.close-button { .close-button {
display: none; display: none;
height: 20px;
} }
.list:hover { .list:hover {
@@ -201,6 +202,7 @@ ion-content{
.close-button { .close-button {
display: block !important; display: block !important;
height: 20px;
} }
} }
@@ -143,7 +143,7 @@ export class EditEventPage implements OnInit {
} }
ngOnChanges(changes: any): void { ngOnChanges(changes: any): void {
// this.loadedEventAttachments = this.loadedEventAttachments.concat(this.postEvent.Attachments) this.loadedEventAttachments = this.loadedEventAttachments.concat(this.postEvent.Attachments)
} }
close() { close() {
@@ -180,7 +180,7 @@
} }
.app-name{ .app-name{
background: #42b9f2; background: var(--title-text-color);
border-radius: 18px; border-radius: 18px;
text-align: center; text-align: center;
display: flex; display: flex;
@@ -199,6 +199,7 @@
.close-button { .close-button {
display: none; display: none;
height: 20px;
} }
.list:hover { .list:hover {
@@ -555,7 +555,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
let url = await this.processesService.GetDocumentUrl(res.data.selected.Id, res.data.selected.ApplicationType).toPromise(); let url = await this.processesService.GetDocumentUrl(res.data.selected.Id, res.data.selected.ApplicationType).toPromise();
let url_no_options: string = url.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1"); let url_no_options: string = url.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
console.log(url_no_options); console.log(url_no_options);
console.log('Oie'); //console.log('Oie');
let body = { let body = {
"message": "message":
@@ -37,7 +37,7 @@
</ion-refresher-content> </ion-refresher-content>
</ion-refresher> </ion-refresher>
<div class="messages" #scrollMe> <div class="messages" #scrollMe>
<div class="messages-list-item-wrapper container-width-100" *ngFor="let msg of chatMessageStore.message[roomId]; let last = last" (click)="openPreview(msg)"> <div class="messages-list-item-wrapper container-width-100" *ngFor="let msg of chatMessageStore.message[roomId]; let last = last">
<div class='message-item incoming-{{msg.u.username!=loggedUser.me.username}} max-width-45'> <div class='message-item incoming-{{msg.u.username!=loggedUser.me.username}} max-width-45'>
<div class="message-item-options d-flex justify-content-end"> <div class="message-item-options d-flex justify-content-end">
<fa-icon [matMenuTriggerFor]="beforeMenu" icon="chevron-down" class="message-options-icon cursor-pointer"></fa-icon> <fa-icon [matMenuTriggerFor]="beforeMenu" icon="chevron-down" class="message-options-icon cursor-pointer"></fa-icon>
@@ -53,11 +53,14 @@
<ion-label>{{msg.msg}}</ion-label> <ion-label>{{msg.msg}}</ion-label>
<div *ngIf="msg.attachments" class="message-attachments"> <div *ngIf="msg.attachments" class="message-attachments">
<div *ngFor="let file of msg.attachments"> <div *ngFor="let file of msg.attachments">
<div (click)="openPreview(msg)">
<!-- <img *ngIf="file.image_url" src="{{file.image_url}}" alt="image" (click)="imageSize(file.image_url)"> -->
<img *ngIf="file.image_url" src="{{file.image_url}}" alt="image"> <img *ngIf="file.image_url" src="{{file.image_url}}" alt="image">
</div>
<div> <div>
<div class="file"> <div class="file">
<!-- <canvas id="pdf_canvas"></canvas> --> <!-- <canvas id="pdf_canvas"></canvas> -->
<div (click)="viewDocument(msg.file, file.title_link)" class="file-details add-ellipsis cursor-pointer" *ngIf="msg.file"> <div (click)="viewDocument(msg, file.title_link)" class="file-details add-ellipsis cursor-pointer" *ngIf="msg.file">
<span *ngIf="msg.file.type"> <span *ngIf="msg.file.type">
<fa-icon *ngIf="msg.file.type == 'application/pdf'" icon="file-pdf" class="pdf-icon"></fa-icon> <fa-icon *ngIf="msg.file.type == 'application/pdf'" icon="file-pdf" class="pdf-icon"></fa-icon>
<fa-icon *ngIf="msg.file.type == 'application/word'" icon="file-word" class="word-icon"></fa-icon> <fa-icon *ngIf="msg.file.type == 'application/word'" icon="file-word" class="word-icon"></fa-icon>
+16 -6
View File
@@ -17,6 +17,7 @@ import { HttpClient, HttpHeaders } from '@angular/common/http';
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page'; import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
import { ThemeService } from 'src/app/services/theme.service' import { ThemeService } from 'src/app/services/theme.service'
import { PreviewCameraPage } from 'src/app/modals/preview-camera/preview-camera.page'; import { PreviewCameraPage } from 'src/app/modals/preview-camera/preview-camera.page';
import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
@Component({ @Component({
selector: 'app-messages', selector: 'app-messages',
@@ -245,9 +246,16 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
}) })
} }
viewDocument(file:any, url?:string){ async viewDocument(msg:any, url?:string){
if(file.type == "application/webtrix") { if(msg.file.type == "application/img"){
this.openViewDocumentModal(file); let response:any = await this.fileService.getFile(msg.file.guid).toPromise();
console.log(response);
//this.openPreview(msg);
}
else if(msg.file.type == "application/webtrix") {
this.openViewDocumentModal(msg.file);
} }
else{ else{
let fullUrl; let fullUrl;
@@ -428,8 +436,10 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
this.fileService.addCameraPictureToChat(roomId); this.fileService.addCameraPictureToChat(roomId);
} }
addImage(){ addImage(){
const roomId = this.roomId const roomId = this.roomId;
this.fileService.addPictureToChat(roomId); this.fileService.addPictureToChat(roomId);
//this.fileService.loadPicture();
//this.fileService.addPictureToChat(roomId);
} }
addFile(){ addFile(){
this.fileService.addDocumentToChat(this.roomId); this.fileService.addDocumentToChat(this.roomId);
@@ -599,8 +609,8 @@ touchStart(card) {
async openPreview(msg) { async openPreview(msg) {
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: PreviewCameraPage, component: ViewMediaPage,
cssClass: 'transparent-modal', cssClass: 'modal modal-desktop',
componentProps: { componentProps: {
image: msg.attachments[0].image_url, image: msg.attachments[0].image_url,
username: msg.u.username, username: msg.u.username,
@@ -1,7 +1,8 @@
import { analyzeAndValidateNgModules } from '@angular/compiler'; import { analyzeAndValidateNgModules } from '@angular/compiler';
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core';
import { ModalController, NavParams, PickerController, PopoverController } from '@ionic/angular'; import { ModalController, NavParams, PickerController, PopoverController } from '@ionic/angular';
import { ChatService } from 'src/app/services/chat.service'; import { ChatService } from 'src/app/services/chat.service';
import { DataService } from 'src/app/services/data.service';
import { GroupDurationPage } from 'src/app/shared/popover/group-duration/group-duration.page'; import { GroupDurationPage } from 'src/app/shared/popover/group-duration/group-duration.page';
import { GroupContactsPage } from '../group-messages/group-contacts/group-contacts.page'; import { GroupContactsPage } from '../group-messages/group-contacts/group-contacts.page';
@@ -10,7 +11,7 @@ import { GroupContactsPage } from '../group-messages/group-contacts/group-contac
templateUrl: './new-group.page.html', templateUrl: './new-group.page.html',
styleUrls: ['./new-group.page.scss'], styleUrls: ['./new-group.page.scss'],
}) })
export class NewGroupPage implements OnInit { export class NewGroupPage implements OnInit{
isGroupCreated:boolean; isGroupCreated:boolean;
showLoader: boolean; showLoader: boolean;
displayDuration: any; displayDuration: any;
@@ -20,6 +21,7 @@ export class NewGroupPage implements OnInit {
selectedDuration = ['','','']; selectedDuration = ['','',''];
countDownTime:any; countDownTime:any;
//groupName:string; //groupName:string;
task:any;
@Input() groupName:string; @Input() groupName:string;
@Output() addGroupMessage:EventEmitter<any> = new EventEmitter<any>(); @Output() addGroupMessage:EventEmitter<any> = new EventEmitter<any>();
@@ -29,16 +31,28 @@ export class NewGroupPage implements OnInit {
private popoverController: PopoverController, private popoverController: PopoverController,
private modalController: ModalController, private modalController: ModalController,
private chatService: ChatService, private chatService: ChatService,
//private navParams: NavParams, private dataService:DataService,
) )
{ {
this.isGroupCreated = false; this.isGroupCreated = false;
//this.groupName = this.navParams.get('name'); //this.groupName = this.navParams.get('name');
} }
ngOnInit() { ngOnInit() {
if(this.dataService.get("newGroup")){
this.task = this.dataService.get("task");
this.groupName = this.task.Folio;
}
console.log(this.task);
} }
/* ngOnDestroy(){
alert('Destroy')
this.dataService.set("newGroup", false);
this.dataService.set("task", null);
this.dataService.set("newGroupName", '');
} */
_ionChange(event){ _ionChange(event){
console.log(event); console.log(event);
console.log(event.detail.checked); console.log(event.detail.checked);
@@ -105,7 +105,7 @@
.attach-title-item{ .attach-title-item{
width: 100%; width: 100%;
font-size: 15px; font-size: 15px;
color:#0d89d1; color:var(--title-text-color);
} }
/* SPAN */ /* SPAN */
.span-left{ .span-left{
@@ -168,7 +168,7 @@
.app-name{ .app-name{
background: #42b9f2; background: var(--title-text-color);
border-radius: 18px; border-radius: 18px;
text-align: center; text-align: center;
display: flex; display: flex;
@@ -187,6 +187,7 @@
.close-button { .close-button {
display: none; display: none;
height: 20px;
} }
+1 -1
View File
@@ -20,7 +20,7 @@
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="icon" src='assets/images/icons-profile.svg'></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="icon" src='assets/images/icons-profile.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="icon" src='assets/images/theme/gov/icons-profile.svg'></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="icon" src='assets/images/theme/gov/icons-profile.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'tribunal' " class="icon" src='assets/images/theme/tribunal/icons-profile.svg'></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'tribunal' " class="icon" src='assets/images/theme/tribunal/icons-profile.svg'></ion-icon>
<ion-label class="profile-text">{{loggeduser.Profile}}</ion-label> <!-- <ion-label class="profile-text">{{loggeduser.Profile}}</ion-label> -->
</div> </div>
</div> </div>
@@ -54,5 +54,8 @@
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button> <button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
<button (click)="cancel()" class="btn-cancel" shape="round" >Cancelar</button> <button (click)="cancel()" class="btn-cancel" shape="round" >Cancelar</button>
</div> </div>
<div class="buttons">
<button (click)="openNewGroupPage()" class="btn-cancel" shape="round" >Iniciar Conversa</button>
</div>
</div> </div>
</div> </div>
@@ -10,6 +10,8 @@ import { ProcessesService } from 'src/app/services/processes.service';
import { ToastService } from 'src/app/services/toast.service'; import { ToastService } from 'src/app/services/toast.service';
import { PedidoService } from 'src/app/Rules/pedido.service'; import { PedidoService } from 'src/app/Rules/pedido.service';
import { PermissionService } from 'src/app/services/worker/permission.service'; import { PermissionService } from 'src/app/services/worker/permission.service';
import { DataService } from 'src/app/services/data.service';
import { NewGroupPage } from 'src/app/pages/chat/new-group/new-group.page';
@Component({ @Component({
@@ -34,7 +36,8 @@ export class RequestOptionsPage implements OnInit {
private toastService: ToastService, private toastService: ToastService,
private router: Router, private router: Router,
public p: PermissionService, public p: PermissionService,
private pedidoService: PedidoService private pedidoService: PedidoService,
private dataService: DataService,
) { ) {
this.task = this.navParams.get('task'); this.task = this.navParams.get('task');
this.fulltask = this.navParams.get('fulltask'); this.fulltask = this.navParams.get('fulltask');
@@ -109,6 +112,32 @@ export class RequestOptionsPage implements OnInit {
modal.onDidDismiss(); modal.onDidDismiss();
} }
openNewGroupPage(){
this.router.navigate(['/home/chat']);
this.dataService.set("newGroup", true);
if( window.innerWidth < 801){
this.newGroup();
}
else{
this.dataService.set("newGroup", true);
/* this.closeAllDesktopComponents();
this.showNewGroup=true; */
}
}
async newGroup(){
const modal = await this.modalController.create({
component: NewGroupPage,
cssClass: 'modal modal-desktop',
componentProps: {
name: this.task.Folio,
},
});
await modal.present();
modal.onDidDismiss();
}
async openExpedientActionsModal(taskAction: any, task: any) { async openExpedientActionsModal(taskAction: any, task: any) {
//this.modalController.dismiss(); //this.modalController.dismiss();
@@ -61,7 +61,8 @@
<div class="ion-item-container-no-border hide-desktop"> <div class="ion-item-container-no-border hide-desktop">
<ion-label (click)="takePicture()"> <ion-label (click)="takePicture()">
<div class="attach-icon"> <div class="attach-icon">
<ion-icon src="assets/images/icons-add-photo.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-add-photo.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-add-photo.svg"></ion-icon>
</div> </div>
<div class="attach-document cursor-pointer"> <div class="attach-document cursor-pointer">
<ion-label>Tirar Fotografia</ion-label> <ion-label>Tirar Fotografia</ion-label>
@@ -72,7 +73,8 @@
<div class="ion-item-container-no-border hide-desktop"> <div class="ion-item-container-no-border hide-desktop">
<ion-label (click)="laodPicture()" class="cursor-pointer"> <ion-label (click)="laodPicture()" class="cursor-pointer">
<div class="attach-icon"> <div class="attach-icon">
<ion-icon src="assets/images/icons-add-photos.svg"></ion-icon> <ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-add-photos.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-add-photos.svg"></ion-icon>
</div> </div>
<div class="attach-document cursor-pointer"> <div class="attach-document cursor-pointer">
<ion-label>Anexar Fotografia</ion-label> <ion-label>Anexar Fotografia</ion-label>
@@ -8,6 +8,7 @@ import { ToastService } from 'src/app/services/toast.service';
import { FormControl, FormGroup, Validators } from '@angular/forms'; import { FormControl, FormGroup, Validators } from '@angular/forms';
import { FileLoaderService } from 'src/app/services/file/file-loader.service' import { FileLoaderService } from 'src/app/services/file/file-loader.service'
import { FileToBase64Service } from 'src/app/services/file/file-to-base64.service'; import { FileToBase64Service } from 'src/app/services/file/file-to-base64.service';
import { ThemeService } from 'src/app/services/theme.service';
import { Camera, CameraResultType, CameraSource, Photo} from '@capacitor/camera'; import { Camera, CameraResultType, CameraSource, Photo} from '@capacitor/camera';
@Component({ @Component({
selector: 'app-new-publication', selector: 'app-new-publication',
@@ -50,7 +51,8 @@ export class NewPublicationPage implements OnInit {
private publications: PublicationsService, private publications: PublicationsService,
private toastService: ToastService, private toastService: ToastService,
private fileLoaderService: FileLoaderService, private fileLoaderService: FileLoaderService,
private fileToBase64Service: FileToBase64Service private fileToBase64Service: FileToBase64Service,
public ThemeService: ThemeService
) { ) {
this.publicationTitle = 'Nova Publicação'; this.publicationTitle = 'Nova Publicação';
} }
@@ -25,8 +25,8 @@
</ion-refresher-content> </ion-refresher-content>
</ion-refresher> </ion-refresher>
<div class="post-item px-20"> <div class="post-item px-20">
<div *ngIf="publication.FileBase64.length > 30" class="post-img"> <div (click)="openPreview(publication)" *ngIf="publication.FileBase64.length > 30" class="post-img">
<img src="{{publication.FileBase64}}" alt="image" tappable (click)="openPreview(publication.FileBase64)"> <img src="{{publication.FileBase64}}" alt="image" tappable>
</div> </div>
<div *ngIf="publication.FileBase64.length < 30" class="post-img"> <div *ngIf="publication.FileBase64.length < 30" class="post-img">
<img src="/assets/icon/icon-no-image.svg" alt="image"> <img src="/assets/icon/icon-no-image.svg" alt="image">
@@ -8,6 +8,7 @@ import { ToastService } from 'src/app/services/toast.service';
import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page'; import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page';
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page'; import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
import { ThemeService } from 'src/app/services/theme.service' import { ThemeService } from 'src/app/services/theme.service'
import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
@Component({ @Component({
selector: 'app-publication-detail-shared', selector: 'app-publication-detail-shared',
@@ -133,20 +134,24 @@ export class PublicationDetailPage implements OnInit {
} }
openPreview(imageUrl:string){
this.modalController.create({
component: ImageModalPage,
componentProps: {
imageUrl:imageUrl,
}
}).then(modal => modal.present());
}
async goBack(){ async goBack(){
this.goBackToViewPublications.emit(); this.goBackToViewPublications.emit();
} }
async openPreview(item) {
const modal = await this.modalController.create({
component: ViewMediaPage,
cssClass: 'modal modal-desktop',
componentProps: {
image: item.FileBase64,
username: item.Title,
_updatedAt: item.DatePublication
}
});
modal.present();
}