Merge branch 'main' into release/v1.0.5
This commit is contained in:
@@ -122,13 +122,13 @@ export const useDriveItem = (id: string) => {
|
||||
}));
|
||||
}
|
||||
// set children and remove duplicates
|
||||
setChildren(prev => [
|
||||
...prev,
|
||||
...details.children.filter(
|
||||
(item, index, self) =>
|
||||
index === self.findIndex(t => t.id === item.id),
|
||||
),
|
||||
]);
|
||||
setChildren(prev => {
|
||||
// Create a Map for existing IDs for fast lookups
|
||||
const existingIds = new Map(prev.map(item => [item.id, true]));
|
||||
|
||||
// Filter children while adding them to the state
|
||||
return [...prev, ...details.children.filter(item => !existingIds.has(item.id))];
|
||||
});
|
||||
} catch (e) {
|
||||
// set pagination end to true
|
||||
set(DriveItemPagination, prev => ({
|
||||
@@ -140,7 +140,7 @@ export const useDriveItem = (id: string) => {
|
||||
} finally {
|
||||
set(DriveItemPagination, prev => ({
|
||||
...prev,
|
||||
page: (prev.page + prev.limit),
|
||||
page: prev.page + prev.limit,
|
||||
}));
|
||||
}
|
||||
setLoading(false);
|
||||
|
||||
@@ -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',
|
||||
@@ -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,
|
||||
|
||||
@@ -49,11 +49,11 @@ const ConfirmTrashModalContent = ({ items }: { items: DriveItem[] }) => {
|
||||
return (
|
||||
<ModalContent
|
||||
title={
|
||||
items.length === 1 ? Languages.t('compenents.ConfirmTrashModalContent_move') + " '" + item?.name + "' " + Languages.t('compenents.ConfirmTrashModalContent_to_trash') : Languages.t('compenents.ConfirmTrashModalContent_move') + " " + items.length + " " + Languages.t('compenents.ConfirmTrashModalContent_items_to_trash')
|
||||
items.length === 1 ? Languages.t('components.ConfirmTrashModalContent_move') + " '" + item?.name + "' " + Languages.t('components.ConfirmTrashModalContent_to_trash') : Languages.t('components.ConfirmTrashModalContent_move') + " " + items.length + " " + Languages.t('components.ConfirmTrashModalContent_items_to_trash')
|
||||
}
|
||||
>
|
||||
<Base className="block my-3">
|
||||
{Languages.t('compenents.ConfirmTrashModalContent_move_to_trash_desc')}
|
||||
{Languages.t('components.ConfirmTrashModalContent_move_to_trash_desc')}
|
||||
</Base>
|
||||
<br />
|
||||
<Button
|
||||
@@ -75,7 +75,7 @@ const ConfirmTrashModalContent = ({ items }: { items: DriveItem[] }) => {
|
||||
setState({ ...state, open: false });
|
||||
}}
|
||||
>
|
||||
{Languages.t('compenents.ConfirmTrashModalContent_move_to_trash')}
|
||||
{Languages.t('components.ConfirmTrashModalContent_move_to_trash')}
|
||||
</Button>
|
||||
</ModalContent>
|
||||
);
|
||||
|
||||
@@ -49,7 +49,7 @@ const VersionModalContent = ({ id }: { id: string }) => {
|
||||
if (!item?.last_version_cache) return <></>;
|
||||
|
||||
return (
|
||||
<ModalContent title={Languages.t('compenents.VersionModalContent_version') + " " + item?.name}>
|
||||
<ModalContent title={Languages.t('components.VersionModalContent_version') + " " + item?.name}>
|
||||
<UploadZone
|
||||
overClassName={'!m-4'}
|
||||
disableClick
|
||||
@@ -70,7 +70,7 @@ const VersionModalContent = ({ id }: { id: string }) => {
|
||||
<div className="flex flex-row">
|
||||
<div className="grow flex items-center">
|
||||
<Base>
|
||||
{Languages.t('compenents.VersionModalContent_version_dec')}
|
||||
{Languages.t('components.VersionModalContent_version_dec')}
|
||||
</Base>
|
||||
</div>
|
||||
<div className="shrink-0 ml-4 flex items-center">
|
||||
@@ -79,7 +79,7 @@ const VersionModalContent = ({ id }: { id: string }) => {
|
||||
onClick={() => uploadZoneRef.current?.open()}
|
||||
loading={loading}
|
||||
>
|
||||
{Languages.t('compenents.VersionModalContent_create')}
|
||||
{Languages.t('components.VersionModalContent_create')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -109,7 +109,7 @@ const VersionModalContent = ({ id }: { id: string }) => {
|
||||
</div>
|
||||
<div className="shrink-0 ml-4">
|
||||
<Button theme="outline" onClick={() => download(id, version.id)}>
|
||||
{Languages.t('compenents.VersionModalContent_donwload')}
|
||||
{Languages.t('components.VersionModalContent_donwload')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import { Button } from '@atoms/button/button';
|
||||
import { Input } from '@atoms/input/input-text';
|
||||
import { AdjustmentsIcon, SearchIcon } from '@heroicons/react/outline';
|
||||
import { SearchIcon } from '@heroicons/react/outline';
|
||||
import { InputDecorationIcon } from '@atoms/input/input-decoration-icon';
|
||||
import Languages from '@features/global/services/languages-service';
|
||||
import RouterServices from '@features/router/services/router-service';
|
||||
import { useSearchModal } from '@features/search/hooks/use-search';
|
||||
import { SearchInputState } from '@features/search/state/search-input';
|
||||
import { useRecoilState } from 'recoil';
|
||||
import { ToasterService } from 'app/features/global/services/toaster-service';
|
||||
import { XIcon } from 'app/atoms/icons-agnostic';
|
||||
|
||||
export default (): JSX.Element => {
|
||||
const { workspaceId, channelId } = RouterServices.getStateFromRoute();
|
||||
@@ -31,6 +30,12 @@ export default (): JSX.Element => {
|
||||
prefix={() => (
|
||||
<SearchIcon className={'h-5 w-5 absolute m-auto top-0 bottom-0 left-3 text-blue-500'} />
|
||||
)}
|
||||
suffix={() =>
|
||||
<XIcon
|
||||
className={'h-4 w-4 absolute m-auto top-0 bottom-0 right-3 cursor-pointer text-zinc-500 ' + (searchState.query?.length ? '' : 'hidden')}
|
||||
onClick={() => setSearchState({ ...searchState, query: '' }) }
|
||||
/>
|
||||
}
|
||||
input={({ className }) => (
|
||||
<Input
|
||||
value={searchState.query}
|
||||
|
||||
@@ -348,10 +348,10 @@ export default class CreateCompanyView extends Component {
|
||||
}}
|
||||
>
|
||||
<div className="subtitle bottom-margin">
|
||||
{this.state.i18n.t('scenes.app.workspaces.create_company.importations.title_1')}{' '}
|
||||
{this.state.i18n.t('scenes.app.workspaces.create_company.imports.title_1')}{' '}
|
||||
<Emojione type=":tools:" />
|
||||
<br />
|
||||
{this.state.i18n.t('scenes.app.workspaces.create_company.importations.title_2')}
|
||||
{this.state.i18n.t('scenes.app.workspaces.create_company.imports.title_2')}
|
||||
</div>
|
||||
<div className="integrations">
|
||||
{[0, 0, 0, 0, 0, 0, 0, 0, 0].map(item => {
|
||||
|
||||
@@ -54,7 +54,7 @@ export default () => {
|
||||
server_infos?.configuration?.branding?.name,
|
||||
server_infos?.configuration?.branding.link || 'tdrive.app',
|
||||
])}
|
||||
<Typography.Link onClick={() => window.open('https://tdriveapp.com', 'blank')}>
|
||||
<Typography.Link onClick={() => window.open('https://drive.twake.app', 'blank')}>
|
||||
{Languages.t('scenes.login.footer.go_to_tdrive')}
|
||||
</Typography.Link>
|
||||
{' - ' + Globals.version.version}
|
||||
@@ -63,7 +63,7 @@ export default () => {
|
||||
{server_infos_loaded && !server_infos?.configuration?.branding?.name && (
|
||||
<Typography.Link
|
||||
className="fade_in"
|
||||
onClick={() => window.open('https://tdriveapp.com', 'blank')}
|
||||
onClick={() => window.open('https://drive.twake.app', 'blank')}
|
||||
>
|
||||
{Languages.t('scenes.login.footer.go_to_tdrive')}
|
||||
</Typography.Link>
|
||||
|
||||
Reference in New Issue
Block a user