try to solve the add file on chat

This commit is contained in:
Eudes Inácio
2023-08-30 20:03:29 +01:00
41 changed files with 173 additions and 213 deletions
@@ -146,6 +146,7 @@
border-radius: 50%;
margin: 0 auto;
border-color: transparent !important;
object-fit: cover;
}
.ion-icon-class-theme {
+1
View File
@@ -86,6 +86,7 @@
border-radius: 50%;
margin: 0 auto;
border-color: transparent !important;
object-fit: cover;
}
.icon {
+2 -2
View File
@@ -140,7 +140,7 @@
</thead>
</table>
<div class="calendar-conteiner-height overflow-hidden" [style.height]="height">
<div class="calendar-conteiner-height overflow-hidden" [style.height]="listBoxService.height">
<calendar
class="calendar-component"
[eventSource]="listToPresent"
@@ -186,7 +186,7 @@
<div class="calendar-title-container px-20 d-flex">
<ion-row class="timeline-date align-center pr-10">
<button class="no-color" *ngIf="showCalendar" (click)="height='0px';showCalendar=false">
<button class="no-color" *ngIf="showCalendar" (click)="listBoxService.height='0px';showCalendar=false">
<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>
+8 -5
View File
@@ -176,7 +176,7 @@ export class AgendaPage implements OnInit {
public eventService: EventsService,
private router: Router,
private dateAdapter: DateAdapter<any>,
private listBoxService: ListBoxService,
public listBoxService: ListBoxService,
private changeProfileService: ChangeProfileService,
private backgroundservice: BackgroundService,
public ThemeService: ThemeService,
@@ -274,6 +274,7 @@ export class AgendaPage implements OnInit {
this.updateEventListBox()
}
realoadCounter++;
this.weekToShow()
}
});
@@ -290,14 +291,12 @@ export class AgendaPage implements OnInit {
}, 1000)
}
height = 'unset'
weekToShow() {
setTimeout(() => {
try {
let weekNum = 0;
function Week(a) {
for(let b of a.querySelectorAll('td')) {
if(!b.className.includes('text-muted')) {
@@ -315,7 +314,11 @@ export class AgendaPage implements OnInit {
}
this.showCalendar = true
this.height = (weekNum * dayBoxHeight) +'px'
this.listBoxService.height = (weekNum * dayBoxHeight) +'px'
if(dayBoxHeight == 0) {
this.weekToShow()
}
} catch (e) {
setTimeout(()=> {
this.weekToShow()
+3 -1
View File
@@ -779,7 +779,9 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
const blob = await response.blob();
const formData = new FormData();
console.log('add file', formData)
formData.append("blobFile", blob);
console.log('add file', formData)
this.ChatSystemService.getDmRoom(roomId).send({
file: {
@@ -843,8 +845,8 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
const formData = new FormData();
console.log('add file', formData)
formData.append('blobFile', blob);
console.log('add file', fileBase64)
this.ChatSystemService.getDmRoom(roomId).send({
file: {
@@ -58,7 +58,7 @@
</div>
<button title="Atualizar" *ngIf="hideRefreshBtn && TaskService.loadCount" class="btn-no-color btn-refresh"
(click)="doRefreshAside()">
<ion-icon class="title-icon font-awesome" name="reload-circle"></ion-icon>
<ion-icon class=" font-45-em" src="assets/images/theme/gov/icon-reload.svg"></ion-icon>
</button>
<div *ngIf="!hideRefreshBtn" class="title-icons">
@@ -20,30 +20,18 @@
<div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
</div>
<div class="ion-input-class flex-grow-1">
<ion-datetime
class="d-block d-md-none"
[(ngModel)]="folder.DateBegin"
placeholder="Início"
displayFormat="D MMM YYYY H:mm"
minuteValues="0,5,10,15,20,25,30,35,40,45,50,55"
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
min="{{minDate}}"
max="2025">
</ion-datetime>
<div class="ion-input-class flex-grow-1" [class.input-error]="Form?.get('Date')?.invalid && validateFrom ">
<mat-form-field appearance="none" class="width-100 date-hour-picker d-none d-md-block">
<mat-form-field appearance="none" class="width-100 date-hour-picker">
<input matInput [ngxMatDatetimePicker]="picker1"
placeholder="Choose a date*"
[formControl]="folder.DateBegin"
[disabled]="disabled"
[(ngModel)]="folder.DateBegin"
>
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1"></mat-datepicker-toggle>
<ngx-mat-datetime-picker #picker1
[showSpinners]="showSpinners"
[showSeconds]="showSeconds"
[stepHour]="stepHour" [stepMinute]="stepMinute"
[stepHour]="1" [stepMinute]="12"
[stepSecond]="stepSecond"
[touchUi]="touchUi">
</ngx-mat-datetime-picker>
@@ -58,30 +46,19 @@
<div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
</div>
<div class="ion-input-class d-flex flex-grow-1">
<ion-datetime
class="flex-grow-1 d-block d-md-none"
[(ngModel)]="folder.DateEnd"
placeholder="Fim"
displayFormat="D MMM YYYY H:mm"
minuteValues="0,5,10,15,20,25,30,35,40,45,50,55"
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
min="{{minDate}}"
max="2025">
</ion-datetime>
<div class="ion-input-class d-flex flex-grow-1" [class.input-error]="Form?.get('Date')?.invalid && validateFrom ">
<mat-form-field class="width-100 date-hour-picker d-none d-md-block">
<mat-form-field class="width-100 date-hour-picker">
<input matInput [ngxMatDatetimePicker]="fim"
placeholder="Choose a date*"
[formControl]="folder.DateEnd"
[(ngModel)]="folder.DateEnd"
[min]="maxDate"
[disabled]="disabled"
>
<mat-datepicker-toggle id="new-fim" matSuffix [for]="fim"></mat-datepicker-toggle>
<ngx-mat-datetime-picker #fim
[showSpinners]="showSpinners"
[showSeconds]="showSeconds"
[stepHour]="stepHour" [stepMinute]="stepMinute"
[stepHour]="1" [stepMinute]="15"
[stepSecond]="stepSecond"
[touchUi]="touchUi">
</ngx-mat-datetime-picker>
@@ -6,11 +6,28 @@ import { PublicationFolder } from 'src/app/models/publicationfolder';
import { PublicationsService } from 'src/app/services/publications.service';
import { ToastService } from 'src/app/services/toast.service';
import { HttpErrorHandle} from 'src/app/services/http-error-handle.service';
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
parse: {
dateInput: "YYYY-MMMM-DD HH:mm"
},
display: {
dateInput: "DD MMM YYYY H:mm",
monthYearLabel: "MMM YYYY",
dateA11yLabel: "LL",
monthYearA11yLabel: "MMMM YYYY"
}
}
@Component({
selector: 'app-edit-action',
templateUrl: './edit-action.page.html',
styleUrls: ['./edit-action.page.scss'],
providers: [
{ provide: NGX_MAT_DATE_FORMATS, useValue: CUSTOM_DATE_FORMATS },
]
})
export class EditActionPage implements OnInit {
@@ -28,8 +45,6 @@ export class EditActionPage implements OnInit {
public stepHour = 1;
public stepMinute = 15;
public stepSecond = 5;
public dateControlStart = new FormControl(moment("DD MM YYYY hh"));
public dateControlEnd = new FormControl(moment("DD MM YYYY hh"));
currentDate = new Date();
folder: PublicationFolder;
@@ -71,26 +86,12 @@ export class EditActionPage implements OnInit {
getPublicationDetail() {
this.publicationsService.GetPresidentialAction(this.folderId).subscribe( res => {
this.folder = res;
this.dateControlStart = new FormControl(moment(new Date(this.folder.DateBegin)));
this.dateControlEnd = new FormControl(moment(new Date(this.folder.DateEnd)));
});
}
get dateValid() {
var validado: boolean;
if (window.innerWidth <= 800) {
if ((this.folder.DateBegin < this.folder.DateEnd) && (new Date(this.folder.DateBegin).getTime() > this.currentDate.getTime())) {
validado = true;
}else{
validado = false;
}
return validado == true ? ['ok']: [];
} else {
return ['ok']
}
return new Date(this.folder.DateBegin).getTime() < new Date(this.folder.DateEnd).getTime()? 'ok': null
}
runValidation() {
@@ -28,7 +28,7 @@
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " slot="icon-only" src='assets/images/theme/{{ThemeService.currentTheme}}/icons-add.svg'></ion-icon>
</button>
<button title="Atualizar" class="btn-no-color" (click)="refreshing()">
<ion-icon slot="icon-only" class="title-icon font-awesome" name="reload-circle" title="Actualizar"></ion-icon>
<ion-icon class=" font-45-em" src="assets/images/theme/gov/icon-reload.svg"></ion-icon>
</button>
</div>
</div>
@@ -7,6 +7,8 @@ import { DateService } from '../date.service';
})
export class ListBoxService {
height = "unset"
constructor(
private dateService: DateService
){}
+1 -1
View File
@@ -318,7 +318,7 @@ export class TaskService {
for(let calendar of this.eventService.calendarNamesAry) {
if(calendar == 'Meu calendario') {
// color
let genericEvents = await this.processesbackend.GetTasksList('Agendar Evento', false).toPromise();
let genericEvents = await this.processesbackend.eventsToApprove(SessionStore.user.UserId, false).toPromise();
let eventsList
try {
eventsList = genericEvents
@@ -106,7 +106,12 @@ export class EventListPage implements OnInit {
if(this.segment == 'Meu calendario') {
// color
this.color = 'mdgpr'
if(SessionStore.user.Profile == 'PR') {
this.color = 'pr'
} else {
this.color = 'mdgpr'
}
let genericEvents = await this.processes.eventsToApprove(SessionStore.user.UserId,'mobile agenda').toPromise()
try {
@@ -117,7 +117,7 @@ ion-content{
background: var(--label-bg-color);
float: right !important;
padding: 5px 13.5px 5px 13.5px;
color: #fff;
color: black;
font-size: rem(14);
}
}
@@ -106,7 +106,7 @@
>
<div class="expediente" *ngIf="TaskService.filter(event, filterName)">
<!-- (click)="openApproveModal(event)" -->
<div class="event-{{color}}-{{event.workflowInstanceDataFields.Agenda}} width-100 d-flex">
<div class="event-{{color}}-{{event.workflowInstanceDataFields.Agenda}} width-100 d-flex flex-wrap">
<div class="approve-event-time">
<p>{{event.workflowInstanceDataFields.StartDate | date: 'HH:mm'}}</p>
<p>{{event.workflowInstanceDataFields.EndDate | date: 'HH:mm'}}</p>
@@ -120,6 +120,9 @@
<span class="dead-line ml-10" *ngIf="TaskService.deadlineIsToday(event.deadline)">Para hoje</span>
<span class="new-task ml-10" *ngIf="TaskService.lessThen24Hours(event.taskReceiveDate)">Nova</span>
</div>
<div *ngIf="event.activityInstanceName" class="width-100 ml-40">
<div class="label-event-type font-13-rem"> {{ event.activityInstanceName }} </div>
</div>
</div>
</div>
</div>
@@ -258,3 +258,15 @@
width: 20px;
}
}
.label-event-type {
padding: 1px 7px;
display: inline-block;
background: #ffb703;
border-radius: 17px;
color: black;
font-size: rem(13);
}
@@ -176,14 +176,17 @@ export class EventsToApprovePage implements OnInit {
this.showLoader = true;
const segment = this.segment
if(SessionStore.user.Profile == 'PR') {
return false
}
if(this.segment == 'Meu calendario') {
// color
this.color = 'mdgpr'
if(SessionStore.user.Profile == 'PR') {
this.color = 'pr'
} else {
this.color = 'mdgpr'
}
let genericEvents = await this.processes.eventsToApprove(SessionStore.user.UserId,'mobile agenda').toPromise()
try {
@@ -16,7 +16,7 @@
<ion-icon class="delete" src='assets/images/theme/gov/icons-delete.svg'></ion-icon>
</button>
<button class="btn-no-color cursor-pointer" (click)="doRefresh($event)">
<ion-icon class="title-icon font-awesome" name="reload-circle"></ion-icon>
<ion-icon class=" font-45-em" src="assets/images/theme/gov/icon-reload.svg"></ion-icon>
</button >
</div>
</div>