web notification config

This commit is contained in:
Eudes Inácio
2021-09-24 08:56:43 +01:00
parent 42ef6f0dc4
commit 08201efe4d
39 changed files with 3706 additions and 2 deletions
@@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { AttachmentsPage } from './attachments.page';
const routes: Routes = [
{
path: '',
component: AttachmentsPage
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class AttachmentsPageRoutingModule {}
@@ -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 { AttachmentsPageRoutingModule } from './attachments-routing.module';
import { AttachmentsPage } from './attachments.page';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
AttachmentsPageRoutingModule
],
declarations: [AttachmentsPage]
})
export class AttachmentsPageModule {}
@@ -0,0 +1,62 @@
<ion-header>
<ion-toolbar>
<ion-buttons slot="start">
<ion-back-button (click)="close()" defaultHref="" icon="chevron-back"></ion-back-button>
</ion-buttons>
<ion-title>Anexos do evento</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<div *ngIf="loadedEventAttachments">
<ion-list>
<ion-item-sliding>
<ion-item class="main-item" lines="none" *ngFor="let att of loadedEventAttachments" (click)="viewDocument(att.Link)">
<ion-icon style="zoom:1.5" class="ion-icon-attach" name="attach"></ion-icon>
<ion-label class="div-content-attachment">
<h3 class="h3">{{ att.SourceName }}</h3>
<p>{{ att.Description }}</p>
<p>{{ att.CreateDate }}</p>
<p class="item-list-small">{{ att.Stakeholders }}</p>
</ion-label>
</ion-item>
</ion-item-sliding>
</ion-list>
</div>
<!-- Skeleton screen -->
<div *ngIf="!loadedEventAttachments">
<ion-list>
<ion-item>
<ion-avatar slot="start">
<ion-skeleton-text animated></ion-skeleton-text>
</ion-avatar>
<ion-label>
<h3>
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
</h3>
<p>
<ion-skeleton-text animated style="width: 80%"></ion-skeleton-text>
</p>
<p>
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
</p>
</ion-label>
</ion-item>
<ion-item>
<ion-avatar slot="start">
<ion-skeleton-text animated></ion-skeleton-text>
</ion-avatar>
<ion-label>
<h3>
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
</h3>
<p>
<ion-skeleton-text animated style="width: 80%"></ion-skeleton-text>
</p>
<p>
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
</p>
</ion-label>
</ion-item>
</ion-list>
</div>
</ion-content>
@@ -0,0 +1,57 @@
ion-back-button {
display: block;
}
/* CONTENT */
ion-content{
--background: #f2f2f2;
}
.div-attach-results{
background: none;
}
ion-list, ion-item-sliding{
background: none;
}
.item-list-small{
font-size: 14px;
overflow: auto;
}
.ion-item-class{
padding: 0;
}
.label-text{
width: 100%;
padding: 0;
margin: 0;
}
//DIV
.main-item{
margin: 15px;
/* border: 1px solid #ccc; */
border-radius: 5px;
box-shadow: 0 4px 8px 0 #ccc, 0 6px 20px 0 #f2f2f2;
}
.div-content-attachment{
margin:0;
padding: 10px;
}
.div-content-attachment h3{
font-size: 18px;
font-weight: 700;
padding-bottom: 5px;
}
ion-item ion-icon{
--border-color: red;
}
/* Custom Skeleton Line Height and Margin */
.custom-skeleton ion-skeleton-text {
line-height: 13px;
}
.custom-skeleton ion-skeleton-text:last-child {
margin-bottom: 5px;
}
@@ -0,0 +1,24 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';
import { AttachmentsPage } from './attachments.page';
describe('AttachmentsPage', () => {
let component: AttachmentsPage;
let fixture: ComponentFixture<AttachmentsPage>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AttachmentsPage ],
imports: [IonicModule.forRoot()]
}).compileComponents();
fixture = TestBed.createComponent(AttachmentsPage);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,47 @@
import { Component, OnInit } from '@angular/core';
import { AttachmentsService } from 'src/app/services/attachments.service';
import { Attachment } from 'src/app/models/attachment.model';
import { ActivatedRoute, Router } from '@angular/router';
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
import { ModalController, NavParams } from '@ionic/angular';
@Component({
selector: 'app-attachments',
templateUrl: './attachments.page.html',
styleUrls: ['./attachments.page.scss'],
})
export class AttachmentsPage implements OnInit {
loadedEventAttachments: Attachment[];
pageId: string;
constructor(
private attachamentsService: AttachmentsService,
private iab: InAppBrowser,
private modalCtrl: ModalController,
private navParams: NavParams) { }
ngOnInit() {
this.loadAttachments(this.navParams.get('eventId'));
}
loadAttachments(eventid:string)
{
this.attachamentsService.getAttachmentsById(eventid).subscribe(attachments => {
this.loadedEventAttachments = attachments;
this.pageId = eventid;
});
}
async viewDocument(documenturl:string)
{
const url: string = documenturl.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
const browser = this.iab.create(url,"_blank");
browser.show();
}
close(){
this.modalCtrl.dismiss(null);
}
}