mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
Merge branch 'feature/viewer-attachment' of https://bitbucket.org/equilibriumito/gabinete-digital-fo into feature/viewer-attachment
This commit is contained in:
+38
-24
@@ -1,4 +1,4 @@
|
|||||||
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
import { Component, ElementRef, OnInit, ViewChild, OnDestroy } from '@angular/core';
|
||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
import { ModalController } from '@ionic/angular';
|
import { ModalController } from '@ionic/angular';
|
||||||
import { Publication } from 'src/app/models/publication';
|
import { Publication } from 'src/app/models/publication';
|
||||||
@@ -13,6 +13,7 @@ import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
|||||||
import { PublicationFolderService } from 'src/app/store/publication-folder.service';
|
import { PublicationFolderService } from 'src/app/store/publication-folder.service';
|
||||||
import { checkFileTypeService } from 'src/app/services/checkFileType.service';
|
import { checkFileTypeService } from 'src/app/services/checkFileType.service';
|
||||||
import { StopvideoService } from "src/app/services/stopvideo.service"
|
import { StopvideoService } from "src/app/services/stopvideo.service"
|
||||||
|
import { PublicationHolderService } from 'src/app/services/publication/publication-holder.service'
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -34,6 +35,8 @@ export class PublicationDetailPage implements OnInit {
|
|||||||
dynamicBullets: true
|
dynamicBullets: true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isComponentIsAlive = true
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private modalController: ModalController,
|
private modalController: ModalController,
|
||||||
private publications:PublicationsService,
|
private publications:PublicationsService,
|
||||||
@@ -45,7 +48,8 @@ export class PublicationDetailPage implements OnInit {
|
|||||||
private httpErrorHandle: HttpErrorHandle,
|
private httpErrorHandle: HttpErrorHandle,
|
||||||
public publicationFolderService: PublicationFolderService,
|
public publicationFolderService: PublicationFolderService,
|
||||||
public checkFileType: checkFileTypeService,
|
public checkFileType: checkFileTypeService,
|
||||||
public StopvideoService: StopvideoService
|
public StopvideoService: StopvideoService,
|
||||||
|
public PublicationHolderService: PublicationHolderService
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,6 +81,19 @@ export class PublicationDetailPage implements OnInit {
|
|||||||
OriginalFileName: '',
|
OriginalFileName: '',
|
||||||
FileExtension: '',
|
FileExtension: '',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
window['publicationEdit'] = () => {
|
||||||
|
if(this.isComponentIsAlive == true) {
|
||||||
|
this.getPublicationDetail()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
OnDestroy() {
|
||||||
|
this.isComponentIsAlive = false
|
||||||
}
|
}
|
||||||
doRefresh(event) {
|
doRefresh(event) {
|
||||||
this.getPublicationDetail();
|
this.getPublicationDetail();
|
||||||
@@ -131,9 +148,6 @@ export class PublicationDetailPage implements OnInit {
|
|||||||
if(this.isModal) {
|
if(this.isModal) {
|
||||||
this.close()
|
this.close()
|
||||||
} else {
|
} else {
|
||||||
if(window['app-view-publications-page-doRefresh']) {
|
|
||||||
window['app-view-publications-page-doRefresh']()
|
|
||||||
}
|
|
||||||
this.RouteService.goBack();
|
this.RouteService.goBack();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,28 +181,28 @@ export class PublicationDetailPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async editPost(publicationType:any) {
|
async editPost(publicationType:any) {
|
||||||
|
if(this.PublicationHolderService.PublicationFormMV.length == 0) {
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: NewPublicationPage,
|
||||||
|
componentProps:{
|
||||||
|
publicationType: publicationType,
|
||||||
|
publication: this.publication,
|
||||||
|
folderId: this.folderId
|
||||||
|
},
|
||||||
|
cssClass: 'new-publication modal modal-desktop',
|
||||||
|
backdropDismiss: false
|
||||||
|
});
|
||||||
|
|
||||||
const modal = await this.modalController.create({
|
modal.onDidDismiss().then((data) => {
|
||||||
component: NewPublicationPage,
|
|
||||||
componentProps:{
|
});
|
||||||
publicationType: publicationType,
|
|
||||||
publication: this.publication,
|
await modal.present();
|
||||||
folderId: this.folderId
|
} else {
|
||||||
},
|
this.toastService._successMessage('já existe uma publicação a ser processado');
|
||||||
cssClass: 'new-publication modal modal-desktop',
|
}
|
||||||
backdropDismiss: false
|
|
||||||
});
|
|
||||||
|
|
||||||
modal.onDidDismiss().then((data) => {
|
|
||||||
if(data.data) {
|
|
||||||
this.publication = data.data
|
|
||||||
if(window['app-view-publications-page-doRefresh']) {
|
|
||||||
window['app-view-publications-page-doRefresh']()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
await modal.present();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async openPreview(item) {
|
async openPreview(item) {
|
||||||
|
|||||||
@@ -126,6 +126,10 @@ export class PublicationFromMvService {
|
|||||||
this.httpErroHandle.httpsSucessMessagge('Editar publicação')
|
this.httpErroHandle.httpsSucessMessagge('Editar publicação')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(window['publicationEdit']) {
|
||||||
|
window['publicationEdit']()
|
||||||
|
}
|
||||||
|
|
||||||
this.publicationFolderService.getPublicationsIds(this.folderId)
|
this.publicationFolderService.getPublicationsIds(this.folderId)
|
||||||
window['upload-header-set-remove'](this.id);
|
window['upload-header-set-remove'](this.id);
|
||||||
|
|
||||||
|
|||||||
@@ -10,28 +10,28 @@
|
|||||||
<div >
|
<div >
|
||||||
<img *ngIf="checkFileType.checkFileType(files.FileExtension ) == 'image'" class="post-img"
|
<img *ngIf="checkFileType.checkFileType(files.FileExtension ) == 'image'" class="post-img"
|
||||||
[src]="'data:image/jpg;base64,' + files.FileBase64" loading="lazy">
|
[src]="'data:image/jpg;base64,' + files.FileBase64" loading="lazy">
|
||||||
|
|
||||||
<video #videoElement [appVisibility]="onVisibilityChange" *ngIf="checkFileType.checkFileType(files.FileExtension ) == 'video'" class="post-video" controls="controls" preload="none"
|
<video #videoElement [appVisibility]="onVisibilityChange" *ngIf="checkFileType.checkFileType(files.FileExtension ) == 'video'" class="post-video" controls="controls" preload="none"
|
||||||
playsinline webkit-playsinline="webkit-playsinline" (play)="stopvideoService.registerVideoWithEvent($event)" (click)="playVideo()">
|
playsinline webkit-playsinline="webkit-playsinline" (play)="stopvideoService.registerVideoWithEvent($event)"q>
|
||||||
<source [src]="files.FileBase64" type="video/mp4">
|
<source [src]="files.FileBase64" type="video/mp4">
|
||||||
</video>
|
</video>
|
||||||
|
|
||||||
<!-- <button class="play-button" *ngIf="!videoPlaying && checkFileType.checkFileType(files.FileExtension ) == 'video'">
|
<!-- <button class="play-button" *ngIf="!videoPlaying && checkFileType.checkFileType(files.FileExtension ) == 'video'">
|
||||||
▶
|
▶
|
||||||
</button> -->
|
</button> -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</swiper-slide>
|
</swiper-slide>
|
||||||
|
|
||||||
</swiper-container>
|
</swiper-container>
|
||||||
|
|
||||||
|
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
|
||||||
<ion-footer>
|
<ion-footer>
|
||||||
<div *ngIf="publicationList.Files.length > 1" class="dots-container">
|
<div *ngIf="publicationList.Files.length > 1" class="dots-container">
|
||||||
<span *ngFor="let files of publicationList.Files; let k = index"
|
<span *ngFor="let files of publicationList.Files; let k = index"
|
||||||
[class.dotsSwiper]="true"
|
[class.dotsSwiper]="true"
|
||||||
[class.active-dot]="swiperIndex === k"
|
[class.active-dot]="swiperIndex === k"
|
||||||
(click)="goToSlide(k)"
|
(click)="goToSlide(k)"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -4,4 +4,4 @@ import { environment as oaprProd } from './suport/oapr'
|
|||||||
import { DevDev } from './suport/dev'
|
import { DevDev } from './suport/dev'
|
||||||
|
|
||||||
|
|
||||||
export const environment: Environment = oaprProd;
|
export const environment: Environment = DevDev;
|
||||||
|
|||||||
Reference in New Issue
Block a user