@@ -11,7 +11,10 @@ import { useEffect, useState } from "react";
1111import { Button , Checkbox , Col , Dropdown , Row , Tag , Tooltip } from "antd" ;
1212import PropTypes from "prop-types" ;
1313
14- import { promptStudioUpdateStatus } from "../../../helpers/GetStaticData" ;
14+ import {
15+ PROMPT_RUN_TYPES ,
16+ promptStudioUpdateStatus ,
17+ } from "../../../helpers/GetStaticData" ;
1518import { ConfirmModal } from "../../widgets/confirm-modal/ConfirmModal" ;
1619import { EditableText } from "../editable-text/EditableText" ;
1720import { useCustomToolStore } from "../../../store/custom-tool-store" ;
@@ -40,13 +43,11 @@ function Header({
4043 setIsEditingTitle,
4144 expandCard,
4245 setExpandCard,
43- enabledProfiles,
4446 spsLoading,
4547 handleSpsLoading,
4648} ) {
4749 const {
4850 selectedDoc,
49- disableLlmOrDocChange,
5051 singlePassExtractMode,
5152 isSinglePassExtractLoading,
5253 indexDocs,
@@ -58,9 +59,9 @@ function Header({
5859
5960 const [ isDisablePrompt , setIsDisablePrompt ] = useState ( null ) ;
6061
61- const handleRunBtnClick = ( profileManager = null , coverAllDoc = true ) => {
62+ const handleRunBtnClick = ( promptRunType , docId = null ) => {
6263 setExpandCard ( true ) ;
63- handleRun ( profileManager , coverAllDoc , enabledProfiles , true ) ;
64+ handleRun ( promptRunType , promptDetails ?. prompt_id , null , docId ) ;
6465 } ;
6566
6667 const handleDisablePrompt = ( event ) => {
@@ -97,7 +98,7 @@ function Header({
9798 ) ,
9899 key : "delete" ,
99100 disabled :
100- disableLlmOrDocChange ?. includes ( promptDetails ?. prompt_id ) ||
101+ isCoverageLoading ||
101102 isSinglePassExtractLoading ||
102103 indexDocs ?. includes ( selectedDoc ?. document_id ) ||
103104 isPublicSource ,
@@ -122,6 +123,7 @@ function Header({
122123 defaultText = { promptDetails ?. prompt_key }
123124 handleChange = { handleChange }
124125 placeHolder = { updatePlaceHolder }
126+ isCoverageLoading = { isCoverageLoading }
125127 />
126128 </ Col >
127129 < Col span = { 12 } className = "display-flex-right" >
@@ -186,13 +188,16 @@ function Header({
186188 type = "text"
187189 className = "prompt-card-action-button"
188190 onClick = { ( ) =>
189- handleRunBtnClick ( promptDetails ?. profile_manager , false )
191+ handleRunBtnClick (
192+ PROMPT_RUN_TYPES . RUN_ONE_PROMPT_ALL_LLMS_ONE_DOC ,
193+ selectedDoc ?. document_id
194+ )
190195 }
191196 disabled = {
192197 ( updateStatus ?. promptId === promptDetails ?. prompt_id &&
193198 updateStatus ?. status ===
194199 promptStudioUpdateStatus ?. isUpdating ) ||
195- disableLlmOrDocChange ?. includes ( promptDetails ?. prompt_id ) ||
200+ isCoverageLoading ||
196201 indexDocs ?. includes ( selectedDoc ?. document_id ) ||
197202 isPublicSource ||
198203 spsLoading [ selectedDoc ?. document_id ]
@@ -206,12 +211,16 @@ function Header({
206211 size = "small"
207212 type = "text"
208213 className = "prompt-card-action-button"
209- onClick = { handleRunBtnClick }
214+ onClick = { ( ) =>
215+ handleRunBtnClick (
216+ PROMPT_RUN_TYPES . RUN_ONE_PROMPT_ALL_LLMS_ALL_DOCS
217+ )
218+ }
210219 disabled = {
211220 ( updateStatus ?. promptId === promptDetails ?. prompt_id &&
212221 updateStatus ?. status ===
213222 promptStudioUpdateStatus ?. isUpdating ) ||
214- disableLlmOrDocChange ?. includes ( promptDetails ?. prompt_id ) ||
223+ isCoverageLoading ||
215224 indexDocs ?. includes ( selectedDoc ?. document_id ) ||
216225 isPublicSource
217226 }
@@ -259,7 +268,6 @@ Header.propTypes = {
259268 setIsEditingTitle : PropTypes . func . isRequired ,
260269 expandCard : PropTypes . bool . isRequired ,
261270 setExpandCard : PropTypes . func . isRequired ,
262- enabledProfiles : PropTypes . array . isRequired ,
263271 spsLoading : PropTypes . object ,
264272 handleSpsLoading : PropTypes . func . isRequired ,
265273} ;
0 commit comments