From f90e1c36883190105abec99bb239969d7e5f86d9 Mon Sep 17 00:00:00 2001 From: Mikita Siadykh Date: Thu, 18 Apr 2024 14:45:01 +0400 Subject: [PATCH] UIOR-1256 use datetime instead of date for csv metadata (#1589) --- src/common/ExportSettingsModal/constants.js | 15 ++++++--------- .../utils/createExportReport.js | 11 ++++------- test/jest/fixtures/exportReport.js | 3 --- 3 files changed, 10 insertions(+), 19 deletions(-) diff --git a/src/common/ExportSettingsModal/constants.js b/src/common/ExportSettingsModal/constants.js index 95d8286a3..29d25227a 100644 --- a/src/common/ExportSettingsModal/constants.js +++ b/src/common/ExportSettingsModal/constants.js @@ -12,8 +12,6 @@ export const EXPORT_ORDER_FIELDS = { shipTo: 'Ship to', manualPo: 'Manual', reEncumber: 'Re-encumber', - createdByUserId: 'Created by', - createdDate: 'Created on', note: 'Note', workflowStatus: 'Workflow status', approved: 'Approved', @@ -26,9 +24,9 @@ export const EXPORT_ORDER_FIELDS = { reviewDate: 'Review date', poTags: 'PO tags', createdBy: 'Created by', - dateCreated: 'Date created', + dateCreated: 'Created on', updatedBy: 'Updated by', - dateUpdated: 'Date updated', + dateUpdated: 'Updated on', }; export const EXPORT_LINE_FIELDS = { @@ -47,7 +45,6 @@ export const EXPORT_LINE_FIELDS = { description: 'Internal note', acquisitionMethod: 'Acquisition method', orderFormat: 'Order format', - createdDateLine: 'Created on (PO Line)', receiptDate: 'Receipt date', receiptStatus: 'Receipt status', paymentStatus: 'Payment status', @@ -90,10 +87,10 @@ export const EXPORT_LINE_FIELDS = { poLineTags: 'POLine tags', renewalNote: 'Renewal note', exchangeRate: 'Exchange rate', - poLineCreatedBy: 'Created by (POL)', - poLineDateCreated: 'Date created (POL)', - poLineUpdatedBy: 'Updated by (POL)', - poLineDateUpdated: 'Date updated (POL)', + poLineCreatedBy: 'Created by (PO Line)', + poLineDateCreated: 'Created on (PO Line)', + poLineUpdatedBy: 'Updated by (PO Line)', + poLineDateUpdated: 'Updated on (PO Line)', }; export const EXPORT_ORDER_FIELDS_OPTIONS = Object.keys(EXPORT_ORDER_FIELDS).map(field => ({ diff --git a/src/common/ExportSettingsModal/utils/createExportReport.js b/src/common/ExportSettingsModal/utils/createExportReport.js index 652ad9dbd..fd4c38b7a 100644 --- a/src/common/ExportSettingsModal/utils/createExportReport.js +++ b/src/common/ExportSettingsModal/utils/createExportReport.js @@ -105,8 +105,6 @@ const getOrderExportData = ({ shipToRecord: addressMap[shipTo], manualPo: !!order.manualPo, reEncumber: order.reEncumber, - createdByUserId: userMap[order.metadata?.createdByUserId]?.username ?? invalidReference, - createdDate: formatDateTime(order.metadata?.createdDate, intl), note: order.notes?.join('|'), workflowStatus: order.workflowStatus, approved: order.approved, @@ -119,9 +117,9 @@ const getOrderExportData = ({ reviewDate: formatDate(order.ongoing?.reviewDate, intl), poTags: order.tags?.tagList?.join('|'), createdBy: userMap[order.metadata?.createdByUserId]?.username ?? invalidReference, - dateCreated: formatDate(order.metadata?.createdDate, intl), + dateCreated: formatDateTime(order.metadata?.createdDate, intl), updatedBy: userMap[order.metadata?.updatedByUserId]?.username ?? invalidReference, - dateUpdated: formatDate(order.metadata?.updatedDate, intl), + dateUpdated: formatDateTime(order.metadata?.updatedDate, intl), }; }; @@ -163,7 +161,6 @@ const getOrderLineExportData = ({ description: lineRecord.description, acquisitionMethod: acquisitionMethodsMap[lineRecord.acquisitionMethod]?.value, orderFormat: lineRecord.orderFormat, - createdDateLine: formatDate(lineRecord.metadata?.createdDate, intl), receiptDate: formatDate(lineRecord.receiptDate, intl), receiptStatus: lineRecord.receiptStatus, paymentStatus: lineRecord.paymentStatus, @@ -206,9 +203,9 @@ const getOrderLineExportData = ({ poLineTags: lineRecord.tags?.tagList?.join('|'), exchangeRate: lineRecord.cost?.exchangeRate, poLineCreatedBy: userMap[lineRecord.metadata?.createdByUserId]?.username ?? invalidReference, - poLineDateCreated: formatDate(lineRecord.metadata?.createdDate, intl), + poLineDateCreated: formatDateTime(lineRecord.metadata?.createdDate, intl), poLineUpdatedBy: userMap[lineRecord.metadata?.updatedByUserId]?.username ?? invalidReference, - poLineDateUpdated: formatDate(lineRecord.metadata?.updatedDate, intl), + poLineDateUpdated: formatDateTime(lineRecord.metadata?.updatedDate, intl), }; }; diff --git a/test/jest/fixtures/exportReport.js b/test/jest/fixtures/exportReport.js index 28d6cf9d5..c028619db 100644 --- a/test/jest/fixtures/exportReport.js +++ b/test/jest/fixtures/exportReport.js @@ -20,9 +20,6 @@ export const exportReport = [ 'contributor': '"contributor""Personal name"', 'createInventory': 'Instance, Holding, Item', 'createInventoryE': 'Instance, Holding', - 'createdByUserId': 'ui-orders.export.invalidReference', - 'createdDate': '2021-08-15', - 'createdDateLine': '2021-08-15', 'currency': 'USD', 'description': '', 'discount': '"20""amount"',