thedevdojo / voyager

Voyager - The Missing Laravel Admin
https://voyager.devdojo.com
MIT License
11.79k stars 2.67k forks source link

[Suggestions] #673

Closed Frondor closed 7 years ago

Frondor commented 7 years ago

Well, lately I've been quite interested in this project and I try to contribute as much as I can. My memory tends to fail very often, so I'll write a list of suggestions I CONSIDER necessary.

:construction:

  1. :warning: Remove resources/views/users views so it makes use of default BREAD views, and properly configure the data rows to make use of Input details JSON api.
  2. Allow "server-paginated" BREAD tables to be ordered by column
  3. Implement the use of filters for "server-paginated" BREAD tables
  4. This
  5. Update the docs. And probably include a new section for "Input JSON API" or something like that, since the number of available options are increasing.
  6. Implement some library like a little code editor, to make the writting of JSON code while creating BREADs, less painful. #697
  7. Make use of bootstrap-datetimepicker (or better) library... It is there! But we are not using it at all :sweat_smile:
  8. Make login screen responsive, add bootstrap library, and use Voyager::setting('logo') (if isset) instead of the default blank wheel #697
  9. ~Think on something to allow administrator changing loading icon.~ It has always been there
  10. all the image inputs, should read from the media manager instead of using the default html file uploader.
  11. show view/edit/delete according to permissions, so the user dont click on it and get an error which is bad user exp.
  12. Create TestCase for parsed/resolved relationships #638
  13. Enabling selecting items from the Media Manager in rich_text_area
  14. :warning: The new way to name BREAD files media/{BREAD}/589c6c66.jpg.
  15. ~:warning: Ability to register formFields like Voyager::addFormField(DateHandler::class);~

What do you think?

marktopper commented 7 years ago

You have done some wonderful pull requests @Frondor. A big thanks for that.

  1. I believe removing all the extra BREAD views might be a good idea to make it easier to maintain since they are all using the same BREAD view. However as it is now it should still be possible to overwrite the BREAD views for specific tables. But I do not believe it's needed to be done by default as it is now for users and posts. I am not quite sure I get your plans for configuring the data rows to make use of Input details JSON api, can you please explain in further details?
  2. šŸ‘ Could be turned into a option, maybe a option in the model or somewhere, open for ideas.
  3. šŸ‘
  4. Indeed a performance issue. šŸ‘
  5. The documentation does indeed have some issues, there are lots of features that are not explained yet in the documentation. I have a lot of works to do there.
  6. Do you know any editor for this purpose?
  7. We should indeed be using libraries to format inputs to make everything easier for everyone. šŸ‘
Frondor commented 7 years ago

Thank you Mark, I appreciate your appreciation :laughing: I try to contribute as much as I can.

I agree with everything, about the code editor I like CodeMirror and Ace. In my next PR I may implement one of them.

marktopper commented 7 years ago

Wonderful. I personally have only experience with Ace Editor, haven't tried CodeMirror. Since it seems that we are only gonna need it for JSON for now, I think we should test out which works with JSON and their performance.

Frondor commented 7 years ago

Both work almost the same... Ace seems a bit more advanced than CodeMirror, and both works with "modes". since we only need JSON mode, either of those two would be fine.

marktopper commented 7 years ago

I am open for both ;)

fletch3555 commented 7 years ago

@marktopper, perhaps we make the code editor as a hook? Seems small/simple enough to build out that way. It's not like functionality wouldn't work without it.

marktopper commented 7 years ago

Well, not quite sure whether or not this should be in a hook, since it would really help people enter the correct JSON into the BREAD fields to have some kind of editor and better validation.

I'm open for a discussion on this šŸ‘

hazem1taha commented 7 years ago

I just want to add more suggestions (not sure whether to put them here or not):

  1. Using CKeditor instead of the current one or event make a setting for selecting the suitable editor.
  2. Exporting Database functionality.
  3. Creating full migration including the table fields instead of just a migration and the increments.
marktopper commented 7 years ago

@EngHazem great suggestions, here are some comments:

  1. CKEditor could be the default rich text editor for Voyager, but could be editable by maybe using a hook (Voyagers plugins system). Then the hook could replace the rich text handler. Then there are no limits for the editors that can be added later.
  2. Do you wish to export the whole database or just some specific parts of it? Cause if this is for migrating local application to production, I think we should start a separate discussion for that.
  3. Full migrations are already planned and I do believe that @abdgad have been digging into this.
hazem1taha commented 7 years ago

@marktopper

Great! Do you mean with Voyagers plugins system, the idea of overriding views in the resources/vendor/ ?

marktopper commented 7 years ago

@EngHazem: Voyagers plugins system, it however haven't been announced yet since there are still some testing going on.

hazem1taha commented 7 years ago

It will be a great addon! I was going to suggest this feature. What if I want to run a specific action after saving the settings form ? Does Voyager currently support that ?

marktopper commented 7 years ago

@EngHazem You can do this using events.

Frondor commented 7 years ago

This is what I've done so far:

You can no longer submit the form with invalid json fields.

marktopper commented 7 years ago

