ahmedkandel / nova-s3-multipart-upload

A Laravel Nova resource tool to upload files directly to Amazon S3. You can (upload | download | delete) single, multiple, small or big files.
MIT License
23 stars 22 forks source link

Laravel Nova 4 compatibility #26

Closed ngunyimacharia closed 9 months ago

ngunyimacharia commented 2 years ago
ngunyimacharia commented 2 years ago

@ahmedkandel have you had a chance to look into this PR?

ahmedkandel commented 2 years ago

Thanks @ngunyimacharia for the PR, I had a quick look at the PR and have some comments as soon as possible will discuss them with you as currently i'm so busy but hope to get a chance within the next weeks.

tractorcow commented 2 years ago

I've done a bit of initial testing, I had a few issues with some of the routes.

E.g. http://localhost:8000/nova-vendor/nova-s3-multipart-upload/media/1/key/files was 404ing, due to FilesController::init() not being able to pull out the upload panel.

tractorcow commented 2 years ago

If I change init() to the below it works.

private function init($request)
    {
        $resource = $request->findResourceOrFail();

        $this->model = $resource->model();

        $fields = $resource->availableFields($request)
            ->map(
                fn($field) => $field instanceof ResourceToolElement
                    ? $field->assignedPanel
                    : $field
            );

        $this->tool = $fields
            ->whereInstanceOf(NovaS3MultipartUpload::class)
            ->firstWhere('attribute', $request->route('field'));

        abort_unless($this->tool, 404);
    }
tractorcow commented 2 years ago

@ngunyimacharia any context you have that might explain the above?

ngunyimacharia commented 2 years ago

Hey @tractorcow, thank you for the feedback. Will look into this sometime today and get back to you.

ngunyimacharia commented 2 years ago

Hey @tractorcow , thank you for your feedback once again. I have reviewed and tested your fix locally. It works well as well as simplifies the code. I have added them to this PR to make the review process easier. Let me know if anything else comes up.

tractorcow commented 2 years ago

Awesome work @ngunyimacharia . I'll continue testing and let you know how I get along.

tractorcow commented 2 years ago

Since nova 4 has dark / light theme support, we might need to adjust some of the styles for supporting both. I've noticed the current styles only really supports light theme, but looks a bit odd on dark.

image

image

tractorcow commented 2 years ago

Some of the buttons on light theme still need tweaking. image

tractorcow commented 2 years ago

Everything else is working perfectly, good job. 👍

ngunyimacharia commented 2 years ago

Thank you for the feedback @tractorcow. Will get the PR updated early this week 🙇🏿

mykkode commented 2 years ago

I've done some UI changes, maybe @ngunyimacharia has some to review them. https://github.com/ngunyimacharia/nova-s3-multipart-upload/pull/1

Screenshot 2022-10-10 174356 Screenshot 2022-10-10 174429 Screenshot 2022-10-10 174443 Screenshot 2022-10-10 174458 Screenshot 2022-10-10 174513 Screenshot 2022-10-10 174335

tractorcow commented 2 years ago

That looks really cool. Nice job. 👍

ahmedkandel commented 2 years ago

Thanks @ngunyimacharia @tractorcow @mykkode for your collaboration. Please let me know when this PR is ready for review and merging.

flexgrip commented 2 years ago

I just tried this on a fresh install of nova 4 and the field just won't show up. I don't see anything in the logs but I'll be digging in. If you guys have any ideas what would cause that, let me know.

flexgrip commented 2 years ago

Ha. Nevermind. I am so dumb. This is a resource tool, not a field 🤣

ahmadbaignbs commented 10 months ago

When are you merging this PR for Nova 4?

ngunyimacharia commented 9 months ago

Hey @ahmedkandel, all the feedback has been integrated into the PR. Feel free to re-review. cc @tractorcow, @mykkode

ahmedkandel commented 9 months ago

Hi @ngunyimacharia, thanks for the updates 👍, i have added some comments can you check them?

ngunyimacharia commented 9 months ago

Hey @ahmedkandel , thank you for your feedback. I've resolved some of the comments. Feel free to review and let me know if anything is still pending.

ahmedkandel commented 9 months ago

Great job @ngunyimacharia 👍

ahmedkandel commented 9 months ago

Once you apply this last comment, can you build and try to install the package on a clean laravel+nova instance to test its functionality? before we release v2.0.0 which adds support to Nova v4

ngunyimacharia commented 9 months ago

Once you apply this last comment, can you build and try to install the package on a clean laravel+nova instance to test its functionality? before we release v2.0.0 which adds support to Nova v4

Which comment is pending? Can't see it from my end.

ngunyimacharia commented 9 months ago

Thanks

You're welcome 🙏🏿