Skip to content
This repository has been archived by the owner on Oct 28, 2020. It is now read-only.

Some suggestions and a bug #5

Closed
Phr33d0m opened this issue Jun 6, 2019 · 4 comments
Closed

Some suggestions and a bug #5

Phr33d0m opened this issue Jun 6, 2019 · 4 comments
Labels
Added to Trello https://trello.com/b/R11mhfdy/pipe-dream enhancement New feature or request help wanted Extra attention is needed

Comments

@Phr33d0m
Copy link

Phr33d0m commented Jun 6, 2019

Hi, first of all I'm sorry about the vague title (as a regular bug-report-submitter I'm ashamed).

Some (useless) context I loved the idea and your work the second I saw it on reddit (I'm not registered there so couldn't put this in that thread).

I wanted to try it ASAP so I fired a laravel new and fired up the /pipe-dream url and then I found some things that didn't allow me to use it as-is without some changes, other stuff were impossible with just changing the templates:

  1. Please make an easier way to specify the models' namespace (some like their models grouped in App\Models (like us here))
    1.1. It'd be cleaner to have all API controllers inside an App\Http\Controllers\API namespace as well (but I could live without this one)
  2. Use model binding by default and load relationships with just (return $model->load($rels))
  3. [bug] If I ctrl+z (to revert a change I made) in the templates window - it wipes out the entire input
  4. ___CASTS_BLOCK___ is missing from Model but you do replace it in ModelPipe.js

Thanks in advance! I hope to be using this tool in the future and forever!

@ajthinking ajthinking added enhancement New feature or request help wanted Extra attention is needed labels Jun 7, 2019
@ajthinking
Copy link
Member

Hi @Phr33d0m, thanks for valuable inputs! I agree 100% on all of them, but cut some of that out just to get to an initial release. I will try to address the features below.

Namespace models/controllers to specific folders

I was thinking about giving the LaravelFileFactory and indivudal Pipes the ability to expose/publish settings to the settings tab. The templates/pipes should then be able to pull in these settings. Maybe something like this would do the trick.

class FileFactory {
    defaultSettings() {
        return {
           // defaults
           modelsNamespace: "App", 
           APINamespace: "App\Http\Controllers\API",
           ...            
        }
    }
}

Model bindings by default

Great, will look into this!

Editor Ctrl-z bug

I cannot reproduce (On a mac using chrome). Is it the same in all editors or just in the templates tab? Im not sure if this is caused by pipe-dream or by the dependency https://github.com/chairuosen/vue2-ace-editor which in turn uses https://github.com/thlorenz/brace. That was kind of a mess to get working.

Missing CASTS_BLOCK in UserPipe

Good catch, that should be fixed. It would be nice to give the templates more power with some real templating syntax language. In this case maybe they could use condtitional statements to only render that section if needed.

I hope to get some time to work on these things soon. If you or anyone else want to beat me to it you are more than welcome to. Again, thanks for your suggestions 😄🎉

@ajthinking
Copy link
Member

Added to this Trello board

@ajthinking ajthinking added the Added to Trello https://trello.com/b/R11mhfdy/pipe-dream label Jun 13, 2019
@ArnaudL-Sirea
Copy link

Hi !
I'm a fan !
Little improvment, add : use Illuminate\Http\Request; at the top of APIController.php files

ajthinking pushed a commit that referenced this issue Jun 25, 2019
@ajthinking
Copy link
Member

Thanks Phr33d0m, @ArnaudL-Sirea and @mateusjunges! Some of these issues are fixed, some are queued for next version. Closing for now.

ajthinking added a commit that referenced this issue Aug 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Added to Trello https://trello.com/b/R11mhfdy/pipe-dream enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants