Merge branch 'feature/viewer-attachment' of https://bitbucket.org/equilibriumito/gabinete-digital-fo into feature/viewer-attachment

This commit is contained in:
Equilibrium ITO
2024-03-02 14:38:18 +01:00
27 changed files with 196 additions and 81 deletions
@@ -279,13 +279,13 @@
<div class="container-div width-100">
<div (click)="addParticipantsCC()" class="ion-item-class-2 cursor-pointer">
<div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-person.svg"></ion-icon>
<ion-icon slot="start" src="assets/images/icons-people-cc.svg"></ion-icon>
</div>
<div class="ion-input-class-no-height d-flex">
<div class="list-people flex-grow-1">
<ion-item lines="none">
<ion-list>
<ion-label *ngIf="taskParticipantsCc?.length < 1" class="list-people-title">Com Conhecimento*</ion-label>
<ion-label *ngIf="taskParticipantsCc?.length < 1" class="list-people-title">Com Conhecimento</ion-label>
<ion-label *ngFor="let participant of taskParticipantsCc">{{participant.Name}}</ion-label>
</ion-list>
</ion-item>
@@ -377,7 +377,7 @@
</button>
</ion-buttons>
<ion-buttons slot="end">
<button class="btn-cancel" fill="clear" color="#061b52" (click)="close()">
<button class="btn-cancel" fill="clear" color="#061b52" (click)="cancel()">
<ion-label>Cancelar</ion-label>
</button>
</ion-buttons>
@@ -203,6 +203,10 @@ export class EditEventPage implements OnInit {
this.modalController.dismiss();
}
cancel() {
this.modalController.dismiss({action:'cancel'});
}
goBack() {
this.router.navigate(['/home', this.caller]);
@@ -155,7 +155,6 @@
[stepHour]="1"
[stepMinute]="15"
[hideTime]="!allDayCheck"
[disabled]="true"
>
</ngx-mat-datetime-picker>
@@ -11,7 +11,6 @@ import { ToastService } from 'src/app/services/toast.service';
import { Event } from '../../../models/event.model';
import { AttendeesPageModal } from '../../events/attendees/attendees.page';
import { SearchPage } from '../../search/search.page';
import { ThemePalette } from '@angular/material/core';
import { FormControl, FormGroup, Validators } from '@angular/forms';
import { ThemeService } from 'src/app/services/theme.service';
import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
@@ -25,6 +24,9 @@ import { TaskService } from 'src/app/services/task.service'
import { ContactsService } from 'src/app/services/contacts.service';
import { DomSanitizerService } from 'src/app/services/DomSanitizer.service';
import { momentG } from 'src/plugin/momentG';
import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE, ThemePalette } from '@angular/material/core';
import { MatDatepickerModule } from '@angular/material/datepicker';
import { MomentDateAdapter } from '@angular/material-moment-adapter';
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
parse: {
@@ -37,12 +39,25 @@ const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
monthYearA11yLabel: "MMMM YYYY"
}
}
const MY_DATE_FORMAT = {
parse: {
dateInput: 'DD-MM-YYYY',
},
display: {
dateInput: 'DD/MM/YYYY',
monthYearLabel: 'MMMM YYYY',
dateA11yLabel: 'LL',
monthYearA11yLabel: 'MMMM YYYY'
}
};
@Component({
selector: 'app-new-event',
templateUrl: './new-event.page.html',
styleUrls: ['./new-event.page.scss'],
providers: [
{ provide: NGX_MAT_DATE_FORMATS, useValue: CUSTOM_DATE_FORMATS },
{ provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE] },
{ provide: MAT_DATE_FORMATS, useValue: MY_DATE_FORMAT }
]
})
@@ -114,7 +129,8 @@ export class NewEventPage implements OnInit {
private processeService: ProcessesService,
public TaskService: TaskService,
private contactsService: ContactsService,
private domSanitazerService: DomSanitizerService
private domSanitazerService: DomSanitizerService,
private dateAdapter: DateAdapter<Date>
) {
this.loggeduser = SessionStore.user;
this.postEvent = new Event();
@@ -18,6 +18,7 @@
</div>
<div class="middle d-flex align-center">
<p class="title" style="font-size: 21.1px"><span>{{loadedEvent.Subject}}</span></p>
<!-- Event details page -->
</div>
<div class="menu-options d-flex">
<button class="btn-no-color" (click)="editEvent()">
@@ -247,6 +247,37 @@ export class ViewEventPage implements OnInit {
}
loadEvent1() {
if(this.sesseionStora.user.Profile == 'MDGPR' || this.sesseionStora.user.Profile == 'PR') {
this.eventsService.getEvent(this.eventId).subscribe(res => {
res = this.dateService.fixDate(res as any)
this.loadedEvent = res;
this.setTimeZone()
// this.addEventToDb(res);
}, (error) => {
});
} else {
if(this.CalendarId) {
this.eventsService.genericGetEvent(this.eventId, this.CalendarId).subscribe(res => {
res = this.dateService.fixDate(res as any)
this.loadedEvent = res;
this.setTimeZone()
}, (error) => {
});
}
}
}
deleteYesOrNo() {
this.alertController.create({
header: 'Eliminar evento?',
@@ -364,14 +395,13 @@ export class ViewEventPage implements OnInit {
await modal.present();
modal.onDidDismiss().then((res) => {
if (res) {
setTimeout(() => {
/* this.loadEvent(); */
this.loadEvent()
this.loadEvent1()
}, 250);
this.isEventEdited = true;
console.log('res', res)
console.log('res', res, res.data?.action, 'cancel')
}
});
@@ -399,7 +429,20 @@ export class ViewEventPage implements OnInit {
modal.onDidDismiss().then((res) => {
if (res) {
if (res.data?.action == 'cancel') {
setTimeout(() => {
/* this.loadEvent(); */
this.loadEvent1()
}, 250);
this.isEventEdited = true;
if(res.data.Attendees?.length >= 1) {
this.loadedEvent.HasAttachments = true
this.getAttachments()
}
console.log('res', res)
} else {
setTimeout(() => {
/* this.loadEvent(); */
this.loadEvent()
@@ -7,6 +7,7 @@
<div style="color: black;">
Evento Pendente de Aprovação
</div>
<!-- Events to approve details mobile -->
</div>
</div>
@@ -72,7 +72,7 @@ export class ApproveEventPage implements OnInit {
});
window['approve-event-getTask'] = () => {
this.getTask1()
this.getTask()
}
}
@@ -281,6 +281,7 @@ export class ApproveEventPage implements OnInit {
});
return await popover.present().then(() => {
this.TaskService.loadEventosParaAprovacao()
this.getTask();
}, (error) => {
console.log(error)
})
@@ -6,6 +6,7 @@ import { DeviceService } from "src/app/services/device.service"
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
import { ProcessesService } from 'src/app/services/processes.service';
import { PermissionService } from 'src/app/services/permission.service';
import { HeaderSettingsService } from "src/app/services/header-settings.service"
@Component({
selector: 'app-viewer-attachment',
@@ -33,6 +34,7 @@ export class ViewerAttachmentPage implements OnInit {
private erroHandler: HttpErrorHandle,
public p: PermissionService,
private processService: ProcessesService,
private HeaderSettingsService: HeaderSettingsService
) { }
ngOnInit() {
@@ -259,7 +259,7 @@ export class NewPublicationPage implements OnInit {
if (this.platform.is('ios')) {
this.recordevideoIos(element.fullPath)
} else {
this.recordVideoAndroid(element.fullPath)
}
} catch (e) {
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { HeaderSettingsService } from './header-settings.service';
describe('HeaderSettingsService', () => {
let service: HeaderSettingsService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(HeaderSettingsService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
@@ -0,0 +1,11 @@
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class HeaderSettingsService {
hideHeader = false
constructor() { }
}
@@ -9,6 +9,7 @@
<div style="color: black;">
Evento Pendente de Aprovação
</div>
<!-- List events to approve desktop -->
</div>
@@ -299,7 +299,7 @@
<div class="container-div width-100">
<div class="ion-item-class-2">
<div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-person.svg"></ion-icon>
<ion-icon slot="start" src="assets/images/icons-people-cc.svg"></ion-icon>
</div>
<div class="ion-input-class-no-height d-flex cursor-pointer" (click)="addParticipantsCC()">
<div class="list-people flex-grow-1">
@@ -309,7 +309,7 @@
display: grid;
">
<ion-label *ngIf="taskParticipantsCc?.length < 1" class="list-people-title">Adicionar Intervenientes</ion-label>
<ion-label *ngIf="taskParticipantsCc?.length < 1" class="list-people-title">Com Conhecimento</ion-label>
<ion-label *ngFor="let participant of taskParticipantsCc">{{participant.Name}}</ion-label>
</ion-list>
</ion-item>
@@ -12,6 +12,7 @@
.main-header{
font-family: Roboto;
background-color: #fff;
min-height: 86px;
overflow:hidden;
transform: translate3d(0, 1px, 0);
@@ -155,7 +155,7 @@ export class ViewEventPage implements OnInit {
div.innerHTML = res.Body.Text
res.Body.Text = div.innerText */
this.loadedEvent = res;
console.log('Event details',res)
// console.log('Event details',res)
this.setTimeZone()
this.today = new Date(res.StartDate);
@@ -8,7 +8,7 @@
<ion-header>
<div class="title-content">
<div class="middle">
<ion-label class="title">Editar evento por aprovar ccxcxcxc</ion-label> <br>
<ion-label class="title">Editar evento por aprovar</ion-label> <br>
<i style="margin-top: -5px; font-size: 15px;" > Campos marcados com * são obrigatórios</i>
</div>
@@ -241,13 +241,13 @@
<div class="container-div width-100" >
<div class="ion-item-class-2">
<div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-person.svg"></ion-icon>
<ion-icon slot="start" src="assets/images/icons-people-cc.svg"></ion-icon>
</div>
<div class="ion-input-class-no-height d-flex" (click)="addParticipantsCC()">
<div class="list-people flex-grow-1">
<ion-item lines="none">
<ion-list>
<ion-label *ngIf="taskParticipantsCc?.length < 1" class="list-people-title">Adicionar Intervenientes</ion-label>
<ion-label *ngIf="taskParticipantsCc?.length < 1" class="list-people-title">Com Conhecimento</ion-label>
<ion-label *ngFor="let participant of taskParticipantsCc">{{participant.Name}}</ion-label>
</ion-list>
</ion-item>
@@ -13,7 +13,7 @@
margin-bottom: 20px;
font-family: Roboto;
background-color: #fff;
min-height: 79px;
min-height: 86px;
overflow:hidden;
transform: translate3d(0, 1px, 0);
@@ -318,7 +318,8 @@ export class EditEventToApproveComponent implements OnInit {
if(document['action'] == 'add') {
delete document.action
this.attachmentsService.setEventAttachmentById(document).subscribe(()=>{
this.toastService._successMessage();
window['approve-event-getTask'] ()
// this.toastService._successMessage();
}, error =>{
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
@@ -330,7 +331,8 @@ export class EditEventToApproveComponent implements OnInit {
} else if(document['action'] == 'delete') {
delete document.action
this.attachmentsService.deleteEventAttachmentById(document.Id).subscribe( res=>{
this.toastService._successMessage()
window['approve-event-getTask'] ()
// this.toastService._successMessage()
}, error =>{
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
@@ -1,5 +1,5 @@
<ion-header *ngIf="task" class="ion-no-border ">
<div *ngIf="dropButton" class="main-header mt-30 px-20">
<div [ngClass]="{'d-item': !dropButton}" class="main-header mt-30 px-20">
<div class="title-content width-100 d-flex justify-space-between align-center">
<div class=" btn-dismiss font-30-rem cursor-pointer" (click)="goBack.emit()" defaultHref="#">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
@@ -28,7 +28,7 @@
</div>
<div class=" flex-1 d-flex flex-column height-100 d-flex overflow-y-auto-desktop" >
<div *ngIf="dropButton" class="upper-content" >
<div [ngClass]="{'d-item': !dropButton}" class="upper-content" >
<div class="content-details">
<div class="mobile-header">
<ion-label>
@@ -44,7 +44,7 @@
</ion-label>
</div>
</div>
<div *ngIf="dropButton" class="line mx-20"></div>
<div [ngClass]="{'d-item': !dropButton}" class="line mx-20"></div>
<div style="
display: flex;
@@ -52,7 +52,7 @@
height: 100%;
flex-grow: 1;
" class="overflow-y-auto-desktop">
<div class="middle-content" *ngIf="dropButton">
<div class="middle-content" [ngClass]="{'d-item': !dropButton}">
<h5 class="font-17-rem" *ngIf="intervenientes">Intervenientes</h5>
<ion-item class="ion-no-margin ion-no-padding">
<ion-label>
@@ -123,12 +123,12 @@
<div style="border-radius: 50px;position: relative;top: 3px;left: 25px;">
<ion-row class="timeline-date align-center pr-10 visionMobile-flex" >
<button class="no-color" *ngIf="dropButton" (click)="dropButton=!dropButton" >
<button class="no-color" [ngClass]="{'d-item': !dropButton}" (click)="changeDropButton()" >
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="collaps font-25" src="assets/images/icons-collaps-up.svg" ></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="collaps font-25" src="assets/images/theme/gov/icons-collaps-up.svg" ></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " class="collaps font-25" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-collaps-up.svg"></ion-icon>
</button>
<button class="no-color visionMobile-flex" *ngIf="!dropButton" (click)="dropButton=!dropButton">
<button class="no-color visionMobile-flex" *ngIf="!dropButton" (click)="changeDropButton()">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="collaps font-25" src="assets/images/icons-collaps-down.svg" ></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="collaps font-25" src="assets/images/theme/gov/icons-collaps-down.svg" ></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " class="collaps font-25" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-collaps-down.svg" ></ion-icon>
@@ -7,6 +7,7 @@ import { PermissionService } from 'src/app/services/permission.service';
import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
import { ModalController } from '@ionic/angular';
import { DocumentSetUpMeetingPage } from 'src/app/modals/document-set-up-meeting/document-set-up-meeting.page';
import { HeaderSettingsService } from "src/app/services/header-settings.service"
@Component({
selector: 'app-task-details',
@@ -33,7 +34,8 @@ export class TaskDetailsPage implements OnInit {
public DeviceService: DeviceService,
private DocumentViewerOptionService: DocumentViewerOptionService,
public p: PermissionService,
private modalController: ModalController
private modalController: ModalController,
private HeaderSettingsService: HeaderSettingsService
) {
this.DeviceService.isDesktop();
}
@@ -120,7 +122,7 @@ export class TaskDetailsPage implements OnInit {
backdropDismiss: false
});
modal.onDidDismiss().then(res=>{
modal.onDidDismiss().then(res => {
//this.RouteService.goBack();
}, (error) => {
console.log(error)
@@ -129,4 +131,8 @@ export class TaskDetailsPage implements OnInit {
await modal.present();
}
changeDropButton() {
this.dropButton = !this.dropButton;
this.HeaderSettingsService.hideHeader = !this.dropButton
}
}
+1 -1
View File
@@ -1,4 +1,4 @@
<div class="header-container header-fix">
<div class="header-container header-fix" [ngClass]="{'d-none-header':HeaderSettingsService.hideHeader}" >
<div class="main-tab pb-10 ion-toolbar header-color">
<div class="mobile pt-20 d-flex div-top-header justify-space-between">
+2
View File
@@ -177,3 +177,5 @@
.tab {
color: var(--header-tab-text-white);
}
+3 -1
View File
@@ -16,6 +16,7 @@ import { ActiveTabService } from 'src/app/services/active-tab.service';
import { NotificationsService } from 'src/app/services/notifications.service';
import { AttachmentsService } from 'src/app/services/attachments.service';
import { NotificationHolderService } from 'src/app/store/notification-holder.service';
import { HeaderSettingsService } from "src/app/services/header-settings.service"
@Component({
selector: 'app-header',
@@ -59,7 +60,8 @@ export class HeaderPage implements OnInit {
private storageService: StorageService,
private zone: NgZone,
private attachmentService: AttachmentsService,
public NotificationHolderService: NotificationHolderService
public NotificationHolderService: NotificationHolderService,
public HeaderSettingsService: HeaderSettingsService
) {
this.loggeduser = SessionStore.user;
router.events.subscribe((val) => {
+1 -1
View File
@@ -58,7 +58,7 @@ export const DevDev: Environment = {
despachoLabel2: 'Despachos Presidênciais',
production: false,
domain: 'gabinetedigital.local',
defaultuser: 'paulo.pinto@gabinetedigital.local',
defaultuser: 'dlima@gabinetedigital.local',
defaultuserpwd: 'tabteste@006',
chatOffline: true,
presidential: true,
+7
View File
@@ -1716,3 +1716,10 @@ h5, .buttons{
height: 100%;
width: 400px;
}
@media only screen and (max-width: 1209px){
.d-none-header, .d-item {
display: none !important;
background-color: red;
}
}