mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
add message errors in new action.
This commit is contained in:
@@ -102,7 +102,13 @@ export class NewActionPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
runValidation() {
|
runValidation() {
|
||||||
this.validateFrom = true
|
this.validateFrom = true;
|
||||||
|
if(new Date(this.folder.DateBegin).toISOString() > new Date(this.folder.DateEnd).toISOString()){
|
||||||
|
this.toastService.badRequest("A data de início não pode ser superior a data de fim");
|
||||||
|
}
|
||||||
|
else if(this.folder.DateBegin > new Date().toISOString()){
|
||||||
|
this.toastService.badRequest("A data de início não pode ser superior a data actual");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
injectValidation() {
|
injectValidation() {
|
||||||
|
|||||||
@@ -51,7 +51,9 @@ export class FileService {
|
|||||||
private platform: Platform,
|
private platform: Platform,
|
||||||
private loadingCtrl: LoadingController,
|
private loadingCtrl: LoadingController,
|
||||||
private http: HttpClient,
|
private http: HttpClient,
|
||||||
) { }
|
) {
|
||||||
|
this.headers = new HttpHeaders();
|
||||||
|
}
|
||||||
|
|
||||||
uploadFile(formData:any){
|
uploadFile(formData:any){
|
||||||
|
|
||||||
@@ -71,6 +73,9 @@ export class FileService {
|
|||||||
|
|
||||||
params = params.set("path", guid);
|
params = params.set("path", guid);
|
||||||
|
|
||||||
|
this.headers = this.headers.set('responseType', 'blob');
|
||||||
|
this.headers = this.headers.set('Content-Type', 'application/octet-stream');
|
||||||
|
|
||||||
let options = {
|
let options = {
|
||||||
headers: this.headers,
|
headers: this.headers,
|
||||||
params: params
|
params: params
|
||||||
|
|||||||
@@ -201,13 +201,11 @@ export class NewEventPage implements OnInit {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
this.taskParticipants = removeDuplicate(this.taskParticipants);
|
this.taskParticipants = removeDuplicate(this.taskParticipants);
|
||||||
this.taskParticipantsCc = removeDuplicate(this.taskParticipantsCc);
|
this.taskParticipantsCc = removeDuplicate(this.taskParticipantsCc);
|
||||||
|
|
||||||
this.setIntervenient.emit(this.taskParticipants);
|
this.setIntervenient.emit(this.taskParticipants);
|
||||||
this.setIntervenientCC.emit(this.taskParticipantsCc);
|
this.setIntervenientCC.emit(this.taskParticipantsCc);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -307,7 +305,6 @@ export class NewEventPage implements OnInit {
|
|||||||
close(){
|
close(){
|
||||||
|
|
||||||
this.deleteTemporaryData();
|
this.deleteTemporaryData();
|
||||||
|
|
||||||
this.cloneAllmobileComponent.emit();
|
this.cloneAllmobileComponent.emit();
|
||||||
this.clearContact.emit();
|
this.clearContact.emit();
|
||||||
this.setIntervenient.emit([]);
|
this.setIntervenient.emit([]);
|
||||||
@@ -425,10 +422,8 @@ export class NewEventPage implements OnInit {
|
|||||||
(id) => {
|
(id) => {
|
||||||
console.log(id);
|
console.log(id);
|
||||||
|
|
||||||
|
|
||||||
const eventId: any = id;
|
const eventId: any = id;
|
||||||
|
|
||||||
|
|
||||||
const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
|
const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
|
||||||
return {
|
return {
|
||||||
SourceTitle: e.Assunto,
|
SourceTitle: e.Assunto,
|
||||||
|
|||||||
@@ -149,9 +149,9 @@
|
|||||||
<!-- <ion-fab-button (click)="addFile()" color="light">
|
<!-- <ion-fab-button (click)="addFile()" color="light">
|
||||||
<ion-icon name="document"></ion-icon>
|
<ion-icon name="document"></ion-icon>
|
||||||
</ion-fab-button> -->
|
</ion-fab-button> -->
|
||||||
<ion-fab-button (click)="addImage()" color="light">
|
<!-- <ion-fab-button (click)="addImage()" color="light">
|
||||||
<ion-icon name="image"></ion-icon>
|
<ion-icon name="image"></ion-icon>
|
||||||
</ion-fab-button>
|
</ion-fab-button> -->
|
||||||
<!-- <ion-fab-button class="hide-desktop" (click)="takePicture()" color="light">
|
<!-- <ion-fab-button class="hide-desktop" (click)="takePicture()" color="light">
|
||||||
<ion-icon name="camera"></ion-icon>
|
<ion-icon name="camera"></ion-icon>
|
||||||
</ion-fab-button> -->
|
</ion-fab-button> -->
|
||||||
|
|||||||
@@ -123,9 +123,9 @@
|
|||||||
<!-- <ion-fab-button hidden (click)="addFile()" color="light">
|
<!-- <ion-fab-button hidden (click)="addFile()" color="light">
|
||||||
<ion-icon name="document"></ion-icon>
|
<ion-icon name="document"></ion-icon>
|
||||||
</ion-fab-button> -->
|
</ion-fab-button> -->
|
||||||
<ion-fab-button (click)="addImage()" color="light">
|
<!-- <ion-fab-button (click)="addImage()" color="light">
|
||||||
<ion-icon name="image"></ion-icon>
|
<ion-icon name="image"></ion-icon>
|
||||||
</ion-fab-button>
|
</ion-fab-button> -->
|
||||||
<!-- <ion-fab-button (click)="takePicture()" color="light">
|
<!-- <ion-fab-button (click)="takePicture()" color="light">
|
||||||
<ion-icon name="camera"></ion-icon>
|
<ion-icon name="camera"></ion-icon>
|
||||||
</ion-fab-button> -->
|
</ion-fab-button> -->
|
||||||
|
|||||||
@@ -250,6 +250,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
if(msg.file.type == "application/img"){
|
if(msg.file.type == "application/img"){
|
||||||
let response:any = await this.fileService.getFile(msg.file.guid).toPromise();
|
let response:any = await this.fileService.getFile(msg.file.guid).toPromise();
|
||||||
console.log(response);
|
console.log(response);
|
||||||
|
alert(response);
|
||||||
|
|
||||||
//this.openPreview(msg);
|
//this.openPreview(msg);
|
||||||
|
|
||||||
|
|||||||
@@ -47,8 +47,8 @@ export class NewActionPage implements OnInit {
|
|||||||
|
|
||||||
|
|
||||||
this.folder = Object.assign(this.folder, {
|
this.folder = Object.assign(this.folder, {
|
||||||
DateBegin: moment(new Date()),
|
DateBegin: new Date().toISOString(),
|
||||||
DateEnd: moment(new Date(new Date().getTime() + 15 * 60000)),
|
DateEnd: (new Date(new Date().getTime() + 15 * 60000)).toISOString(),
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -78,7 +78,13 @@ export class NewActionPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
runValidation() {
|
runValidation() {
|
||||||
this.validateFrom = true
|
this.validateFrom = true;
|
||||||
|
if((new Date(this.folder.DateBegin).getTime()) > (new Date(this.folder.DateEnd).getTime())){
|
||||||
|
this.toastService._badRequest("A data de início não pode ser superior a data de fim");
|
||||||
|
}
|
||||||
|
else if(new Date(this.folder.DateBegin).getTime() > new Date().getTime()){
|
||||||
|
this.toastService._badRequest("A data de início não pode ser superior a data actual");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
injectValidation() {
|
injectValidation() {
|
||||||
@@ -125,11 +131,11 @@ export class NewActionPage implements OnInit {
|
|||||||
try {
|
try {
|
||||||
await this.publication.CreatePublicationFolder(this.folder).toPromise()
|
await this.publication.CreatePublicationFolder(this.folder).toPromise()
|
||||||
this.close();
|
this.close();
|
||||||
this.toastService.successMessage('Acção presidencial criada')
|
this.toastService._successMessage('Acção presidencial criada')
|
||||||
|
|
||||||
this.getActions.emit()
|
this.getActions.emit()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.toastService.badRequest('Não foi possivel criar a acção presidencial')
|
this.toastService._badRequest('Não foi possivel criar a acção presidencial')
|
||||||
} finally {
|
} finally {
|
||||||
loader.remove()
|
loader.remove()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user