fix pages

This commit is contained in:
Peter Maquiran
2023-08-22 15:43:20 +01:00
parent f9a4830a30
commit 977aed8862
6 changed files with 42 additions and 32 deletions
+1 -4
View File
@@ -844,10 +844,7 @@ export class AgendaPage implements OnInit {
const selectedCalendarIds = this.getSelectedAgendaCalendars();
this.listToPresent = this.CalendarStore.getEventsByCalendarIds(selectedCalendarIds)
const listToPresent = this.listToPresent.filter( e => momentG(new Date(this.eventSelectedDate), 'dd MMMM yyyy', 'pt') == momentG(e.startTime, 'dd MMMM yyyy', 'pt'))
this.TimelineMDList = this.listBoxService.list(listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
const selectedDay = momentG(this.eventSelectedDate, 'dd', 'pt');
if(this.TimelineMDList[selectedDay]) {
@@ -211,6 +211,7 @@ export class NewPublicationPage implements OnInit {
if (this.publicationType == '3') {
// has captured image
if (this.capturedImage != '') {
this.publication = {
DateIndex: this.publication.DateIndex,
@@ -232,7 +233,7 @@ export class NewPublicationPage implements OnInit {
this.httpErrorHandle.httpsSucessMessagge('Publicação Editada')
console.log({response})
this.RouteService.goBack()
this.close()
} catch (error) {
this.httpErrorHandle.httpStatusHandle(error)
} finally {
@@ -240,8 +241,8 @@ export class NewPublicationPage implements OnInit {
}
}
else if (!this.publication.OriginalFileName) {
// no file names
else if (!this.PublicationFolderService.PublicationHasImage(this.publication)) {
this.publication = {
DateIndex: this.publication.DateIndex,
DocumentId: this.publication.DocumentId,
@@ -249,9 +250,9 @@ export class NewPublicationPage implements OnInit {
Title: this.pub.Title,
Message: this.pub.Message,
DatePublication: this.publication.DatePublication,
// OriginalFileName: this.publication.OriginalFileName,
// FileBase64: this.publication.FileBase64,
// FileExtension: 'jpeg',
OriginalFileName: "",
FileBase64: "",
FileExtension: "",
}
const loader = this.toastService.loading()
@@ -261,7 +262,7 @@ export class NewPublicationPage implements OnInit {
this.httpErrorHandle.httpsSucessMessagge('Criar publicação')
console.log({response})
this.RouteService.goBack()
this.close()
} catch (error) {
this.httpErrorHandle.httpStatusHandle(error)
} finally {
@@ -276,8 +277,8 @@ export class NewPublicationPage implements OnInit {
Title: this.pub.Title,
Message: this.pub.Message,
DatePublication: this.publication.DatePublication,
OriginalFileName: this.capturedImageTitle,
FileBase64: this.capturedImage,
OriginalFileName: this.publication.OriginalFileName,
FileBase64: this.publication.FileBase64,
FileExtension: 'jpeg',
}
@@ -287,7 +288,7 @@ export class NewPublicationPage implements OnInit {
const response = await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
this.httpErrorHandle.httpsSucessMessagge('Publicação Editada')
console.log({response})
this.RouteService.goBack()
this.close()
} catch (error) {
this.httpErrorHandle.httpStatusHandle(error)
} finally {
@@ -345,8 +346,8 @@ export class NewPublicationPage implements OnInit {
}
clear() {
this.capturedImageTitle = '';
this.capturedImage = '';
this.capturedImageTitle = null;
this.capturedImage = null;
}
setTitle() {
+2 -2
View File
@@ -20,8 +20,8 @@ export class PublicationPipe implements PipeTransform {
"DatePublication": element.DatePublication,
/* image:itemImage, */
"FileBase64": "data:image/jpg;base64," + element.FileBase64,
"OriginalFileName": '',
"FileExtension": '',
"OriginalFileName": element?.OriginalFileName,
"FileExtension": element?.FileExtension,
"OrganicEntityId": element.OrganicEntityId
}
}
@@ -102,6 +102,9 @@ export class NewPublicationPage implements OnInit {
}
this.pub = this.publication;
this.showLoader = false;
}, () => {
this.showLoader = false;
this.goBack()
});
}
@@ -174,7 +177,7 @@ export class NewPublicationPage implements OnInit {
Title: this.pub.Title,
Message: this.pub.Message,
DatePublication: this.publication.DatePublication,
OriginalFileName: this.capturedImageTitle,
OriginalFileName: this.publication.OriginalFileName || 'foto',
FileBase64: this.capturedImage,
FileExtension: 'jpeg',
}
@@ -196,7 +199,8 @@ export class NewPublicationPage implements OnInit {
}
}
else if (!this.publication.OriginalFileName) { //
else if (!this.PublicationFolderService.PublicationHasImage(this.publication)) { //
this.publication = {
DateIndex: this.publication.DateIndex,
DocumentId:this.publication.DocumentId,
@@ -204,10 +208,9 @@ export class NewPublicationPage implements OnInit {
Title: this.pub.Title,
Message: this.pub.Message,
DatePublication: this.publication.DatePublication,
OriginalFileName: this.capturedImageTitle,
// OriginalFileName: this.publication.OriginalFileName,
// FileBase64: this.publication.FileBase64,
// FileExtension: 'jpeg',
OriginalFileName: this.publication.OriginalFileName,
FileBase64: "",
FileExtension: this.publication.FileExtension,
}
const loader = this.toastService.loading()
@@ -233,7 +236,7 @@ export class NewPublicationPage implements OnInit {
Title: this.pub.Title,
Message: this.pub.Message,
DatePublication: this.publication.DatePublication,
OriginalFileName: this.capturedImageTitle,
OriginalFileName: this.publication.OriginalFileName,
FileBase64: this.capturedImage,
FileExtension: 'jpeg',
}
@@ -196,6 +196,15 @@ export class PublicationFolderService {
}
PublicationHasImage(Publication: Publication) {
return Publication.FileBase64 != '' && Publication.FileBase64 != "data:image/jpg;base64,null"
}
hasCapturedImage(Publication: Publication) {
return Publication.FileBase64 != '' && Publication.FileBase64 != "data:image/jpg;base64,null"
}
}