Skip to content

Commit a53e4f0

Browse files
authored
Merge pull request #761 from RohitR311/norob-ui
feat: placeholder message for empty robots and runs
2 parents 7d27557 + 83f0497 commit a53e4f0

File tree

8 files changed

+284
-153
lines changed

8 files changed

+284
-153
lines changed

public/locales/de.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@
4848
"options": "Optionen",
4949
"heading": "Meine Roboter",
5050
"new": "Roboter erstellen",
51+
"search_criteria": "Versuchen Sie, Ihre Suchkriterien anzupassen",
52+
"placeholder": {
53+
"title": "Alles bereit für den Start",
54+
"body": "Roboter, die Sie erstellen, werden hier angezeigt. Klicken Sie auf „Roboter erstellen“, um loszulegen!",
55+
"search": "Keine Roboter entsprechen Ihrer Suche"
56+
},
5157
"modal": {
5258
"title": "Geben Sie die URL ein",
5359
"login_title": "Ist für diese Website eine Anmeldung erforderlich?",
@@ -90,6 +96,11 @@
9096
"settings": "Einstellungen",
9197
"search": "Ausführungen suchen...",
9298
"sort_tooltip": "Zum Sortieren klicken",
99+
"placeholder": {
100+
"title": "Keine Durchläufe gefunden",
101+
"body": "Hier werden alle Ihre Roboter-Durchläufe angezeigt. Sobald ein Roboter aktiv ist, werden seine Durchläufe hier protokolliert.",
102+
"search": "Keine Durchläufe entsprechen Ihrer Suche"
103+
},
93104
"notifications": {
94105
"no_runs": "Keine Ausführungen gefunden. Bitte versuchen Sie es erneut.",
95106
"delete_success": "Ausführung erfolgreich gelöscht"

public/locales/en.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@
4848
"options": "Options",
4949
"heading":"My Robots",
5050
"new":"Create Robot",
51+
"search_criteria": "Try adjusting your search criteria",
52+
"placeholder": {
53+
"title": "You're All Set to Start",
54+
"body": "Robots you create will appear here. Click \"Create Robot\" to get started!",
55+
"search": "No robots match your search"
56+
},
5157
"modal":{
5258
"title":"Enter the URL",
5359
"login_title": "Does this website require logging in?",
@@ -90,6 +96,11 @@
9096
"settings":"Settings",
9197
"search":"Search Runs...",
9298
"sort_tooltip": "Click to sort",
99+
"placeholder": {
100+
"title": "No Runs Found",
101+
"body": "This is where all your robot runs will appear. Once a robot is active, its runs will be logged here.",
102+
"search":"No runs match your search"
103+
},
93104
"notifications": {
94105
"no_runs": "No runs found. Please try again.",
95106
"delete_success": "Run deleted successfully"

public/locales/es.json

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@
4848
"options": "Opciones",
4949
"heading": "Mis Robots",
5050
"new": "Crear Robot",
51+
"search_criteria": "Intente ajustar sus criterios de búsqueda",
52+
"placeholder": {
53+
"title": "Todo listo para empezar",
54+
"body": "Los robots que cree aparecerán aquí. ¡Haga clic en \"Crear robot\" para comenzar!",
55+
"search": "Ningún robot coincide con su búsqueda"
56+
},
5157
"modal": {
5258
"title": "Ingresa la URL",
5359
"login_title": "¿Este sitio web requiere iniciar sesión?",
@@ -90,6 +96,11 @@
9096
"settings": "Ajustes",
9197
"search": "Buscar ejecuciones...",
9298
"sort_tooltip": "Haga clic para ordenar",
99+
"placeholder": {
100+
"title": "No se encontraron ejecuciones",
101+
"body": "Aquí aparecerán todas las ejecuciones de sus robots. Una vez que un robot esté activo, sus ejecuciones se registrarán aquí.",
102+
"search": "Ninguna ejecución coincide con su búsqueda"
103+
},
93104
"notifications": {
94105
"no_runs": "No se encontraron ejecuciones. Por favor, inténtelo de nuevo.",
95106
"delete_success": "Ejecución eliminada con éxito"
@@ -276,24 +287,6 @@
276287
"reset_successful": "Se reiniciaron correctamente todas las capturas y se volvió al estado inicial"
277288
}
278289
},
279-
"interpretation_log": {
280-
"titles": {
281-
"output_preview": "Vista Previa de Datos de Salida",
282-
"screenshot": "Captura de pantalla"
283-
},
284-
"messages": {
285-
"additional_rows": "Se extraerán filas adicionales de datos una vez que termine la grabación.",
286-
"successful_training": "¡Has entrenado exitosamente al robot para realizar acciones! Haz clic en el botón de abajo para obtener una vista previa de los datos que tu robot extraerá.",
287-
"no_selection": "Parece que aún no has seleccionado nada para extraer. Una vez que lo hagas, el robot mostrará una vista previa de tus selecciones aquí."
288-
},
289-
"data_sections": {
290-
"binary_received": "---------- Datos binarios de salida recibidos ----------",
291-
"serializable_received": "---------- Datos serializables de salida recibidos ----------",
292-
"mimetype": "tipo MIME: ",
293-
"image_below": "La imagen se muestra a continuación:",
294-
"separator": "--------------------------------------------------"
295-
}
296-
},
297290
"interpretation_buttons": {
298291
"buttons": {
299292
"preview": "Obtener Vista Previa de Datos de Salida",

public/locales/ja.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@
4848
"options": "オプション",
4949
"heading": "私のロボット",
5050
"new": "ロボットを作成",
51+
"search_criteria": "検索条件を調整してみてください",
52+
"placeholder": {
53+
"title": "始める準備ができました",
54+
"body": "作成したロボットはここに表示されます。「ロボットを作成」をクリックして始めましょう!",
55+
"search": "検索に一致するロボットはありません"
56+
},
5157
"modal": {
5258
"title": "URLを入力してください",
5359
"login_title": "このサイトはログインが必要ですか?",
@@ -90,6 +96,11 @@
9096
"settings": "設定",
9197
"search": "実行を検索...",
9298
"sort_tooltip": "クリックして並べ替え",
99+
"placeholder": {
100+
"title": "実行が見つかりません",
101+
"body": "すべてのロボットの実行はここに表示されます。ロボットがアクティブになると、その実行はここに記録されます。",
102+
"search": "検索に一致する実行はありません"
103+
},
93104
"notifications": {
94105
"no_runs": "実行が見つかりません。もう一度お試しください。",
95106
"delete_success": "実行が正常に削除されました"

public/locales/tr.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@
4848
"options": "Seçenekler",
4949
"heading": "Robotlarım",
5050
"new": "Robot Oluştur",
51+
"search_criteria": "Arama kriterlerinizi değiştirmeyi deneyin",
52+
"placeholder": {
53+
"title": "Başlamaya Hazırsınız",
54+
"body": "Oluşturduğunuz robotlar burada görünecektir. Başlamak için \"Robot Oluştur\"a tıklayın!",
55+
"search": "Aramanızla eşleşen robot yok"
56+
},
5157
"modal": {
5258
"title": "URL’yi Girin",
5359
"login_title": "Bu web sitesine giriş gerekiyor mu?",
@@ -90,6 +96,11 @@
9096
"settings": "Ayarlar",
9197
"search": "Çalıştırma Ara...",
9298
"sort_tooltip": "Sıralamak için tıkla",
99+
"placeholder": {
100+
"title": "Çalıştırma Bulunamadı",
101+
"body": "Tüm robot çalıştırmalarınız burada görünecektir. Bir robot aktif olduğunda, çalıştırmaları buraya kaydedilecektir.",
102+
"search": "Aramanızla eşleşen çalıştırma yok"
103+
},
93104
"notifications": {
94105
"no_runs": "Çalıştırma bulunamadı. Lütfen tekrar deneyin.",
95106
"delete_success": "Çalıştırma başarıyla silindi"

public/locales/zh.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@
4848
"options": "选项",
4949
"heading": "我的机器人",
5050
"new": "创建机器人",
51+
"search_criteria": "请尝试调整您的搜索条件",
52+
"placeholder": {
53+
"title": "一切就绪,可以开始了",
54+
"body": "您创建的机器人将显示在这里。点击“创建机器人”即可开始!",
55+
"search": "没有与您搜索匹配的机器人"
56+
},
5157
"modal": {
5258
"title": "输入URL",
5359
"login_title": "此网站需要登录吗?",
@@ -90,6 +96,11 @@
9096
"settings": "设置",
9197
"search": "搜索运行记录...",
9298
"sort_tooltip": "点击排序",
99+
"placeholder": {
100+
"title": "未找到运行记录",
101+
"body": "您所有的机器人运行记录都将显示在此处。一旦机器人被激活,其运行记录将在这里记下。",
102+
"search": "没有与您搜索匹配的运行记录"
103+
},
93104
"notifications": {
94105
"no_runs": "未找到运行记录。请重试。",
95106
"delete_success": "运行记录删除成功"

src/components/robot/RecordingsTable.tsx

Lines changed: 80 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
ListItemText,
2424
FormControlLabel,
2525
Checkbox,
26+
CircularProgress,
2627
} from "@mui/material";
2728
import {
2829
Schedule,
@@ -154,6 +155,7 @@ export const RecordingsTable = ({
154155
const [searchTerm, setSearchTerm] = React.useState('');
155156
const [isWarningModalOpen, setWarningModalOpen] = React.useState(false);
156157
const [activeBrowserId, setActiveBrowserId] = React.useState('');
158+
const [isLoading, setIsLoading] = React.useState(true);
157159

158160
const columns = useMemo(() => [
159161
{ id: 'interpret', label: t('recordingtable.run'), minWidth: 80 },
@@ -270,6 +272,8 @@ export const RecordingsTable = ({
270272
} catch (error) {
271273
console.error('Error fetching recordings:', error);
272274
notify('error', t('recordingtable.notifications.fetch_error'));
275+
} finally {
276+
setIsLoading(false);
273277
}
274278
}, [setRecordings, notify, t]);
275279

@@ -405,9 +409,7 @@ export const RecordingsTable = ({
405409
}
406410

407411
useEffect(() => {
408-
if (rows.length === 0) {
409-
fetchRecordings();
410-
}
412+
fetchRecordings();
411413
}, [fetchRecordings]);
412414

413415
useEffect(() => {
@@ -513,42 +515,81 @@ export const RecordingsTable = ({
513515
</IconButton>
514516
</Box>
515517
</Box>
516-
<TableContainer component={Paper} sx={{ width: '100%', overflow: 'hidden', marginTop: '15px' }}>
517-
<Table stickyHeader aria-label="sticky table">
518-
<TableHead>
519-
<TableRow>
520-
{columns.map((column) => (
521-
<MemoizedTableCell
522-
key={column.id}
523-
style={{ minWidth: column.minWidth }}
524-
>
525-
{column.label}
526-
</MemoizedTableCell>
527-
))}
528-
</TableRow>
529-
</TableHead>
530-
<TableBody>
531-
{visibleRows.map((row) => (
532-
<TableRowMemoized
533-
key={row.id}
534-
row={row}
535-
columns={columns}
536-
handlers={handlers}
537-
/>
538-
))}
539-
</TableBody>
540-
</Table>
541-
</TableContainer>
542-
543-
<TablePagination
544-
rowsPerPageOptions={[10, 25, 50, 100]}
545-
component="div"
546-
count={filteredRows.length}
547-
rowsPerPage={rowsPerPage}
548-
page={page}
549-
onPageChange={handleChangePage}
550-
onRowsPerPageChange={handleChangeRowsPerPage}
551-
/>
518+
519+
{isLoading ? (
520+
<Box
521+
display="flex"
522+
justifyContent="center"
523+
alignItems="center"
524+
sx={{
525+
minHeight: '60vh',
526+
width: '100%'
527+
}}
528+
>
529+
<CircularProgress size={60} />
530+
</Box>
531+
) : filteredRows.length === 0 ? (
532+
<Box
533+
display="flex"
534+
flexDirection="column"
535+
alignItems="center"
536+
justifyContent="center"
537+
sx={{
538+
minHeight: 300,
539+
textAlign: 'center',
540+
color: 'text.secondary'
541+
}}
542+
>
543+
<Typography variant="h6" gutterBottom>
544+
{debouncedSearchTerm ? t('recordingtable.placeholder.search') : t('recordingtable.placeholder.title')}
545+
</Typography>
546+
<Typography variant="body2" color="text.secondary">
547+
{debouncedSearchTerm
548+
? t('recordingtable.search_criteria')
549+
: t('recordingtable.placeholder.body')
550+
}
551+
</Typography>
552+
</Box>
553+
) : (
554+
<>
555+
<TableContainer component={Paper} sx={{ width: '100%', overflow: 'hidden', marginTop: '15px' }}>
556+
<Table stickyHeader aria-label="sticky table">
557+
<TableHead>
558+
<TableRow>
559+
{columns.map((column) => (
560+
<MemoizedTableCell
561+
key={column.id}
562+
style={{ minWidth: column.minWidth }}
563+
>
564+
{column.label}
565+
</MemoizedTableCell>
566+
))}
567+
</TableRow>
568+
</TableHead>
569+
<TableBody>
570+
{visibleRows.map((row) => (
571+
<TableRowMemoized
572+
key={row.id}
573+
row={row}
574+
columns={columns}
575+
handlers={handlers}
576+
/>
577+
))}
578+
</TableBody>
579+
</Table>
580+
</TableContainer>
581+
582+
<TablePagination
583+
rowsPerPageOptions={[10, 25, 50, 100]}
584+
component="div"
585+
count={filteredRows.length}
586+
rowsPerPage={rowsPerPage}
587+
page={page}
588+
onPageChange={handleChangePage}
589+
onRowsPerPageChange={handleChangeRowsPerPage}
590+
/>
591+
</>
592+
)}
552593
<GenericModal isOpen={isWarningModalOpen} onClose={() => setWarningModalOpen(false)} modalStyle={modalStyle}>
553594
<div style={{ padding: '10px' }}>
554595
<Typography variant="h6" gutterBottom>{t('recordingtable.warning_modal.title')}</Typography>

0 commit comments

Comments
 (0)