mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 21:35:50 +00:00
fix pages
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
export let versionData = {
|
||||
"shortSHA": "51a526644",
|
||||
"SHA": "51a526644a23bae4c4a8bfd869df93ea72c7ddd6",
|
||||
"shortSHA": "f9a4830a3",
|
||||
"SHA": "f9a4830a30a0bbcb05daad197f636edf6c920569",
|
||||
"branch": "developer-prod",
|
||||
"lastCommitAuthor": "'Peter Maquiran'",
|
||||
"lastCommitTime": "'Tue Aug 22 13:06:52 2023 +0100'",
|
||||
"lastCommitMessage": "merge",
|
||||
"lastCommitNumber": "5201",
|
||||
"change": "diff --git a/src/app/pages/publications/new-publication/new-publication.page.ts b/src/app/pages/publications/new-publication/new-publication.page.ts\nindex edbbc4a99..4b1165668 100644\n--- a/src/app/pages/publications/new-publication/new-publication.page.ts\n+++ b/src/app/pages/publications/new-publication/new-publication.page.ts\n@@ -211,6 +211,7 @@ export class NewPublicationPage implements OnInit {\n \n if (this.publicationType == '3') {\n \n+ // has captured image\n if (this.capturedImage != '') {\n this.publication = {\n DateIndex: this.publication.DateIndex,\n@@ -240,8 +241,8 @@ export class NewPublicationPage implements OnInit {\n }\n \n }\n- else if (!this.publication.OriginalFileName) {\n-\n+ // no file names\n+ else if (!this.PublicationFolderService.PublicationHasImage(this.publication)) {\n this.publication = {\n DateIndex: this.publication.DateIndex,\n DocumentId: this.publication.DocumentId,\n@@ -249,9 +250,9 @@ export class NewPublicationPage implements OnInit {\n Title: this.pub.Title,\n Message: this.pub.Message,\n DatePublication: this.publication.DatePublication,\n- // OriginalFileName: this.publication.OriginalFileName,\n- // FileBase64: this.publication.FileBase64,\n- // FileExtension: 'jpeg',\n+ OriginalFileName: \"\",\n+ FileBase64: \"\",\n+ FileExtension: \"\",\n }\n \n const loader = this.toastService.loading()\n@@ -276,8 +277,8 @@ export class NewPublicationPage implements OnInit {\n Title: this.pub.Title,\n Message: this.pub.Message,\n DatePublication: this.publication.DatePublication,\n- OriginalFileName: this.capturedImageTitle,\n- FileBase64: this.capturedImage,\n+ OriginalFileName: this.publication.OriginalFileName,\n+ FileBase64: this.publication.FileBase64,\n FileExtension: 'jpeg',\n }\n \n@@ -345,8 +346,8 @@ export class NewPublicationPage implements OnInit {\n }\n \n clear() {\n- this.capturedImageTitle = '';\n- this.capturedImage = '';\n+ this.capturedImageTitle = null;\n+ this.capturedImage = null;\n }\n \n setTitle() {\ndiff --git a/src/app/shared/publication/new-publication/new-publication.page.ts b/src/app/shared/publication/new-publication/new-publication.page.ts\nindex 4e1a59bee..fe2c6bea1 100644\n--- a/src/app/shared/publication/new-publication/new-publication.page.ts\n+++ b/src/app/shared/publication/new-publication/new-publication.page.ts\n@@ -196,7 +196,8 @@ export class NewPublicationPage implements OnInit {\n }\n \n }\n- else if (!this.publication.OriginalFileName) { //\n+ else if (!this.PublicationFolderService.PublicationHasImage(this.publication)) { //\n+ \n this.publication = {\n DateIndex: this.publication.DateIndex,\n DocumentId:this.publication.DocumentId,\n@@ -204,10 +205,9 @@ export class NewPublicationPage implements OnInit {\n Title: this.pub.Title,\n Message: this.pub.Message,\n DatePublication: this.publication.DatePublication,\n- OriginalFileName: this.capturedImageTitle,\n- // OriginalFileName: this.publication.OriginalFileName,\n- // FileBase64: this.publication.FileBase64,\n- // FileExtension: 'jpeg',\n+ OriginalFileName: this.publication.OriginalFileName,\n+ FileBase64: \"\",\n+ FileExtension: this.publication.FileExtension,\n }\n const loader = this.toastService.loading()\n \ndiff --git a/src/app/store/publication-folder.service.ts b/src/app/store/publication-folder.service.ts\nindex a54700c33..9cbdac7f3 100644\n--- a/src/app/store/publication-folder.service.ts\n+++ b/src/app/store/publication-folder.service.ts\n@@ -196,6 +196,15 @@ export class PublicationFolderService {\n \n }\n \n+\n+ PublicationHasImage(Publication: Publication) {\n+ return Publication.FileBase64 != '' && Publication.FileBase64 != \"data:image/jpg;base64,null\"\n+ }\n+\n+ hasCapturedImage(Publication: Publication) {\n+ return Publication.FileBase64 != '' && Publication.FileBase64 != \"data:image/jpg;base64,null\"\n+ }\n+\n }",
|
||||
"changeStatus": "On branch developer-prod\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/home/home.page.ts\n\tmodified: src/app/pages/events/events.page.ts\n\nChanges not staged for commit:\n (use \"git add <file>...\" to update what will be committed)\n (use \"git restore <file>...\" to discard changes in working directory)\n\tmodified: src/app/pages/publications/new-publication/new-publication.page.ts\n\tmodified: src/app/shared/publication/new-publication/new-publication.page.ts\n\tmodified: src/app/store/publication-folder.service.ts",
|
||||
"lastCommitTime": "'Tue Aug 22 14:39:33 2023 +0100'",
|
||||
"lastCommitMessage": "fix date picker",
|
||||
"lastCommitNumber": "5202",
|
||||
"change": "",
|
||||
"changeStatus": "On branch developer-prod\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/pages/agenda/agenda.page.ts\n\tmodified: src/app/pages/publications/new-publication/new-publication.page.ts\n\tmodified: src/app/pipes/publication.pipe.ts\n\tmodified: src/app/shared/publication/new-publication/new-publication.page.ts\n\tmodified: src/app/store/publication-folder.service.ts",
|
||||
"changeAuthor": "peter.maquiran"
|
||||
}
|
||||
Reference in New Issue
Block a user