Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Commit

Permalink
Merge pull request #366 from mgilangjanuar/staging
Browse files Browse the repository at this point in the history
Release v2.5.1
  • Loading branch information
mgilangjanuar authored Jun 7, 2022
2 parents d7ce729 + 36f4ea4 commit 0af651c
Show file tree
Hide file tree
Showing 12 changed files with 105 additions and 19 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ COPY package.json .
COPY api/package.json api/package.json
COPY web/package.json web/package.json
COPY docker/.env .
RUN yarn install
RUN yarn cache clean
RUN yarn install --network-timeout 1000000
COPY . .
RUN yarn workspaces run build
4 changes: 2 additions & 2 deletions api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "api",
"version": "2.5.0",
"version": "2.5.1",
"main": "dist/index.js",
"license": "MIT",
"private": true,
Expand Down Expand Up @@ -85,4 +85,4 @@
"rimraf": "^3.0.2",
"typescript": "^4.4.2"
}
}
}
8 changes: 8 additions & 0 deletions api/src/api/v1/Files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,14 @@ export class Files {
{ NOT: { name: { endsWith: '11' } } },
{ NOT: { name: { endsWith: '111' } } },
{ NOT: { name: { endsWith: '1111' } } },
{ NOT: { name: { endsWith: '21' } } },
{ NOT: { name: { endsWith: '31' } } },
{ NOT: { name: { endsWith: '41' } } },
{ NOT: { name: { endsWith: '51' } } },
{ NOT: { name: { endsWith: '61' } } },
{ NOT: { name: { endsWith: '71' } } },
{ NOT: { name: { endsWith: '81' } } },
{ NOT: { name: { endsWith: '91' } } },
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "teledrive",
"version": "2.5.0",
"version": "2.5.1",
"repository": "git@github.com:mgilangjanuar/teledrive.git",
"author": "M Gilang Januar <mgilangjanuar@teledriveapp.com>",
"license": "MIT",
Expand Down
4 changes: 2 additions & 2 deletions web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "web",
"version": "2.5.0",
"version": "2.5.1",
"private": true,
"dependencies": {
"@ideasio/add-to-homescreen-react": "^1.0.10",
Expand Down Expand Up @@ -109,4 +109,4 @@
"workbox-strategies": "^5.1.3",
"workbox-streams": "^5.1.3"
}
}
}
27 changes: 24 additions & 3 deletions web/src/pages/#.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,14 @@ const Login: React.FC<Props> = ({ me }) => {
setLoadingSendCode(false)
notification.error({
message: 'Error',
description: error?.response?.data?.error || error.message || 'Something error'
description: <>
<Typography.Paragraph>
{error?.response?.data?.error || error.message || 'Something error'}
</Typography.Paragraph>
<Typography.Paragraph code>
{JSON.stringify(error?.response?.data || error?.data || error, null, 2)}
</Typography.Paragraph>
</>
})
if (error?.status === 400 || error?.response?.status === 400) {
await fetch()
Expand Down Expand Up @@ -194,7 +201,14 @@ const Login: React.FC<Props> = ({ me }) => {
}
return notification.error({
message: 'Error',
description: error?.response?.data?.error || error.message || 'Something error'
description: <>
<Typography.Paragraph>
{error?.response?.data?.error || error.message || 'Something error'}
</Typography.Paragraph>
<Typography.Paragraph code>
{JSON.stringify(error?.response?.data || error?.data || error, null, 2)}
</Typography.Paragraph>
</>
})
}
}
Expand Down Expand Up @@ -324,7 +338,14 @@ const Login: React.FC<Props> = ({ me }) => {
setLoadingLogin(false)
return notification.error({
message: 'Error',
description: error.response?.data?.error || 'Something error'
description: <>
<Typography.Paragraph>
{error?.response?.data?.error || error.message || 'Something error'}
</Typography.Paragraph>
<Typography.Paragraph code>
{JSON.stringify(error?.response?.data || error?.data || error, null, 2)}
</Typography.Paragraph>
</>
})
}
}
Expand Down
9 changes: 8 additions & 1 deletion web/src/pages/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,14 @@ const Settings: React.FC<Props> = ({ me, mutate, error }) => {
return window.location.replace('/')
} catch (error: any) {
setLoadingRemove(false)
return notification.error({ message: 'Error', description: error.response?.data.error })
return notification.error({ message: 'Error', description: <>
<Typography.Paragraph>
{error?.response?.data?.error || error.message || 'Something error'}
</Typography.Paragraph>
<Typography.Paragraph code>
{JSON.stringify(error?.response?.data || error?.data || error, null, 2)}
</Typography.Paragraph>
</> })
}
}

