-
Notifications
You must be signed in to change notification settings - Fork 472
Conversation
Tests are not passing because coverage got reduced. Any chance that we could expose the coverage report on coveralls or anything similar? I have problem testing portusctl and couldn't reproduce the same coverage problem. |
|
||
if ($('body section.sign-up, body section.login').length) { | ||
rndNum = Math.floor((Math.random() * 2) + 1); | ||
$('body').addClass('massive-background-' + rndNum).hide().fadeIn(1000); |
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.
Any idea what this massive-background-n
is/was used for? I didn't find anything.
Most of the work is done. I'd appreciate some feedback. |
@vitoravelino I'll review this PR later, but in principle it looks like a nice idea. In the meantime take a look at #1238. This is still WIP and it's something I've done during the weekend, and I think that it clashes a bit with your PR (not too much). My idea would be to get that one merged before yours, because the importing of modules will change (and also note that using webpack allows us to ignore the dependency on the |
@mssola Oh, that looks great. I didn't consider webpack because I thought it would add another thing to the build process and that would be an issue. I'll take a look at your work. As soon as you merge your PR I'll rebase my branch and you can review it. Feeling excited for both changes. Woohooo! 😄 |
@vitoravelino the PRs regarding webpack and ruby 2.4 have been merged. You can go ahead 👍 |
1dbfe64
to
11815ce
Compare
@mssola I've rebased and fixed the issues but there are some feature tests failing in travis but passing on localhost. It doesn't make sense. Any idea what could be? =/ |
Enabled |
Finally figured out the problem. For some unknown (at least for me) reason I know that the project is moving forward to use a library to manage the view layer but the structure is not gonna change much from what I've written here. 😃 |
66a0bbe
to
0b93aac
Compare
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.
In general it looks great to me. Just fix my comments (the documentation comment applies to all classes btw, I didn't want to repeat myself after some point :D) 😉
const APP_TOKEN_FORM = '#add_application_token_form'; | ||
const APP_TOKEN_FIELD = '#application_token_application'; | ||
|
||
class ApplicationTokenPanel extends BaseComponent { |
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.
Could you add documentation ?
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.
Is there any format/rule that I should follow?
const NEW_CONFIRMATION_PASSWORD_FIELD = '#user_password_confirmation'; | ||
const SUBMIT_BUTTON = 'input[type=submit]'; | ||
|
||
class UsersPasswordForm extends BaseComponent { |
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
const DISPLAY_NAME_FIELD = '#user_display_name'; | ||
const SUBMIT_BUTTON = 'input[type=submit]'; | ||
|
||
class UsersProfileForm extends BaseComponent { |
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.
ditto
.form-group | ||
.col-md-offset-2.col-md-7 | ||
= f.submit('Create', class: 'btn btn-primary') | ||
.app-token-wrapper |
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.
Instead of wrapping the form, why don't you simply add this class into the form itself ?
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.
The idea is to have an element that contains both the link and the form. I know I could just add classes/ids to the elements and access from the global scope but restricting the component to access only the this.$el
give us more control of what's going on and also a good practice.
Ideally, panel and form could be separated components and when user clicked on the link an event is triggered and the component that contains both panel and form will tell the form to show itself. What do you think?
But yeah, wrapping them in a component to restrict dom element scope would still be needed.
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.
Got it. Thanks
@@ -1,130 +1,130 @@ | |||
// to render the layout correctly in every browser/screen |
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'm not sure I understand what changed here 😅
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.
Me neither. Maybe because of the rebase? LOL. 😅
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.
Then, rebase again and checkout --
this file 😉
Added some documentation. I would appreciate some guidance since I don't know what you are expecting. |
@vitoravelino you overdid it! 😄 So, the documentation should be one the same lines as the ruby code: human explanation of what it does, and when there is a parameter explain what is it expecting and all that. You can take the LDAP class as reference 😉 So, avoid all the @ references and such, it should be simpler. |
Also, for comments I'd only use // instead of /** |
KKKKK. Will do. 😅 |
c1ec5fa
to
72d2839
Compare
@mssola Done. Let me know if it still needs improvement, please. |
.babelrc
Outdated
@@ -0,0 +1,3 @@ | |||
{ | |||
"presets": ["es2015"] | |||
} |
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'm ok with this, but I think that we already provide the babel config through the package.json file no ? Why would we need this ? (asking just in case we can avoid duplication)
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 didn't see the package.json config. I prefer having babel config on their own file. This is actually from my work of adding ES2015 support that I forgot to delete it.
I just realized that we might not need both of them since you already set
query: {
presets: ['es2015'],
},
on the babel-loader config. Should I remove both or just .babelrc?
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 just the babelrc file.
@@ -0,0 +1,53 @@ | |||
/* eslint-disable class-methods-use-this */ | |||
|
|||
// |
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.
You can remove this line and the one in the end. So, all comments can be like this:
// BaseComponent class to avoid boilerplate code
// into component classes and add some convention.
//
// The subclasses are not obligated to implement all
// of these methods but if they need to perform an action
// that fits one of the descriptions below, it's highly
// recommended to use the proper method.
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 same thing applies to the other classes, functions, etc.
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.
👍
.form-group | ||
.col-md-offset-2.col-md-7 | ||
= f.submit('Create', class: 'btn btn-primary') | ||
.app-token-wrapper |
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.
Got it. Thanks
@@ -1,130 +1,130 @@ | |||
// to render the layout correctly in every browser/screen |
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.
Then, rebase again and checkout --
this file 😉
72d2839
to
78e8ef6
Compare
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.
Just remove the .babelrc
file and squash your commits and I'll merge it. Thanks for the patience! 👍
1c9ebc7
to
3b7488a
Compare
Signed-off-by: Vítor Avelino <[email protected]>
3b7488a
to
52bc961
Compare
No worries, @mssola. 😄 |
Thanks 👏 |
So, this is something I've been thinking about for a while since I started contributing to Portus. After #1238 were merged, we are now able to write js using the new ES2015 syntax. This will improve the code readability and maintainability.
One of the coolest feature on ES2015 is the module support. The folder structure I'm proposing is something similar to:
The
index.js
in theteams
folder is simple and will be responsiable to know which which page component should be used on the loaded page. Example:I know that it's quite a poor technique but since we have the module system on our side, it guarantees that only the code involved on the page component will be executed.
A
BaseComponent
was created as an artifact to avoid code duplication and create some convention.Suggestions are more than welcome. 😃