Merge pull request 'feat: update text desc scheduling loh' (#180) from fix/log-scheduling into development
Reviewed-on: #180pull/142/head 1.7.2-alpha.7
commit
aba438382d
|
@ -31,7 +31,7 @@ export class DataSchedulingChangeStatusHandler
|
|||
const editorName = newData.editor_name || 'System';
|
||||
const totalPercentage = decryptionTotal(newData?.indexing_key);
|
||||
|
||||
const description = `<div><b>${editorName}</b> changed the status of <b><i>${scheduleName} (${totalPercentage}%)</i></b> from <b><i>${oldStatus}</i></b> to <b><i>${newStatus}</i></b>.</div>`;
|
||||
const description = `<div><b>${editorName}</b> changed the status of <b><i>${scheduleName} (${totalPercentage}%)</i></b> schedule from <b><i>${newData?.schedule_date_from}</i></b> to <b><i>${newData.schedule_date_to}</i></b> from <b><i>${oldStatus}</i></b> to <b><i>${newStatus}</i></b>.</div>`;
|
||||
|
||||
const payload: DataSchedulingLogEntity = {
|
||||
type: SCHEDULING_LOG_TYPE_ENUM.DATA_SCHEDULING,
|
||||
|
|
|
@ -29,7 +29,7 @@ export class DataSchedulingDeletedHandler
|
|||
|
||||
const scheduleName = deletedData?.name || 'an item';
|
||||
const totalPercentage = decryptionTotal(deletedData?.indexing_key);
|
||||
const description = `<div><b>${deleterName}</b> deleted schedule: <b><i>${scheduleName} (${totalPercentage}%)</i></b>.</div>`;
|
||||
const description = `<div><b>${deleterName}</b> deleted schedule: <b><i>${scheduleName} (${totalPercentage}%)</i></b> schedule from <b><i>${deletedData?.schedule_date_from}</i></b> to <b><i>${deletedData.schedule_date_to}</i></b>.</div>`;
|
||||
|
||||
const payload: DataSchedulingLogEntity = {
|
||||
type: SCHEDULING_LOG_TYPE_ENUM.DATA_SCHEDULING,
|
||||
|
|
|
@ -128,10 +128,10 @@ export class DataSchedulingUpdatedHandler
|
|||
: `${totalPercentageOld}% to ${totalPercentageNew}%`
|
||||
}`;
|
||||
|
||||
let description = `<div><b>${editorName}</b> has updated schedule for <b><i>${itemName} (${labelName})</i></b>.`;
|
||||
let description = `<div><b>${editorName}</b> has updated schedule for <b><i>${itemName} (${labelName})</i></b> schedule from <b><i>${newData?.schedule_date_from}</i></b> to <b><i>${newData.schedule_date_to}</i></b>.<br>`;
|
||||
|
||||
if (Object.keys(changingData.old).length > 0) {
|
||||
description += ` Change details:<ul>`;
|
||||
description += `Change details:<ul>`;
|
||||
for (const key in changingData.old) {
|
||||
if (Object.prototype.hasOwnProperty.call(changingData.old, key)) {
|
||||
const label = this.labelMap[key] || key;
|
||||
|
|
|
@ -74,8 +74,8 @@ export class DataSchedulingManager {
|
|||
|
||||
if (existData?.default_value !== saveData?.default_value) {
|
||||
const description = existData?.id
|
||||
? `<p><b>${saveData.editor_name}</b> mengubah pengaturan <b><i>Default Percentage</i></b> dari <b><i>${existData.default_value}%</i></b> menjadi <b><i>${saveData.default_value}%</i></b>.</p>`
|
||||
: `<p><b>${saveData.creator_name}</b> membuat pengaturan <b><i>Default Percentage</i></b> dengan value <b><i>${saveData.default_value}%</i></b>.</p>`;
|
||||
? `<div><b>${saveData.editor_name}</b> changed the <b><i>Default Percentage</i></b> setting from <b><i>${existData.default_value}%</i></b> to <b><i>${saveData.default_value}%</i></b>.</div>`
|
||||
: `<div><b>${saveData.creator_name}</b> created the <b><i>Default Percentage</i></b> setting with a value of <b><i>${saveData.default_value}%</i></b>.</div>`;
|
||||
|
||||
const logPayload: DataSchedulingLogEntity = {
|
||||
type: SCHEDULING_LOG_TYPE_ENUM.DEFAULT_PERCENTAGE,
|
||||
|
|
|
@ -79,16 +79,22 @@ export class IndexDataSchedulingLogManager extends BaseIndexManager<DataScheduli
|
|||
});
|
||||
}
|
||||
|
||||
if (this.filterParam.log_created_from) {
|
||||
if (this.filterParam.log_created_from && this.filterParam.log_created_to) {
|
||||
const dateFrom = this.filterParam.log_created_from;
|
||||
queryBuilder.andWhere('log_created_from >= :dateFrom', {
|
||||
const dateTo = this.filterParam.log_created_to;
|
||||
|
||||
queryBuilder.andWhere('log_created_at BETWEEN :dateFrom AND :dateTo', {
|
||||
dateFrom: dateFrom,
|
||||
dateTo: dateTo,
|
||||
});
|
||||
} else if (this.filterParam.log_created_from) {
|
||||
const dateFrom = this.filterParam.log_created_from;
|
||||
queryBuilder.andWhere('log_created_at >= :dateFrom', {
|
||||
dateFrom: dateFrom,
|
||||
});
|
||||
}
|
||||
|
||||
if (this.filterParam.log_created_to) {
|
||||
} else if (this.filterParam.log_created_to) {
|
||||
const dateTo = this.filterParam.log_created_to;
|
||||
queryBuilder.andWhere('log_created_to <= :dateTo', {
|
||||
queryBuilder.andWhere('log_created_at <= :dateTo', {
|
||||
dateTo: dateTo,
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue