-
Notifications
You must be signed in to change notification settings - Fork 472
js: Namespaces#index refactoring w/ Vue #1371
js: Namespaces#index refactoring w/ Vue #1371
Conversation
0a8ff43
to
a751fe6
Compare
active_model_serializers (0.10.6) | ||
actionpack (>= 4.1, < 6) | ||
activemodel (>= 4.1, < 6) | ||
case_transform (>= 0.2) |
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 couldn't find a package for this. :(
actionpack (>= 4.1, < 6) | ||
activemodel (>= 4.1, < 6) | ||
case_transform (>= 0.2) | ||
jsonapi-renderer (>= 0.1.1.beta1, < 0.2) |
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 couldn't find a package for this either. :(
@@ -20,8 +20,11 @@ GEM | |||
erubis (~> 2.7.0) | |||
rails-dom-testing (~> 1.0, >= 1.0.5) | |||
rails-html-sanitizer (~> 1.0, >= 1.0.3) | |||
active_model_serializers (0.9.0) | |||
activemodel (>= 3.2) | |||
active_model_serializers (0.10.6) |
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.
Upgraded because 0.9 was buggy
a751fe6
to
3ba8794
Compare
74eb204
to
4bede10
Compare
@mssola ready for review! 😄 |
b061785
to
8626e07
Compare
I just merged #1299, I think this affects this PR. |
8626e07
to
999953a
Compare
@mssola Rebased! |
@mssola Are we going with Grape or are we still waiting @jordimassaguerpla packaging feedback on it? |
@vitoravelino I've already merged it, so it's safe to say that we are at least giving Grape a try 😉 As for the packaging side, now I need to update quite some bits, but if @jordimassaguerpla doesn't like the whole idea, or he thinks that it brings more harm than good, then we have two options:
I'm liking grape, and I'm already benefiting of some of its features (check #1384), so I'd like to evaluate all our options before going back to the worst case scenario 😁 |
@mssola I also like Grape and would love to stay with it. I'm just trying to play safe but if you want to go wild... Let's go! Haha... I've worked in a project with Grape a few years ago (ruby 1.9 era) and it used to do his job. So I guess going with your personal pick wouldn't be a big deal unless we are using a fancy new feature. Based on that I think we are safer than what I thought. If you approve this PR, we can merge it and I can rewrite the API part in Grape but in another PR. |
Cool, I'll review later 😉 |
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.
Works wonders. Just two things:
- Fix the issues I mentioned
- Write a more complete commit message. Right now it's pretty raw... So, explain the changes you made and why you made them 😉
app/views/namespaces/index.html.slim
Outdated
= render "namespaces/components/panel" | ||
|
||
script#js-namespaces-table-tmpl type="text/x-template" | ||
== render "namespaces/components/table" |
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.
Typo, should be a single =
.
app/views/namespaces/index.html.slim
Outdated
= render "namespaces/components/table_row" | ||
|
||
script#js-namespace-visibility-tmpl type="text/x-template" | ||
== render "namespaces/components/visibility" |
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.
Same here
@@ -0,0 +1,16 @@ | |||
tr :class="scopeClass" | |||
td | |||
a{ :href="namespace.links.self.href" } |
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.
If :class="scopeClass"
works, then :href="..."
should also work. Will try without the curly brackets.
app/views/namespaces/index.html.slim
Outdated
= render "namespaces/components/panel" | ||
|
||
script#js-namespaces-table-tmpl type="text/x-template" | ||
== render "namespaces/components/table" |
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.
Maybe the ==
is not necessary here.
999953a
to
6518e29
Compare
- Created custom elements for namespaces (namespace-panel, new-namespace-form, namespace-table, namespace-table-row, namespace-visibility) - Added sorting columns (similar to SUSE#590) - Fixed pagination (similar to SUSE#585) - Improved UX of changing namespace visibility (see gif below) - Updated slim gem - Updated active_model_serializers gem - Used serializers (check namespace_serializer.rb) for json rendering - Added moment for dates (kind of overkill but a good thing in the long term) - Added lodash and lodash babel plugin (makes partial imports possible) - And other minor changes
6518e29
to
3e145dc
Compare
Since the requested changes were made and travis is passing, I'll merge this by myself to unblock other issues. |
Well, I wasn't expecting a long PR but...
\_("/)_/
Here are some of the changes:
namespace-panel
,new-namespace-form
,namespace-table
,namespace-table-row
,namespace-visibility
)slim
gemactive_model_serializers
gemIf we agree on going with Vue all the way, I'll start working on the missing checklist below. Let me know if I should proceed with it or not.
Missing
Make sorting and pagination reachable through URL (e.g.:Make namespace table sorting reachable through URL #1373orderBy=clean_name&sortAsc=true
)UseReuse <namespaces-panel> component on Team#show page #1374<namespaces-panel>
on Team#show pageRemove legacy components (Reuse <namespaces-panel> component on Team#show page #1374new-namespace-form
andnamespaces-panel
)Add global pagination configAdd global pagination limit config value #1375Inline validation with bootstrap css classes (e.g.: http://1000hz.github.io/bootstrap-validator/#validator-examples)Add inline validation for fields in Namespaces#index form #1376Created at
column formatformat.json
responses