Skip to content

Commit

Permalink
feat: Updated review to consider default delimiter if not available
Browse files Browse the repository at this point in the history
  • Loading branch information
chavda-bhavik committed Jul 16, 2024
1 parent 770ed75 commit f55e355
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,6 @@ export class BaseReview {

if (numberColumnHeadings.has(heading) && val !== '' && !isNaN(val)) val = Number(val);
if (typeof val === 'string') val = val.trim();

if (multiSelectColumnHeadings[heading])
acc.checkRecord[heading] = !val ? [] : val.split(multiSelectColumnHeadings[heading]);
else acc.checkRecord[heading] = val;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class DoReview extends BaseReview {
const numberColumnHeadings = new Set<string>();
(columns as ITemplateSchemaItem[]).forEach((column) => {
if (column.type === ColumnTypesEnum.SELECT && column.allowMultiSelect)
multiSelectColumnHeadings[column.key] = column.delimiter;
multiSelectColumnHeadings[column.key] = column.delimiter || ',';
if (column.type === ColumnTypesEnum.NUMBER || column.type === ColumnTypesEnum.DOUBLE)
numberColumnHeadings.add(column.key);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export class DoReReview extends BaseReview {
const multiSelectColumnHeadings: Record<string, string> = {};
(columns as ITemplateSchemaItem[]).forEach((column) => {
if (column.type === ColumnTypesEnum.SELECT && column.allowMultiSelect)
multiSelectColumnHeadings[column.key] = column.delimiter;
multiSelectColumnHeadings[column.key] = column.delimiter || ',';
});

uniqueFieldData.forEach((item) => {
Expand Down
2 changes: 1 addition & 1 deletion apps/widget/src/hooks/Phase3/usePhase3.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export function usePhase3({ onNext }: IUsePhase3Props) {
case ColumnTypesEnum.SELECT:
columnItem.type = 'text';
columnItem.renderer = 'custom';
columnItem.delimiter = column.delimiter;
columnItem.delimiter = column.delimiter || ',';
columnItem.selectOptions = column.selectValues;
columnItem.editor = column.allowMultiSelect ? MultiSelectEditor : SelectEditor;
break;
Expand Down

0 comments on commit f55e355

Please sign in to comment.