-
Notifications
You must be signed in to change notification settings - Fork 36
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
Lua Toolbox merge #86
Conversation
This is great. I still miss one of the main features from Toolbox though: the ability to see the list of modules endorsed / followed by someone and a list of people endorsing / following a module. If this isn't available then followings cannot replace endorsements. The first one could be added below the list of modules authored by a user on their user page and the second one could be accessible by clicking here: Regarding DB dumps, if I give you a dump and at a later time another one, can you apply the changes? I am starting to think about exactly when I should shut Toolbox down. |
oops! :) coming in soon :) |
Awesome! I am still wondering if "follows" and "endorsements" should be the same thing. On GitHub they are not (Follow would be Watch and Endorse would be Star). What do you think? |
I had this discussion with @leafo , the issue is that maybe this makes for too many verbs and features for the users to catch up for now and the current following feature doesn't do much for the moment, he suggested merging them up and I thought it was a good idea. @hishamhm suggested maybe we should rename the followings to something simpler, such as stars, so user engagement can come easier. |
OK, it makes sense. Regarding missing features, I also think that:
Regarding the transition, here is how I see it:
How does that sound? |
Yes, my argument was that "follow" makes me think "no, I don't want to I also suggested that, if possible, it would be nice to import Github stars
|
@catwell sounds perfect to me! |
|
||
[modules_label: "/label/modules/:label"]: capture_errors_404 => | ||
label = assert_error Labels\find(name: @params.label), "Invalid label" | ||
return unless label |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert error jumps out of the function, so this return is unnecessary
import | ||
modules | ||
labels | ||
from require "secrets.toolbox" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think specs should depend on the secrets, since anyone who checks out the code will not be able to run the specs successfully. Maybe we can have a fake dump stored elsewhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree! I only added it there because I'm not sure how else to run the function I created from within helpers to import the labels from the lua dump to the sql. Should we make a separate script to do that, and then we can remove this from here or add the fake dump?
Thanks for the patch, I did a quick code review. Tell me if you have any questions. Didn't get a chance to run the code and check out the UI yet. I named the functionality follow because to me that says you'd like to follow the changes/updates of the module. I planned to have some sort of feature where it would give you a digest page on the site of modules you follow that got updated, and an optional email when new versions of modules you follow are released. I think having github stars displayed could be a great way for someone browsing modules to identify what's used, but not sure about he complexities in keeping in synchronized. |
} | ||
@transfer_count = @transfer_count+1 | ||
|
||
render: "user_settings.import_toolbox" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once you change this action to post, you should turn this into a redirect to go to the page that renders this view. You can pass transfer count as a query param
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I decided to move this into a helper function that returns the count
Are you planning on making these changes @Etiene? I know your time is limited for this project, no need to rush, just curious. |
the time for the project is up, had to shift to report writing, but I will make these changes! :) |
commit e5ec6ff Author: Etiene Dalcol <dalcol@etiene.net> Date: Fri May 6 23:03:50 2016 +0200 Refactor commit a69197b Author: Etiene Dalcol <dalcol@etiene.net> Date: Fri May 6 22:15:07 2016 +0200 Refactor commit 368cd1b Author: Etiene Dalcol <dalcol@etiene.net> Date: Fri May 6 22:04:16 2016 +0200 Refactor commit 5240e5f Author: Etiene Dalcol <dalcol@etiene.net> Date: Fri May 6 21:59:43 2016 +0200 Refactor: User post on import endorsements commit b220a1e Author: Etiene Dalcol <dalcol@etiene.net> Date: Fri May 6 01:10:01 2016 +0200 Refactor commit c6187dd Author: Etiene Dalcol <dalcol@etiene.net> Date: Fri May 6 00:39:53 2016 +0200 Fix indentation commit 70f3c0e Author: Etiene Dalcol <dalcol@etiene.net> Date: Fri May 6 00:34:56 2016 +0200 Change style on url redirect on remove label commit f7ae6d7 Author: Etiene Dalcol <dalcol@etiene.net> Date: Fri May 6 00:15:42 2016 +0200 Use list comprehension on module label list commit c384ebd Author: Etiene Dalcol <dalcol@etiene.net> Date: Thu May 5 20:09:38 2016 +0200 Remove unnecessary return
Sorry for the delay! Finishing masters, moving to a different country and stuff! @leafo I've made a refactor following most of your suggestions. I'll need help with some of them, though, I'll reply to those one by one. Could you take another look now? @catwell I'll start working on your suggestions now |
action: @url_for(@module_endorsing and "unendorse_module" or"endorse_module", module_id: @module.id) | ||
method: "post" | ||
}, -> | ||
@csrf_input |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be method call
Alright! Sorry for the huge delay. I've merged in your changes. I hope you don't mind but I ended up refactoring things a bit to simplify the model structure. Labels are stored right on the module with an postgres array type. I also moved the label stuff into a new application, and added tests. I've hidden the endorsement -> follows stuff at the moment. Once I get the data dump I can test running it, then add it back. Thanks for your help getting this stuff done, sorry for the slow turnaround time. @catwell could you email me that dump when you get a chance? Thanks |
@leafo email sent. |
No, dont worry, thank you! I'm sorry it took me ages to reply as well and I didn't have the time to go through all your suggestions! I'm really glad this is happening! 👯 |
I have seen that this is merged, awesome! All that's missing for me now is:
I will set Lua Toolbox read-only and point users to LuaRocks as soon as I find the time. (EDIT: done) |
A brand new dump of LuaToolbox's db will be needed (cc @catwell)
For transferring endorsements to Followings I added a new tab on the user settings explaining the situation with a link for the transfer. I have an issue once the transfer is done though. I'm rendering the same view from a different action and this results on the url changing when you get the success message. I don't particularly like that but I didn't know how to do otherwise and this might need a touch-up. Not a huge deal, though.
When importing current labels I was not exactly sure how to access Lapis' model module in a simple script. So for the moment the functions are in a helper class and I tested and ran them using the specs.
I also added the labels to the front page, but I'm not sure if it's pretty enough.
For the moment only module owners can add or remove labels from a module. There's no way to add new labels yet, only to select from existing labels.
Screenshots of my local system:
|--> Owner's view: Add label link is on owner's menu for the moment