Skip to content

Conversation

@xabg2
Copy link
Contributor

@xabg2 xabg2 commented Sep 19, 2025

Description

This PR implements the logic to block/open the dialogs when a shared feature is blocked, depending on the user tier.

Related Issues

Related Pull Requests

Checklist

  • Changes have been tested locally.
  • Unit tests have been written or updated as necessary.
  • The code adheres to the repository's coding standards.
  • Relevant documentation has been added or updated.
  • No new warnings or errors have been introduced.
  • SonarCloud issues have been reviewed and addressed.
  • QA Passed

Testing Process

Additional Notes

@xabg2 xabg2 self-assigned this Sep 19, 2025
@xabg2 xabg2 requested a review from CandelR as a code owner September 19, 2025 11:11
@xabg2 xabg2 added the enhancement New feature or request label Sep 19, 2025
@vercel
Copy link

vercel bot commented Sep 19, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
drive-web Ready Ready Preview Comment Oct 6, 2025 10:25am


export type UserTierFeatures = Tier['featuresPerService'];

// TODO: REMOVE THIS USELESS CALL
Copy link
Collaborator

Choose a reason for hiding this comment

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

why didn't have removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because a reducer depends on this function and I do not want to remove a lot of thinks that, in fact, does not belongs to this task.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just added the comment to indicate that we can remove this as it is not longer used (or at list I think so).

Comment on lines +131 to +132
const [isRestrictedSharingDialogOpen, setIsRestrictedSharingDialogOpen] = useState<boolean>(false);
const [isRestrictedPasswordDialogOpen, setIsRestrictedPasswordDialogOpen] = useState<boolean>(false);
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: Perhaps we should start considering using useReducer here, as the number of states is starting to become large

};

const onPasswordCheckboxChange = useCallback(() => {
if (!isPasswordSharingAvailable) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

forgot to add isPasswordSharingAvailable to the dendency array of useCallback

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ops, on it.

Comment on lines 101 to 102
folderUuid: file.parentFolderId,
encryptVersion: StorageTypes.EncryptionVersion.Aes03,
Copy link
Collaborator

Choose a reason for hiding this comment

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

have you checked that parentFolderId it is the folder uuid?

Copy link
Contributor Author

@xabg2 xabg2 Sep 19, 2025

Choose a reason for hiding this comment

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

Yep, it is. But this change does not belong to this PR. It belongs to this PR. I'm going to remove this change from this PR.

Comment on lines 93 to 95
const userFeatures = await getAvailableUserFeatures();

dispatch(userActions.setUserTierFeatures(userFeatures));
Copy link
Collaborator

Choose a reason for hiding this comment

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

There is no case handled if this fails or takes too long, perhaps we should implement a warning that there may be some unused features due to the failure 🤔

…ected' into feat/logic-to-block-shared-features-based-on-user-tier
…ected' into feat/logic-to-block-shared-features-based-on-user-tier
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Sep 19, 2025

Deploying drive-web with  Cloudflare Pages  Cloudflare Pages

Latest commit: a87f98c
Status: ✅  Deploy successful!
Preview URL: https://e2930928.drive-web.pages.dev
Branch Preview URL: https://feat-logic-to-block-shared-f.drive-web.pages.dev

View logs

@xabg2 xabg2 changed the title feat(shared): block features depending on the user tier [PB-4568]: feat/block features depending on the user tier Sep 22, 2025
"@internxt/css-config": "1.0.3",
"@internxt/lib": "1.3.1",
"@internxt/sdk": "=1.11.2",
"@internxt/sdk": "=1.11.11",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this not require any additional changes to function arguments? I say this because of the changes that have been made to some SDK functions

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. We need to merge the SDK update first.

…ected' into feat/logic-to-block-shared-features-based-on-user-tier
…ected' into feat/logic-to-block-shared-features-based-on-user-tier
Base automatically changed from feat/design-to-block-restricted-items-and-password-protected to master September 30, 2025 08:30
@xabg2 xabg2 requested a review from CandelR September 30, 2025 08:34
@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 6, 2025

@xabg2 xabg2 merged commit ad36e31 into master Oct 6, 2025
16 checks passed
@xabg2 xabg2 deleted the feat/logic-to-block-shared-features-based-on-user-tier branch October 6, 2025 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request ready-for-preview

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants