refactor: streamline widget and integration architecture
This commit is contained in:
1 parent
ec295fe26e
commit
425cb653a1
243 files changed
+5722
-2255
No files matched your search
@@ -463,9 +463,11 @@ export const SetupStudio = ({ environment, assistantConfiguration }: OnboardingS
|
||||
...generalWidgets,
|
||||
...discoveredIntegrations.filter((integration) => selectedSourceIds.has(integration.sourceId)),
|
||||
...appsToCreate,
|
||||
].flatMap((selection) =>
|
||||
typeof selection === "string" ? [selection] : selection.widgetKind ? [selection.widgetKind] : [],
|
||||
),
|
||||
].flatMap((selection) => {
|
||||
if (typeof selection === "string") return [selection];
|
||||
if (!selection.widgetKind) return [];
|
||||
return [selection.widgetKind];
|
||||
}),
|
||||
),
|
||||
],
|
||||
});
|
||||
@@ -1931,13 +1933,19 @@ const getPreviewWidgetKinds = (props: StudioSectionProps) => [
|
||||
...props.drafts.filter(isIntegrationDraftComplete).flatMap((draft) => getWidgetKindsForIntegration(draft.kind)),
|
||||
...props.discoveredApps
|
||||
.filter((app) => props.selectedAppIds.includes(app.sourceId))
|
||||
.flatMap((app) => (app.widgetKind ? [app.widgetKind] : [])),
|
||||
.flatMap((app) => {
|
||||
if (!app.widgetKind) return [];
|
||||
return [app.widgetKind];
|
||||
}),
|
||||
]),
|
||||
];
|
||||
|
||||
const getPreviewAppCount = (props: StudioSectionProps) =>
|
||||
props.drafts.filter(isIntegrationDraftComplete).length +
|
||||
props.discoveredApps.filter((app) => props.selectedAppIds.includes(app.sourceId)).length;
|
||||
const getPreviewAppCount = (props: StudioSectionProps) => {
|
||||
return (
|
||||
props.drafts.filter(isIntegrationDraftComplete).length +
|
||||
props.discoveredApps.filter((app) => props.selectedAppIds.includes(app.sourceId)).length
|
||||
);
|
||||
};
|
||||
|
||||
const createDraft = ({
|
||||
id,
|
||||
|
||||
Reference in new issue
Block a user