From 66bdb6afe10d7bd672ca9a75500f94305c7330ac Mon Sep 17 00:00:00 2001 From: RohitR311 Date: Sat, 28 Dec 2024 19:11:13 +0530 Subject: [PATCH 1/7] feat: display message if list fields is empty --- src/components/organisms/RightSidePanel.tsx | 112 ++++++++++---------- 1 file changed, 58 insertions(+), 54 deletions(-) diff --git a/src/components/organisms/RightSidePanel.tsx b/src/components/organisms/RightSidePanel.tsx index 12f75028..b09964e6 100644 --- a/src/components/organisms/RightSidePanel.tsx +++ b/src/components/organisms/RightSidePanel.tsx @@ -545,60 +545,64 @@ export const RightSidePanel: React.FC = ({ onFinishCapture )} {step.type === 'list' && ( - <> - {t('right_panel.messages.list_selected')} - {Object.entries(step.fields).map(([key, field]) => ( - - handleTextLabelChange(field.id, e.target.value, step.id, key)} - fullWidth - margin="normal" - InputProps={{ - readOnly: confirmedListTextFields[field.id]?.[key], - startAdornment: ( - - - - ) - }} - /> - - - - ) - }} - /> - {!confirmedListTextFields[step.id]?.[key] && ( - - - - - )} - - ))} - + Object.entries(step.fields).length === 0 ? ( + {t('right_panel.messages.list_empty')} + ) : ( + <> + {t('right_panel.messages.list_selected')} + {Object.entries(step.fields).map(([key, field]) => ( + + handleTextLabelChange(field.id, e.target.value, step.id, key)} + fullWidth + margin="normal" + InputProps={{ + readOnly: confirmedListTextFields[field.id]?.[key], + startAdornment: ( + + + + ) + }} + /> + + + + ) + }} + /> + {!confirmedListTextFields[step.id]?.[key] && ( + + + + + )} + + ))} + + ) )} ))} From 6665a4ed641d2c992fb404356a2983cbc84edf22 Mon Sep 17 00:00:00 2001 From: RohitR311 Date: Sat, 28 Dec 2024 19:11:55 +0530 Subject: [PATCH 2/7] feat: add translation for list empty message --- public/locales/de.json | 3 ++- public/locales/en.json | 3 ++- public/locales/es.json | 3 ++- public/locales/ja.json | 3 ++- public/locales/zh.json | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/public/locales/de.json b/public/locales/de.json index 411d8f22..072d9606 100644 --- a/public/locales/de.json +++ b/public/locales/de.json @@ -190,7 +190,8 @@ "field_data": "Felddaten" }, "messages": { - "list_selected": "Liste erfolgreich ausgewählt" + "list_selected": "Liste erfolgreich ausgewählt", + "list_empty": "Liste ist leer. Es wurden keine Felder ausgewählt." }, "errors": { "select_pagination": "Bitte wählen Sie einen Paginierungstyp aus.", diff --git a/public/locales/en.json b/public/locales/en.json index c5a2ff4c..4eceee3d 100644 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -191,7 +191,8 @@ "field_data": "Field Data" }, "messages": { - "list_selected": "List Selected Successfully" + "list_selected": "List Selected Successfully", + "list_empty": "List is empty. No fields have been selected." }, "errors": { "select_pagination": "Please select a pagination type.", diff --git a/public/locales/es.json b/public/locales/es.json index 6e52cc6f..5f79c7cf 100644 --- a/public/locales/es.json +++ b/public/locales/es.json @@ -191,7 +191,8 @@ "field_data": "Datos del Campo" }, "messages": { - "list_selected": "Lista seleccionada exitosamente" + "list_selected": "Lista seleccionada exitosamente", + "list_empty": "La lista está vacía. No se han seleccionado campos." }, "errors": { "select_pagination": "Por favor seleccione un tipo de paginación.", diff --git a/public/locales/ja.json b/public/locales/ja.json index 9d2d9a89..f664e03e 100644 --- a/public/locales/ja.json +++ b/public/locales/ja.json @@ -191,7 +191,8 @@ "field_data": "フィールドデータ" }, "messages": { - "list_selected": "リストが正常に選択されました" + "list_selected": "リストが正常に選択されました", + "list_empty": "リストが空です。フィールドが選択されていません。" }, "errors": { "select_pagination": "ページネーションタイプを選択してください。", diff --git a/public/locales/zh.json b/public/locales/zh.json index 69561d5c..ead470d2 100644 --- a/public/locales/zh.json +++ b/public/locales/zh.json @@ -191,7 +191,8 @@ "field_data": "字段数据" }, "messages": { - "list_selected": "列表选择成功" + "list_selected": "列表选择成功", + "list_empty": "列表为空。尚未选择任何字段。" }, "errors": { "select_pagination": "请选择分页类型。", From 678d84b803d65487e1bc9b8f43d466e3bea0abd4 Mon Sep 17 00:00:00 2001 From: amhsirak Date: Mon, 13 Jan 2025 13:26:06 +0530 Subject: [PATCH 3/7] feat: prompt user --- public/locales/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/locales/en.json b/public/locales/en.json index 3d4c2b54..b3f44225 100644 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -194,7 +194,7 @@ }, "messages": { "list_selected": "List Selected Successfully", - "list_empty": "List is empty. No fields have been selected." + "list_empty": "List selected. Please select fields inside the list." }, "errors": { "select_pagination": "Please select a pagination type.", From 174149472ff9b67110720fde794ba443b1abd5b7 Mon Sep 17 00:00:00 2001 From: amhsirak Date: Mon, 13 Jan 2025 13:27:52 +0530 Subject: [PATCH 4/7] feat(german): prompt user --- public/locales/de.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/locales/de.json b/public/locales/de.json index 2453d482..afbbc81b 100644 --- a/public/locales/de.json +++ b/public/locales/de.json @@ -193,7 +193,7 @@ }, "messages": { "list_selected": "Liste erfolgreich ausgewählt", - "list_empty": "Liste ist leer. Es wurden keine Felder ausgewählt." + "list_empty": "Liste ausgewählt. Bitte wählen Sie Felder innerhalb der Liste aus." }, "errors": { "select_pagination": "Bitte wählen Sie einen Paginierungstyp aus.", From 2c91cdc9e30c5cb7f0a26c3bee624754d86006ab Mon Sep 17 00:00:00 2001 From: amhsirak Date: Mon, 13 Jan 2025 13:28:32 +0530 Subject: [PATCH 5/7] feat(spanish): prompt user --- public/locales/es.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/locales/es.json b/public/locales/es.json index a971a8a8..08d1ef98 100644 --- a/public/locales/es.json +++ b/public/locales/es.json @@ -194,7 +194,7 @@ }, "messages": { "list_selected": "Lista seleccionada exitosamente", - "list_empty": "La lista está vacía. No se han seleccionado campos." + "list_empty": "Lista seleccionada. Seleccione los campos dentro de la lista." }, "errors": { "select_pagination": "Por favor seleccione un tipo de paginación.", From ff4ce152cd4a9d4df87764f95abeb7d0dba64192 Mon Sep 17 00:00:00 2001 From: amhsirak Date: Mon, 13 Jan 2025 13:29:07 +0530 Subject: [PATCH 6/7] feat(japanese): prompt user on empty list --- public/locales/ja.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/locales/ja.json b/public/locales/ja.json index 1d79de2b..521a7f70 100644 --- a/public/locales/ja.json +++ b/public/locales/ja.json @@ -194,7 +194,7 @@ }, "messages": { "list_selected": "リストが正常に選択されました", - "list_empty": "リストが空です。フィールドが選択されていません。" + "list_empty": "リストが選択されました。リスト内のフィールドを選択してください。" }, "errors": { "select_pagination": "ページネーションタイプを選択してください。", From a9380a89782e647e8ef82bd2608f33b3224bc1ea Mon Sep 17 00:00:00 2001 From: amhsirak Date: Mon, 13 Jan 2025 13:29:35 +0530 Subject: [PATCH 7/7] feat(chinese): prompt user on empty list --- public/locales/zh.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/locales/zh.json b/public/locales/zh.json index 72596475..076f449a 100644 --- a/public/locales/zh.json +++ b/public/locales/zh.json @@ -194,7 +194,7 @@ }, "messages": { "list_selected": "列表选择成功", - "list_empty": "列表为空。尚未选择任何字段。" + "list_empty": "已选择列表。请选择列表内的字段。" }, "errors": { "select_pagination": "请选择分页类型。",