Good idea with the last check before submission. Ensures that people does not create BREAD with invalid JSON. šŸ‘

Frondor commented 7 years ago

I believe removing all the extra BREAD views might be a good idea to make it easier to maintain since they are all using the same BREAD view. However as it is now it should still be possible to overwrite the BREAD views for specific tables. But I do not believe it's needed to be done by default as it is now for users and posts. I am not quite sure I get your plans for configuring the data rows to make use of Input details JSON api, can you please explain in further details?

@marktopper If we're going to get rid of those overrides (views for users BREAD, posts, etc...), they should be "configured" by default, for example, the fields we are showing/hidding for each B.R.E.A.D, fields details, etc... (otherwise, if we simply delete the users folder, the users BREAD shall look messed up). I believe that's part of the installation process :thinking:

marktopper commented 7 years ago

Good point @Frondor. I think that is a better approach to make some kind of configurations for the layout of the BREAD. So then there can be a set of "layouts" to use for a BREAD.

ctf0 commented 7 years ago

a couple more features to add

marktopper commented 7 years ago

Good suggestions @ctf0. However I am already working on a system like laravel-translatable for Voyager. But will be turning it into a Voyager plugin that can easily be installed for those needing it.

Reference #561

ctf0 commented 7 years ago

awesome, am also thinking of adding http://plugins.krajee.com/file-input for the images & even have an example https://gist.github.com/ctf0/8cdad76b8b8a0c80f2241d47ab430402 so we dont need to use ajax calls on each upload

Frondor commented 7 years ago

awesome, am also thinking of adding http://plugins.krajee.com/file-input for the images & even have an example https://gist.github.com/ctf0/8cdad76b8b8a0c80f2241d47ab430402 so we dont need to use ajax calls on each upload

In my opinion, we should wait until L5.4 is supported, so we can create an image_uploader blade component to load in edit-add.blade.php views, and use the media manager just like wordpress does.

I'm updating the main post.

marktopper commented 7 years ago

Reference according to Laravel 5.4 support #626

Frondor commented 7 years ago

@marktopper I wonder how all the changes we've been committing to master would merge to v0.11 branch or vice versa... I'm not a git advanced user but to be honest, I'm afraid of the merge breaking too many things :laughing:

marktopper commented 7 years ago

Actually I did most of them yesterday šŸ˜†

marktopper commented 7 years ago

https://github.com/the-control-group/voyager/commit/20604a5c835384722c4ef0549498d9c645f0c0ce

ctf0 commented 7 years ago

a continuation for the image , maybe a little bit later but am just adding for discussion

on other hand for the Additional Field Options, like Generating Slugs

Frondor commented 7 years ago

I don't know about @marktopper but I'd like to keep BREAD relationships as simple as possible. Also there's no point to specify another model different from the one already used by current BREAD, and the eloquent relationships has to be manually added so I wouldn't consider that suggestion.

marktopper commented 7 years ago

I must agree with @Frondor on that one.

However about the libraries:

use https://packagist.org/packages/spatie/laravel-medialibrary instead of normal intervention use https://github.com/kblais/laravel-uuid for the image names instead of hashing.

Then what would they give or improve to this package? Maybe we should open up a different issue for discussing those.

ctf0 commented 7 years ago

@marktopper


a side from those 2, i would suggest adding a btn to the rich text inputs toolbar that show the media manager in a pop-up so the user can select any images/vids/etc... he wants and once clicked it gets added to the input, so now we can 1- add a direct link to that file and get the benefits of cdn/cloud storage like s3 2- the db will be much smaller cuz now instead of adding a dataURI for the images "which is bad for big files", we instead use links 3- the user can now upload any videos or files he wants through the media manager and access them directly without going back & forth between the view and the media manager to get the direct links of those files.

marktopper commented 7 years ago

@ctf0

marktopper commented 7 years ago

About the button for the rich text input toolbar for enabling selecting items from the Media Manager, then a pull request is more than welcome šŸ‘

marktopper commented 7 years ago

I have added this to the milestone of v0.11. Hopefully we can get those things done in time.

Frondor commented 7 years ago

@marktopper Wow! This is such a big list for a milestone :laughing: but meh, I think it's a decent challenge.

I can create a Vue.js component for the embedded media manager if needed, but first we may need an AJAX api (and with this I simply mean a structure for controllers) so we can use it for select2 inputs that actually, query the whole list of records for a relationship.

Regarding to uuids, they are large indeed and people tend to make bad uses of them. Indexing large strings significantly increases mysql memory usage, and perform badly in comparison to ints.

If you don't want to use auto_increment, we can simply convert a timestamp to hexadecimal like dechex(time());. and result on something like media/{BREAD}/589c6c66.jpg (because storage doesn't sounds good :D)

I'm updating the main post.

marktopper commented 7 years ago

@Frondor: It might take some longer time for the v0.11 release. But I prefer the release to have some good improvements.

Nice, let me know if you need help with the Vue.js component for the Mdeia Manager or the API Controllers. And the API controllers would indeed be quite a nice improvement, then we could start moving things over to use AJAX requests instead of reloading the page every time something is done.

