Skip to content

Commit

Permalink
fix: Remove LastCloneBy and LastCloneDate fields
Browse files Browse the repository at this point in the history
  • Loading branch information
jfeng-salesforce committed Nov 11, 2023
1 parent 56e2b8b commit f63f265
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/shared/snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ export interface OrgSnapshotRequest {
export type OrgSnapshot = OrgSnapshotRequest & {
Id: string;
Status: string;
LastClonedDate?: string;
LastClonedById?: string;
CreatedDate: string;
LastModifiedDate: string;
ExpirationDate?: string;
Expand All @@ -39,8 +37,6 @@ export const ORG_SNAPSHOT_FIELDS = [
'CreatedDate',
'LastModifiedDate',
'ExpirationDate',
'LastClonedDate',
'LastClonedById',
'Error',
];
const dateTimeFormatter = (dateString?: string): string =>
Expand Down Expand Up @@ -73,11 +69,6 @@ const ORG_SNAPSHOT_COLUMNS = {
header: 'Expiration Date',
get: (row: OrgSnapshot): string => (row.ExpirationDate ? new Date(row.ExpirationDate).toLocaleDateString() : ''),
},
LastClonedDate: {
header: 'Last Cloned Date',
get: (row: OrgSnapshot): string => rowDateTimeFormatter(row, 'LastClonedDate'),
},
LastClonedById: { header: 'Last Cloned By Id', get: (row: OrgSnapshot): string => row.LastClonedById ?? '' },
};

const invalidTypeErrorHandler = (e: unknown): never => {
Expand Down Expand Up @@ -122,7 +113,7 @@ export const printSingleRecordTable = (snapshotRecord: OrgSnapshot): void => {
.map(([key, value]: [string, string]) => ({
Name: capitalCase(key),
// format the datetime values
Value: ['LastModifiedDate', 'LastClonedDate', 'CreatedDate'].includes(key) ? dateTimeFormatter(value) : value,
Value: ['LastModifiedDate', 'CreatedDate'].includes(key) ? dateTimeFormatter(value) : value,
}))
// null/undefined becomes empty string
.map((row) => (row.Value ? row : { ...row, Value: '' })),
Expand Down

0 comments on commit f63f265

Please sign in to comment.