Skip to content

Commit e45f835

Browse files
committed
fix: final review
1 parent 889ccf6 commit e45f835

2 files changed

Lines changed: 18 additions & 5 deletions

File tree

apps/api/src/app/workspaces/resolvers/transformers/workspace.transformer.ts

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,16 @@ import {
44
Organization,
55
Workspace,
66
} from "@prisma/client";
7-
import {
8-
Workspace as ApiWorkspace,
9-
WorkspaceFeatureAdoption,
10-
} from "../../../../graphql-types";
7+
import { Workspace as ApiWorkspace } from "../../../../graphql-types";
118
import {
129
getWorkspaceAvatar,
1310
getWorkspaceHandle,
1411
getWorkspaceName,
1512
getWorkspaceUninstallGitUrl,
1613
} from "../../services/workspace.service";
1714
import { getWorkspaceSettings } from "../../services/workspace-settings.service";
15+
import { WorkspaceFeatureAdoption } from "../../services/workspace.types";
16+
import { captureException } from "../../../../lib/sentry";
1817

1918
type WorkspaceWithRelations = Workspace & {
2019
gitProfile: GitProfile | null;
@@ -34,6 +33,19 @@ export const transformWorkspace = (
3433
| "settings"
3534
| "featureAdoption"
3635
> => {
36+
const { data: featureAdoption, error } = WorkspaceFeatureAdoption.safeParse(
37+
workspace.featureAdoption
38+
);
39+
40+
if (error) {
41+
captureException(error, {
42+
extra: {
43+
workspaceId: workspace.id,
44+
featureAdoption: workspace.featureAdoption,
45+
},
46+
});
47+
}
48+
3749
return {
3850
// Base properties
3951
id: workspace.id,
@@ -42,6 +54,6 @@ export const transformWorkspace = (
4254
avatar: getWorkspaceAvatar(workspace),
4355
gitUninstallUrl: getWorkspaceUninstallGitUrl(workspace),
4456
settings: getWorkspaceSettings(workspace),
45-
featureAdoption: workspace.featureAdoption as WorkspaceFeatureAdoption,
57+
featureAdoption: featureAdoption ?? {},
4658
};
4759
};

apps/web/src/components/alert-banner/alert-banner.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export const AlertBanner = ({
5757
variant="filled"
5858
color={color}
5959
rightSection={<IconExternalLink stroke={1.5} size={16} />}
60+
{...buttonProps}
6061
>
6162
{ctaText}
6263
</Button>

0 commit comments

Comments
 (0)