Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c0d0f6fa90 | ||
|
|
4a016ed57d | ||
|
|
5ea63fb60b | ||
|
|
57cb683c64 | ||
|
|
783b8c2e91 | ||
|
|
75f57a4e57 | ||
|
|
eb142b75f7 |
3
.github/workflows/backend-system-tests.yml
vendored
3
.github/workflows/backend-system-tests.yml
vendored
@@ -17,9 +17,6 @@ jobs:
|
||||
- name: Install Dependencies
|
||||
working-directory: ./backend
|
||||
run: npm install
|
||||
- name: Create .env file
|
||||
working-directory: ./backend
|
||||
run: mv .env.example .env
|
||||
- name: Run Server and Test with Newman
|
||||
working-directory: ./backend
|
||||
run: npm run test:system
|
||||
|
||||
16
CHANGELOG.md
16
CHANGELOG.md
@@ -1,3 +1,19 @@
|
||||
### [0.3.2](https://github.com/stonith404/pingvin-share/compare/v0.3.1...v0.3.2) (2022-12-07)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* make share password optional ([57cb683](https://github.com/stonith404/pingvin-share/commit/57cb683c64eaedec2697ea6863948bd2ae68dd75))
|
||||
* unauthenticated dialog not shown ([4a016ed](https://github.com/stonith404/pingvin-share/commit/4a016ed57db526ee900c567f7b7f0991f948c631))
|
||||
* use session storage for share token ([5ea63fb](https://github.com/stonith404/pingvin-share/commit/5ea63fb60be0c508c38ba228cc8ac6dd7b403aac))
|
||||
|
||||
### [0.3.1](https://github.com/stonith404/pingvin-share/compare/v0.3.0...v0.3.1) (2022-12-05)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* dropzone rejection on chrome ([75f57a4](https://github.com/stonith404/pingvin-share/commit/75f57a4e57fb13cc62e87428e8302b453ea6b44b))
|
||||
|
||||
## [0.3.0](https://github.com/stonith404/pingvin-share/compare/v0.2.0...v0.3.0) (2022-12-05)
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { IsString } from "class-validator";
|
||||
import { IsOptional, IsString } from "class-validator";
|
||||
|
||||
export class SharePasswordDto {
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
password: string;
|
||||
}
|
||||
|
||||
14
frontend/package-lock.json
generated
14
frontend/package-lock.json
generated
@@ -10,13 +10,13 @@
|
||||
"dependencies": {
|
||||
"@emotion/react": "^11.10.5",
|
||||
"@emotion/server": "^11.10.0",
|
||||
"@mantine/core": "^5.9.1",
|
||||
"@mantine/dropzone": "^5.9.1",
|
||||
"@mantine/form": "^5.9.1",
|
||||
"@mantine/hooks": "^5.9.1",
|
||||
"@mantine/modals": "^5.9.1",
|
||||
"@mantine/next": "^5.9.1",
|
||||
"@mantine/notifications": "^5.9.1",
|
||||
"@mantine/core": "^5.9.2",
|
||||
"@mantine/dropzone": "^5.9.2",
|
||||
"@mantine/form": "^5.9.2",
|
||||
"@mantine/hooks": "^5.9.2",
|
||||
"@mantine/modals": "^5.9.2",
|
||||
"@mantine/next": "^5.9.2",
|
||||
"@mantine/notifications": "^5.9.2",
|
||||
"axios": "^1.2.0",
|
||||
"cookies-next": "^2.1.1",
|
||||
"file-saver": "^2.0.5",
|
||||
|
||||
@@ -11,13 +11,13 @@
|
||||
"dependencies": {
|
||||
"@emotion/react": "^11.10.5",
|
||||
"@emotion/server": "^11.10.0",
|
||||
"@mantine/core": "^5.9.1",
|
||||
"@mantine/dropzone": "^5.9.1",
|
||||
"@mantine/form": "^5.9.1",
|
||||
"@mantine/hooks": "^5.9.1",
|
||||
"@mantine/modals": "^5.9.1",
|
||||
"@mantine/next": "^5.9.1",
|
||||
"@mantine/notifications": "^5.9.1",
|
||||
"@mantine/core": "^5.9.2",
|
||||
"@mantine/dropzone": "^5.9.2",
|
||||
"@mantine/form": "^5.9.2",
|
||||
"@mantine/hooks": "^5.9.2",
|
||||
"@mantine/modals": "^5.9.2",
|
||||
"@mantine/next": "^5.9.2",
|
||||
"@mantine/notifications": "^5.9.2",
|
||||
"axios": "^1.2.0",
|
||||
"cookies-next": "^2.1.1",
|
||||
"file-saver": "^2.0.5",
|
||||
|
||||
@@ -45,12 +45,6 @@ const Dropzone = ({
|
||||
return (
|
||||
<div className={classes.wrapper}>
|
||||
<MantineDropzone
|
||||
// Temporary fix for Dropzone issue (https://github.com/mantinedev/mantine/issues/3115)
|
||||
getFilesFromEvent={(e) => {
|
||||
return Promise.resolve([
|
||||
...((e.target as EventTarget & HTMLInputElement)?.files as any),
|
||||
]);
|
||||
}}
|
||||
maxSize={parseInt(config.get("MAX_FILE_SIZE"))}
|
||||
onReject={(e) => {
|
||||
toast.error(e[0].errors[0].message);
|
||||
|
||||
@@ -29,8 +29,8 @@ const showCreateUploadModal = (
|
||||
modals: ModalsContextProps,
|
||||
options: {
|
||||
isUserSignedIn: boolean;
|
||||
ALLOW_UNAUTHENTICATED_SHARES: boolean;
|
||||
ENABLE_EMAIL_RECIPIENTS: boolean;
|
||||
allowUnauthenticatedShares: boolean;
|
||||
enableEmailRecepients: boolean;
|
||||
},
|
||||
uploadCallback: (
|
||||
id: string,
|
||||
@@ -62,15 +62,13 @@ const CreateUploadModalBody = ({
|
||||
) => void;
|
||||
options: {
|
||||
isUserSignedIn: boolean;
|
||||
ALLOW_UNAUTHENTICATED_SHARES: boolean;
|
||||
ENABLE_EMAIL_RECIPIENTS: boolean;
|
||||
allowUnauthenticatedShares: boolean;
|
||||
enableEmailRecepients: boolean;
|
||||
};
|
||||
}) => {
|
||||
const modals = useModals();
|
||||
|
||||
const [showNotSignedInAlert, setShowNotSignedInAlert] = useState(
|
||||
options.ENABLE_EMAIL_RECIPIENTS
|
||||
);
|
||||
const [showNotSignedInAlert, setShowNotSignedInAlert] = useState(true);
|
||||
|
||||
const validationSchema = yup.object().shape({
|
||||
link: yup
|
||||
@@ -230,7 +228,7 @@ const CreateUploadModalBody = ({
|
||||
{ExpirationPreview({ form })}
|
||||
</Text>
|
||||
<Accordion>
|
||||
{options.ENABLE_EMAIL_RECIPIENTS && (
|
||||
{options.enableEmailRecepients && (
|
||||
<Accordion.Item value="recipients" sx={{ borderBottom: "none" }}>
|
||||
<Accordion.Control>Email recipients</Accordion.Control>
|
||||
<Accordion.Panel>
|
||||
|
||||
@@ -105,21 +105,19 @@ const Upload = () => {
|
||||
<Button
|
||||
loading={isUploading}
|
||||
disabled={files.length <= 0}
|
||||
onClick={() =>
|
||||
onClick={() => {
|
||||
showCreateUploadModal(
|
||||
modals,
|
||||
{
|
||||
isUserSignedIn: user ? true : false,
|
||||
ALLOW_UNAUTHENTICATED_SHARES: config.get(
|
||||
allowUnauthenticatedShares: config.get(
|
||||
"ALLOW_UNAUTHENTICATED_SHARES"
|
||||
),
|
||||
ENABLE_EMAIL_RECIPIENTS: config.get(
|
||||
"ENABLE_EMAIL_RECIPIENTS"
|
||||
),
|
||||
enableEmailRecepients: config.get("ENABLE_EMAIL_RECIPIENTS"),
|
||||
},
|
||||
uploadFiles
|
||||
)
|
||||
}
|
||||
);
|
||||
}}
|
||||
>
|
||||
Share
|
||||
</Button>
|
||||
|
||||
@@ -21,7 +21,7 @@ const completeShare = async (id: string) => {
|
||||
};
|
||||
|
||||
const get = async (id: string): Promise<Share> => {
|
||||
const shareToken = localStorage.getItem(`share_${id}_token`);
|
||||
const shareToken = sessionStorage.getItem(`share_${id}_token`);
|
||||
return (
|
||||
await api.get(`shares/${id}`, {
|
||||
headers: { "X-Share-Token": shareToken ?? "" },
|
||||
@@ -30,7 +30,7 @@ const get = async (id: string): Promise<Share> => {
|
||||
};
|
||||
|
||||
const getMetaData = async (id: string): Promise<ShareMetaData> => {
|
||||
const shareToken = localStorage.getItem(`share_${id}_token`);
|
||||
const shareToken = sessionStorage.getItem(`share_${id}_token`);
|
||||
return (
|
||||
await api.get(`shares/${id}/metaData`, {
|
||||
headers: { "X-Share-Token": shareToken ?? "" },
|
||||
@@ -49,7 +49,7 @@ const getMyShares = async (): Promise<MyShare[]> => {
|
||||
const getShareToken = async (id: string, password?: string) => {
|
||||
const { token } = (await api.post(`/shares/${id}/token`, { password })).data;
|
||||
|
||||
localStorage.setItem(`share_${id}_token`, token);
|
||||
sessionStorage.setItem(`share_${id}_token`, token);
|
||||
};
|
||||
|
||||
const isShareIdAvailable = async (id: string): Promise<boolean> => {
|
||||
@@ -57,7 +57,7 @@ const isShareIdAvailable = async (id: string): Promise<boolean> => {
|
||||
};
|
||||
|
||||
const getFileDownloadUrl = async (shareId: string, fileId: string) => {
|
||||
const shareToken = localStorage.getItem(`share_${shareId}_token`);
|
||||
const shareToken = sessionStorage.getItem(`share_${shareId}_token`);
|
||||
return (
|
||||
await api.get(`shares/${shareId}/files/${fileId}/download`, {
|
||||
headers: { "X-Share-Token": shareToken ?? "" },
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "pingvin-share",
|
||||
"version": "0.3.0",
|
||||
"version": "0.3.2",
|
||||
"scripts": {
|
||||
"format": "cd frontend && npm run format && cd ../backend && npm run format",
|
||||
"lint": "cd frontend && npm run lint && cd ../backend && npm run lint",
|
||||
|
||||
Reference in New Issue
Block a user