add and view docments on chat solved

This commit is contained in:
Equilibrium ITO
2024-03-14 09:10:17 +01:00
parent 5b7224dbd6
commit 8cb9961bad
19 changed files with 230 additions and 25 deletions
@@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { ViewDocumentSecondOptionsPage } from './view-document-second-options.page';
const routes: Routes = [
{
path: '',
component: ViewDocumentSecondOptionsPage
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class ViewDocumentSecondOptionsPageRoutingModule {}
@@ -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 { ViewDocumentSecondOptionsPageRoutingModule } from './view-document-second-options-routing.module';
import { ViewDocumentSecondOptionsPage } from './view-document-second-options.page';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
ViewDocumentSecondOptionsPageRoutingModule,
FontAwesomeModule
],
declarations: [ViewDocumentSecondOptionsPage]
})
export class ViewDocumentSecondOptionsPageModule {}
@@ -0,0 +1,24 @@
<ion-header class="ion-no-border">
<ion-toolbar class="d-flex">
<div class="d-flex align-items-center px-20 pt-20 font-25">
<div class="left cursor-pointer" (click)="close()">
<fa-icon icon="chevron-left" class="menu-icon font-awesome-1"></fa-icon>
</div>
<div class="middle ">
{{filename}}
</div>
<div *ngIf=" task || Document" class="right cursor-pointer" (click)="openOptions()">
<fa-icon icon="ellipsis-v" class="menu-icon font-awesome-1"></fa-icon>
</div>
</div>
</ion-toolbar>
</ion-header>
<ion-content class="pt-10 height-100">
<div class="height-100">
<iframe class="iframe" [src]="trustedUrl" height="100%" width="100%" title="Iframe Example"></iframe>
</div>
</ion-content>
@@ -0,0 +1,27 @@
.left{
float: left;
}
.middle{
float: left;
padding-left: 5px !important;
}
.right{
float: right;
margin-left: auto;
}
.container-img {
background-image: url(/assets/gif/theme/gov/Blocks-loader.svg);
background-repeat: no-repeat;
background-position-x: center;
background-position-y: center;
}
@media only screen and (max-width: 650px) {
.container-img {
background-size: 25%;
}
}
@@ -0,0 +1,24 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';
import { ViewDocumentSecondOptionsPage } from './view-document-second-options.page';
describe('ViewDocumentSecondOptionsPage', () => {
let component: ViewDocumentSecondOptionsPage;
let fixture: ComponentFixture<ViewDocumentSecondOptionsPage>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ ViewDocumentSecondOptionsPage ],
imports: [IonicModule.forRoot()]
}).compileComponents();
fixture = TestBed.createComponent(ViewDocumentSecondOptionsPage);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,40 @@
import { Component, OnInit } from '@angular/core';
import { DomSanitizer } from '@angular/platform-browser';
import { ModalController, NavParams } from '@ionic/angular';
@Component({
selector: 'app-view-document-second-options',
templateUrl: './view-document-second-options.page.html',
styleUrls: ['./view-document-second-options.page.scss'],
})
export class ViewDocumentSecondOptionsPage implements OnInit {
fileUrl: string;
filename: string;
completeUrl: string
trustedUrl: any;
constructor(
private modalController: ModalController,
private navParams: NavParams,
private sanitazer: DomSanitizer,
) {
this.fileUrl = this.navParams.get('fileUrl');
this.filename = this.navParams.get('filename');
this.completeUrl = `/assets/www/pdfjs/web/viewer.html?file=${this.fileUrl}`;
}
ngOnInit() {
console.log(this.fileUrl)
console.log(this.completeUrl)
const link: string = this.completeUrl.replace('//pdfjs/web/', '/pdfjs/web/')
this.trustedUrl = this.sanitazer.bypassSecurityTrustResourceUrl(link);
}
close() {
this.modalController.dismiss();
}
}