fix: added support for date, matrix, address and cal question to notion integration (#2726)

This commit is contained in:
Dhruwang Jariwala
2024-06-03 20:36:50 +05:30
committed by GitHub
parent cb44b575c2
commit 48638e8ca2
3 changed files with 11 additions and 4 deletions

View File

@@ -263,11 +263,14 @@ export const AddIntegrationModal = ({
</>
);
case ERRORS.MAPPING:
const question = questionTypes.find((qt) => qt.id === ques.type);
if (!question) return null;
return (
<>
- <i>&quot;{ques.name}&quot;</i> of type{" "}
<b>{questionTypes.find((qt) => qt.id === ques.type)?.label}</b> can&apos;t be mapped to the
column <i>&quot;{col.name}&quot;</i> of type <b>{col.type}</b>
- <i>&quot;{ques.name}&quot;</i> of type <b>{question.label}</b> can&apos;t be mapped to the
column <i>&quot;{col.name}&quot;</i> of type <b>{col.type}</b>. Instead use column of type{" "}
{""}
<b>{TYPE_MAPPING[question.id].join(" ,")}.</b>
</>
);
default:

View File

@@ -22,6 +22,10 @@ export const TYPE_MAPPING = {
[TSurveyQuestionType.Rating]: ["number"],
[TSurveyQuestionType.PictureSelection]: ["url"],
[TSurveyQuestionType.FileUpload]: ["url"],
[TSurveyQuestionType.Date]: ["date"],
[TSurveyQuestionType.Address]: ["rich_text"],
[TSurveyQuestionType.Matrix]: ["rich_text"],
[TSurveyQuestionType.Cal]: ["checkbox"],
};
export const UNSUPPORTED_TYPES_BY_NOTION = [

View File

@@ -165,7 +165,7 @@ const buildNotionPayloadProperties = (
const value = responses[map.question.id];
properties[map.column.name] = {
[map.column.type]: getValue(map.column.type, value),
[map.column.type]: getValue(map.column.type, processResponseData(value)),
};
});