Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch data source view in agent configuration #6708

Merged
merged 11 commits into from
Aug 9, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ export default function AssistantBuilderDataSourceModal({
...currentConfigurations,
[ds.name]: {
dataSource: ds,
// TODO(GROUPS_INFRA) Replace with DataSourceViewType once the UI has it.
dataSourceViewId: null,
selectedResources: [],
isSelectAll: true,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ export async function buildInitialActions({
const dataSource = dataSourcesByName[ds.dataSourceName];
if (!dataSource.connectorId || !ds.resources) {
return {
dataSource: dataSource,
dataSource,
// TODO(GROUPS_INFRA) Replace with DataSourceViewType once the UI has it.
dataSourceViewId: null,
selectedResources: [],
isSelectAll: ds.isSelectAll,
};
Expand All @@ -92,7 +94,9 @@ export async function buildInitialActions({
}

return {
dataSource: dataSource,
dataSource,
// TODO(GROUPS_INFRA) Replace with DataSourceViewType once the UI has it.
dataSourceViewId: null,
selectedResources: response.value.nodes,
isSelectAll: ds.isSelectAll,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ export async function submitAssistantBuilderForm({
a.configuration.dataSourceConfigurations
).map(({ dataSource, selectedResources, isSelectAll }) => ({
dataSourceId: dataSource.name,
// TODO(GROUPS_INFRA) Replace with DataSourceViewType once the UI has it.
dataSourceViewId: null,
workspaceId: owner.sId,
filter: {
parents: !isSelectAll
Expand Down Expand Up @@ -150,6 +152,8 @@ export async function submitAssistantBuilderForm({
a.configuration.dataSourceConfigurations
).map(({ dataSource, selectedResources, isSelectAll }) => ({
dataSourceId: dataSource.name,
// TODO(GROUPS_INFRA) Replace with DataSourceViewType once the UI has it.
dataSourceViewId: null,
workspaceId: owner.sId,
filter: {
parents: !isSelectAll
Expand Down
2 changes: 2 additions & 0 deletions front/components/assistant_builder/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ export const ACTION_MODES = [

export type AssistantBuilderDataSourceConfiguration = {
dataSource: DataSourceType;
// TODO(GROUPS_INFRA) Replace with DataSourceViewType once the UI has it.
dataSourceViewId: null;
selectedResources: ContentNode[];
isSelectAll: boolean;
};
Expand Down
Loading
Loading