(null);
const [rowCount, setRowCount] = useState(0);
@@ -99,6 +119,17 @@ export function CsvImportSection({ connectorId, environmentId, onImportComplete
}
};
+ const handleImportRef = useRef(handleImport);
+ handleImportRef.current = handleImport;
+
+ if (handleRef) {
+ handleRef.current = { import: () => handleImportRef.current() };
+ }
+
+ useEffect(() => {
+ onStateChange?.({ rowCount, isImporting, hasData: parsedData.length > 0 });
+ }, [rowCount, isImporting, parsedData.length, onStateChange]);
+
const handleClear = () => {
setCsvFile(null);
setParsedData([]);
@@ -108,9 +139,9 @@ export function CsvImportSection({ connectorId, environmentId, onImportComplete
return (
-
-
{t("environments.unify.csv_import_duplicate_warning")}
-
+
+ {t("environments.unify.csv_import_duplicate_warning")}
+
{csvError && (
@@ -130,16 +161,18 @@ export function CsvImportSection({ connectorId, environmentId, onImportComplete
-
+ {renderFooter && (
+
+ )}
) : (
diff --git a/apps/web/app/(app)/environments/[environmentId]/workspace/unify/sources/components/edit-connector-modal.tsx b/apps/web/app/(app)/environments/[environmentId]/workspace/unify/sources/components/edit-connector-modal.tsx
index 08931aec0b..d76fca067f 100644
--- a/apps/web/app/(app)/environments/[environmentId]/workspace/unify/sources/components/edit-connector-modal.tsx
+++ b/apps/web/app/(app)/environments/[environmentId]/workspace/unify/sources/components/edit-connector-modal.tsx
@@ -38,6 +38,7 @@ interface EditConnectorModalProps {
fieldMappings?: TFieldMapping[];
}) => Promise;
surveys: TUnifySurvey[];
+ onOpenCsvImport?: () => void;
}
const getConnectorIcon = (type: TConnectorType) => {
@@ -79,6 +80,7 @@ export const EditConnectorModal = ({
onOpenChange,
onUpdateConnector,
surveys,
+ onOpenCsvImport,
}: EditConnectorModalProps) => {
const { t } = useTranslation();
const [connectorName, setConnectorName] = useState("");
@@ -271,6 +273,16 @@ export const EditConnectorModal = ({
+ {connector.type === "csv" && (
+
+ )}
diff --git a/apps/web/locales/en-US.json b/apps/web/locales/en-US.json
index 62c59cf80f..eeb3e8d840 100644
--- a/apps/web/locales/en-US.json
+++ b/apps/web/locales/en-US.json
@@ -2064,7 +2064,7 @@
"csv_files_only": "CSV files only",
"csv_import": "CSV Import",
"csv_import_complete": "CSV import complete: {successes} succeeded, {failures} failed, {skipped} skipped",
- "csv_import_duplicate_warning": "Importing data that was already imported may create duplicate records.",
+ "csv_import_duplicate_warning": "Importing data twice will create duplicate records.",
"csv_inconsistent_columns": "Row {row} has inconsistent columns. All rows must have the same headers.",
"csv_max_records": "Maximum {max} records allowed.",
"default_connector_name_csv": "CSV Import",
@@ -2072,6 +2072,7 @@
"deselect_all": "Deselect all",
"drop_a_field_here": "Drop a field here",
"drop_field_or": "Drop field or",
+ "edit_csv_mapping": "Edit CSV mapping",
"edit_source_connection": "Edit Source Connection",
"enter_name_for_source": "Enter a name for this source",
"enter_value": "Enter value...",
@@ -2080,7 +2081,8 @@
"feedback_record_fields": "Feedback Record Fields",
"formbricks_surveys": "Formbricks Surveys",
"historical_import_complete": "Import complete: {successes} succeeded, {failures} failed, {skipped} skipped (no data)",
- "import_csv_data": "Import CSV Data",
+ "import_csv_data": "Import feedback",
+ "import_feedback": "Import feedback",
"import_rows": "Import {count} rows",
"importing_data": "Importing data...",
"importing_historical_data": "Importing historical data...",