🚨⚰️ front: Remove unused references
This commit is contained in:
committed by
ericlinagora
parent
b2bbce98f9
commit
26ca1be629
@@ -1,4 +1,4 @@
|
||||
import React, { useEffect } from 'react';
|
||||
import React from 'react';
|
||||
import './connection-indicator.scss';
|
||||
import ErrorOutlinedIcon from '@material-ui/icons/ErrorOutlined';
|
||||
import HourglassEmpty from '@material-ui/icons/HourglassEmpty';
|
||||
@@ -9,7 +9,7 @@ import { useRecoilState } from 'recoil';
|
||||
// import WebSocket, { WebsocketEvents } from '@features/global/types/websocket-types';
|
||||
|
||||
export default () => {
|
||||
const [{ connected, reconnecting }, setState] = useRecoilState(ConnectedState);
|
||||
const [{ connected, reconnecting }] = useRecoilState(ConnectedState);
|
||||
|
||||
return (
|
||||
<div className={'connection_indicator ' + (connected === false ? 'visible' : '')}>
|
||||
|
||||
@@ -1,24 +1,21 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import InitService from '../../features/global/services/init-service';
|
||||
// import InitService from '../../features/global/services/init-service';
|
||||
import LocalStorage from '../../features/global/framework/local-storage-service';
|
||||
import DownloadBanner from '@molecules/download-banner';
|
||||
import { detectDesktopAppPresence } from '../../../utils/browser-detect';
|
||||
|
||||
export default (): React.ReactElement => {
|
||||
const [showBanner, setShowBanner] = useState(false);
|
||||
const [ , setShowBanner] = useState(false);
|
||||
|
||||
const download = (): void => {
|
||||
const appDownloadUrl = InitService?.server_infos?.configuration?.app_download_url;
|
||||
// const download = (): void => {
|
||||
// const appDownloadUrl = InitService?.server_infos?.configuration?.app_download_url;
|
||||
// if (appDownloadUrl)
|
||||
// window.open(appDownloadUrl, '_blank');
|
||||
// };
|
||||
|
||||
if (appDownloadUrl) {
|
||||
window.open(appDownloadUrl, '_blank');
|
||||
}
|
||||
};
|
||||
|
||||
const removeBanner = (): void => {
|
||||
LocalStorage.setItem('show_app_banner', 'false');
|
||||
setShowBanner(false);
|
||||
};
|
||||
// const removeBanner = (): void => {
|
||||
// LocalStorage.setItem('show_app_banner', 'false');
|
||||
// setShowBanner(false);
|
||||
// };
|
||||
|
||||
useEffect(() => {
|
||||
if (LocalStorage.getItem('show_app_banner') === 'false') {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import React, { ReactNode } from 'react';
|
||||
import { getDevice } from '../../features/global/utils/device';
|
||||
import configuration from '../../environment/environment';
|
||||
import { Smartphone, X } from 'react-feather';
|
||||
import './style.scss';
|
||||
|
||||
@@ -29,7 +29,7 @@ export default class PopupComponent extends React.Component {
|
||||
{this.state.popupManager.canClose() && (
|
||||
<div className="header">
|
||||
<div className="close" onClick={() => this.state.popupManager.close()}>
|
||||
<CloseIcon class="m-icon" />
|
||||
<CloseIcon className="m-icon" />
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { FolderIcon } from '@heroicons/react/solid';
|
||||
import Highlighter from 'react-highlight-words';
|
||||
import { useRecoilState, useRecoilValue } from 'recoil';
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import { onDriveItemDownloadClick } from '../common';
|
||||
import ResultContext from './result-context';
|
||||
import { Button } from '@atoms/button/button';
|
||||
@@ -15,18 +15,14 @@ import { SearchInputState } from '@features/search/state/search-input';
|
||||
import { UserType } from '@features/users/types/user';
|
||||
import { useDrivePreview } from '@features/drive/hooks/use-drive-preview';
|
||||
import Media from '@molecules/media';
|
||||
import { DriveCurrentFolderAtom } from '@views/client/body/drive/browser';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import RouterServices from '@features/router/services/router-service';
|
||||
import { useCurrentUser } from 'app/features/users/hooks/use-current-user';
|
||||
import useRouterCompany from 'app/features/router/hooks/use-router-company';
|
||||
import { DocumentIcon } from '@views/client/body/drive/documents/document-icon';
|
||||
|
||||
export default (props: { driveItem: DriveItem & { user?: UserType }}) => {
|
||||
const history = useHistory();
|
||||
const input = useRecoilValue(SearchInputState);
|
||||
const { user } = useCurrentUser();
|
||||
const [_, setParentId] = useRecoilState(DriveCurrentFolderAtom({ initialFolderId: 'user_'+user?.id }));
|
||||
const file = props.driveItem;
|
||||
const name = file?.name;
|
||||
const extension = name?.split('.').pop();
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
type TreeItem = { [key: string]: File | TreeItem };
|
||||
|
||||
export type FileTreeObject = {
|
||||
|
||||
@@ -10,7 +10,6 @@ import AlertManager from '@features/global/services/alert-manager-service';
|
||||
import Languages from '@features/global/services/languages-service';
|
||||
import JWTStorage from '@features/auth/jwt-storage-service';
|
||||
import Globals from '@features/global/services/globals-tdrive-app-service';
|
||||
import { useCurrentUser } from '@features/users/hooks/use-current-user';
|
||||
import UserAPIClient from '../../features/users/api/user-api-client';
|
||||
import { getUser } from '@features/users/hooks/use-user-list';
|
||||
|
||||
@@ -68,6 +67,7 @@ class CurrentUser extends Observable {
|
||||
const data = {
|
||||
status: user.tutorial_status,
|
||||
};
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
Api.post('/ajax/users/account/set_tutorial_status', data, () => {});
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ import {
|
||||
onChangeCompanyApplications,
|
||||
} from '../state/company-applications';
|
||||
import CompanyApplicationsAPIClient from 'app/features/applications/api/company-applications-api-client';
|
||||
import { useCurrentCompany } from '../../companies/hooks/use-companies';
|
||||
import { Application } from 'app/features/applications/types/application';
|
||||
import { LoadingState } from 'app/features/global/state/atoms/Loading';
|
||||
import useRouterWorkspace from 'app/features/router/hooks/use-router-workspace';
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { atomFamily, selectorFamily } from 'recoil';
|
||||
|
||||
import { Application } from 'app/features/applications/types/application';
|
||||
import Collections from 'app/deprecated/CollectionsV1/Collections/Collections';
|
||||
import _ from 'lodash';
|
||||
|
||||
//Retro compatibility
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import { atomFamily } from 'recoil';
|
||||
import Collections from '@deprecated/CollectionsV1/Collections/Collections';
|
||||
|
||||
import { CompanyType } from '@features/companies/types/company';
|
||||
import CompanyAPIClient from '@features/companies/api/company-api-client';
|
||||
import _ from 'lodash';
|
||||
|
||||
const companies: { [key: string]: CompanyType } = {};
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ import Languages from '@features/global/services/languages-service';
|
||||
import { ToasterService as Toaster } from '@features/global/services/toaster-service';
|
||||
import { ConsoleMemberRole } from '@features/console/types/types';
|
||||
import Logger from '@features/global/framework/logger-service';
|
||||
import { JWTDataType } from '@features/auth/jwt-storage-service';
|
||||
|
||||
class ConsoleService {
|
||||
logger: Logger.Logger;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { MouseEventHandler } from 'react';
|
||||
import React from 'react';
|
||||
import {useDraggable} from '@dnd-kit/core';
|
||||
|
||||
type DraggableProps={
|
||||
@@ -7,7 +7,7 @@ type DraggableProps={
|
||||
}
|
||||
|
||||
export function Draggable(props:DraggableProps) {
|
||||
const {attributes, listeners, setNodeRef, transform} = useDraggable({
|
||||
const { attributes, listeners, setNodeRef } = useDraggable({
|
||||
id: `draggable-${props.id+1}`,
|
||||
data: {
|
||||
child: props.children
|
||||
|
||||
@@ -17,7 +17,7 @@ export const useDriveActions = (inPublicSharing?: boolean) => {
|
||||
const companyId = useRouterCompany();
|
||||
const sharedFilter = useRecoilValue(SharedWithMeFilterState);
|
||||
const sortItem = useRecoilValue(DriveItemSort);
|
||||
const [paginateItem, _] = useRecoilState(DriveItemPagination);
|
||||
const [ paginateItem ] = useRecoilState(DriveItemPagination);
|
||||
const { getQuota } = useUserQuota();
|
||||
|
||||
const refresh = useRecoilCallback(
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { ToasterService } from '@features/global/services/toaster-service';
|
||||
import { LoadingStateInitTrue } from '@features/global/state/atoms/Loading';
|
||||
import useRouterCompany from '@features/router/hooks/use-router-company';
|
||||
import { useCallback, useState } from 'react';
|
||||
import { useCallback } from 'react';
|
||||
import { useRecoilCallback, useRecoilState, useRecoilValue } from 'recoil';
|
||||
import { DriveItemAtom, DriveItemChildrenAtom, DriveItemPagination } from '../state/store';
|
||||
import { DriveItem } from '../types';
|
||||
@@ -20,7 +20,7 @@ export const useDriveItem = (id: string) => {
|
||||
// const children = useRecoilValue(DriveItemChildrenAtom(id));
|
||||
const [children, setChildren] = useRecoilState(DriveItemChildrenAtom(id));
|
||||
const [loading, setLoading] = useRecoilState(LoadingStateInitTrue('useDriveItem-' + id));
|
||||
const [_, setPaginateItem] = useRecoilState(DriveItemPagination);
|
||||
const [, setPaginateItem] = useRecoilState(DriveItemPagination);
|
||||
const {
|
||||
refresh: refreshItem,
|
||||
create,
|
||||
@@ -171,6 +171,7 @@ export const useDriveItem = (id: string) => {
|
||||
updateLevel,
|
||||
remove,
|
||||
refresh,
|
||||
restore,
|
||||
loadNextPage,
|
||||
};
|
||||
};
|
||||
|
||||
@@ -6,18 +6,15 @@ import { useRecoilState } from 'recoil';
|
||||
import { DriveApiClient } from '../api-client/api-client';
|
||||
import { DriveViewerState } from '../state/viewer';
|
||||
import { DriveItem } from '../types';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import RouterServices from '@features/router/services/router-service';
|
||||
import useRouterCompany from '@features/router/hooks/use-router-company';
|
||||
import { DriveCurrentFolderAtom } from 'app/views/client/body/drive/browser';
|
||||
import { useCurrentUser } from 'app/features/users/hooks/use-current-user';
|
||||
|
||||
export const useDrivePreviewModal = () => {
|
||||
const history = useHistory();
|
||||
const company = useRouterCompany();
|
||||
const [status, setStatus] = useRecoilState(DriveViewerState);
|
||||
const { user } = useCurrentUser();
|
||||
const [ parentId, setParentId ] = useRecoilState(
|
||||
const [ , setParentId ] = useRecoilState(
|
||||
DriveCurrentFolderAtom({ initialFolderId: 'user_'+user?.id }),
|
||||
);
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { string } from 'prop-types';
|
||||
import { atom } from 'recoil';
|
||||
|
||||
export type SharedWithMeFilter = {
|
||||
|
||||
@@ -23,7 +23,7 @@ export const useSearchDriveItems = () => {
|
||||
const [loading, setLoading] = useRecoilState(LoadingState('useSearchDriveItems'));
|
||||
|
||||
const [searched, setSearched] = useRecoilState(SearchDriveItemsResultsState(companyId));
|
||||
const [recent, setRecent] = useRecoilState(RecentDriveItemsState(companyId));
|
||||
const [, setRecent] = useRecoilState(RecentDriveItemsState(companyId));
|
||||
|
||||
const opt = _.omitBy(
|
||||
{
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
import { useEffect, useRef } from "react";
|
||||
import { useEffect } from "react";
|
||||
import LoginService from '@features/auth/login-service';
|
||||
import UserAPIClient from '@features/users/api/user-api-client';
|
||||
import { useRecoilState } from 'recoil';
|
||||
import { CurrentUserState } from '../state/atoms/current-user';
|
||||
import Languages from '@features/global/services/languages-service';
|
||||
|
||||
@@ -4,8 +4,6 @@ import { atomFamily, selectorFamily, useSetRecoilState } from 'recoil';
|
||||
import { WorkspaceType } from '@features/workspaces/types/workspace';
|
||||
import WorkspaceAPIClient from '@features/workspaces/api/workspace-api-client';
|
||||
import Logger from '@features/global/framework/logger-service';
|
||||
import _ from 'lodash';
|
||||
import Collections from '@deprecated/CollectionsV1/Collections/Collections';
|
||||
|
||||
const logger = Logger.getLogger('WorkspaceListState');
|
||||
|
||||
|
||||
@@ -10,9 +10,9 @@ import { useDriveUpload } from '@features/drive/hooks/use-drive-upload';
|
||||
import { DriveItemSelectedList, DriveItemSort } from '@features/drive/state/store';
|
||||
import { formatBytes } from '@features/drive/utils';
|
||||
import useRouterCompany from '@features/router/hooks/use-router-company';
|
||||
import _, { set } from 'lodash';
|
||||
import _ from 'lodash';
|
||||
import { memo, Suspense, useCallback, useEffect, useRef, useState } from 'react';
|
||||
import { atomFamily, useRecoilState, useSetRecoilState, useRecoilValue } from 'recoil';
|
||||
import { atomFamily, useRecoilState, useSetRecoilState } from 'recoil';
|
||||
import { DrivePreview } from '../../viewer/drive-preview';
|
||||
import {
|
||||
useOnBuildContextMenu,
|
||||
@@ -49,7 +49,6 @@ import { useCurrentUser } from 'app/features/users/hooks/use-current-user';
|
||||
import { ConfirmModal } from './modals/confirm-move';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { SortIcon } from 'app/atoms/icons-agnostic';
|
||||
import { useDrivePreview, useDrivePreviewLoading } from 'app/features/drive/hooks/use-drive-preview';
|
||||
|
||||
export const DriveCurrentFolderAtom = atomFamily<
|
||||
string,
|
||||
@@ -78,12 +77,9 @@ export default memo(
|
||||
? (user?.companies || []).find(company => company?.company.id === companyId)?.role
|
||||
: 'member';
|
||||
setTdriveTabToken(tdriveTabContextToken || null);
|
||||
const [filter, __] = useRecoilState(SharedWithMeFilterState);
|
||||
const { viewId, dirId, itemId } = useRouteState();
|
||||
const { status } = useDrivePreview();
|
||||
const { openWithId, close } = useDrivePreview();
|
||||
const [ filter ] = useRecoilState(SharedWithMeFilterState);
|
||||
const { viewId, dirId } = useRouteState();
|
||||
const [sortLabel] = useRecoilState(DriveItemSort)
|
||||
const { loading: isModalLoading } = useDrivePreviewLoading();
|
||||
const [parentId, _setParentId] = useRecoilState(
|
||||
DriveCurrentFolderAtom({
|
||||
context: context,
|
||||
|
||||
@@ -22,9 +22,7 @@ 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 useRouteState from 'app/features/router/hooks/use-route-state';
|
||||
import RouterServices from '@features/router/services/router-service';
|
||||
import useRouterCompany from '@features/router/hooks/use-router-company';
|
||||
import _, { set } from 'lodash';
|
||||
import _ from 'lodash';
|
||||
import Languages from 'features/global/services/languages-service';
|
||||
import { hasAnyPublicLinkAccess } from '@features/files/utils/access-info-helpers';
|
||||
import FeatureTogglesService, {
|
||||
@@ -42,7 +40,7 @@ export const useOnBuildContextMenu = (
|
||||
const [checkedIds, setChecked] = useRecoilState(DriveItemSelectedList);
|
||||
const checked = children.filter(c => checkedIds[c.id]);
|
||||
|
||||
const [_, setParentId] = useRecoilState(
|
||||
const [setParentId] = useRecoilState(
|
||||
DriveCurrentFolderAtom({ initialFolderId: initialParentId || 'root' }),
|
||||
);
|
||||
|
||||
@@ -59,11 +57,6 @@ export const useOnBuildContextMenu = (
|
||||
const setUsersModalState = useSetRecoilState(UsersModalAtom);
|
||||
const { open: preview } = useDrivePreview();
|
||||
const { viewId } = useRouteState();
|
||||
const company = useRouterCompany();
|
||||
|
||||
function getIdsFromArray(arr: DriveItem[]): string[] {
|
||||
return arr.map(obj => obj.id);
|
||||
}
|
||||
|
||||
return useCallback(
|
||||
async (parent?: Partial<DriveItemDetails> | null, item?: DriveItem) => {
|
||||
@@ -378,7 +371,7 @@ export const useOnBuildContextMenu = (
|
||||
};
|
||||
|
||||
export const useOnBuildFileTypeContextMenu = () => {
|
||||
const [filter, setFilter] = useRecoilState(SharedWithMeFilterState);
|
||||
const [, setFilter] = useRecoilState(SharedWithMeFilterState);
|
||||
const mimeTypes = [
|
||||
{ key: Languages.t('components.item_context_menu.all'), value: '' },
|
||||
{ key: 'CSV', value: 'text/csv' },
|
||||
@@ -414,8 +407,8 @@ export const useOnBuildFileTypeContextMenu = () => {
|
||||
};
|
||||
|
||||
export const useOnBuildPeopleContextMenu = () => {
|
||||
const [filter, setFilter] = useRecoilState(SharedWithMeFilterState);
|
||||
const [_userList, setUserList] = useState(getCurrentUserList());
|
||||
const [, setFilter] = useRecoilState(SharedWithMeFilterState);
|
||||
const [_userList] = useState(getCurrentUserList());
|
||||
let userList = _userList;
|
||||
userList = _.uniqBy(userList, 'id');
|
||||
return useCallback(() => {
|
||||
@@ -439,7 +432,7 @@ export const useOnBuildPeopleContextMenu = () => {
|
||||
};
|
||||
|
||||
export const useOnBuildDateContextMenu = () => {
|
||||
const [filter, setFilter] = useRecoilState(SharedWithMeFilterState);
|
||||
const [, setFilter] = useRecoilState(SharedWithMeFilterState);
|
||||
return useCallback(() => {
|
||||
const menuItems = [
|
||||
{
|
||||
|
||||
@@ -9,7 +9,6 @@ export type DriveItemProps = {
|
||||
checked: boolean;
|
||||
onClick?: () => void;
|
||||
onBuildContextMenu: () => Promise<any[]>;
|
||||
inPublicSharing?: boolean;
|
||||
};
|
||||
|
||||
export type DriveItemOverlayProps = {
|
||||
|
||||
@@ -5,13 +5,12 @@ import Menu from '@components/menus/menu';
|
||||
import useRouterCompany from '@features/router/hooks/use-router-company';
|
||||
import { useDrivePreview } from '@features/drive/hooks/use-drive-preview';
|
||||
import { formatBytes } from '@features/drive/utils';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useState } from 'react';
|
||||
import { PublicIcon } from '../components/public-icon';
|
||||
import { CheckableIcon, DriveItemOverlayProps, DriveItemProps } from './common';
|
||||
import './style.scss';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import RouterServices from '@features/router/services/router-service';
|
||||
import useRouteState from 'app/features/router/hooks/use-route-state';
|
||||
import { DocumentIcon } from './document-icon';
|
||||
import { hasAnyPublicLinkAccess } from '@features/files/utils/access-info-helpers';
|
||||
import { formatDateShort } from 'app/features/global/utils/Numbers';
|
||||
@@ -23,11 +22,10 @@ export const DocumentRow = ({
|
||||
checked,
|
||||
onClick,
|
||||
onBuildContextMenu,
|
||||
inPublicSharing,
|
||||
}: DriveItemProps) => {
|
||||
const history = useHistory();
|
||||
const [hover, setHover] = useState(false);
|
||||
const { open, close, isOpen } = useDrivePreview();
|
||||
const {open} = useDrivePreview();
|
||||
const company = useRouterCompany();
|
||||
|
||||
const preview = () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { DesktopComputerIcon } from '@heroicons/react/solid';
|
||||
import { Base } from '@atoms/text';
|
||||
|
||||
export const DriveItem = ({ className, onClick }: { className?: string; onClick: Function }) => {
|
||||
export const DriveItem = ({ className, onClick }: { className?: string; onClick: () => void }) => {
|
||||
return (
|
||||
<div
|
||||
className={
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { useCompanyApplications } from 'app/features/applications/hooks/use-company-applications';
|
||||
import Browser from './browser';
|
||||
import { SelectorModal } from './modals/selector';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import { useRecoilState } from 'recoil';
|
||||
import { CreateModalAtom, CreateModalAtomType } from '.';
|
||||
import { CreateModalAtom } from '.';
|
||||
import { Button } from '@atoms/button/button';
|
||||
import { Input } from '@atoms/input/input-text';
|
||||
import { Info } from '@atoms/text';
|
||||
@@ -9,7 +9,7 @@ import Languages from "features/global/services/languages-service";
|
||||
|
||||
export const CreateFolder = () => {
|
||||
const [name, setName] = useState<string>('');
|
||||
const [loading, _] = useState<boolean>(false);
|
||||
const [loading] = useState<boolean>(false);
|
||||
const [state, setState] = useRecoilState(CreateModalAtom);
|
||||
const { create } = useDriveActions();
|
||||
const inputRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Button } from '@atoms/button/button';
|
||||
import { Input } from '@atoms/input/input-text';
|
||||
import { Info } from '@atoms/text';
|
||||
import { useDriveActions } from '@features/drive/hooks/use-drive-actions';
|
||||
import { useState } from 'react';
|
||||
import { useRecoilState } from 'recoil';
|
||||
|
||||
@@ -7,9 +7,7 @@ import { Application } from '@features/applications/types/application';
|
||||
import { Transition } from '@headlessui/react';
|
||||
import {
|
||||
ChevronLeftIcon,
|
||||
DocumentDownloadIcon,
|
||||
FolderAddIcon,
|
||||
FolderDownloadIcon,
|
||||
LinkIcon,
|
||||
} from '@heroicons/react/outline';
|
||||
import { ReactNode } from 'react';
|
||||
@@ -35,8 +33,6 @@ export const CreateModalAtom = atom<CreateModalAtomType>({
|
||||
});
|
||||
|
||||
export const CreateModal = ({
|
||||
selectFromDevice,
|
||||
selectFolderFromDevice,
|
||||
addFromUrl,
|
||||
}: {
|
||||
selectFromDevice: () => void;
|
||||
|
||||
@@ -5,14 +5,12 @@ import Languages from 'features/global/services/languages-service';
|
||||
export const AccessLevel = ({
|
||||
level,
|
||||
onChange,
|
||||
canRemove,
|
||||
hiddenLevels,
|
||||
className,
|
||||
}: {
|
||||
disabled?: boolean;
|
||||
level: DriveFileAccessLevel | null;
|
||||
onChange: (level: DriveFileAccessLevel & 'remove') => void;
|
||||
canRemove?: boolean;
|
||||
className?: string;
|
||||
hiddenLevels?: string[];
|
||||
}) => {
|
||||
|
||||
@@ -4,7 +4,6 @@ import Avatar from '@atoms/avatar';
|
||||
import { Base, Info } from '@atoms/text';
|
||||
import { atom, useRecoilState } from 'recoil';
|
||||
import { useDriveItem } from '@features/drive/hooks/use-drive-item';
|
||||
import AlertManager from '@features/global/services/alert-manager-service';
|
||||
import { useCurrentUser } from '@features/users/hooks/use-current-user';
|
||||
import { useUser } from '@features/users/hooks/use-user';
|
||||
import currentUserService from '@features/users/services/current-user-service';
|
||||
@@ -55,7 +54,7 @@ const UserAccessLevel = ({
|
||||
}) => {
|
||||
const user = useUser(userId);
|
||||
const { user: currentUser } = useCurrentUser();
|
||||
const { item, loading, updateLevel } = useDriveItem(id);
|
||||
const { updateLevel } = useDriveItem(id);
|
||||
const [level, setLevel] = useState<DriveFileAccessLevel>(role == "admin" ? "manage" : "read");
|
||||
//const level = role == "admin" ? "manage" : "read";
|
||||
|
||||
@@ -78,7 +77,6 @@ const UserAccessLevel = ({
|
||||
<AccessLevel
|
||||
disabled={userId === currentUser?.id}
|
||||
level={level}
|
||||
canRemove
|
||||
onChange={level => {
|
||||
setLevel(level);
|
||||
updateLevel(userId || '', level);
|
||||
|
||||
@@ -39,7 +39,7 @@ export const SelectorModal = () => {
|
||||
);
|
||||
};
|
||||
|
||||
const SelectorModalContent = (key:any,showfiles:boolean) => {
|
||||
const SelectorModalContent = (key: any) => {
|
||||
const [state, setState] = useRecoilState(SelectorModalAtom);
|
||||
const [selected, setSelected] = useState<DriveItem[]>([]);
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
@@ -41,7 +41,7 @@ const AccessModalContent = (props: {
|
||||
onCloseModal: () => void,
|
||||
}) => {
|
||||
const { id } = props;
|
||||
const { item, access, loading, update, refresh } = useDriveItem(id);
|
||||
const { item, access, loading, refresh } = useDriveItem(id);
|
||||
const { refresh: refreshCompany } = useCurrentCompany();
|
||||
useEffect(() => {
|
||||
refresh(id);
|
||||
|
||||
@@ -1,16 +1,11 @@
|
||||
import Avatar from '@atoms/avatar';
|
||||
import A from '@atoms/link';
|
||||
import { Modal, ModalContent } from '@atoms/modal';
|
||||
import { Base } from '@atoms/text';
|
||||
import { useCompanyApplications } from '@features/applications/hooks/use-company-applications';
|
||||
import { Application } from '@features/applications/types/application';
|
||||
import { Transition } from '@headlessui/react';
|
||||
import {
|
||||
ChevronLeftIcon,
|
||||
DocumentDownloadIcon,
|
||||
FolderAddIcon,
|
||||
FolderDownloadIcon,
|
||||
LinkIcon,
|
||||
} from '@heroicons/react/outline';
|
||||
import { ReactNode } from 'react';
|
||||
import { atom, useRecoilState } from 'recoil';
|
||||
@@ -34,14 +29,12 @@ export const UploadModelAtom = atom<UploadModalAtomType>({
|
||||
export const UploadModal = ({
|
||||
selectFromDevice,
|
||||
selectFolderFromDevice,
|
||||
addFromUrl,
|
||||
}: {
|
||||
selectFromDevice: () => void;
|
||||
selectFolderFromDevice: () => void;
|
||||
addFromUrl: (url: string, name: string) => void;
|
||||
}) => {
|
||||
const [state, setState] = useRecoilState(UploadModelAtom);
|
||||
const { applications } = useCompanyApplications();
|
||||
|
||||
return (
|
||||
<Modal
|
||||
|
||||
@@ -10,7 +10,7 @@ import FeatureTogglesService, {
|
||||
FeatureNames,
|
||||
} from '@features/global/services/feature-toggles-service';
|
||||
|
||||
export default ({ sidebar }: { sidebar?: boolean }): JSX.Element => {
|
||||
export default (): JSX.Element => {
|
||||
const { user } = useCurrentUser();
|
||||
|
||||
if (!user) return <></>;
|
||||
|
||||
@@ -24,7 +24,7 @@ export const CreateModalWithUploadZones = ({ initialParentId }: { initialParentI
|
||||
const setUploadModalState = useSetRecoilState(UploadModelAtom);
|
||||
const { uploadTree, uploadFromUrl } = useDriveUpload();
|
||||
const { user } = useCurrentUser();
|
||||
const [parentId, _] = useRecoilState(
|
||||
const [ parentId ] = useRecoilState(
|
||||
DriveCurrentFolderAtom({ initialFolderId: initialParentId || 'user_'+user?.id }),
|
||||
);
|
||||
|
||||
@@ -96,7 +96,7 @@ export const CreateModalWithUploadZones = ({ initialParentId }: { initialParentI
|
||||
export default () => {
|
||||
const { user } = useCurrentUser();
|
||||
const { viewId, dirId } = useRouteState();
|
||||
const [parentId, _] = useRecoilState(DriveCurrentFolderAtom({ initialFolderId: dirId || viewId || 'user_'+user?.id }));
|
||||
const [ parentId ] = useRecoilState(DriveCurrentFolderAtom({ initialFolderId: dirId || viewId || 'user_'+user?.id }));
|
||||
const { access, item } = useDriveItem(parentId);
|
||||
const { children: trashChildren } = useDriveItem(viewId === 'trash' ? 'trash' : 'trash_'+user?.id);
|
||||
const uploadZoneRef = useRef<UploadZone | null>(null);
|
||||
|
||||
@@ -53,7 +53,7 @@ export default () => {
|
||||
<div className="sm:hidden block mb-2">
|
||||
<div className="flex flex-row space-between w-full">
|
||||
<div className="grow">
|
||||
<Account sidebar />
|
||||
<Account />
|
||||
</div>
|
||||
<AppGrid />
|
||||
</div>
|
||||
|
||||
@@ -12,7 +12,6 @@ import { Modal } from '@atoms/modal';
|
||||
import * as Text from '@atoms/text';
|
||||
import { addShortcut, removeShortcut } from '@features/global/services/shortcut-service';
|
||||
import { formatSize } from '@features/global/utils/format-file-size';
|
||||
import useRouterWorkspace from '@features/router/hooks/use-router-workspace';
|
||||
import currentUserService from '@features/users/services/current-user-service';
|
||||
import { UserType } from '@features/users/types/user';
|
||||
import {
|
||||
@@ -125,13 +124,12 @@ const Navigation = () => {
|
||||
};
|
||||
|
||||
const Footer = () => {
|
||||
const { status, close } = useFileViewer();
|
||||
const { status } = useFileViewer();
|
||||
const { download } = useViewerDisplayData();
|
||||
const { type = '' } = useViewerDisplayData();
|
||||
const user = status?.details?.user as UserType;
|
||||
const name = status.details?.metadata?.name;
|
||||
const extension = name?.split('.').pop();
|
||||
const workspaceId = useRouterWorkspace();
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user