Skip to content

Commit

Permalink
feat(app-admin): extract common functions into FM provider
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel910 committed Mar 17, 2023
1 parent cae03ac commit c589100
Show file tree
Hide file tree
Showing 85 changed files with 868 additions and 1,259 deletions.
1 change: 1 addition & 0 deletions packages/api-file-manager-s3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"@webiny/validation": "0.0.0",
"form-data": "^4.0.0",
"mdbid": "^1.0.0",
"mime": "^3.0.0",
"node-fetch": "^2.6.1",
"sanitize-filename": "^1.6.3"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import mdbid from "mdbid";
import sanitizeFilename from "sanitize-filename";
import S3 from "aws-sdk/clients/s3";
import mime from "mime";
import { validation } from "@webiny/validation";
import { PresignedPostPayloadData, PresignedPostPayloadDataResponse } from "~/types";
import { FileManagerSettings } from "@webiny/api-file-manager/types";
Expand Down Expand Up @@ -47,6 +48,12 @@ export default async (
// Replace all whitespace.
key = key.replace(/\s/g, "");

// Make sure file key contains a file extension
const ext = mime.getExtension(contentType);
if (!key.endsWith(`.${ext}`)) {
key = key + `.${ext}`;
}

const uploadMinFileSize = sanitizeFileSizeValue(settings.uploadMinFileSize, 0);
const uploadMaxFileSize = sanitizeFileSizeValue(
settings.uploadMaxFileSize,
Expand Down
3 changes: 0 additions & 3 deletions packages/app-admin/src/assets/icons/add-18px.svg

This file was deleted.

4 changes: 0 additions & 4 deletions packages/app-admin/src/assets/icons/arrow_drop_down-24px.svg

This file was deleted.

This file was deleted.

4 changes: 0 additions & 4 deletions packages/app-admin/src/assets/icons/baseline-menu-24px.svg

This file was deleted.

This file was deleted.

This file was deleted.

8 changes: 0 additions & 8 deletions packages/app-admin/src/assets/icons/filter-24px.svg

This file was deleted.

1 change: 0 additions & 1 deletion packages/app-admin/src/assets/icons/highlight-24px.svg

This file was deleted.

1 change: 0 additions & 1 deletion packages/app-admin/src/assets/icons/info.svg

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion packages/app-admin/src/assets/icons/insert_photo-24px.svg

This file was deleted.

1 change: 0 additions & 1 deletion packages/app-admin/src/assets/icons/label-24px.svg

This file was deleted.

This file was deleted.

16 changes: 0 additions & 16 deletions packages/app-admin/src/assets/icons/round-add-24px.svg

This file was deleted.

This file was deleted.

12 changes: 0 additions & 12 deletions packages/app-admin/src/assets/icons/round-chevron_right-24px.svg

This file was deleted.

54 changes: 0 additions & 54 deletions packages/app-admin/src/assets/icons/round-feedback-24px.svg

This file was deleted.

1 change: 0 additions & 1 deletion packages/app-admin/src/assets/icons/round-help-24px.svg

This file was deleted.

52 changes: 0 additions & 52 deletions packages/app-admin/src/assets/icons/round-invert_colors-24px.svg

This file was deleted.

This file was deleted.

This file was deleted.

60 changes: 0 additions & 60 deletions packages/app-admin/src/assets/icons/round-lock_open-24px.svg

This file was deleted.

12 changes: 0 additions & 12 deletions packages/app-admin/src/assets/icons/round-more_vert-24px.svg

This file was deleted.

Loading

0 comments on commit c589100

Please sign in to comment.