Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POC for MP multi-file uploader to S3 #404

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mantasmuliar
Copy link

@mantasmuliar mantasmuliar commented Aug 28, 2024

Overview

POC for Marketplace multi-file uploader.
The functionality is fully working with usage examples both for generic media file, and CSV import file uploads.

Implementation relies on Service/AwsS3 module for communication with AWS api.
Remaining modules in ZED provides internal functionality:

  • FileUpload - generic entity manager (CRUD) module for persisting uploaded files metadata in the database.
  • FileUploadMerchantPortalGui - provides API endpoints for Angular file uploader calls and GUI for listing merchant's uploaded files.
  • MerchantProductImport - entity manager module for handling uploaded import file's progress tracking.
  • MerchantProductImportMerchantPortalGui - provides GUI for tracking merchant product import files processing progress.

Usage example in frontend:

{% embed 'ZedUi/Partials/file-upload.twig' with {
    data: {
        errorType: 'Only image/png, image/jpeg file formats are allowed' | trans,
        multiple: true,
        fileData: [
            {
                size: 2,
                errorSize: 'The file should be less then 2MB' | trans,
                types: ['image/png', 'image/jpeg'],
            },
        ],
    }
} %}
    {% block textData %}
        <ul description>
            <li>
                {{ 'You can upload multiple images' | trans }}
                {{ 'Max allowed single image size - 2MB' | trans }}
            </li>
        </ul>
        <span modal-title>{{ 'Import Images' | trans }}</span>
        <span input-label>{{ 'Choose or drag your images' | trans }}</span>
        {{ 'Import Images' | trans }}
    {% endblock %}
{% endembed %}

@mantasmuliar mantasmuliar marked this pull request as draft August 28, 2024 15:42
@mantasmuliar mantasmuliar changed the title Partial POC for MP multi-file uploader to S3 POC for MP multi-file uploader to S3 Aug 28, 2024
Copy link
Contributor

@matweew matweew left a comment

Choose a reason for hiding this comment

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

so my general feedback for this PR is following:

  • modules code has to be moved under Spryker\ namespace to spryker/spryker repository
  • AWS S3 functionality can be used via the existing module spryker/file-system and adapter for S3 from spryker/flysystem-aws3v3-file-system or the adapter can be updated for this story needs.
  • (optional) FileUpload can be replaced with spryker/file-manager
  • MerchantProductImport is renamed to MerchantProductUploader
  • Functional tests are added for main modules (not GUI)
  • The modules have to be released as beta 0.1.0, so we will have opportunity to change API & DB structure later before 1.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants