mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 13:55:51 +00:00
"acept"
This commit is contained in:
@@ -104,9 +104,9 @@ export class EditActionPage implements OnInit {
|
||||
await this.publicationsService.UpdatePresidentialAction(body).toPromise()
|
||||
this.close();
|
||||
this.updateDesktopComponent.emit();
|
||||
this.toastService.successMessage('Acção presidencial atualizada')
|
||||
this.toastService._successMessage('Acção presidencial atualizada')
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Não foi possivel atualizar a acção presidencial')
|
||||
this.toastService._badRequest('Não foi possivel atualizar a acção presidencial')
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ font-size: 25px;
|
||||
|
||||
.attach-document{
|
||||
font-size: 15px;
|
||||
color: #0d89d1;
|
||||
color: var(--title-text-color);
|
||||
margin: 5px 5px 20px 10px;
|
||||
padding: 5px;
|
||||
float: left;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { LoadingController, ModalController, NavParams, Platform, ToastController } from '@ionic/angular';
|
||||
import { ModalController, NavParams, Platform, LoadingController } from '@ionic/angular';
|
||||
|
||||
/* import {Plugins, CameraResultType, CameraSource} from '@capacitor/core'; */
|
||||
import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
|
||||
@@ -16,20 +16,18 @@ import { formatDate } from 'src/plugin/momentG.js'
|
||||
import { FileLoaderService } from 'src/app/services/file/file-loader.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 { Photos } from './Photos';
|
||||
import { Directory, Filesystem } from '@capacitor/filesystem';
|
||||
import { Capacitor } from '@capacitor/core';
|
||||
import { Storage } from '@capacitor/storage'
|
||||
import { Camera, CameraResultType, CameraSource, Photo } from '@capacitor/camera';
|
||||
|
||||
import { Filesystem, Directory } from '@capacitor/filesystem';
|
||||
import { Photos } from './photos';
|
||||
|
||||
const IMAGE_DIR = 'stored-images';
|
||||
|
||||
|
||||
interface LocalFile {
|
||||
name: string;
|
||||
path: string;
|
||||
data: string;
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'app-new-publication',
|
||||
templateUrl: './new-publication.page.html',
|
||||
@@ -45,7 +43,7 @@ export class NewPublicationPage implements OnInit {
|
||||
public showSeconds = false;
|
||||
public touchUi = false;
|
||||
public enableMeridian = false;
|
||||
public minDate = new Date().toISOString().slice(0,10)
|
||||
public minDate = new Date().toISOString().slice(0, 10)
|
||||
public endMinDate = new Date(new Date().getTime() + 15 * 60000);
|
||||
public stepHour = 1;
|
||||
public stepMinute = 5;
|
||||
@@ -61,18 +59,19 @@ export class NewPublicationPage implements OnInit {
|
||||
folderId: string;
|
||||
image: Image = new Image();
|
||||
|
||||
publicationType:string;
|
||||
publicationTitle:string;
|
||||
imgUrl:any;
|
||||
publicationType: string;
|
||||
publicationTitle: string;
|
||||
imgUrl: any;
|
||||
|
||||
Defaultimage:any = '';
|
||||
Defaultimage: any = '';
|
||||
|
||||
photo: SafeResourceUrl;
|
||||
|
||||
guestPicture:any;
|
||||
guestPicture: any;
|
||||
|
||||
capturedImage:any = '';
|
||||
capturedImageTitle:any;
|
||||
capturedImage: any = '';
|
||||
capturedImageTitle: any;
|
||||
// public photos: any[] = [];
|
||||
|
||||
public photos: Photos[] = [];
|
||||
private PHOTO_STORAGE: string = "photos";
|
||||
@@ -87,81 +86,48 @@ export class NewPublicationPage implements OnInit {
|
||||
private fileLoaderService: FileLoaderService,
|
||||
private fileToBase64Service: FileToBase64Service,
|
||||
public ThemeService: ThemeService,
|
||||
platform: Platform,
|
||||
// private platform: Platform,
|
||||
private loadingCtrl: LoadingController,
|
||||
private toastCtrl: ToastController
|
||||
) {
|
||||
) {
|
||||
|
||||
this.publicationType = this.navParams.get('publicationType');
|
||||
this.folderId = this.navParams.get('folderId');
|
||||
this.publicationTitle = 'Nova Publicação';
|
||||
this.platform = platform;
|
||||
}
|
||||
this.publicationType = this.navParams.get('publicationType');
|
||||
this.folderId = this.navParams.get('folderId');
|
||||
this.publicationTitle = 'Nova Publicação';
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.setTitle();
|
||||
this.loadFiles()
|
||||
|
||||
console.log(this.folderId);
|
||||
Filesystem.mkdir({
|
||||
path: IMAGE_DIR,
|
||||
directory: Directory.Data,
|
||||
recursive: true
|
||||
});
|
||||
|
||||
// this.takePicture();
|
||||
}
|
||||
|
||||
async loadFiles() {
|
||||
this.images = [];
|
||||
|
||||
const loading = await this.loadingCtrl.create({
|
||||
message: 'Loading data...',
|
||||
async takePicture() {
|
||||
const image = await Camera.getPhoto({
|
||||
quality: 90,
|
||||
allowEditing: false,
|
||||
resultType: CameraResultType.Uri,
|
||||
source: CameraSource.Camera // Camera, Photos or Prompt!
|
||||
});
|
||||
await loading.present();
|
||||
|
||||
Filesystem.readdir({
|
||||
path: IMAGE_DIR,
|
||||
directory: Directory.Data,
|
||||
}).then(result => {
|
||||
this.loadFileData(result.files);
|
||||
},
|
||||
async (err) => {
|
||||
|
||||
// Folder does not yet exists!
|
||||
await Filesystem.mkdir({
|
||||
path: IMAGE_DIR,
|
||||
directory: Directory.Data,
|
||||
});
|
||||
}
|
||||
).then(_ => {
|
||||
loading.dismiss();
|
||||
});
|
||||
}
|
||||
|
||||
// Get the actual base64 data of an image
|
||||
// base on the name of the file
|
||||
async loadFileData(fileNames: string[]) {
|
||||
for (let f of fileNames) {
|
||||
const filePath = `${IMAGE_DIR}/${f}`;
|
||||
|
||||
const readFile = await Filesystem.readFile({
|
||||
path: filePath,
|
||||
directory: Directory.Data,
|
||||
});
|
||||
|
||||
this.images.push({
|
||||
name: f,
|
||||
path: filePath,
|
||||
data: `data:image/jpeg;base64,${readFile.data}`,
|
||||
});
|
||||
this.images.forEach(function(value){
|
||||
this.capturedImage = value.data
|
||||
})
|
||||
if (image) {
|
||||
this.saveImage(image)
|
||||
}
|
||||
}
|
||||
|
||||
// Little helper
|
||||
async presentToast(text) {
|
||||
const toast = await this.toastCtrl.create({
|
||||
message: text,
|
||||
duration: 3000,
|
||||
});
|
||||
toast.present();
|
||||
}
|
||||
// async presentToast(text) {
|
||||
// const toast = await this.toastCtrl.create({
|
||||
// message: text,
|
||||
// duration: 3000,
|
||||
// });
|
||||
// toast.present();
|
||||
// }
|
||||
|
||||
async selectImage() {
|
||||
const image = await Camera.getPhoto({
|
||||
@@ -231,17 +197,38 @@ convertBlobToBase64 = (blob: Blob) => new Promise((resolve, reject) => {
|
||||
|
||||
|
||||
|
||||
async takePicture() {
|
||||
const capturedImage = await Camera.getPhoto({
|
||||
quality: 90,
|
||||
// allowEditing: true,
|
||||
resultType: CameraResultType.Uri,
|
||||
source: CameraSource.Camera
|
||||
// async takePicture() {
|
||||
// const capturedImage = await Camera.getPhoto({
|
||||
// quality: 90,
|
||||
// // allowEditing: true,
|
||||
// resultType: CameraResultType.Uri,
|
||||
// source: CameraSource.Camera
|
||||
|
||||
});
|
||||
// });
|
||||
|
||||
const response = await fetch(capturedImage.webPath!);
|
||||
const blob = await response.blob();
|
||||
// }
|
||||
|
||||
// convertBlobToBase64 = (blob: Blob) => new Promise((resolve, reject) => {
|
||||
// const reader = new FileReader;
|
||||
// reader.onerror = reject;
|
||||
// reader.onload = () => {
|
||||
// resolve(reader.result);
|
||||
// };
|
||||
// reader.readAsDataURL(blob);
|
||||
// });
|
||||
|
||||
|
||||
async laodPicture() {
|
||||
const capturedImage = await Camera.getPhoto({
|
||||
resultType: CameraResultType.Uri,
|
||||
source: CameraSource.Photos,
|
||||
quality: 90,
|
||||
width: 1080,
|
||||
height: 720,
|
||||
});
|
||||
|
||||
const response = await fetch(capturedImage.webPath!);
|
||||
const blob = await response.blob();
|
||||
|
||||
this.photos.unshift({
|
||||
filepath: "soon...",
|
||||
@@ -249,21 +236,16 @@ async takePicture() {
|
||||
});
|
||||
|
||||
this.capturedImage = await this.convertBlobToBase64(blob);
|
||||
|
||||
console.log(this.capturedImage)
|
||||
this.capturedImageTitle = new Date().getTime() + '.jpeg';
|
||||
}
|
||||
|
||||
/* laodPicture() {
|
||||
const input = this.fileLoaderService.createInput({
|
||||
accept: ['image/apng', 'image/jpeg', 'image/png']
|
||||
})
|
||||
|
||||
// helper function
|
||||
// convertBlobToBase64 = (blob: Blob) => new Promise((resolve, reject) => {
|
||||
// const reader = new FileReader;
|
||||
// reader.onerror = reject;
|
||||
// reader.onload = () => {
|
||||
// resolve(reader.result);
|
||||
// };
|
||||
// reader.readAsDataURL(blob);
|
||||
// });
|
||||
|
||||
input.onchange = async () => {
|
||||
const file = this.fileLoaderService.getFirstFile(input)
|
||||
|
||||
|
||||
// // native devices ionic capacitor
|
||||
@@ -306,78 +288,11 @@ private async savePicture(photo: Photo) {
|
||||
filepath: savedFile.uri,
|
||||
webviewPath: Capacitor.convertFileSrc(savedFile.uri),
|
||||
};
|
||||
}
|
||||
else {
|
||||
// Use webPath to display the new image instead of base64 since it's
|
||||
// already loaded into memory
|
||||
return {
|
||||
filepath: fileName,
|
||||
webviewPath: photo.webPath
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public async loadSaved() {
|
||||
// Retrieve cached photo array data
|
||||
const photoList = await Storage.get({ key: this.PHOTO_STORAGE });
|
||||
this.photos = JSON.parse(photoList.value) || [];
|
||||
|
||||
// Easiest way to detect when running on the web:
|
||||
// “when the platform is NOT hybrid, do this”
|
||||
if (!this.platform.is('hybrid')) {
|
||||
// Display the photo by reading into base64 format
|
||||
for (let photo of this.photos) {
|
||||
// Read each saved photo's data from the Filesystem
|
||||
const readFile = await Filesystem.readFile({
|
||||
path: photo.filepath,
|
||||
directory: Directory.Data
|
||||
});
|
||||
|
||||
// Web platform only: Load the photo as base64 data
|
||||
photo.webviewPath = `data:image/jpeg;base64,${readFile.data}`;
|
||||
|
||||
this.capturedImage = photo.webviewPath
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// laodPicture() {
|
||||
// const input = this.fileLoaderService.createInput({
|
||||
// accept: ['image/apng', 'image/jpeg', 'image/png']
|
||||
// })
|
||||
|
||||
// input.onchange = async () => {
|
||||
// const file = this.fileLoaderService.getFirstFile(input)
|
||||
|
||||
// const imageData = await this.fileToBase64Service.convert(file)
|
||||
// this.capturedImage = imageData;
|
||||
// this.capturedImageTitle = file.name
|
||||
|
||||
// console.log(this.capturedImage)
|
||||
// };
|
||||
|
||||
// }
|
||||
} */
|
||||
|
||||
runValidation() {
|
||||
this.validateFrom = true
|
||||
this.validateFrom = true
|
||||
}
|
||||
|
||||
injectValidation() {
|
||||
@@ -403,16 +318,18 @@ public async loadSaved() {
|
||||
this.injectValidation()
|
||||
this.runValidation()
|
||||
|
||||
if(this.Form.invalid) return false
|
||||
if (this.Form.invalid) return false
|
||||
|
||||
if(this.publicationType == '3') {
|
||||
|
||||
|
||||
if (this.publicationType == '3') {
|
||||
console.log(this.navParams.get('publication'));
|
||||
|
||||
if(this.capturedImage != '') {
|
||||
if (this.capturedImage != '') {
|
||||
this.publication = {
|
||||
DateIndex: this.publication.DateIndex,
|
||||
DocumentId:this.publication.DocumentId,
|
||||
ProcessId:this.publication.ProcessId,
|
||||
DocumentId: this.publication.DocumentId,
|
||||
ProcessId: this.publication.ProcessId,
|
||||
Title: this.pub.Title,
|
||||
Message: this.pub.Message,
|
||||
DatePublication: this.publication.DatePublication,
|
||||
@@ -427,11 +344,11 @@ public async loadSaved() {
|
||||
console.log(this.publication);
|
||||
|
||||
await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
|
||||
this.toastService.successMessage("Publicação criado")
|
||||
this.toastService.successMessage("Publicação editada")
|
||||
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest("Publicação não criado")
|
||||
this.toastService.badRequest("Publicação não editada")
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -441,8 +358,8 @@ public async loadSaved() {
|
||||
|
||||
this.publication = {
|
||||
DateIndex: this.publication.DateIndex,
|
||||
DocumentId:this.publication.DocumentId,
|
||||
ProcessId:this.publication.ProcessId,
|
||||
DocumentId: this.publication.DocumentId,
|
||||
ProcessId: this.publication.ProcessId,
|
||||
Title: this.pub.Title,
|
||||
Message: this.pub.Message,
|
||||
DatePublication: this.publication.DatePublication,
|
||||
@@ -463,15 +380,15 @@ public async loadSaved() {
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest("Publicação não criado")
|
||||
} finally {
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
} else {
|
||||
} else {
|
||||
this.publication = {
|
||||
DateIndex: this.publication.DateIndex,
|
||||
DocumentId:this.publication.DocumentId,
|
||||
ProcessId:this.publication.ProcessId,
|
||||
DocumentId: this.publication.DocumentId,
|
||||
ProcessId: this.publication.ProcessId,
|
||||
Title: this.pub.Title,
|
||||
Message: this.pub.Message,
|
||||
DatePublication: this.publication.DatePublication,
|
||||
@@ -491,7 +408,7 @@ public async loadSaved() {
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest("Publicação não criado")
|
||||
} finally {
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
@@ -499,13 +416,15 @@ public async loadSaved() {
|
||||
}
|
||||
else {
|
||||
|
||||
const date = formatDate(new Date(), 'yyyy-MM-dd HH:mm:ss')
|
||||
console.log(date)
|
||||
const date = formatDate(new Date(), 'yyyy-MM-dd HH:mm:ss')
|
||||
console.log(date);
|
||||
console.log(this.folderId);
|
||||
|
||||
|
||||
this.publication = {
|
||||
DateIndex: date,
|
||||
DocumentId:null,
|
||||
ProcessId:this.folderId,
|
||||
DocumentId: null,
|
||||
ProcessId: this.folderId,
|
||||
Title: this.pub.Title,
|
||||
Message: this.pub.Message,
|
||||
DatePublication: date,
|
||||
@@ -526,7 +445,7 @@ public async loadSaved() {
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest("Publicação não criado")
|
||||
} finally {
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
@@ -536,8 +455,8 @@ public async loadSaved() {
|
||||
|
||||
|
||||
close() {
|
||||
this.modalController.dismiss().then(()=>{
|
||||
this.showLoader=true;
|
||||
this.modalController.dismiss().then(() => {
|
||||
this.showLoader = true;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -546,13 +465,13 @@ public async loadSaved() {
|
||||
}
|
||||
|
||||
setTitle() {
|
||||
if(this.publicationType == '1') {
|
||||
if (this.publicationType == '1') {
|
||||
this.publicationTitle = 'Nova Publicação Rápida';
|
||||
}
|
||||
else if(this.publicationType == '2') {
|
||||
else if (this.publicationType == '2') {
|
||||
this.publicationTitle = 'Nova Publicação';
|
||||
}
|
||||
else if(this.publicationType == '3') {
|
||||
else if (this.publicationType == '3') {
|
||||
this.publicationTitle = 'Editar Publicação';
|
||||
this.pub = this.navParams.get('publication');
|
||||
|
||||
@@ -572,16 +491,114 @@ public async loadSaved() {
|
||||
modal.onDidDismiss();
|
||||
} */
|
||||
|
||||
/* async takePicture(){
|
||||
const image = await Plugins.Camera.getPhoto({
|
||||
quality: 100,
|
||||
allowEditing: false,
|
||||
resultType: CameraResultType.DataUrl,
|
||||
source: CameraSource.Camera
|
||||
/* async takePicture(){
|
||||
const image = await Plugins.Camera.getPhoto({
|
||||
quality: 100,
|
||||
allowEditing: false,
|
||||
resultType: CameraResultType.DataUrl,
|
||||
source: CameraSource.Camera
|
||||
});
|
||||
console.log(image);
|
||||
|
||||
this.photo = this.sanitizer.bypassSecurityTrustResourceUrl(image && (image.dataUrl));
|
||||
} */
|
||||
|
||||
|
||||
|
||||
|
||||
// async selectImage() {
|
||||
// const image = await Camera.getPhoto({
|
||||
// quality: 90,
|
||||
// allowEditing: false,
|
||||
// resultType: CameraResultType.Uri,
|
||||
// source: CameraSource.Photos // Camera, Photos or Prompt!
|
||||
// });
|
||||
|
||||
// if (image) {
|
||||
// this.saveImage(image)
|
||||
// }
|
||||
// }
|
||||
|
||||
// // Create a new file from a capture image
|
||||
// async saveImage(photo: Photo) {
|
||||
// const base64Data = await this.readAsBase64(photo);
|
||||
|
||||
// const fileName = new Date().getTime() + '.jpeg';
|
||||
// const savedFile = await Filesystem.writeFile({
|
||||
// path: `${IMAGE_DIR}/${fileName}`,
|
||||
// data: base64Data,
|
||||
// directory: Directory.Data
|
||||
// });
|
||||
|
||||
// this.loadFiles();
|
||||
// }
|
||||
|
||||
// private async readAsBase64(photo: Photo) {
|
||||
// if (this.platform.is('hybrid')) {
|
||||
// const file = await Filesystem.readFile({
|
||||
// path: photo.path
|
||||
// });
|
||||
|
||||
// return file.data;
|
||||
// }
|
||||
// else {
|
||||
// // Fetch the photo, read as a blob, then convert to base64 format
|
||||
// const response = await fetch(photo.webPath);
|
||||
// const blob = await response.blob();
|
||||
|
||||
// return await this.convertBlobToBase64(blob) as string;
|
||||
// }
|
||||
// }
|
||||
|
||||
async loadFiles() {
|
||||
this.images = [];
|
||||
|
||||
const loading = await this.loadingCtrl.create({
|
||||
message: 'Loading data...',
|
||||
});
|
||||
console.log(image);
|
||||
await loading.present();
|
||||
|
||||
this.photo = this.sanitizer.bypassSecurityTrustResourceUrl(image && (image.dataUrl));
|
||||
} */
|
||||
Filesystem.readdir({
|
||||
path: IMAGE_DIR,
|
||||
directory: Directory.Data,
|
||||
}).then(result => {
|
||||
console.log('ALL RESULTS', result.files[0])
|
||||
let lastphoto = result.files[result.files.length - 1]
|
||||
this.loadFileData(lastphoto);
|
||||
},
|
||||
async (err) => {
|
||||
console.log('ERROR FILE DOSENT EXIST', err)
|
||||
// Folder does not yet exists!
|
||||
await Filesystem.mkdir({
|
||||
path: IMAGE_DIR,
|
||||
directory: Directory.Data,
|
||||
recursive: true
|
||||
});
|
||||
}
|
||||
).then(_ => {
|
||||
loading.dismiss();
|
||||
});
|
||||
}
|
||||
|
||||
async loadFileData(fileName: string) {
|
||||
console.log('ALL PHOTOT FILE', fileName)
|
||||
// for (let f of fileNames) {
|
||||
const filePath = `${IMAGE_DIR}/${fileName}`;
|
||||
|
||||
const readFile = await Filesystem.readFile({
|
||||
path: filePath,
|
||||
directory: Directory.Data,
|
||||
});
|
||||
|
||||
this.images.push({
|
||||
name: fileName,
|
||||
path: filePath,
|
||||
data: `data:image/jpeg;base64,${readFile.data}`,
|
||||
});
|
||||
|
||||
console.log('ALL IMAGE', this.images)
|
||||
|
||||
this.capturedImage = this.images[0].data
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
export interface Photos {
|
||||
filepath: string;
|
||||
webviewPath: string;
|
||||
}
|
||||
@@ -4,8 +4,9 @@
|
||||
<div class="content-container">
|
||||
<div *ngIf="publication.Title != ''">
|
||||
<div class="title-content">
|
||||
<div class="back-icon">
|
||||
<ion-icon tappable (click)="close()" slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
|
||||
<div class="back-icon cursor-pointer">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " tappable (click)="close()" slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " tappable (click)="close()" slot="end" src='assets/images/theme/gov/icons-calendar-arrow-left.svg'></ion-icon>
|
||||
</div>
|
||||
<div class="div-title">
|
||||
<ion-label class="title"> {{publication.Title}}</ion-label>
|
||||
@@ -31,8 +32,9 @@
|
||||
</div>
|
||||
<div *ngIf="publication.Title == ''">
|
||||
<div class="title-content">
|
||||
<div class="back-icon">
|
||||
<ion-icon (click)="close()" slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
|
||||
<div class="back-icon cursor-pointer">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " (click)="close()" slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " (click)="close()" slot="end" src='assets/images/theme/gov/icons-calendar-arrow-left.svg'></ion-icon>
|
||||
</div>
|
||||
<div class="div-title">
|
||||
<ion-label class="title"><ion-skeleton-text animated style="width: 60%;"></ion-skeleton-text></ion-label>
|
||||
|
||||
@@ -8,6 +8,7 @@ import { NewPublicationPage } from '../new-publication/new-publication.page';
|
||||
import { Location } from '@angular/common';
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { BackgroundService } from 'src/app/services/background.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -29,7 +30,8 @@ export class PublicationDetailPage implements OnInit {
|
||||
private toastService: ToastService,
|
||||
private location: Location,
|
||||
private sqliteservice: SqliteService,
|
||||
private backgroundservice: BackgroundService ) {
|
||||
private backgroundservice: BackgroundService,
|
||||
public ThemeService: ThemeService ) {
|
||||
|
||||
this.publicationId = this.navParams.get('publicationId');
|
||||
/* this.folderId = this.navParams.get('folderIdId'); */
|
||||
|
||||
@@ -26,10 +26,11 @@
|
||||
</div>
|
||||
<div class="div-icon">
|
||||
<button class="btn-no-color" (click)="AddPublicationFolder()">
|
||||
<ion-icon slot="icon-only" src='assets/images/icons-add.svg'></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="icon-only" src='assets/images/icons-add.svg'></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="icon-only" src='assets/images/theme/gov/icons-add.svg'></ion-icon>
|
||||
</button>
|
||||
<button *ngIf="hideRefreshBtn" class="btn-no-color" (click)="refreshing()">
|
||||
<ion-icon slot="icon-only" class="title-icon" name="reload-circle" title="Actualizar"></ion-icon>
|
||||
<ion-icon slot="icon-only" class="title-icon font-awesome" name="reload-circle" title="Actualizar"></ion-icon>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -46,22 +47,27 @@
|
||||
[class.item-active]="viagem.ProcessId == idSelected"
|
||||
>
|
||||
<div (click)="goToPublicationsList(viagem.ProcessId)" class="item-icon cursor-pointer">
|
||||
<ion-icon slot="end" src='assets/images/icons-plane-active.svg'></ion-icon>
|
||||
</div>
|
||||
<div (click)="goToPublicationsList(viagem.ProcessId)" class="item-content flex-grow-1 cursor-pointer">
|
||||
<p class="item-content-date my-5" [class.item-content-date-active]="viagem.ProcessId == idSelected">De {{getDate(viagem.DateBegin)}} a {{getDate(viagem.DateEnd)}}</p>
|
||||
<p class="item-content-title my-10" [class.item-content-title-active]="viagem.ProcessId == idSelected">{{viagem.Description}}</p>
|
||||
<p class="item-content-detail my-5" [class.item-content-detail-active]="viagem.ProcessId == idSelected">{{viagem.Detail}}</p>
|
||||
</div>
|
||||
<div (click)="openOptions(viagem.ProcessId)" class="item-options d-none cursor-pointer" [class.item-options-active]="viagem.ProcessId == idSelected" autoHide="false">
|
||||
<!-- <ion-icon src="assets/images/icons-menu.svg"></ion-icon> -->
|
||||
<i class="fas fa-ellipsis-v"></i>
|
||||
</div>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="end" src='assets/images/icons-plane-active.svg'></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && viagem.ProcessId != idSelected " slot="end" src='assets/images/theme/gov/icons-plane-active.svg'></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && viagem.ProcessId == idSelected " slot="end" src='assets/images/theme/gov/icons-plane-active-hover.svg'></ion-icon>
|
||||
|
||||
</div>
|
||||
<div (click)="goToPublicationsList(viagem.ProcessId)" class="item-content flex-grow-1 cursor-pointer">
|
||||
<p class="item-content-date my-5" [class.item-content-date-active]="viagem.ProcessId == idSelected">De {{getDate(viagem.DateBegin)}} a {{getDate(viagem.DateEnd)}}</p>
|
||||
<p class="item-content-title my-10" [class.item-content-title-active]="viagem.ProcessId == idSelected">{{viagem.Description}}</p>
|
||||
<p class="item-content-detail my-5" [class.item-content-detail-active]="viagem.ProcessId == idSelected">{{viagem.Detail}}</p>
|
||||
</div>
|
||||
<div (click)="openOptions(viagem.ProcessId)" class="item-options d-none cursor-pointer" [class.item-options-active]="viagem.ProcessId == idSelected" autoHide="false">
|
||||
<!-- <ion-icon src="assets/images/icons-menu.svg"></ion-icon> -->
|
||||
<i class="fas fa-ellipsis-v"></i>
|
||||
</div>
|
||||
</ion-item>
|
||||
<ion-item-options class="members-options" side="end">
|
||||
<ion-item-option class="edit-option" (click)="editAction(viagem.ProcessId)">
|
||||
<button class="btn-no-color">
|
||||
<ion-icon class="edit" slot="end" src="assets/images/icons-edit.svg" ></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="edit" slot="end" src="assets/images/icons-edit.svg" ></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="edit" slot="end" src="assets/images/theme/gov/cons-edit.svg" ></ion-icon>
|
||||
|
||||
</button>
|
||||
</ion-item-option>
|
||||
<ion-item-option class="delete-option" (click)="deleteAction(viagem.ProcessId)">
|
||||
@@ -79,7 +85,9 @@
|
||||
[class.item-active]="evento.ProcessId == idSelected"
|
||||
(click)="goToPublicationsList(evento.ProcessId)">
|
||||
<div class="item-icon2">
|
||||
<ion-icon slot="end" src='assets/images/icons-nav-actions.svg'></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="end" src='assets/images/icons-nav-actions.svg'></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && evento.ProcessId != idSelected " slot="end" src='assets/images/theme/gov/icons-nav-actions.svg'></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && evento.ProcessId == idSelected " slot="end" src='assets/images/theme/gov/icons-nav-actions-hover.svg'></ion-icon>
|
||||
</div>
|
||||
<div class="item-content flex-grow-1">
|
||||
<ion-label>
|
||||
@@ -95,7 +103,9 @@
|
||||
<ion-item-options class="members-options" side="end">
|
||||
<ion-item-option class="edit-option" (click)="editAction(evento.ProcessId)">
|
||||
<button class="btn-no-color">
|
||||
<ion-icon class="edit" slot="end" src="assets/images/icons-edit.svg" ></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="edit" slot="end" src="assets/images/icons-edit.svg" ></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="edit" slot="end" src="assets/images/theme/gov/icons-edit.svg" ></ion-icon>
|
||||
|
||||
</button>
|
||||
</ion-item-option>
|
||||
<ion-item-option class="delete-option" (click)="deleteAction(evento.ProcessId)">
|
||||
|
||||
@@ -149,7 +149,7 @@ ion-toolbar{
|
||||
padding: 0 !important;
|
||||
}
|
||||
.item-content-title{
|
||||
color: #0d89d1;
|
||||
color: var(--title-text-color);
|
||||
font-size: 15px;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
@@ -161,7 +161,7 @@ ion-toolbar{
|
||||
padding: 0 !important;
|
||||
}
|
||||
.item-options{
|
||||
color: #42b9fe;
|
||||
color: var(--box-hover-background-color);
|
||||
width: 25px;
|
||||
font-size: 20px;
|
||||
}
|
||||
@@ -172,12 +172,13 @@ ion-toolbar{
|
||||
}
|
||||
|
||||
.item-active{
|
||||
background-color: #42b9fe !important;
|
||||
background-color: var(--gabinete-active-hove-background) !important;
|
||||
color: #fff !important;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.item:hover{
|
||||
background-color: #e6f6ff75;
|
||||
background-color: var(--box-hover-background-color) !important;
|
||||
}
|
||||
|
||||
ion-item-options{
|
||||
|
||||
@@ -15,6 +15,7 @@ import { PublicationEventFolderStorage } from 'src/app/store/publication-event-f
|
||||
import { PublicationTravelFolderStore } from 'src/app/store/publication-travel-folder.service';
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { BackgroundService } from 'src/app/services/background.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
|
||||
@Component({
|
||||
selector: 'app-publications',
|
||||
@@ -66,7 +67,8 @@ export class PublicationsPage implements OnInit {
|
||||
private toastService: ToastService,
|
||||
private sqliteservice: SqliteService,
|
||||
private backgroundservice: BackgroundService,
|
||||
private platform: Platform
|
||||
private platform: Platform,
|
||||
public ThemeService: ThemeService
|
||||
) {
|
||||
this.months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
|
||||
this.days = ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"];
|
||||
@@ -236,9 +238,9 @@ export class PublicationsPage implements OnInit {
|
||||
|
||||
try {
|
||||
await this.publications.DeletePresidentialAction(id).toPromise();
|
||||
this.toastService.successMessage()
|
||||
this.toastService._successMessage()
|
||||
} catch (e) {
|
||||
this.toastService.badRequest()
|
||||
this.toastService._badRequest()
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
|
||||
+4
-2
@@ -13,7 +13,8 @@
|
||||
<div *ngIf="publication.Title != ''" class="d-flex flex-column height-100">
|
||||
<div class="title-content px-20 width-100 ">
|
||||
<div class="back-icon cursor-pointer" (click)="goBack()">
|
||||
<ion-icon slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="end" src='assets/images/theme/gov/icons-calendar-arrow-left.svg'></ion-icon>
|
||||
</div>
|
||||
<div class="div-title">
|
||||
<ion-label class="title"> {{publication.Title}}</ion-label>
|
||||
@@ -37,7 +38,8 @@
|
||||
<div *ngIf="publication.Title == ''" class="d-flex flex-column">
|
||||
<div class="title-content width-100">
|
||||
<div class="back-icon cursor-pointer">
|
||||
<ion-icon (click)="close()" slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " (click)="close()" slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " (click)="close()" slot="end" src='assets/images/theme/gov/icons-calendar-arrow-left.svg'></ion-icon>
|
||||
</div>
|
||||
<div class="div-title">
|
||||
<ion-label class="title"><ion-skeleton-text animated style="width: 60%;"></ion-skeleton-text></ion-label>
|
||||
|
||||
+3
@@ -7,6 +7,8 @@ import { ToastService } from 'src/app/services/toast.service';
|
||||
import { ImageModalPage } from '../../gallery/image-modal/image-modal.page';
|
||||
import { NewPublicationPage } from '../../new-publication/new-publication.page';
|
||||
import { Location } from '@angular/common';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-publication-detail',
|
||||
@@ -28,6 +30,7 @@ export class PublicationDetailPage implements OnInit {
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private router: Router,
|
||||
private location: Location,
|
||||
public ThemeService: ThemeService
|
||||
) {
|
||||
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
|
||||
@@ -6,17 +6,19 @@
|
||||
<!-- <ion-toolbar class="bg-blue"> -->
|
||||
<div class="main-header">
|
||||
<div class="title-content d-flex width-100">
|
||||
<div class="back-icon" (click)="goBack()">
|
||||
<ion-icon slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
|
||||
<div class="back-icon cursor-pointer" (click)="goBack()">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="end" src='assets/images/theme/gov/icons-calendar-arrow-left.svg'></ion-icon>
|
||||
</div>
|
||||
<div class="div-title flex-grow-1">
|
||||
<ion-label class="title">{{item.Description}}</ion-label>
|
||||
<p class="item-content-detail">{{item.Detail}}</p>
|
||||
<p class="item-content-date">{{item.DateBegin | date: 'dd-MM-yy | HH:mm'}}</p>
|
||||
</div>
|
||||
<div class="actions-icon" (click)="AddPublication('2',item.ProcessId)">
|
||||
<div class="actions-icon cursor-pointer" (click)="AddPublication('2',item.ProcessId)">
|
||||
<!-- <ion-icon (click)="AddPublication('1',item.ProcessId)" slot="end" src='assets/images/icons-add-photo.svg'></ion-icon> -->
|
||||
<ion-icon slot="end" src='assets/images/icons-add.svg'></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="end" src='assets/images/icons-add.svg'></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="end" src='assets/images/theme/gov/icons-add.svg'></ion-icon>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -12,6 +12,7 @@ import { NewPublicationPage } from '../new-publication/new-publication.page';
|
||||
import { PublicationDetailPage } from './publication-detail/publication-detail.page';
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { BackgroundService } from 'src/app/services/background.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
|
||||
@Component({
|
||||
selector: 'app-view-publications',
|
||||
@@ -43,7 +44,8 @@ export class ViewPublicationsPage implements OnInit {
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private router: Router,
|
||||
private sqliteservice: SqliteService,
|
||||
private backgroundservice: BackgroundService) {
|
||||
private backgroundservice: BackgroundService,
|
||||
public ThemeService: ThemeService) {
|
||||
|
||||
this.item = new PublicationFolder();
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
@@ -194,7 +196,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
component: NewPublicationPage,
|
||||
componentProps: {
|
||||
publicationType: publicationType,
|
||||
folderId: folderId,
|
||||
folderId: this.folderId,
|
||||
},
|
||||
cssClass: 'new-publication modal modal-desktop',
|
||||
backdropDismiss: false
|
||||
|
||||
Reference in New Issue
Block a user