Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

feat(core): Minor UI fixes for mobile; autofocus #1499

Merged
merged 18 commits into from
Oct 5, 2016

Conversation

hyperreality
Copy link
Contributor

@hyperreality hyperreality commented Sep 10, 2016

feat(core): Minor UI fixes for mobile; autofocus

  • Social login buttons now 80% of old size, they are too large on small screens such as the iPhone and oversized on the desktop too IMO
  • Moved the 'sign in failed' warning above the login form, so that it is not cut off on small devices
  • Fix broken password popover balloon
  • Added an autofocus directive to automatically move focus to relevant fields on MEAN.js forms. The directive only fires if screen width >= 800px because otherwise a large keyboard may open on a mobile device.
  • The autofocus directive overwrites the 'autofocus' HTML5 attribute (the attribute is no good for angular apps as it doesn't work across state changes) - I don't believe there's any problem with doing that but I'm open to being corrected

@coveralls
Copy link

coveralls commented Sep 10, 2016

Coverage Status

Coverage decreased (-0.2%) to 72.809% when pulling 6a5303c86866de3c178cdb83a14578287fbf2d60 on hyperreality:social-login2 into 17772fe on meanjs:master.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 72.809% when pulling 6a5303c86866de3c178cdb83a14578287fbf2d60 on hyperreality:social-login2 into 17772fe on meanjs:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 72.809% when pulling 6a5303c86866de3c178cdb83a14578287fbf2d60 on hyperreality:social-login2 into 17772fe on meanjs:master.

@coveralls
Copy link

coveralls commented Sep 10, 2016

Coverage Status

Coverage decreased (-0.2%) to 72.809% when pulling 249fe4e207671384086f332d463ad0279643f3af on hyperreality:social-login2 into 17772fe on meanjs:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 72.809% when pulling 249fe4e207671384086f332d463ad0279643f3af on hyperreality:social-login2 into 17772fe on meanjs:master.

@hyperreality hyperreality force-pushed the social-login2 branch 2 times, most recently from 39aa6ae to 5fe2640 Compare September 10, 2016 04:56
@coveralls
Copy link

coveralls commented Sep 10, 2016

Coverage Status

Coverage decreased (-0.2%) to 72.809% when pulling 5fe26403b44745dcfe1d0d77d8c43cc2f4c69875 on hyperreality:social-login2 into 17772fe on meanjs:master.

@coveralls
Copy link

coveralls commented Sep 10, 2016

Coverage Status

Coverage decreased (-0.2%) to 72.809% when pulling 5fe26403b44745dcfe1d0d77d8c43cc2f4c69875 on hyperreality:social-login2 into 17772fe on meanjs:master.

@mleanos
Copy link
Member

mleanos commented Sep 10, 2016

@hyperreality Can you think of a test to write for this new directive? The coverage decreased, so that may be why the coveralls build failed. I think we have a threshold of coverage decreasing.

@lirantal I couldn't find the settings on Coveralls. Do you know what this setting is, and where I can see it?

@hyperreality
Copy link
Contributor Author

hyperreality commented Sep 10, 2016

@mleanos I'll play around with sending keypresses on Protractor.

The coveralls settings are a tiny button on the top left.

@coveralls
Copy link

coveralls commented Sep 11, 2016

Coverage Status

Coverage decreased (-0.2%) to 72.809% when pulling bdbc3fec01defb7d378987584be328e4ee0ba950 on hyperreality:social-login2 into 17772fe on meanjs:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 72.809% when pulling bdbc3fec01defb7d378987584be328e4ee0ba950 on hyperreality:social-login2 into 17772fe on meanjs:master.

@hyperreality
Copy link
Contributor Author

hyperreality commented Sep 11, 2016

The test is failing on Travis - I suspect that's because the directive only fires if window width is over 800px and Travis ones are smaller than that? However, trying to get Protractor tests working with different windows sizes was a nightmare I don't fancy revisiting for the time being

@coveralls
Copy link

coveralls commented Sep 11, 2016

Coverage Status

Coverage decreased (-0.2%) to 72.809% when pulling 98871623645fcc9f6a1a4359ab3cd299cb6bd2cc on hyperreality:social-login2 into b2a5cb5 on meanjs:master.

@mleanos
Copy link
Member

mleanos commented Sep 11, 2016

@hyperreality Ok. Understood. Perhaps we can just leave that test out then?

I'm surprised the coverage decreased so much by merely adding this one directive.

@hyperreality
Copy link
Contributor Author

hyperreality commented Sep 12, 2016

I'll have one more crack at the test I think.

In the modules directory:
find . -name '*.js' | xargs wc -l reports ~10000 lines of code
wc -l core/client/directives/autofocus.js is 28 lines
Which is about 0.2%

@lirantal
Copy link
Member

@hyperreality let's see if we can kick this in before a coming 0.5.0 release

@coveralls
Copy link

coveralls commented Sep 15, 2016

Coverage Status

Coverage decreased (-0.1%) to 72.869% when pulling 598711a5c145620c82a9aa7b2f45269ceb06ae2d on hyperreality:social-login2 into b2a5cb5 on meanjs:master.

Copy link
Member

@mleanos mleanos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a couple of comments, but other than those this looks really good. I took it for a test spin, and realized this branch is a bit behind master. We've merged some changes in recently that fixed a couple issues revolving around the Social Logins; including some UI button issues.

Can you rebase this with master, so that I can do a quick manual run through, when you make the requested changes?

<a class="btn btn-danger btn-add-remove-account" ng-click="vm.removeUserSocialAccount(providerName)">
<i class="glyphicon glyphicon-trash"></i>
<a ng-click="vm.removeUserSocialAccount(providerName)">
<img class="social-button" ng-src="/modules/users/client/img/buttons/{{providerName}}.png">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These social provider images are being shown twice. If you see above at line 10, the <img> is present there as well. Remove whichever one we don't need. I'm guessing we want this new one that you added.

<i class="glyphicon glyphicon-trash"></i>
<a ng-click="vm.removeUserSocialAccount(providerName)">
<img class="social-button" ng-src="/modules/users/client/img/buttons/{{providerName}}.png">
<span class="btn btn-success btn-add-remove-account">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be using the btn-danger class, rather than btn-success.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cheers

@mleanos
Copy link
Member

mleanos commented Sep 17, 2016

@hyperreality I left a review, but for some reason it doesn't mark the PR as "updated".

@@ -8,8 +8,11 @@ <h3 class="col-md-12 text-center" ng-show="vm.hasConnectedAdditionalSocialAccoun
</div>
<div ng-repeat="(providerName, providerData) in vm.user.additionalProvidersData" class="social-account-container">
<img ng-src="/modules/users/client/img/buttons/{{providerName}}.png">
Copy link
Member

@simison simison Sep 17, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would probably make sense to use one time binding here: {{::providerName}}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, there's several other places in the project where it would make sense too that we'll have to get round to eventually.

@coveralls
Copy link

coveralls commented Sep 17, 2016

Coverage Status

Coverage decreased (-0.3%) to 72.932% when pulling 10d822b9153a06fc996cd7c3353164492e272d93 on hyperreality:social-login2 into fa13804 on meanjs:master.

@coveralls
Copy link

coveralls commented Sep 17, 2016

Coverage Status

Coverage decreased (-0.3%) to 72.932% when pulling bdb5b9d8d008e65ad0901cf23d1fe2215e5dc22c on hyperreality:social-login2 into fa13804 on meanjs:master.

lirantal and others added 18 commits September 17, 2016 18:45
Fixes css lintings warnings of properties not alphabetized.
Uses the passport info object to simplify login and remove the need to
temporarily cache the redirect within the session.
…he server configs.

Also added a time indicator on failed login attempts to give the user feedback on subsequent failed login attempts.
…down to the client.

reverted some of the other changes (regarding the http request).
Modified config to be "shared". This will allow future configurations to be easily passed to the client.
For New Article, delete function no required
Replaces the $http service calls with promise based methods
of the client-side UsersService for the following:
  Users Change Password
  Users Manage Social Accounts
  Users Password Forgot
  Users Password Reset
  Users Signup
  Users Signin

Modifies tests to reflect changes.

Closes meanjs#1479
@coveralls
Copy link

coveralls commented Sep 17, 2016

Coverage Status

Coverage decreased (-0.2%) to 73.058% when pulling 33fb7d1 on hyperreality:social-login2 into fa13804 on meanjs:master.

@mleanos
Copy link
Member

mleanos commented Oct 1, 2016

@hyperreality I'd like to merge this in, but I'm having a hard time reviewing this with all the other commits from your rebase included. I don't know which commits are specific to this PR. Would it be possible for you to clean this up?

@mleanos
Copy link
Member

mleanos commented Oct 5, 2016

@meanjs/contributors @hyperreality

I pulled this branch down locally, and was able to review. Everything seems to be working. I'm merging this now since it introduces a few important fixes, and we need to finalize the other open PR's to get ready for 0.5.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants