Skip to content

Commit

Permalink
chore: integrate file association query API for Appsmith API (#39098)
Browse files Browse the repository at this point in the history
/ok-to-test tags="@tag.Sanity"

Corresponding CE files for EE PR

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
- Introduced enhanced control features by adding an optional action
identifier, providing greater context for interactions.
- Added a new document selection control type, expanding available form
control options in the editor.

- **Refactor**
- Improved control rendering performance by refining the update logic to
better handle state changes such as disabled status.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/13183325897>
> Commit: c645c5c
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=13183325897&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Sanity`
> Spec:
> <hr>Thu, 06 Feb 2025 17:39:42 UTC
<!-- end of auto-generated comment: Cypress test results  -->
  • Loading branch information
jsartisan authored Feb 7, 2025
1 parent 24f5a9e commit 3442aeb
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/client/src/components/formControls/BaseControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export interface ControlData {
addMoreButtonLabel?: string;
datasourceId?: string;
workspaceId?: string;
actionId?: string;
}
export type FormConfigType = Omit<ControlData, "configProperty"> & {
configProperty?: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
interface RagDocumentsSelectorProps {
workspaceId?: string;
actionId?: string;
datasourceId?: string;
}

// Used in EE
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export const RagDocumentsSelector = (props: RagDocumentsSelectorProps) => {
return null;
};
1 change: 1 addition & 0 deletions app/client/src/ee/components/formControls/Rag/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export { RagDocuments } from "./RagDocuments";
export { RagIntegrations } from "./RagIntegrations";
export { RagDocumentsSelector } from "./RagDocumentsSelector";
1 change: 1 addition & 0 deletions app/client/src/pages/Editor/FormControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ function FormControl(props: FormControlProps) {
...config,
datasourceId: dsId,
workspaceId,
actionId: actionValues?.id,
},
props.formName,
props?.multipleConfig,
Expand Down
19 changes: 18 additions & 1 deletion app/client/src/utils/formControl/FormControlRegistry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ import MultiFilePickerControl from "components/formControls/MultiFilePickerContr
import type { MultipleFilePickerControlProps } from "components/formControls/MultiFilePickerControl";
import type { RadioButtonControlProps } from "components/formControls/RadioButtonControl";
import RadioButtonControl from "components/formControls/RadioButtonControl";
import { RagIntegrations } from "ee/components/formControls/Rag";
import {
RagIntegrations,
RagDocumentsSelector,
} from "ee/components/formControls/Rag";
import {
SliderControl,
type SliderControlProps,
Expand Down Expand Up @@ -208,6 +211,20 @@ class FormControlRegistry {
return <SliderControl {...controlProps} />;
},
});
FormControlFactory.registerControlBuilder(
formControlTypes.RAG_DOCUMENTS_SELECTOR,
{
buildPropertyControl(controlProps): JSX.Element {
return (
<RagDocumentsSelector
actionId={controlProps.actionId}
datasourceId={controlProps.datasourceId}
workspaceId={controlProps.workspaceId}
/>
);
},
},
);
}
}

Expand Down
1 change: 1 addition & 0 deletions app/client/src/utils/formControl/formControlTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ export default {
RADIO_BUTTON: "RADIO_BUTTON",
RAG_INTEGRATIONS: "RAG_INTEGRATIONS",
SLIDER: "SLIDER",
RAG_DOCUMENTS_SELECTOR: "RAG_DOCUMENTS_SELECTOR",
};

0 comments on commit 3442aeb

Please sign in to comment.