Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 3 additions & 17 deletions packages/react-ui/src/app/routes/openops-tables/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,16 @@ import { t } from 'i18next';
import { useLocation } from 'react-router-dom';

import { flagsHooks } from '@/app/common/hooks/flags-hooks';
import { platformHooks } from '@/app/common/hooks/platform-hooks';
import { projectHooks } from '@/app/common/hooks/project-hooks';
import { useDefaultSidebarState } from '@/app/common/hooks/use-default-sidebar-state';
import { useCandu } from '@/app/features/extensions/candu/use-candu';
import { FlagId } from '@openops/shared';

const OpenOpsTablesPage = () => {
useDefaultSidebarState('minimized');
const { isCanduEnabled, canduClientToken, canduUserId } = useCandu();
const { project } = projectHooks.useCurrentProject();
const { platform: organization } = platformHooks.useCurrentPlatform();

// TODO: Remove type assertion and remove organization?.tablesWorkspaceId fallback once Phase 1 is complete
const workspaceId =
(project as any)?.tablesWorkspaceId ?? organization?.tablesWorkspaceId;

const parentDataObj = {
userId: canduUserId ?? undefined,
canduClientToken: canduClientToken ?? undefined,
...(isCanduEnabled && { isCanduEnabled: true }),
...(workspaceId !== undefined && { workspaceId }),
};

const parentData = encodeURIComponent(JSON.stringify(parentDataObj));
const parentData = encodeURIComponent(
JSON.stringify({ isCanduEnabled, userId: canduUserId, canduClientToken }),
Copy link

Copilot AI Nov 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parentData object includes isCanduEnabled directly without conditionally checking if Candu is enabled. This differs from the reverted code which only included isCanduEnabled: true when it was actually enabled. If isCanduEnabled is false, it will now be passed as false rather than being omitted, which may cause unintended behavior in the iframe.

Suggested change
JSON.stringify({ isCanduEnabled, userId: canduUserId, canduClientToken }),
JSON.stringify({
...(isCanduEnabled ? { isCanduEnabled: true } : {}),
userId: canduUserId,
canduClientToken,
}),

Copilot uses AI. Check for mistakes.
);

const location = useLocation();
const params = new URLSearchParams(location.search);
Expand Down
Loading