diff --git a/tdrive/frontend/public/locales/en.json b/tdrive/frontend/public/locales/en.json index af045d67..32927481 100644 --- a/tdrive/frontend/public/locales/en.json +++ b/tdrive/frontend/public/locales/en.json @@ -51,7 +51,6 @@ "scenes.app.workspaces.create_company.group_data.group_main_activity.administration": "Administration", "scenes.app.workspaces.create_company.group_data.group_main_activity.other": "Other", "components.drive_dropzone.uploading": "Uploading...", - "components.user_picker.modal_results_count_none": "No results found", "components.user_picker.modal.result_add.none": "No rights", "components.user_picker.modal.result_add.read": "Grant read", "components.user_picker.modal.result_add.write": "Grant write", diff --git a/tdrive/frontend/src/app/atoms/modal/confirm.tsx b/tdrive/frontend/src/app/atoms/modal/confirm.tsx index 365cef43..08327344 100644 --- a/tdrive/frontend/src/app/atoms/modal/confirm.tsx +++ b/tdrive/frontend/src/app/atoms/modal/confirm.tsx @@ -10,7 +10,7 @@ export type ConfirmModalProps = { title: string; text: string; theme?: ModalContentTheme; - icon: React.ComponentType; + icon?: React.ComponentType; skipCancelOnClose?: boolean; buttonOkTheme?: ButtonTheme; buttonOkLabel: string; @@ -40,17 +40,17 @@ export const ConfirmModal = (props: ConfirmModalProps) => { <> - + } /> diff --git a/tdrive/frontend/src/app/molecules/grouped-rows/user/index.tsx b/tdrive/frontend/src/app/molecules/grouped-rows/user/index.tsx index f6512bd2..cd483176 100644 --- a/tdrive/frontend/src/app/molecules/grouped-rows/user/index.tsx +++ b/tdrive/frontend/src/app/molecules/grouped-rows/user/index.tsx @@ -14,6 +14,7 @@ interface UserBlockProps { subtitle_suffix?: JSX.Element | string | false; user?: UserType; isSelf?: boolean; + onClick?: () => void; } export default function UserBlock(props: UserBlockProps) { @@ -22,7 +23,7 @@ export default function UserBlock(props: UserBlockProps) { suffix={props.suffix} title_suffix={props.title_suffix} subtitle_suffix={props.subtitle_suffix} - + onClick={props.onClick} avatar={ { const createOption = (level: DriveFileAccessLevelOrRemove) => !hiddenLevels?.includes(level) && ; @@ -41,7 +43,7 @@ export const AccessLevelDropdown = ({ disabled={disabled} size={size} className={className + ' w-auto'} - theme={level === 'none' ? 'rose' : 'outline'} + theme={(!noRedBobMode && level === 'none') ? 'rose' : 'outline'} value={level || 'none'} onChange={e => onChange(e.target.value as DriveFileAccessLevel & 'remove')} > diff --git a/tdrive/frontend/src/app/views/client/body/drive/modals/public-link/copy-link-button.tsx b/tdrive/frontend/src/app/views/client/body/drive/modals/public-link/copy-link-button.tsx index 78f2c6b6..7ff176be 100644 --- a/tdrive/frontend/src/app/views/client/body/drive/modals/public-link/copy-link-button.tsx +++ b/tdrive/frontend/src/app/views/client/body/drive/modals/public-link/copy-link-button.tsx @@ -25,7 +25,7 @@ export const CopyLinkButton = (props: { }} disabled={!haveTextToCopy} theme={didJustCompleteACopy ? "green" : "primary"} - className="justify-center" + className="justify-center w-64" > { didJustCompleteACopy ? diff --git a/tdrive/frontend/src/app/views/client/body/drive/modals/public-link/index.tsx b/tdrive/frontend/src/app/views/client/body/drive/modals/public-link/index.tsx index f5b507cb..6817f717 100644 --- a/tdrive/frontend/src/app/views/client/body/drive/modals/public-link/index.tsx +++ b/tdrive/frontend/src/app/views/client/body/drive/modals/public-link/index.tsx @@ -11,7 +11,7 @@ import A from '@atoms/link'; import { Subtitle } from '@atoms/text'; import { LockClosedIcon, EyeIcon, PencilIcon, ScaleIcon, EyeOffIcon } from '@heroicons/react/outline'; import { Modal, ModalContent } from '@atoms/modal'; -import { PublicLinkAccessOptions } from '../public-link/public-link-access-options'; +import { PublicLinkAccessOptions } from './public-link-access-options'; import BaseBlock from '@molecules/grouped-rows/base'; import { AccessLevelDropdown, translateAccessLevel } from '../../components/access-level-dropdown'; import { CopyLinkButton } from './copy-link-button'; @@ -93,7 +93,7 @@ const SwitchToAdvancedSettingsRow = (props: { title={Languages.t('components.public-link-security')} suffix={ { @@ -114,8 +114,7 @@ const PublicLinkModalContent = (props: { }) => { const { id } = props; const { item, access, loading, update, refresh } = useDriveItem(id); - const { item: parentItem } = useDriveItem(item?.parent_id || ''); - const { company, refresh: refreshCompany } = useCurrentCompany(); + const { refresh: refreshCompany } = useCurrentCompany(); useEffect(() => { refresh(id); refreshCompany(); diff --git a/tdrive/frontend/src/app/views/client/body/drive/modals/public-link/password-editor-row.tsx b/tdrive/frontend/src/app/views/client/body/drive/modals/public-link/password-editor-row.tsx index 45803a40..f6fc2298 100644 --- a/tdrive/frontend/src/app/views/client/body/drive/modals/public-link/password-editor-row.tsx +++ b/tdrive/frontend/src/app/views/client/body/drive/modals/public-link/password-editor-row.tsx @@ -80,7 +80,7 @@ export const PasswordEditorRow = (props: { {!!props.password?.length && !isEditingPassword && { if (!disabled) { setCurrentEditedPassword(props.password!); @@ -140,9 +140,7 @@ export const PasswordEditorRow = (props: { open={isConfirmingPasswordRemoval} title={Languages.t("components.public-link-security_password_removal_title")} text={Languages.t("components.public-link-security_password_removal_body")} - theme="danger" - icon={ShieldExclamationIcon} - buttonOkTheme='danger' + buttonOkTheme='primary' buttonOkLabel='components.public-link-security_password_removal_confirm' onClose={() => setIsConfirmingPasswordRemoval(false)} diff --git a/tdrive/frontend/src/app/views/client/body/drive/modals/update-access/index.tsx b/tdrive/frontend/src/app/views/client/body/drive/modals/update-access/index.tsx index 8dcc9ae5..91675021 100644 --- a/tdrive/frontend/src/app/views/client/body/drive/modals/update-access/index.tsx +++ b/tdrive/frontend/src/app/views/client/body/drive/modals/update-access/index.tsx @@ -25,25 +25,25 @@ export const AccessModalAtom = atom({ export const AccessModal = () => { const [state, setState] = useRecoilState(AccessModalAtom); - + const closeModal = () => setState({ ...state, open: false }); return ( setState({ ...state, open: false })} + onClose={closeModal} > - {!!state.id && } + {!!state.id && } ); }; const AccessModalContent = (props: { id: string, + onCloseModal: () => void, }) => { const { id } = props; const { item, access, loading, update, refresh } = useDriveItem(id); - const { item: parentItem } = useDriveItem(item?.parent_id || ''); - const { company, refresh: refreshCompany } = useCurrentCompany(); + const { refresh: refreshCompany } = useCurrentCompany(); useEffect(() => { refresh(id); refreshCompany(); @@ -60,7 +60,7 @@ const AccessModalContent = (props: { >
{FeatureTogglesService.isActiveFeatureName(FeatureNames.COMPANY_SEARCH_USERS) && ( - + )}
diff --git a/tdrive/frontend/src/app/views/client/body/drive/modals/update-access/internal-access.tsx b/tdrive/frontend/src/app/views/client/body/drive/modals/update-access/internal-access.tsx index 6bb2e92d..8af6aed1 100644 --- a/tdrive/frontend/src/app/views/client/body/drive/modals/update-access/internal-access.tsx +++ b/tdrive/frontend/src/app/views/client/body/drive/modals/update-access/internal-access.tsx @@ -17,7 +17,15 @@ import { InputDecorationIcon } from '@atoms/input/input-decoration-icon'; import { AccessLevelDropdown } from '../../components/access-level-dropdown'; import UserBlock from '@molecules/grouped-rows/user'; -export const InternalAccessManager = ({ id, disabled }: { id: string; disabled: boolean }) => { +export const InternalAccessManager = ({ + id, + disabled, + onCloseModal, +}: { + id: string; + disabled: boolean; + onCloseModal: () => void, +}) => { const { item, loading, update } = useDriveItem(id); const [level, setLevel] = useState('manage'); const usersWithAccess = item && getAllUserAccesses(item); @@ -113,6 +121,7 @@ export const InternalAccessManager = ({ id, disabled }: { id: string; disabled:
{showResults && <> -
+
{/* Necessary so the relative results don't take height */} -
+
{ shownResults && shownResults.map((user, index) => 0 && index !== ((selectedKeyIndex ?? 0) + 1) ? ' border-t' : ''))} + className={'hover:bg-zinc-300 dark:hover:bg-zinc-700 cursor-pointer !border-x-0' + (index === selectedKeyIndex ? ' ring' : (index > 0 && index !== ((selectedKeyIndex ?? 0) + 1) ? ' border-t' : ''))} isSearchResultAdd={level} onAddSearchResult={(userId) => { item && update(changeUserAccess(item, userId, level)); @@ -139,7 +148,7 @@ export const InternalAccessManager = ({ id, disabled }: { id: string; disabled: /> )} {!loading && resultFooterText && <> -
+
{resultFooterText}
} @@ -166,6 +175,16 @@ export const InternalAccessManager = ({ id, disabled }: { id: string; disabled:
 
}
+
+ +
); }; @@ -186,11 +205,11 @@ const UserAccessLevel = (props: { className={"p-4 border-x dark:border-zinc-700" + ' ' + (props.className ?? '')} user={user} isSelf={!!currentUser?.id && user?.id === currentUser?.id} + onClick={() => props.isSearchResultAdd && user && props.onAddSearchResult!(props.userId)} suffix={ props.isSearchResultAdd ?