⭐️ Open in new window menu option (#183)
⭐️ Open in new window menu option
This commit is contained in:
@@ -313,6 +313,7 @@
|
||||
"components.item_context_menu.today": "Today",
|
||||
"components.item_context_menu.last_week": "Last week",
|
||||
"components.item_context_menu.last_month": "Last month",
|
||||
"components.item_context_menu.open_new_window": "Open in new window",
|
||||
"scenes.app.shared_with_me.shared_with_me": "Shared with me",
|
||||
"scenes.app.shared_with_me.file_type": "File type",
|
||||
"scenes.app.shared_with_me.people": "People",
|
||||
|
||||
@@ -312,6 +312,7 @@
|
||||
"components.item_context_menu.today": "Aujourd'hui",
|
||||
"components.item_context_menu.last_week": "La semaine dernière",
|
||||
"components.item_context_menu.last_month": "Le mois dernier",
|
||||
"components.item_context_menu.open_new_window": "Open in new window",
|
||||
"scenes.app.shared_with_me.shared_with_me": "Partagé avec moi",
|
||||
"scenes.app.shared_with_me.file_type": "Type de fichier",
|
||||
"scenes.app.shared_with_me.people": "Personnes",
|
||||
|
||||
@@ -312,6 +312,7 @@
|
||||
"components.item_context_menu.today": "Сегодня",
|
||||
"components.item_context_menu.last_week": "За неделю",
|
||||
"components.item_context_menu.last_month": "За месяц",
|
||||
"components.item_context_menu.open_new_window": "Открыть в новом окне",
|
||||
"scenes.app.shared_with_me.shared_with_me": "Доступные мне",
|
||||
"scenes.app.shared_with_me.file_type": "Тип файла",
|
||||
"scenes.app.shared_with_me.people": "Люди",
|
||||
|
||||
@@ -19,6 +19,8 @@ import { ToasterService } from '@features/global/services/toaster-service';
|
||||
import { copyToClipboard } from '@features/global/utils/CopyClipboard';
|
||||
import { SharedWithMeFilterState } from '@features/drive/state/shared-with-me-filter';
|
||||
import { getCurrentUserList } from '@features/users/hooks/use-user-list';
|
||||
import RouterServices from '@features/router/services/router-service';
|
||||
import useRouterCompany from '@features/router/hooks/use-router-company';
|
||||
import _ from 'lodash';
|
||||
import Languages from 'features/global/services/languages-service';
|
||||
|
||||
@@ -43,6 +45,8 @@ export const useOnBuildContextMenu = (children: DriveItem[], initialParentId?: s
|
||||
const setPropertiesModalState = useSetRecoilState(PropertiesModalAtom);
|
||||
const setUsersModalState = useSetRecoilState(UsersModalAtom);
|
||||
const { open: preview } = useDrivePreview();
|
||||
const company = useRouterCompany();
|
||||
|
||||
function getIdsFromArray(arr: DriveItem[]): string[] {
|
||||
return arr.map((obj) => obj.id);
|
||||
}
|
||||
@@ -87,6 +91,15 @@ export const useOnBuildContextMenu = (children: DriveItem[], initialParentId?: s
|
||||
}
|
||||
},
|
||||
{ type: 'separator' },
|
||||
{
|
||||
type: 'menu',
|
||||
text: Languages.t('components.item_context_menu.open_new_window'),
|
||||
onClick: () => {
|
||||
const route = RouterServices.generateRouteFromState({ companyId: company, viewId: item.parent_id, itemId: item.id });
|
||||
window.open(route, '_blank');
|
||||
}
|
||||
},
|
||||
{ type: 'separator' },
|
||||
{
|
||||
type: 'menu',
|
||||
text: Languages.t('components.item_context_menu.manage_access'),
|
||||
|
||||
Reference in New Issue
Block a user