From 679f16b194e40891e5b58c216db42f043c319eab Mon Sep 17 00:00:00 2001 From: jagadeeswaran-zipstack Date: Tue, 24 Sep 2024 11:25:31 +0530 Subject: [PATCH] fixed FE linter issues --- .../components/custom-tools/editable-text/EditableText.jsx | 4 ++-- .../custom-tools/output-for-doc-modal/OutputForDocModal.jsx | 6 +++--- .../custom-tools/prompt-card/DisplayPromptResult.jsx | 2 +- frontend/src/components/custom-tools/prompt-card/Header.jsx | 2 +- .../components/custom-tools/prompt-card/PromptCardItems.jsx | 6 +++--- .../components/custom-tools/prompt-card/PromptOutput.jsx | 2 +- .../custom-tools/prompt-card/PromptOutputExpandBtn.jsx | 2 +- .../custom-tools/prompt-card/PromptOutputsModal.jsx | 3 ++- .../components/custom-tools/prompt-card/PromptRunCost.jsx | 5 +++-- .../components/custom-tools/prompt-card/PromptRunTimer.jsx | 2 +- .../src/components/custom-tools/token-usage/TokenUsage.jsx | 3 ++- 11 files changed, 20 insertions(+), 17 deletions(-) diff --git a/frontend/src/components/custom-tools/editable-text/EditableText.jsx b/frontend/src/components/custom-tools/editable-text/EditableText.jsx index b2f90bd4c..54267f49d 100644 --- a/frontend/src/components/custom-tools/editable-text/EditableText.jsx +++ b/frontend/src/components/custom-tools/editable-text/EditableText.jsx @@ -129,8 +129,8 @@ EditableText.propTypes = { setIsEditing: PropTypes.func.isRequired, text: PropTypes.string, setText: PropTypes.func.isRequired, - promptId: PropTypes.string.isRequired, - defaultText: PropTypes.string.isRequired, + promptId: PropTypes.string, + defaultText: PropTypes.string, handleChange: PropTypes.func.isRequired, isTextarea: PropTypes.bool, placeHolder: PropTypes.string, diff --git a/frontend/src/components/custom-tools/output-for-doc-modal/OutputForDocModal.jsx b/frontend/src/components/custom-tools/output-for-doc-modal/OutputForDocModal.jsx index f7f45c125..68acfd36a 100644 --- a/frontend/src/components/custom-tools/output-for-doc-modal/OutputForDocModal.jsx +++ b/frontend/src/components/custom-tools/output-for-doc-modal/OutputForDocModal.jsx @@ -386,10 +386,10 @@ function OutputForDocModal({ OutputForDocModal.propTypes = { open: PropTypes.bool.isRequired, setOpen: PropTypes.func.isRequired, - promptId: PropTypes.string.isRequired, - promptKey: PropTypes.string.isRequired, + promptId: PropTypes.string, + promptKey: PropTypes.string, profileManagerId: PropTypes.string, - docOutputs: PropTypes.object, + docOutputs: PropTypes.array, }; export { OutputForDocModal }; diff --git a/frontend/src/components/custom-tools/prompt-card/DisplayPromptResult.jsx b/frontend/src/components/custom-tools/prompt-card/DisplayPromptResult.jsx index c63821719..f26a344b2 100644 --- a/frontend/src/components/custom-tools/prompt-card/DisplayPromptResult.jsx +++ b/frontend/src/components/custom-tools/prompt-card/DisplayPromptResult.jsx @@ -25,7 +25,7 @@ function DisplayPromptResult({ output }) { } DisplayPromptResult.propTypes = { - output: PropTypes.any.isRequired, + output: PropTypes.any, }; export { DisplayPromptResult }; diff --git a/frontend/src/components/custom-tools/prompt-card/Header.jsx b/frontend/src/components/custom-tools/prompt-card/Header.jsx index 0397d9019..ca436389f 100644 --- a/frontend/src/components/custom-tools/prompt-card/Header.jsx +++ b/frontend/src/components/custom-tools/prompt-card/Header.jsx @@ -243,7 +243,7 @@ function Header({ Header.propTypes = { promptDetails: PropTypes.object.isRequired, - promptKey: PropTypes.text, + promptKey: PropTypes.string, setPromptKey: PropTypes.func.isRequired, progressMsg: PropTypes.object.isRequired, handleRun: PropTypes.func.isRequired, diff --git a/frontend/src/components/custom-tools/prompt-card/PromptCardItems.jsx b/frontend/src/components/custom-tools/prompt-card/PromptCardItems.jsx index cc1b88fd2..05eeaf1f6 100644 --- a/frontend/src/components/custom-tools/prompt-card/PromptCardItems.jsx +++ b/frontend/src/components/custom-tools/prompt-card/PromptCardItems.jsx @@ -297,11 +297,11 @@ PromptCardItems.propTypes = { promptDetails: PropTypes.object.isRequired, enforceTypeList: PropTypes.array, isRunLoading: PropTypes.object, - promptKey: PropTypes.text, + promptKey: PropTypes.string, setPromptKey: PropTypes.func.isRequired, - promptText: PropTypes.text, + promptText: PropTypes.string, setPromptText: PropTypes.func.isRequired, - coverage: PropTypes.number.isRequired, + coverage: PropTypes.object.isRequired, progressMsg: PropTypes.object.isRequired, handleRun: PropTypes.func.isRequired, handleChange: PropTypes.func.isRequired, diff --git a/frontend/src/components/custom-tools/prompt-card/PromptOutput.jsx b/frontend/src/components/custom-tools/prompt-card/PromptOutput.jsx index a77a749a2..ec83ebfd4 100644 --- a/frontend/src/components/custom-tools/prompt-card/PromptOutput.jsx +++ b/frontend/src/components/custom-tools/prompt-card/PromptOutput.jsx @@ -416,7 +416,7 @@ PromptOutput.propTypes = { setEnabledProfiles: PropTypes.func.isRequired, isNotSingleLlmProfile: PropTypes.bool.isRequired, setIsIndexOpen: PropTypes.func.isRequired, - enforceType: PropTypes.string.isRequired, + enforceType: PropTypes.string, promptOutputs: PropTypes.object.isRequired, }; diff --git a/frontend/src/components/custom-tools/prompt-card/PromptOutputExpandBtn.jsx b/frontend/src/components/custom-tools/prompt-card/PromptOutputExpandBtn.jsx index 97f80fc93..50a28c397 100644 --- a/frontend/src/components/custom-tools/prompt-card/PromptOutputExpandBtn.jsx +++ b/frontend/src/components/custom-tools/prompt-card/PromptOutputExpandBtn.jsx @@ -42,7 +42,7 @@ function PromptOutputExpandBtn({ PromptOutputExpandBtn.propTypes = { promptId: PropTypes.string.isRequired, llmProfiles: PropTypes.array.isRequired, - enforceType: PropTypes.string.isRequired, + enforceType: PropTypes.string, displayLlmProfile: PropTypes.bool.isRequired, promptOutputs: PropTypes.object.isRequired, }; diff --git a/frontend/src/components/custom-tools/prompt-card/PromptOutputsModal.jsx b/frontend/src/components/custom-tools/prompt-card/PromptOutputsModal.jsx index 4ccab2261..066ef21e5 100644 --- a/frontend/src/components/custom-tools/prompt-card/PromptOutputsModal.jsx +++ b/frontend/src/components/custom-tools/prompt-card/PromptOutputsModal.jsx @@ -1,5 +1,6 @@ import { Col, Image, Modal, Row, Typography } from "antd"; import PropTypes from "prop-types"; + import { DisplayPromptResult } from "./DisplayPromptResult"; import { TABLE_ENFORCE_TYPE } from "./constants"; import SpaceWrapper from "../../widgets/space-wrapper/SpaceWrapper"; @@ -102,7 +103,7 @@ PromptOutputsModal.propTypes = { setOpen: PropTypes.func.isRequired, promptId: PropTypes.string.isRequired, llmProfiles: PropTypes.array.isRequired, - enforceType: PropTypes.string.isRequired, + enforceType: PropTypes.string, displayLlmProfile: PropTypes.bool.isRequired, promptOutputs: PropTypes.object.isRequired, }; diff --git a/frontend/src/components/custom-tools/prompt-card/PromptRunCost.jsx b/frontend/src/components/custom-tools/prompt-card/PromptRunCost.jsx index 01438442f..411f1e93e 100644 --- a/frontend/src/components/custom-tools/prompt-card/PromptRunCost.jsx +++ b/frontend/src/components/custom-tools/prompt-card/PromptRunCost.jsx @@ -1,5 +1,6 @@ import { memo } from "react"; import PropTypes from "prop-types"; + import { formatNumberWithCommas, getFormattedTotalCost, @@ -16,8 +17,8 @@ const PromptRunCost = memo(({ tokenUsage, isLoading }) => { PromptRunCost.displayName = "PromptRunCost"; PromptRunCost.propTypes = { - tokenUsage: PropTypes.number, - isLoading: PropTypes.bool.isRequired, + tokenUsage: PropTypes.object, + isLoading: PropTypes.bool, }; export { PromptRunCost }; diff --git a/frontend/src/components/custom-tools/prompt-card/PromptRunTimer.jsx b/frontend/src/components/custom-tools/prompt-card/PromptRunTimer.jsx index 0e2e2ef63..456b75ac4 100644 --- a/frontend/src/components/custom-tools/prompt-card/PromptRunTimer.jsx +++ b/frontend/src/components/custom-tools/prompt-card/PromptRunTimer.jsx @@ -13,7 +13,7 @@ PromptRunTimer.displayName = "PromptRunTimer"; PromptRunTimer.propTypes = { timer: PropTypes.object, - isLoading: PropTypes.bool.isRequired, + isLoading: PropTypes.bool, }; export { PromptRunTimer }; diff --git a/frontend/src/components/custom-tools/token-usage/TokenUsage.jsx b/frontend/src/components/custom-tools/token-usage/TokenUsage.jsx index 513f1633b..a684c203f 100644 --- a/frontend/src/components/custom-tools/token-usage/TokenUsage.jsx +++ b/frontend/src/components/custom-tools/token-usage/TokenUsage.jsx @@ -1,5 +1,6 @@ import PropTypes from "prop-types"; import { useEffect, useState } from "react"; + import { useTokenUsageStore } from "../../../store/token-usage-store"; import { formatNumberWithCommas } from "../../../helpers/GetStaticData"; @@ -33,7 +34,7 @@ function TokenUsage({ tokenUsageId, isLoading }) { TokenUsage.propTypes = { tokenUsageId: PropTypes.string.isRequired, - isLoading: PropTypes.bool.isRequired, + isLoading: PropTypes.bool, }; export { TokenUsage };