|
@@ -10,6 +10,7 @@ import {space} from 'sentry/styles/space';
|
|
import {trackAnalytics} from 'sentry/utils/analytics';
|
|
import {trackAnalytics} from 'sentry/utils/analytics';
|
|
import useDismissAlert from 'sentry/utils/useDismissAlert';
|
|
import useDismissAlert from 'sentry/utils/useDismissAlert';
|
|
import useOrganization from 'sentry/utils/useOrganization';
|
|
import useOrganization from 'sentry/utils/useOrganization';
|
|
|
|
+import useProjectSdkNeedsUpdate from 'sentry/utils/useProjectSdkNeedsUpdate';
|
|
|
|
|
|
const LOCAL_STORAGE_KEY = 'replay-canvas-supported';
|
|
const LOCAL_STORAGE_KEY = 'replay-canvas-supported';
|
|
|
|
|
|
@@ -20,6 +21,12 @@ export function CanvasSupportNotice() {
|
|
const organization = useOrganization();
|
|
const organization = useOrganization();
|
|
const {dismiss, isDismissed} = useDismissAlert({key: LOCAL_STORAGE_KEY});
|
|
const {dismiss, isDismissed} = useDismissAlert({key: LOCAL_STORAGE_KEY});
|
|
const {isFetching, replay} = useReplayContext();
|
|
const {isFetching, replay} = useReplayContext();
|
|
|
|
+ const projectId = replay?.getReplay().project_id;
|
|
|
|
+ const {needsUpdate} = useProjectSdkNeedsUpdate({
|
|
|
|
+ minVersion: '7.98.0',
|
|
|
|
+ organization,
|
|
|
|
+ projectId: [projectId ?? '-1'],
|
|
|
|
+ });
|
|
|
|
|
|
// No need for notice if they are not feature flagged into the replayer
|
|
// No need for notice if they are not feature flagged into the replayer
|
|
if (!organization.features.includes('session-replay-enable-canvas-replayer')) {
|
|
if (!organization.features.includes('session-replay-enable-canvas-replayer')) {
|
|
@@ -53,20 +60,41 @@ export function CanvasSupportNotice() {
|
|
/>
|
|
/>
|
|
}
|
|
}
|
|
>
|
|
>
|
|
- {tct(
|
|
|
|
- 'This replay contains a [code:canvas] element. Support for recording [code:canvas] data was added in SDK version 7.98.0. [link:Learn more].',
|
|
|
|
- {
|
|
|
|
- code: <code />,
|
|
|
|
- link: (
|
|
|
|
- <ExternalLink
|
|
|
|
- onClick={() => {
|
|
|
|
- trackAnalytics('replay.canvas-detected-banner-clicked', {organization});
|
|
|
|
- }}
|
|
|
|
- href="https://docs.sentry.io/platforms/javascript/session-replay/#canvas-recording"
|
|
|
|
- />
|
|
|
|
- ),
|
|
|
|
- }
|
|
|
|
- )}
|
|
|
|
|
|
+ {needsUpdate
|
|
|
|
+ ? tct(
|
|
|
|
+ 'This replay contains a [code:canvas] element. Please update your SDK to 7.98.0 or higher to enable [code:canvas] recording. [link:Learn more in our docs].',
|
|
|
|
+ {
|
|
|
|
+ code: <code />,
|
|
|
|
+ link: (
|
|
|
|
+ <ExternalLink
|
|
|
|
+ onClick={() => {
|
|
|
|
+ trackAnalytics('replay.canvas-detected-banner-clicked', {
|
|
|
|
+ sdk_needs_update: true,
|
|
|
|
+ organization,
|
|
|
|
+ });
|
|
|
|
+ }}
|
|
|
|
+ href="https://docs.sentry.io/platforms/javascript/session-replay/#canvas-recording"
|
|
|
|
+ />
|
|
|
|
+ ),
|
|
|
|
+ }
|
|
|
|
+ )
|
|
|
|
+ : tct(
|
|
|
|
+ 'This replay contains a [code:canvas] element. Learn how to enable [code:canvas] recording [link:in our docs].',
|
|
|
|
+ {
|
|
|
|
+ code: <code />,
|
|
|
|
+ link: (
|
|
|
|
+ <ExternalLink
|
|
|
|
+ onClick={() => {
|
|
|
|
+ trackAnalytics('replay.canvas-detected-banner-clicked', {
|
|
|
|
+ sdk_needs_update: false,
|
|
|
|
+ organization,
|
|
|
|
+ });
|
|
|
|
+ }}
|
|
|
|
+ href="https://docs.sentry.io/platforms/javascript/session-replay/#canvas-recording"
|
|
|
|
+ />
|
|
|
|
+ ),
|
|
|
|
+ }
|
|
|
|
+ )}
|
|
</StyledAlert>
|
|
</StyledAlert>
|
|
);
|
|
);
|
|
}
|
|
}
|