microcipcip

Members
  • Content count

    72
  • Joined

  • Last visited

  • Days Won

    1

microcipcip last won the day on March 12

microcipcip had the most liked content!

Community Reputation

93 Excellent

1 Follower

About microcipcip

  • Rank
    Full Member
  1. No, whichever way you choose I think that a login process with Vue will be greately appreciated by the community
  2. Thanks @thomasaull that would be great! There is an amazing new tutorial https://auth0.com/blog/vuejs2-authentication-tutorial/ if you don't mind having the users saved on Auth0. After all, Auth0 is the company behind the JWT website so they should implement it properly and you can obviosuly still keep all users in sync with ProcessWire db. But regarding Rest API I'd rather use GraphQL instead because that seems more flexible.
  3. It is very difficult to choose a framework, that's why I never use one . I just use SASS with normalize.css, bourbon bitter and a grid system I've built. This requires more work at first, but you avoid the bloat.
  4. Thanks @thomasaull ATM I am waiting for GraphQL module support for RepeaterFields before I integrate it in processvue. I'll implement the JWT login later on because I haven't used it before so I need to learn how it works, but it is definitely on my list of things to do. I don't know how JWT should integrate with GraphQL too, I'll probably ask @Nurguly Ashyrov if he has any idea of how I should integrate it. There's also the problem that GraphQL allows you way too much freedom on what kind of query you can perform on the client, to prevent that I've got to implement persisted queries.
  5. Aren't you missing the "data-thumb" attribute in your hidden div?
  6. I think this may be your problem: https://processwire.com/api/selectors/
  7. I think I have found a possible solution for @bernhard and @LostKobrakai concerns about the ability to perform queries in the frontend. You could use the persisted queries technique, basically you can install this npm package (there's also this webpack plugin) that will scan your code and remove the graphQL client side queries and save them to an external JSON file. Then in the PHP side you could load this JSON file and give GraphQL the right query based on the query id sent from the client side (I think you can also send variables along the query id, so the query is not "static"). I guess that if a malicious user sends a standard graphQL query you could just intercept that, so if it is not a valid id from the generated JSON file you won't execute graphQL.
  8. I am glad that this project is helping ProcessWire getting more devs on board :). I just want to say that I wouldn't have been able to finish ProcessVue if it wasn't for the amazing ProcessWire community. I believe that the community truly is the biggest selling point for new users (like me). Before trying ProcessWire I used OctoberCMS for a while but when I was stuck I got 0 support from the forums, so...althought the CMS is based on the amazing Laravel framework, I just left! I think that ProcessWire is extremely powerful and flexible and with time will become the tool of choice for frontend developers, the new GraphQL module will also help on this direction. Droves of frontend developers are looking for a CMS like this, they just don't know it exists! The usual keywords they use when looking for a SPAs CMS is "Decoupled CMS" or "Headless CMS", and I believe that that's exactly what ProcessWire is for! Some frontend developers prefer to use NodeJS but I think that Node is just too young and is not stable enough, the learning curve is huge if you need it for a non trivial project, and the worst thing of all is that after two weeks ANY js tool you may have used is outdated. See for example how Angular has been replaced with React or Vue, and Gulp with Webpack. That doesn't mean that I am against improvements in this regard, I just feel that it's just too much for us poor frontend devs to cope with! ProcessWire is stable, easy to use and won't change API every week. BTW, after that I migrate ProcessVue to GraphQL I am also planning to add Auth0 login integration with JWT, as I think that login/signup is a common feature in SPAs. I am sure I'll have to annoy @Nurguly Ashyrov and the rest of ProcessWire community for getting it in sync with ProcessWire users, but the result should be quite useful
  9. Now it works!! This is so cool...I wish I could like this thread twice :). Do you have any plan of adding the RepeaterField? I don't know if it has been mentioned in this thread yet, but I found this cool GraphQL tutorial that may be useful for someone new to GraphQL. When I learn GraphQL properly I'll test this module more, as I think it has huge potential for introducing FrontEnd devs to ProcessWire.
  10. I am trying to use this module in the frontend. I added the following code: <button class="graphBtn">Fetch data!</button> <script src="<?php echo $config->urls->templates?>js/axios.js"></script> <script> var $button = document.querySelector('.graphBtn'); $button.addEventListener('click', function (e) { e.preventDefault(); axios.post('/graphql/', { query: ` { basic_page{ list{ title, summary, url } } } ` }) .then(response => { console.log(response.data); }); }); </script> And this is what I get back: { "errors": [ { "message": "Must provide an operation." } ] } Do you know why? If I try the query in the GraphiQl admin I get the right data back. Do I have the wrong permissions set in the module?
  11. I have edited the github repository, now ProcessVue is a site profile and you can install it easily. Just note that the REST API may have bugs...I don't even remember how it works
  12. Ooops stupid mistakes, now it works :). Btw, do you usually build twig forms in this way or do you use ProcessWire form API?
  13. @Wanze I am trying to build a simple contact form with Twig but I am unable to do an ajax request to the php template file. My template name is test.php and I have the following code: <form class="form" action="./" gy="g"> <label for="first_name">Name</label> <input name="first_name" id="first_name" type="text" required=""> <label for="email">Email</label> <input name="email" id="email" type="email" required=""> <label for="msg">Msg</label> <textarea name="msg" id="msg" cols="30" rows="10" required=""></textarea> <input type="hidden" value="{{ page.title }}"> <button>Send</button> </form> // ajax submit $form.submit(function (e) { var request = $.ajax({ url: $form.attr('action'), method: 'POST', data: $form.serialize(), dataType: "html" }); request.done(function( data ) { console.log(data); }); request.fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); }); // avoid to execute the actual submit of the form. e.preventDefault(); }); In test.php I tried: if (wire('input')->post) { echo "Submitted"; // with this I get echo back in the AJAX response, but if I refresh the page I get a blank page with the text "Submitted" in it. exit(); } if (wire('input')->post->submit) { echo "Submitted"; // this never get fired exit(); } // here twig code... $test = wire('page')->siblings("template=test"); $view->set('test', $test);
  14. @Ivan Gretsky Is there a way to customize the export or should I just edit the zip file and remove /node_modules/ and add all the config files that start with a dot that have been removed?
  15. @Ivan Gretsky ooops....I am a beginner PW user I didn't even know it was possible to do that! I'll check it out when I have the time, thanks