Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

feat(import): explain the Default row and make value mappings clearable

Gaurav Bhattea2bf69c9f25
diff --git a/apps/erp/app/components/ImportCSVModal/FieldMappings.tsx b/apps/erp/app/components/ImportCSVModal/FieldMappings.tsx
index 8e63fc5e75..7cecbd7e4f 100644
--- a/apps/erp/app/components/ImportCSVModal/FieldMappings.tsx
+++ b/apps/erp/app/components/ImportCSVModal/FieldMappings.tsx
@@ -593,17 +593,37 @@ function EnumMappingStep({
name: `${name}-${csvValue}`,
value: mappings[csvValue],
options,
+ // Optional so the combobox shows a clear (×) affordance. Clearing
+ // resets the row to empty — this lets a mis-pick be undone, and
+ // clearing the Default row sets the field back to "leave blank".
+ isOptional: true,
onChange: (value: { value: string; label: ReactNode } | null) => {
- if (value?.value) {
- onEnumMappingChange(name, csvValue, value.value);
- }
+ onEnumMappingChange(name, csvValue, value?.value ?? "");
}
};
return (
<Fragment key={csvValue}>
<div className="flex min-w-0 items-center justify-between gap-2">
- <div className="min-w-0 truncate" title={csvValue}>
- {csvValue}
+ <div className="flex min-w-0 items-center gap-1.5">
+ <div className="min-w-0 truncate" title={csvValue}>
+ {csvValue}
+ </div>
+ {csvValue === "Default" && (
+ <TooltipProvider delayDuration={50}>
+ <Tooltip>
+ <TooltipTrigger className="flex-shrink-0">
+ <LuInfo className="text-muted-foreground" />
+ </TooltipTrigger>
+ <TooltipContent className="max-w-64 p-2 text-sm">
+ <Trans>
+ The value Carbon assigns when this field's cell is
+ empty or doesn't match any value above. Clear the
+ selection to leave those rows blank.
+ </Trans>
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
+ )}
</div>
<LuMoveRight className="flex-shrink-0 text-muted-foreground" />
</div>
diff --git a/packages/locale/locales/de/erp.po b/packages/locale/locales/de/erp.po
index c9f3b78aa6..10084cabd0 100644
--- a/packages/locale/locales/de/erp.po
+++ b/packages/locale/locales/de/erp.po
@@ -7988,6 +7988,9 @@ msgstr "Der Speicherdienst hat nicht rechtzeitig geantwortet. Bitte versuchen Si
msgid "The unit price of the item at the time of the purchase"
msgstr "Der Stückpreis des Artikels zum Zeitpunkt des Kaufs"
+msgid "The value Carbon assigns when this field's cell is empty or doesn't match any value above. Clear the selection to leave those rows blank."
+msgstr ""
+
msgid "Theme"
msgstr "Design"
diff --git a/packages/locale/locales/en/erp.po b/packages/locale/locales/en/erp.po
index 783c14aaed..aa46302c21 100644
--- a/packages/locale/locales/en/erp.po
+++ b/packages/locale/locales/en/erp.po
@@ -7988,6 +7988,9 @@ msgstr "The storage service didn't respond in time. Please try again."
msgid "The unit price of the item at the time of the purchase"
msgstr "The unit price of the item at the time of the purchase"
+msgid "The value Carbon assigns when this field's cell is empty or doesn't match any value above. Clear the selection to leave those rows blank."
+msgstr "The value Carbon assigns when this field's cell is empty or doesn't match any value above. Clear the selection to leave those rows blank."
+
msgid "Theme"
msgstr "Theme"
diff --git a/packages/locale/locales/es/erp.po b/packages/locale/locales/es/erp.po
index 59a6266c75..f6a4829742 100644
--- a/packages/locale/locales/es/erp.po
+++ b/packages/locale/locales/es/erp.po
@@ -7988,6 +7988,9 @@ msgstr "El servicio de almacenamiento no respondió a tiempo. Por favor, intént
msgid "The unit price of the item at the time of the purchase"
msgstr "El precio unitario del artículo en el momento de la compra"
+msgid "The value Carbon assigns when this field's cell is empty or doesn't match any value above. Clear the selection to leave those rows blank."
+msgstr ""
+
msgid "Theme"
msgstr "Tema"
diff --git a/packages/locale/locales/fr/erp.po b/packages/locale/locales/fr/erp.po
index 7a2b5b7bb1..019675bc0a 100644
--- a/packages/locale/locales/fr/erp.po
+++ b/packages/locale/locales/fr/erp.po
@@ -7988,6 +7988,9 @@ msgstr "Le service de stockage n'a pas répondu à temps. Veuillez réessayer."
msgid "The unit price of the item at the time of the purchase"
msgstr "Le prix unitaire de l'article au moment de l'achat"
+msgid "The value Carbon assigns when this field's cell is empty or doesn't match any value above. Clear the selection to leave those rows blank."
+msgstr ""
+
msgid "Theme"
msgstr "Thème"
diff --git a/packages/locale/locales/hi/erp.po b/packages/locale/locales/hi/erp.po
index 439723ace1..124cddf981 100644
--- a/packages/locale/locales/hi/erp.po
+++ b/packages/locale/locales/hi/erp.po
@@ -7988,6 +7988,9 @@ msgstr "स्टोरेज सेवा समय पर प्रतिक
msgid "The unit price of the item at the time of the purchase"
msgstr "खरीद के समय आइटम की यूनिट कीमत"
+msgid "The value Carbon assigns when this field's cell is empty or doesn't match any value above. Clear the selection to leave those rows blank."
+msgstr ""
+
msgid "Theme"
msgstr "थीम"
diff --git a/packages/locale/locales/it/erp.po b/packages/locale/locales/it/erp.po
index 7fe14dd0bf..b53a8fb60d 100644
--- a/packages/locale/locales/it/erp.po
+++ b/packages/locale/locales/it/erp.po
@@ -7988,6 +7988,9 @@ msgstr "Il servizio di archiviazione non ha risposto in tempo. Riprova."
msgid "The unit price of the item at the time of the purchase"
msgstr "Il prezzo unitario dell'articolo al momento dell'acquisto"
+msgid "The value Carbon assigns when this field's cell is empty or doesn't match any value above. Clear the selection to leave those rows blank."
+msgstr ""
+
msgid "Theme"
msgstr "Tema"
diff --git a/packages/locale/locales/ja/erp.po b/packages/locale/locales/ja/erp.po
index 653a9f230e..1e3f3ac1e8 100644
--- a/packages/locale/locales/ja/erp.po
+++ b/packages/locale/locales/ja/erp.po
@@ -7988,6 +7988,9 @@ msgstr "ストレージサービスが時間内に応答しませんでした。
msgid "The unit price of the item at the time of the purchase"
msgstr "購入時のアイテムの単価"
+msgid "The value Carbon assigns when this field's cell is empty or doesn't match any value above. Clear the selection to leave those rows blank."
+msgstr ""
+
msgid "Theme"
msgstr "テーマ"
diff --git a/packages/locale/locales/pl/erp.po b/packages/locale/locales/pl/erp.po
index 13e9452f17..858b519c1d 100644
--- a/packages/locale/locales/pl/erp.po
+++ b/packages/locale/locales/pl/erp.po
@@ -7988,6 +7988,9 @@ msgstr "Usługa magazynowania nie odpowiedziała w czasie. Spróbuj ponownie."
msgid "The unit price of the item at the time of the purchase"
msgstr "Cena jednostkowa towaru w momencie zakupu"
+msgid "The value Carbon assigns when this field's cell is empty or doesn't match any value above. Clear the selection to leave those rows blank."
+msgstr ""
+
msgid "Theme"
msgstr "Motyw"
diff --git a/packages/locale/locales/pt/erp.po b/packages/locale/locales/pt/erp.po
index 8c93adc084..313733f711 100644
--- a/packages/locale/locales/pt/erp.po
+++ b/packages/locale/locales/pt/erp.po
@@ -7988,6 +7988,9 @@ msgstr "O serviço de armazenamento não respondeu a tempo. Tente novamente."
msgid "The unit price of the item at the time of the purchase"
msgstr "O preço unitário do item no momento da compra"
+msgid "The value Carbon assigns when this field's cell is empty or doesn't match any value above. Clear the selection to leave those rows blank."
+msgstr ""
+
msgid "Theme"
msgstr "Tema"
diff --git a/packages/locale/locales/ru/erp.po b/packages/locale/locales/ru/erp.po
index 8fd9a9c863..74f50e9963 100644
--- a/packages/locale/locales/ru/erp.po
+++ b/packages/locale/locales/ru/erp.po
@@ -7988,6 +7988,9 @@ msgstr "Сервис хранилища не ответил вовремя. По
msgid "The unit price of the item at the time of the purchase"
msgstr "Цена за единицу товара на момент покупки"
+msgid "The value Carbon assigns when this field's cell is empty or doesn't match any value above. Clear the selection to leave those rows blank."
+msgstr ""
+
msgid "Theme"
msgstr "Тема"
diff --git a/packages/locale/locales/zh/erp.po b/packages/locale/locales/zh/erp.po
index 47d2fa0988..0c60f02a6b 100644
--- a/packages/locale/locales/zh/erp.po
+++ b/packages/locale/locales/zh/erp.po
@@ -7988,6 +7988,9 @@ msgstr "存储服务未及时响应。请重试。"
msgid "The unit price of the item at the time of the purchase"
msgstr "购买时该商品的单价"
+msgid "The value Carbon assigns when this field's cell is empty or doesn't match any value above. Clear the selection to leave those rows blank."
+msgstr ""
+
msgid "Theme"
msgstr "主题"