I like the idea about 'media/{BREAD}/589c6c66.jpg'. I can look into this if you aren't got time?

Frondor commented 7 years ago

@marktopper please, go ahead. I'll create a codepen with the vue component so we can review it here.

Regarding to the AJAX support for bread, we can always make use of request->expetsJson() to handle responses. But regarding to the issue with select_dropdown querying all() records of relationships, probably we may need to address the separation of input types as modules first and create a relationship-field-type module/package so all the logic goes there.

marktopper commented 7 years ago

Good idea @Frondor.

marktopper commented 7 years ago

@Frondor: I have been working on the new locations for BREAD files with their new filename.

However, I came to a problem with this, when uploading multiple files are uploaded at the sae page. Since the filename is made from the current time.

Any ideas how to solve this?

marktopper commented 7 years ago

I have decided that the following things should be merged into v0.11 before its released.

:construction:

  1. Remove resources/views/users views so it makes use of default BREAD views, and properly configure the data rows to make use of Input details JSON api.
  2. The new way to name BREAD files media/{BREAD}/589c6c66.jpg.

I believe the rest of them can be merged later without issues. Thoughts?

marktopper commented 7 years ago

Think on something to allow administrator changing loading icon.

This is already possible in settings.

skaermbillede 2017-02-12 kl 10 50 35
Frondor commented 7 years ago

However, I came to a problem with this, when uploading multiple files are uploaded at the same page. Since the filename is made from the current time.

Sorry but I can't replicate the case in my mind... The problem here is that every file has the same name?

I have decided that the following things should be merged into v0.11 before its released. :construction:

  1. Remove resources/views/users views so it makes use of default BREAD views, and properly configure the data rows to make use of Input details JSON api.
  2. The new way to name BREAD files media/{BREAD}/589c6c66.jpg.

I agree. Do I need to edit my PR or something?

Also, I've been seeing some PRs lately, and I think that we need to separate the each input fields into its own view and controller as soon as possible. The code is getting really messy and hard to maintain (every time I try to understand a PR I struggle trying to figuring out each line).

For example #715 actually can break the whole parsing of relationships (linked anchors), and VoyagerBreadController is now huge. Shouldn't we consider addressing this at master as well?

marktopper commented 7 years ago

However, I came to a problem with this, when uploading multiple files are uploaded at the same page. Since the filename is made from the current time.

Sorry but I can't replicate the case in my mind... The problem here is that every file has the same name?

Uploading multiple files at the exact same time (lets say time() = 1486910263) it generates the same filename (in this case 58a07337.jpg).

I agree. Do I need to edit my PR or something?

Your pull request is fine and may include additional stuff. I however just focus on the things that must be merged before the release of v0.10.

Also, I've been seeing some PRs lately, and I think that we need to separate the each input fields into its own view and controller as soon as possible. The code is getting really messy and hard to maintain (every time I try to understand a PR I struggle trying to figuring out each line).

In v0.11 the types have already been separated into it own views. See https://github.com/the-control-group/voyager/tree/release/v0.11/resources/views/formfields

Frondor commented 7 years ago

Uploading multiple files at the exact same time (lets say time() = 1486910263) it generates the same filename (in this case 58a07337.jpg)

What about dechex(time() + $fileIndex) where $fileIndex should be the index in the incoming files' array. Or even dechex(time()) + $fileIndex

In v0.11 the types have already been separated into it own views. See https://github.com/the-control-group/voyager/tree/release/v0.11/resources/views/formfields

Yes, yes, but the logic is still in the view. I'm suggesting moving that logic to its own field controller and then using something like Voyager::formField('select_dropdown') which uses the controller and calls to the proper view. Probably something like resources/views/formfields/Controllers/CheckboxController.php ?

marktopper commented 7 years ago

Will work it out with the filenames and send a pull request and ping you.

How about the form fields are separated into each class and view and then it can be added to Voyager this way (will also make it able to add new types in extensions)

Add type

Voyager::addType('date', DateHandler::class);

Handler class

class DateHandler extends Handler
{
    protected $view = 'voyager::formfields.date';

    public function getViewArguments()
    {
        return [
            // an array of arguments that will be sent to the view?
        ];
    }
}

Just an idea.

Frondor commented 7 years ago

Just updated the main post and marked urgent things with a :warning:

marktopper commented 7 years ago

Removing this from milestone v0.11 since all v0.11 changes are covered in #718.

ctf0 commented 7 years ago

also the img folder under assets is only called inside publishable/assets/css/style.css but without any impact whether its avail or not, so what is it for ?

ctf0 commented 7 years ago
arrilot commented 7 years ago

Hi, do you have any news according bread table filters?

ibourgeois commented 7 years ago

laravel_voyager_media_manager

WIP: but what do you think so far? This is a reusable modal in a partial that can be injected anywhere, including as a tinymce toolbar addition

fletch3555 commented 7 years ago

@marktopper, any idea what's left here? Can this be closed?

@iBourgeois, that looks great! It would be worth tracking that in it's own issue/pull request.