This commit is contained in:
Peter Maquiran
2024-02-29 22:29:00 +01:00
parent af05727bb4
commit 3625a91894
9 changed files with 88 additions and 73 deletions
@@ -23,7 +23,7 @@
<div *ngIf="Form && validateFrom" > <div *ngIf="Form && validateFrom" >
<div *ngIf="Form.get('Subject').invalid " class="input-errror-message"> <div *ngIf="Form.get('Subject').invalid " class="input-errror-message">
<!-- <div *ngIf="Form.get('Subject').errors?.required"> <!-- <div *ngIf="Form.get('Subject').errors?.required">
</div> --> </div> -->
<div *ngIf="Form.get('Subject').errors?.minlength"> <div *ngIf="Form.get('Subject').errors?.minlength">
O campo deve ter pelo menos 4 caracteres. O campo deve ter pelo menos 4 caracteres.
@@ -47,7 +47,7 @@
<div *ngIf="Form && validateFrom" > <div *ngIf="Form && validateFrom" >
<div *ngIf="Form.get('Location').invalid " class="input-errror-message"> <div *ngIf="Form.get('Location').invalid " class="input-errror-message">
<div *ngIf="Form.get('Location').errors?.required"> <div *ngIf="Form.get('Location').errors?.required">
</div> </div>
<div *ngIf="Form.get('Location').errors?.minlength"> <div *ngIf="Form.get('Location').errors?.minlength">
O campo deve ter pelo menos 4 caracteres. O campo deve ter pelo menos 4 caracteres.
@@ -61,9 +61,9 @@
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon> <ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
</div> </div>
<div class="ion-input-class flex-grow-1 justify-center align-center material-inputs " > <div class="ion-input-class flex-grow-1 justify-center align-center material-inputs " >
<ion-input [disabled]=true autocomplete="on" autocorrect="on" spellcheck="true" placeholder="CalendarName*" [(ngModel)]="CalendarNameOwnerName"></ion-input> <ion-input [disabled]=true autocomplete="on" autocorrect="on" spellcheck="true" placeholder="CalendarName*" [(ngModel)]="CalendarNameOwnerName"></ion-input>
</div> </div>
</div> </div>
</div> --> </div> -->
@@ -92,7 +92,7 @@
<div *ngIf="Form.get('CalendarName').invalid " class="input-errror-message"> <div *ngIf="Form.get('CalendarName').invalid " class="input-errror-message">
{{ postEvent.Category }} {{ postEvent.Category }}
<div *ngIf="Form.get('CalendarName').errors?.required"> <div *ngIf="Form.get('CalendarName').errors?.required">
</div> </div>
</div> </div>
</div> </div>
@@ -130,7 +130,7 @@
<div *ngIf="Form.get('Categories').invalid " class="input-errror-message"> <div *ngIf="Form.get('Categories').invalid " class="input-errror-message">
{{ postEvent.Category}} {{ postEvent.Category}}
<div *ngIf="Form.get('Categories').errors?.required"> <div *ngIf="Form.get('Categories').errors?.required">
</div> </div>
</div> </div>
</div> </div>
@@ -371,6 +371,6 @@
<ion-label>Cancelar</ion-label> <ion-label>Cancelar</ion-label>
</button> </button>
</ion-buttons> </ion-buttons>
</ion-toolbar> </ion-toolbar>
</ion-footer> </ion-footer>
@@ -128,7 +128,6 @@ ion-menu{
.aside-right{ .aside-right{
overflow: auto; overflow: auto;
padding: 30px 20px 0 20px !important; padding: 30px 20px 0 20px !important;
width: 100% !important;
.arrow-right{ .arrow-right{
display: flex; display: flex;
@@ -17,7 +17,7 @@
<ion-icon class="mr-10 font-25" src="assets/images/theme/gov/crescente.svg" ></ion-icon> <ion-icon class="mr-10 font-25" src="assets/images/theme/gov/crescente.svg" ></ion-icon>
</div> </div>
<div class="d-flex" (click)="reorderList('recent')" *ngIf="ordinance != 'recent' "> <div class="d-flex" (click)="reorderList('recent')" *ngIf="ordinance != 'recent' ">
<ion-icon class="mr-10 font-25" src="assets/images/theme/gov/decrescente.svg" ></ion-icon> <ion-icon class="mr-10 font-25" src="assets/images/theme/gov/decrescente.svg" ></ion-icon>
</div> </div>
@@ -43,7 +43,7 @@
</mat-option> </mat-option>
<mat-option value="OverdueTasks"> <mat-option value="OverdueTasks">
Em atraso Em atraso
</mat-option> </mat-option>
@@ -62,7 +62,7 @@
</ion-segment-button> --> </ion-segment-button> -->
<ion-segment-button *ngFor="let calendars of eventService.calendarNamesAryPR; let i index" [value]="i === 'Meu calendario' ? 'Meu calendario' : i.OwnerUserId "> <ion-segment-button *ngFor="let calendars of eventService.calendarNamesAryPR; let i index" [value]="i === 'Meu calendario' ? 'Meu calendario' : i.OwnerUserId ">
<div *ngIf="calendars == 'Meu calendario'"> <div *ngIf="calendars == 'Meu calendario'">
<!-- <span *ngIf="SessionStore.user.Profile == 'PR' ">PR</span> <!-- <span *ngIf="SessionStore.user.Profile == 'PR' ">PR</span>
<span *ngIf="SessionStore.user.Profile == 'MDGPR' ">MDGPR</span> <span *ngIf="SessionStore.user.Profile == 'MDGPR' ">MDGPR</span>
<span *ngIf="SessionStore.user.Profile != 'MDGPR' && SessionStore.user.Profile != 'PR' ">Minha agenda</span> --> <span *ngIf="SessionStore.user.Profile != 'MDGPR' && SessionStore.user.Profile != 'PR' ">Minha agenda</span> -->
@@ -118,7 +118,7 @@
<h3>{{event.workflowInstanceDataFields.Subject}}</h3> <h3>{{event.workflowInstanceDataFields.Subject}}</h3>
<p *ngIf="event.workflowInstanceDataFields.StartDate != event.workflowInstanceDataFields.EndDate">{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} - {{ event.workflowInstanceDataFields.EndDate | date: 'dd/M/yy'}} | {{event.workflowInstanceDataFields.Location}}</p> <p *ngIf="event.workflowInstanceDataFields.StartDate != event.workflowInstanceDataFields.EndDate">{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} - {{ event.workflowInstanceDataFields.EndDate | date: 'dd/M/yy'}} | {{event.workflowInstanceDataFields.Location}}</p>
<p *ngIf="event.workflowInstanceDataFields.StartDate == event.workflowInstanceDataFields.EndDate">{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} | {{event.workflowInstanceDataFields.Location}}</p> <p *ngIf="event.workflowInstanceDataFields.StartDate == event.workflowInstanceDataFields.EndDate">{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} | {{event.workflowInstanceDataFields.Location}}</p>
<div *ngIf="event.activityInstanceName"> <div *ngIf="event.activityInstanceName">
<div class="label-event-type font-13-rem"> {{ event.activityInstanceName }} </div> <div class="label-event-type font-13-rem"> {{ event.activityInstanceName }} </div>
</div> </div>
@@ -3,11 +3,11 @@
<div class="d-flex overflow-x-auto pa-10 width-100" style="background-color: #d9d9d9;" *ngIf="showAttachmentList"> <div class="d-flex overflow-x-auto pa-10 width-100" style="background-color: #d9d9d9;" *ngIf="showAttachmentList">
<div *ngFor="let attachment of taskViewerAttachment; let i = index" <div *ngFor="let attachment of taskViewerAttachment; let i = index"
class="ion-no-margin ion-no-padding cursor-pointer attachment-list" class="pa-10 mx-10 card-text" [ngClass]="{'selected-attachment': i === selectedIndex}" class="ion-no-margin ion-no-padding cursor-pointer attachment-list" class="pa-10 mx-10 card-text align-baseline" [ngClass]="{'selected-attachment': i === selectedIndex}"
> >
<div class="attachment" > <div class="attachment" >
<div class="attach-title-item tex-left d-flex"> <div class="attach-title-item tex-left d-flex ">
<div> <div>
<div class="subject" [ngClass]="{'add-ellipsis': i != selectedIndex}">{{ attachment.Assunto || "Sem assunto" }}</div> <div class="subject" [ngClass]="{'add-ellipsis': i != selectedIndex}">{{ attachment.Assunto || "Sem assunto" }}</div>
<div class="user" > <div class="user" >
@@ -15,15 +15,20 @@
</div> </div>
</div> </div>
<span class="document-type" *ngIf="isSelectedAttachmentIsDraft(attachment)">Rascunho</span> <span class="document-type ml-20" (click)="clickDraft(i)" *ngIf="isSelectedAttachmentIsDraft(attachment)">Rascunho</span>
<br *ngIf="isSelectedAttachmentIsDraft(attachment)"> <br *ngIf="isSelectedAttachmentIsDraft(attachment)">
<div class="date d-flex justify-content-between"> <div class="date d-flex justify-content-between" >
<div (click)="clickDocument(attachment, i )"> <div *ngIf="!isSelectedAttachmentIsDraft(attachment)" (click)="clickDocument(attachment, i )">
<button mat-icon-button aria-label="Example icon-button with a menu"> <button mat-icon-button aria-label="Example icon-button with a menu">
<ion-icon src="assets/images/icons-nav-actions.svg" class=" font-25-em "></ion-icon> <ion-icon src="assets/images/icons-nav-actions.svg" class=" font-25-em "></ion-icon>
</button> </button>
</div> </div>
<div> <div *ngIf="isSelectedAttachmentIsDraft(attachment)" (click)="clickDraft(i )">
<button mat-icon-button aria-label="Example icon-button with a menu">
<ion-icon src="assets/images/icons-nav-actions.svg" class=" font-25-em "></ion-icon>
</button>
</div>
<div *ngIf="!isSelectedAttachmentIsDraft(attachment)">
<button (click)="doSomething($event);" mat-icon-button [matMenuTriggerFor]="menu" aria-label="Example icon-button with a menu"> <button (click)="doSomething($event);" mat-icon-button [matMenuTriggerFor]="menu" aria-label="Example icon-button with a menu">
<mat-icon>more_vert</mat-icon> <mat-icon>more_vert</mat-icon>
</button> </button>
@@ -63,7 +68,7 @@
*ngIf="taskViewerAttachment[selectedIndex].content" *ngIf="taskViewerAttachment[selectedIndex].content"
class="container-img height-100 flex-1" class="container-img height-100 flex-1"
apiKey="wr5dk69kive0qr9ig6y5spqvlj3a0tsiwnzdsexnz241k69p" apiKey="wr5dk69kive0qr9ig6y5spqvlj3a0tsiwnzdsexnz241k69p"
[(ngModel)]="editorContent" [(ngModel)]="taskViewerAttachment[selectedIndex].content"
[init]="{ [init]="{
save_onsavecallback: 'onSaveContent', save_onsavecallback: 'onSaveContent',
language: 'pt_PT', language: 'pt_PT',
@@ -81,7 +86,9 @@
bullist numlist outdent indent | removeformat | print | save | help ' }" bullist numlist outdent indent | removeformat | print | save | help ' }"
initialValue='{{content}}' initialValue='{{content}}'
[(ngModel)]="content" [(ngModel)]="taskViewerAttachment[selectedIndex].content"
(onSaveContent)="somefunction()"
(ngModelChange)="onEditorContentChange()"
></editor> ></editor>
</div> </div>
@@ -32,6 +32,7 @@ export class ViewerAttachmentPage implements OnInit {
private processes: ProcessesService, private processes: ProcessesService,
private erroHandler: HttpErrorHandle, private erroHandler: HttpErrorHandle,
public p: PermissionService, public p: PermissionService,
private processService: ProcessesService,
) { } ) { }
ngOnInit() { ngOnInit() {
@@ -54,7 +55,7 @@ export class ViewerAttachmentPage implements OnInit {
firstLoad = true firstLoad = true
async clickDocument(viewerAttachment: ViewerAttachment, i) { async clickDocument(viewerAttachment: ViewerAttachment, i) {
this.draft = this.isSelectedAttachmentIsDraft(this.taskViewerAttachment[this.selectedIndex]) this.draft = false
let count = 0 let count = 0
this.loading = true this.loading = true
@@ -132,45 +133,13 @@ export class ViewerAttachmentPage implements OnInit {
ngOnChanges() { ngOnChanges() {
const task = this.taskViewerAttachment[this.selectedIndex] const task = this.taskViewerAttachment[this.selectedIndex]
this.draft = this.isSelectedAttachmentIsDraft(this.taskViewerAttachment[this.selectedIndex])
if(!this.draft) {
this.clickDocument(task, this.selectedIndex)
}
this.clickDocument(task, this.selectedIndex)
} }
private holdStart: number = 0;
private holdEnd: number = 0;
private holdDuration: number = 500; // Adjust the duration needed for a "hold"
private holdTimer: any;
private isHoldTriggered: boolean = false;
startHold(event: TouchEvent, attachment: any, index: number): void {
event.preventDefault();
this.holdStart = new Date().getTime();
// Handle your logic for the initial touch (if needed)
this.clickDocument(attachment, index);
this.holdTimer = setTimeout(() => {
const currentTime = new Date().getTime();
if (currentTime - this.holdStart >= this.holdDuration) {
// Your logic for "hold to click" action goes here
console.log('Hold to click action triggered!');
console.log(event)
window['e'] = event;
if(!this.isSelectedAttachmentIsDraft(attachment)) {
(event as any).target.parentElement.querySelector('button').click()
}
this.isHoldTriggered = true;
}
}, this.holdDuration);
}
endHold(): void {
clearTimeout(this.holdTimer);
this.holdEnd = new Date().getTime();
this.isHoldTriggered = false;
}
openExpedientActionsModal(taskAction, Document) { openExpedientActionsModal(taskAction, Document) {
window['TaskDetailsPage-openExpedientActionsModal'](taskAction, Document) window['TaskDetailsPage-openExpedientActionsModal'](taskAction, Document)
} }
@@ -182,4 +151,52 @@ export class ViewerAttachmentPage implements OnInit {
e.stopPropagation(); e.stopPropagation();
// do other stuff... // do other stuff...
} }
saveDraft(selectedIndex) {
// Lógica que deseja executar em intervalos regulares
console.log('Intervalo de 3 segundos...');
const document = this.taskViewerAttachment[selectedIndex]
let objectDraft = {
"status": false,
"description": document.Assunto,
"content": document.content,
"path": document.path,
"ownerId": document.ownerId
}
this.processService.SaveDraftByID(document.DocId, objectDraft).subscribe((res) => {
console.log('Saved tinymce')
}, (error) => {
this.erroHandler.httpStatusHandle(error)
})
}
onEditorContentChange() {
const selectedIndex = this.selectedIndex
console.log('Autosave successful! Content saved to local storage1.');
if (this.saveTimeout) {
clearTimeout(this.saveTimeout);
}
this.saveTimeout = setTimeout(() => {
this.saveDraft(selectedIndex);
clearTimeout(this.saveTimeout);
}, 5000);
}
somefunction() {
console.log('Saved tinymce')
}
clickDraft(i: number) {
this.selectedIndex = i
this.draft = true
}
} }
@@ -147,7 +147,6 @@ export class ListBoxService {
startDate.getMonth() != endDate.getMonth() || startDate.getMonth() != endDate.getMonth() ||
startDate.getDate() != endDate.getDate()) { startDate.getDate() != endDate.getDate()) {
console.log("while", event)
const newDate = startDate.setDate(startDate.getDate()+ i) const newDate = startDate.setDate(startDate.getDate()+ i)
let otherDays = this.dateService.getDay(newDate) let otherDays = this.dateService.getDay(newDate)
+2 -4
View File
@@ -51,14 +51,12 @@ export class DateService {
date.setDate(date.getDate() -1); date.setDate(date.getDate() -1);
const _date = date.getDate(); const _date = String(date.getDate()).padStart(2,'0');
const month = date.getMonth() + 1; const month = String(date.getMonth() + 1).padStart(2,'0');
const fullYear = date.getFullYear(); const fullYear = date.getFullYear();
const formattedDate = `${fullYear}-${month}-${_date} 23:59`; const formattedDate = `${fullYear}-${month}-${_date} 23:59`;
res.EndDate = formattedDate res.EndDate = formattedDate
console.log('reduze')
} }
return res as any return res as any
+4 -9
View File
@@ -666,22 +666,17 @@ export class EventsService {
date.setDate(date.getDate() -1); date.setDate(date.getDate() -1);
const _date = date.getDate(); const _date = String(date.getDate()).padStart(2,'0');
const month = date.getMonth() + 1; const month = String(date.getMonth() + 1).padStart(2,'0');
const fullYear = date.getFullYear(); const fullYear = date.getFullYear();
console.log({_date, month})
const formattedDate = `${fullYear}-${month}-${_date} 23:59`; const formattedDate = `${fullYear}-${month}-${_date} 23:59`;
e.EndDate = formattedDate e.EndDate = formattedDate
console.log('reduze')
} }
return e return e
}) })
console.log({calendar})
result = result.concat(calendar) result = result.concat(calendar)
} }
+1 -1
View File
@@ -95,7 +95,7 @@ export class TinyMCEPage implements OnDestroy {
if (this.saveTimeout) { if (this.saveTimeout) {
clearTimeout(this.saveTimeout); clearTimeout(this.saveTimeout);
} }
this.saveTimeout = setTimeout(() => { this.saveTimeout = setTimeout(() => {
this.saveDraft(); this.saveDraft();
clearTimeout(this.saveTimeout); clearTimeout(this.saveTimeout);