Skip to content

Commit

Permalink
Merge pull request #111 from abhishekas7/remove-finish-button-on-capa…
Browse files Browse the repository at this point in the history
…bilities-screen

Remove finish button on capabilities screen
  • Loading branch information
ashmilhussain authored Oct 16, 2024
2 parents 9c5e027 + a049e72 commit bcf2f33
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions ui/src/pages/ChatConfiguration/ChatConfiguration.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ const BotConfiguration = () => {
setSelectedOptions(tempSelectedCapabilities)


if(configs[0].capabalities?.length>0){
setCapabalities(configs[0].capabalities)
if(configs[0].capabilities?.length>0){
setCapabalities(configs[0].capabilities)
}

if(configs[0].inference[0]?.id){
Expand Down Expand Up @@ -172,6 +172,7 @@ const BotConfiguration = () => {
saveBotInferene(currentConfigID, currentInferenceID, data).then(() => {
toast.success("Inference saved successfully")
setShowNotificationPanel(false);
setActiveTab("capabalities")
})
.catch(() => {
setShowNotificationPanel(true);
Expand Down Expand Up @@ -326,23 +327,23 @@ const BotConfiguration = () => {
<form onSubmit={configHandleSubmit(onBotConfigSave)}>
<div>
<Input
label="Bot Configuration Name"
maxLength={50}
value={configWatch("botName")}
hasError={configFormError["botName"]?.message ? true : false}
errorMessage={configFormError["botName"]?.message}
{...configRegister("botName", {
required: "This field is required",
maxLength: {
value: 50,
message: "The maximum length is 50 characters"
},
minLength: {
value: 10,
message: "The minimum length is 20 characters"
}
})}
/>
label="Bot Configuration Name"
maxLength={50}
value={configWatch("botName")}
hasError={configFormError["botName"]?.message ? true : false}
errorMessage={configFormError["botName"]?.message}
{...configRegister("botName", {
required: "This field is required",
maxLength: {
value: 50,
message: "The maximum length is 50 characters"
},
minLength: {
value: 10,
message: "The minimum length is 20 characters"
}
})}
/>
<Input label="Bot Short Description" placeholder="brief detail about the use case of the bot" minLength={20} maxLength={200} value={configWatch("botShortDescription")} hasError={configFormError["botShortDescription"]?.message ? true : false} errorMessage={configFormError["botShortDescription"]?.message} {...configRegister("botShortDescription", { required: "This field is required", minLength: {value: 20, message : "minimun length is 20"}, maxLength: {value: 200, message: "maximum length is 200"}})} />
<Textarea label="Bot Long Description" placeholder="detailed information about the bot, including its full use case and functionalities" rows={10} minLength={50} maxLength={400} value={configWatch("botLongDescription")} hasError={configFormError["botLongDescription"]?.message ? true : false} errorMessage={configFormError["botLongDescription"]?.message} {...configRegister("botLongDescription", { required: "This field is required", minLength:{value: 50, message: "minimun length is 50"}, maxLength: {value: 400, message: "maximum length is 400"}})} />

Expand Down Expand Up @@ -378,7 +379,7 @@ const BotConfiguration = () => {
{ showNotificationPanel && <NotificationPanel message={notificationMessage} containerStyle={{marginBottom: "30px"}} /> }
<div className={`${style.SaveConfigContainer} ${style.InferenceSaveContainer}`}>
<div style={{flexGrow: 1}}>
<Button type="transparent" className="icon-button" onClick={()=>setActiveTab("configuration")} > <FaArrowLeft/> Back</Button>
<Button type="transparent" className="icon-button" onClick={()=>{setActiveTab("configuration")}} > <FaArrowLeft/> Back</Button>
</div>
<div>
{ disabledInferenceSave && <Button onClick={onTestInference} style={{marginRight: "10px"}}> Test <LiaToolsSolid/> </Button> }
Expand All @@ -396,6 +397,7 @@ const BotConfiguration = () => {
<Button variant="secondary" className="icon-button" onClick={addNewCapability}>New Capability <GoPlus/> </Button>
</div>
<div>

{capabalities?.map((item, index)=>{
return <Capability
key={index}
Expand All @@ -417,11 +419,9 @@ const BotConfiguration = () => {
</div>
<div className={style.ActionDiv}>
<div style={{flexGrow: 1}}>
<Button type="transparent" className="icon-button" onClick={()=>setCurrentActiveTab("documentation")}> <FaArrowLeft/> Back</Button>
</div>
<div>
<Button buttonType="submit" className="icon-button" onClick={()=>navigate("/plugins")}> Finish <FiCheckCircle/></Button>
<Button type="transparent" className="icon-button" onClick={()=>setActiveTab("inferenceendpoint")}> <FaArrowLeft/> Back</Button>
</div>

</div>
</Tab>
</Tabs>
Expand Down

0 comments on commit bcf2f33

Please sign in to comment.