Expand Down
27 changes: 24 additions & 3 deletions web/src/pages/admin/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,14 @@ const Admin: FC<Props> = ({ me, errorMe }) => {
} catch (error: any) {
return notification.error({
message: error?.response?.status || 'Something error',
...error?.response?.data ? { description: error.response.data.error } : {}
...error?.response?.data ? { description: <>
<Typography.Paragraph>
{error?.response?.data?.error || error.message || 'Something error'}
</Typography.Paragraph>
<Typography.Paragraph code>
{JSON.stringify(error?.response?.data || error?.data || error, null, 2)}
</Typography.Paragraph>
</> } : {}
})
}
}
Expand Down Expand Up @@ -198,7 +205,14 @@ const Admin: FC<Props> = ({ me, errorMe }) => {
}).catch(error => {
notification.error({
message: error?.response?.status || 'Something error',
...error?.response?.data ? { description: error.response.data.error } : {}
...error?.response?.data ? { description: <>
<Typography.Paragraph>
{error?.response?.data?.error || error.message || 'Something error'}
</Typography.Paragraph>
<Typography.Paragraph code>
{JSON.stringify(error?.response?.data || error?.data || error, null, 2)}
</Typography.Paragraph>
</> } : {}
})
})
}} />
Expand All @@ -210,7 +224,14 @@ const Admin: FC<Props> = ({ me, errorMe }) => {
}).catch(error => {
notification.error({
message: error?.response?.status || 'Something error',
...error?.response?.data ? { description: error.response.data.error } : {}
...error?.response?.data ? { description: <>
<Typography.Paragraph>
{error?.response?.data?.error || error.message || 'Something error'}
</Typography.Paragraph>
<Typography.Paragraph code>
{JSON.stringify(error?.response?.data || error?.data || error, null, 2)}
</Typography.Paragraph>
</> } : {}
})
})
}}>
Expand Down
9 changes: 8 additions & 1 deletion web/src/pages/dashboard/components/Messaging.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,14 @@ const Messaging: React.FC<Props> = ({ me, collapsed, parent, setCollapsed }) =>
setLoadingSend(false)
return notification.error({
message: 'Error',
description: error?.response.data?.error || 'Something error, please try again.'
description: <>
<Typography.Paragraph>
{error?.response?.data?.error || error.message || 'Something error'}
</Typography.Paragraph>
<Typography.Paragraph code>
{JSON.stringify(error?.response?.data || error?.data || error, null, 2)}
</Typography.Paragraph>
</>
})
}
return setLoadingSend(false)
Expand Down
20 changes: 17 additions & 3 deletions web/src/pages/dashboard/components/Upload.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CloudUploadOutlined } from '@ant-design/icons'
import { notification, Upload as BaseUpload } from 'antd'
import { notification, Typography, Upload as BaseUpload } from 'antd'
import mime from 'mime-types'
import React, { useEffect, useRef } from 'react'
import { Api } from 'teledrive-client'
Expand Down Expand Up @@ -37,7 +37,14 @@ const Upload: React.FC<Props> = ({ dataFileList: [fileList, setFileList], parent
await new Promise(res => setTimeout(res, 3000 * ++retry))
await cb?.()
if (retry === RETRY_COUNT) {
notification.error({ message: 'Failed to upload file', description: error.message })
notification.error({ message: 'Failed to upload file', description: <>
<Typography.Paragraph>
{error?.response?.data?.error || error.message || 'Something error'}
</Typography.Paragraph>
<Typography.Paragraph code>
{JSON.stringify(error?.response?.data || error?.data || error, null, 2)}
</Typography.Paragraph>
</> })
throw error
}
}
Expand Down Expand Up @@ -275,7 +282,14 @@ const Upload: React.FC<Props> = ({ dataFileList: [fileList, setFileList], parent
notification.error({
key: 'fileUploadError',
message: error?.response?.status || 'Something error',
...error?.response?.data ? { description: error.response.data.error } : {}
...error?.response?.data ? { description: <>
<Typography.Paragraph>
{error?.response?.data?.error || error.message || 'Something error'}
</Typography.Paragraph>
<Typography.Paragraph code>
{JSON.stringify(error?.response?.data || error?.data || error, null, 2)}
</Typography.Paragraph>
</> } : {}
})
// filesWantToUpload.current = filesWantToUpload.current?.map(f => f.uid === file.uid ? { ...f, status: 'done' } : f)
filesWantToUpload.current = filesWantToUpload.current?.map(f => f.uid === file.uid ? null : f).filter(Boolean)
Expand Down
9 changes: 8 additions & 1 deletion web/src/pages/dashboard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,14 @@ const Dashboard: React.FC<PageProps & { me?: any, errorMe?: any }> = ({ match })
}
return notification.error({
message: error?.response?.status || 'Something error',
...error?.response?.data ? { description: error.response.data.error } : {}
...error?.response?.data ? { description: <>
<Typography.Paragraph>
{error?.response?.data?.error || error.message || 'Something error'}
</Typography.Paragraph>
<Typography.Paragraph code>
{JSON.stringify(error?.response?.data || error?.data || error, null, 2)}
</Typography.Paragraph>
</> } : {}
})
} finally {
setSyncConfirmation(false)
Expand Down
2 changes: 1 addition & 1 deletion web/src/utils/Constant.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const VERSION = '2.5.0'
export const VERSION = '2.5.1'
export const MAX_UPLOAD_SIZE = 2_000_000_000
export const CHUNK_SIZE = 512 * 1024
export const RETRY_COUNT = 50

1 comment on commit 0af651c

@vercel
Copy link

@vercel vercel bot commented on 0af651c Jun 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please # to comment.