fix: made reranker not disable when hybrid search is enabled (#7622)

* added toggle_disable option

* made toggle be disabled when toggle_disable is true

* added logic to disable toggle when choosing hybrid search

* Updated starter projects

* Fixed toggle_disable to be optional

* fixed toggle disable to remove toggle

* ✅ (intComponent.spec.ts): update test assertions to match expected behavior after changes in the component's functionality

---------

Co-authored-by: Carlos Coelho <80289056+carlosrcoelho@users.noreply.github.com>
Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
This commit is contained in:
Lucas Oliveira 2025-04-14 20:47:14 -03:00 • committed by GitHub
commit 7fb400d99e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 19 additions and 4 deletions

View file

@ -18,6 +18,7 @@ export default function DropdownComponent({
handleNodeClass,
toggle,
toggleValue,
toggleDisable,
...baseInputProps
}: InputProps<string, DropDownComponentType>) {
const onChange = (value: any, dbValue?: boolean, skipSnapshot?: boolean) => {
@ -44,7 +45,7 @@ export default function DropdownComponent({
handleOnNewValue={handleOnNewValue}
{...baseInputProps}
/>
{toggle && (
{toggle && toggleDisable !== true ? (
<ToggleShadComponent
value={toggleValue ?? true}
handleOnNewValue={(data) => {
@ -57,6 +58,8 @@ export default function DropdownComponent({
id={`toggle_dropdown_${id}`}
disabled={disabled}
/>
) : (
<></>
)}
</div>
);

View file

@ -78,6 +78,7 @@ export function StrRenderComponent({
name={templateData?.name!}
toggle={templateData.toggle}
toggleValue={templateData.toggle_value}
toggleDisable={templateData.toggle_disable}
/>
);
}

View file

@ -99,6 +99,7 @@ export type DropDownComponentType = {
handleNodeClass: (value: any, code?: string, type?: string) => void;
toggle?: boolean;
toggleValue?: boolean;
toggleDisable?: boolean;
};
export type TextAreaComponentType = {