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

fix(comments): enable check #5918

Merged
merged 2 commits into from
Mar 7, 2024
Merged

fix(comments): enable check #5918

merged 2 commits into from
Mar 7, 2024

Conversation

hermanwikner
Copy link
Member

Description

This pull request ensures that we only display the upsell UI or the comments UI if we can successfully fetch the feature flags for the current project. If fetching the feature flags is not possible, for example, due to the current user's permissions restricting access to "project details," we cannot accurately determine which UI to display. Therefore, in such scenarios, we must disable the feature entirely to prevent inadvertently showing the upsell UI for a project where it is actually enabled.

What to review

  • Make sure that the upsell UI is only displayed if the project is not having access to studioComments

Notes for release

N/A

@hermanwikner hermanwikner requested review from a team as code owners March 6, 2024 13:41
@hermanwikner hermanwikner requested review from pedrobonamin and ricokahler and removed request for a team March 6, 2024 13:41
Copy link

vercel bot commented Mar 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
performance-studio ✅ Ready (Inspect) Visit Preview Mar 6, 2024 3:46pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 6, 2024 3:46pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Mar 6, 2024 3:46pm

@@ -37,29 +41,22 @@ export function useFeatureEnabled(featureKey: string): Features {
const {projectId} = useSource()

if (!cachedFeatureRequest.get(projectId)) {
const features = fetchFeatures({versionedClient}).pipe(
shareReplay(),
catchError((error) => {
Copy link
Member Author

Choose a reason for hiding this comment

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

Removing the error catch here so that we can catch it below instead.

Copy link
Contributor

github-actions bot commented Mar 6, 2024

No changes to documentation

Copy link
Contributor

github-actions bot commented Mar 6, 2024

Component Testing Report Updated Mar 6, 2024 3:49 PM (UTC)

File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 37s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 6s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 12s 3 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 13s 4 2 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 12s 6 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 32s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 0s 15 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 1s 18 0 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 12s 6 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 13s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ❌ Failed (Inspect) 23s 8 0 1

Copy link
Contributor

@pedrobonamin pedrobonamin left a comment

Choose a reason for hiding this comment

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

Thanks @hermanwikner !

@hermanwikner hermanwikner added this pull request to the merge queue Mar 7, 2024
Merged via the queue into next with commit c230bb5 Mar 7, 2024
40 checks passed
@hermanwikner hermanwikner deleted the edx-1103 branch March 7, 2024 14:13
juice49 pushed a commit that referenced this pull request Mar 13, 2024
* feat(core): add `error` to `useFeatureEnabled`

* fix(comments): only enable comments if we are able to fetch project features
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants