disabling buttons if there is a error

main
alex 2023-09-12 18:53:41 +02:00
parent a7c1780070
commit d16e1e8f86
3 changed files with 25 additions and 7 deletions

View File

@ -162,7 +162,13 @@
"role.title": "Rolle",
"groupId.title": "Gruppen ID"
},
"card": { "checkbox": { "info": "INFO", "error": "FEHLER" } },
"card": {
"checkbox": {
"autoScroll": "Auto scroll",
"info": "INFO",
"error": "FEHLER"
}
},
"tooltip": {
"previous": "Vorige",
"next": "Nächste"

View File

@ -162,7 +162,13 @@
"role.title": "Role",
"groupId.title": "Group ID"
},
"card": { "checkbox": { "info": "INFO", "error": "ERROR" } },
"card": {
"checkbox": {
"autoScroll": "Auto scroll",
"info": "INFO",
"error": "ERROR"
}
},
"tooltip": {
"previous": "Previous",
"next": "Next"

View File

@ -1,5 +1,4 @@
import { ReloadOutlined } from "@ant-design/icons";
import { Card, Checkbox, Col, Row, Select, Space, Spin, Tooltip } from "antd";
import { Card, Checkbox, Col, Row, Select, Spin } from "antd";
import { useEffect, useRef, useState } from "react";
import { Constants, myFetch } from "../../utils";
import { useTranslation } from "react-i18next";
@ -122,9 +121,13 @@ export default function LogCard({
useEffect(() => {
// scroll to bottom
if (checkboxAutoScrollChecked && virtuosoRef.current !== undefined) {
if (
checkboxAutoScrollChecked &&
virtuosoRef.current !== undefined &&
virtuosoRef.current.scrollToIndex !== null
) {
virtuosoRef.current.scrollToIndex({
index: logs.length - 5,
index: logs.length - 1,
align: "start",
behavior: "auto",
});
@ -148,11 +151,12 @@ export default function LogCard({
setCheckboxAutoScrollChecked(e.target.checked)
}
>
Auto scroll
{t("logCard.card.checkbox.autoScroll")}
</Checkbox>
</Col>
<Col>
<Checkbox
disabled={customResult !== undefined}
checked={checkboxInfoChecked}
onChange={(e) => setCheckboxInfoChecked(e.target.checked)}
>
@ -161,6 +165,7 @@ export default function LogCard({
</Col>
<Col>
<Checkbox
disabled={customResult !== undefined}
checked={checkboxErrorChecked}
onChange={(e) => setCheckboxErrorChecked(e.target.checked)}
>
@ -170,6 +175,7 @@ export default function LogCard({
<Col>
<Select
disabled={customResult !== undefined}
style={{ width: 120 }}
options={availableDates}
value={selectedDate}