Skip to content

Commit bffbe51

Browse files
author
naman-contentstack
committed
resolve comments
1 parent be3e28a commit bffbe51

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

packages/contentstack-branches/src/config/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,4 @@ const config = {
22
skip: 0,
33
limit: 100
44
};
5-
6-
export const FIELD_TYPES = ['modified', 'added', 'deleted'] as const;
7-
85
export default config;

packages/contentstack-branches/src/interfaces/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ export interface AddCSVRowParams {
9898
targetValue: string;
9999
}
100100

101+
export const FIELD_TYPES = ['modified', 'added', 'deleted'] as const;
102+
103+
export const CSV_HEADER = 'Sr No,Content Type Name,Field Name,Field Path,Operation,Source Branch Value,Target Branch Value\n';
104+
101105
export interface ContentTypeItem {
102106
title?: string;
103107
uid?: string;

packages/contentstack-branches/src/utils/csv-utility.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { writeFileSync, existsSync, mkdirSync } from 'fs';
22
import { join } from 'path';
33
import { cliux, log, sanitizePath } from '@contentstack/cli-utilities';
4-
import { BranchDiffVerboseRes, CSVRow, ModifiedFieldsInput, ContentTypeItem, AddCSVRowParams } from '../interfaces';
5-
import { FIELD_TYPES } from '../config';
4+
import { BranchDiffVerboseRes, CSVRow, ModifiedFieldsInput, ContentTypeItem, AddCSVRowParams, FIELD_TYPES, CSV_HEADER } from '../interfaces';
65

76
/**
87
* Get display name for a field with special handling for system fields
@@ -333,7 +332,7 @@ export function exportCSVReport(
333332

334333
const csvRows = diffData.csvData || [];
335334

336-
const csvHeader = 'Sr No,Content Type Name,Field Name,Field Path,Operation,Source Branch Value,Target Branch Value\n';
335+
const csvHeader = CSV_HEADER;
337336
const csvContent = csvRows.map(row =>
338337
`${row.srNo},"${row.contentTypeName}","${row.fieldName}","${row.fieldPath}","${row.operation}","${row.sourceBranchValue}","${row.targetBranchValue}"`
339338
).join('\n');

0 commit comments

Comments
 (0)