From a90130e8bfc9028130ecea70bb9efe7027f2db88 Mon Sep 17 00:00:00 2001 From: diced Date: Sat, 22 Oct 2022 23:42:52 -0700 Subject: [PATCH] feat(v3.6.0-rc1): small fixes --- package.json | 6 +-- src/components/Layout.tsx | 43 ++++--------------- src/components/Theming.tsx | 5 +++ src/components/dropzone/DropzoneFile.tsx | 20 ++++----- .../pages/Manage/GeneratorModal.tsx | 2 +- src/components/pages/Manage/index.tsx | 15 +++++-- src/components/pages/UploadText.tsx | 1 + src/lib/middleware/withZipline.ts | 2 +- src/lib/util.ts | 27 +----------- src/lib/utils/crypto.ts | 26 +++++++++++ src/pages/api/stats.ts | 4 +- src/pages/api/upload.ts | 2 +- src/pages/api/user/export.ts | 2 +- src/scripts/read-config.ts | 2 +- 14 files changed, 73 insertions(+), 84 deletions(-) create mode 100644 src/lib/utils/crypto.ts diff --git a/package.json b/package.json index fc94410..91f1076 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zipline", - "version": "3.5.1", + "version": "3.6.0-rc1", "license": "MIT", "scripts": { "dev": "npm-run-all build:server dev:run", @@ -17,7 +17,7 @@ "docker:run": "docker-compose up -d", "docker:down": "docker-compose down", "docker:build-dev": "docker-compose --file docker-compose.dev.yml up --build", - "scripts:read-config": "node dist/scripts/read-config" + "scripts:read-config": "npm-run-all build:server && node dist/scripts/read-config" }, "dependencies": { "@dicedtomato/mantine-data-grid": "0.0.23", @@ -82,4 +82,4 @@ "url": "https://github.com/diced/zipline.git" }, "packageManager": "yarn@3.2.4" -} +} \ No newline at end of file diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index 2955bfc..9101281 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -21,6 +21,7 @@ import { Image, Tooltip, Badge, + Menu, } from '@mantine/core'; import { useClipboard } from '@mantine/hooks'; import { useModals } from '@mantine/modals'; @@ -194,7 +195,7 @@ export default function Layout({ children, props }) { const openResetToken = () => modals.openConfirmModal({ - title: 'Reset Token', + title: Reset Token?, children: ( Once you reset your token, you will have to update any uploaders to use this new token. @@ -227,7 +228,7 @@ export default function Layout({ children, props }) { const openCopyToken = () => modals.openConfirmModal({ - title: 'Copy Token', + title: Copy Token, children: ( Make sure you don't share this token with anyone as they will be able to upload files on your @@ -362,17 +363,10 @@ export default function Layout({ children, props }) { - - {user.username} - + + {user.username}{' '} + {user.administrator && user.username !== 'administrator' ? '(Administrator)' : ''} + } href='/dashboard/manage'> Manage Account @@ -398,20 +392,10 @@ export default function Layout({ children, props }) { } href='/auth/logout' color='red'> Logout - ({ - width: '110%', - borderTopColor: - theme.colorScheme === 'dark' ? theme.colors.dark[7] : theme.colors.gray[2], - margin: `${theme.spacing.xs / 2}px -4px`, - })} - /> + {user.oauth ? ( <> @@ -424,16 +408,7 @@ export default function Layout({ children, props }) { {user.oauthProvider} - ({ - width: '110%', - borderTopColor: - theme.colorScheme === 'dark' ? theme.colors.dark[7] : theme.colors.gray[2], - margin: `${theme.spacing.xs / 2}px -4px`, - })} - /> + ) : null} }> diff --git a/src/components/Theming.tsx b/src/components/Theming.tsx index e0b71bc..1141c7f 100644 --- a/src/components/Theming.tsx +++ b/src/components/Theming.tsx @@ -100,6 +100,11 @@ export default function ZiplineTheming({ Component, pageProps, ...props }) { overlayColor: theme.colorScheme === 'dark' ? theme.colors.dark[6] : 'white', }, }, + Loader: { + defaultProps: { + variant: 'dots', + }, + }, Card: { styles: (t) => ({ root: { diff --git a/src/components/dropzone/DropzoneFile.tsx b/src/components/dropzone/DropzoneFile.tsx index 94b5428..5c77091 100644 --- a/src/components/dropzone/DropzoneFile.tsx +++ b/src/components/dropzone/DropzoneFile.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Table, Tooltip, Badge, useMantineTheme } from '@mantine/core'; +import { Table, Tooltip, Badge, HoverCard, Text, useMantineTheme, Group } from '@mantine/core'; import Type from 'components/Type'; export function FilePreview({ file }: { file: File }) { @@ -21,10 +21,12 @@ export default function FileDropzone({ file }: { file: File }) { const theme = useMantineTheme(); return ( - + + + {file.name} + + + @@ -43,10 +45,8 @@ export default function FileDropzone({ file }: { file: File }) {
- - } - > - {file.name} -
+ + + ); } diff --git a/src/components/pages/Manage/GeneratorModal.tsx b/src/components/pages/Manage/GeneratorModal.tsx index 3121aa2..670fda8 100644 --- a/src/components/pages/Manage/GeneratorModal.tsx +++ b/src/components/pages/Manage/GeneratorModal.tsx @@ -14,7 +14,7 @@ export function GeneratorModal({ opened, onClose, title, onSubmit, ...other }) { return ( {title}} size='lg'> - {other.desc && {other.desc}} + {other.desc && {other.desc}}
onSubmit(values))}>