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

💄 front: remove move context menu entry for shared link pages (and skip a separator when appropriate) (#484) #709

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
18 changes: 10 additions & 8 deletions tdrive/frontend/src/app/views/client/body/drive/context-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,26 +80,28 @@ export const useOnBuildContextMenu = (
//Add item related menus
const upToDateItem = await DriveApiClient.get(item.company_id, item.id);
const access = upToDateItem.access || 'none';
const hideShareItem = access === 'read' || getPublicLinkToken() || inTrash;
const hideManageAccessItem =
access === 'read'
|| getPublicLinkToken()
|| inTrash
|| !FeatureTogglesService.isActiveFeatureName(FeatureNames.COMPANY_MANAGE_ACCESS);
const newMenuActions = [
{
type: 'menu',
icon: 'share-alt',
text: Languages.t('components.item_context_menu.share'),
hide: access === 'read' || getPublicLinkToken() || inTrash,
hide: hideShareItem,
onClick: () => setPublicLinkModalState({ open: true, id: item.id }),
},
{
type: 'menu',
icon: 'users-alt',
text: Languages.t('components.item_context_menu.manage_access'),
hide:
access === 'read' ||
getPublicLinkToken() ||
inTrash ||
!FeatureTogglesService.isActiveFeatureName(FeatureNames.COMPANY_MANAGE_ACCESS),
hide: hideManageAccessItem,
onClick: () => setAccessModalState({ open: true, id: item.id }),
},
{ type: 'separator', hide: inTrash },
{ type: 'separator', hide: inTrash || (hideShareItem && hideManageAccessItem) },
{
type: 'menu',
icon: 'download-alt',
Expand Down Expand Up @@ -130,7 +132,7 @@ export const useOnBuildContextMenu = (
type: 'menu',
icon: 'folder-question',
text: Languages.t('components.item_context_menu.move'),
hide: access === 'read' || inTrash,
hide: access === 'read' || inTrash || inPublicSharing,
onClick: () =>
setSelectorModalState({
open: true,
Expand Down