Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Updated review to consider default delimiter if not available #688

Merged
merged 1 commit into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading