Skip to content
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

[NEW] Option to enable/disable auto away and configure timer #8029

Merged
merged 21 commits into from
Dec 5, 2017

Conversation

armand1m
Copy link
Contributor

@armand1m armand1m commented Sep 3, 2017

@RocketChat/core

Closes #736

This PR adds two new options to the Account Preferences, where the user can:

  • Enable Auto Away
  • Configure a default Idle Time Limit (only works when auto away is enabled, of course)

This PR also fixes a bug I've found in the checked template helper of the account settings package. When values where persisted as false values, but their default ones where true values, the checked helper would return always the default value since the way it was accessing the nested properties and verifying if they exists where the same as searching for its value.

screenshot_27

Adds "Enable Auto Away" and "Idle Time Limit" field to account settings. Also adds  internationalization to Enable Auto Away. Idle Time Limit internationalization strings still missing. Also adds a Idle Time Limit to RocketChat default settings.
Adds enableAutoAway and idleTimeLimit to the account preferences, and configures the startup.js to
these settings as well..
@CLAassistant
Copy link

CLAassistant commented Sep 3, 2017

CLA assistant check
All committers have signed the CLA.

@engelgabriel engelgabriel modified the milestone: 0.60.0 Sep 4, 2017
@@ -568,6 +568,8 @@
"Enable_Svg_Favicon": "Enable SVG favicon",
"Enable_two-factor_authentication": "Enable two-factor authentication",
"Enabled": "Enabled",
"Enable_Auto_Away": "Enable Auto Away",
"Enable_Svg_Favicon": "Enable SVG favicon",
Copy link
Member

Choose a reason for hiding this comment

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

Is this string addition correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe that the "Enable Svg Favicon" came from a merge made to resolve some conflicts. I may need to look at this PR again now :/

@@ -39,6 +39,10 @@ class SideNav extends Page {
get avatar() { return browser.element('[href="/changeavatar"]'); }
get preferencesClose() { return browser.element('.sidebar-flex__close-button[data-action="close"]'); }

get accountStatusBullet() { return browser.element('.sidebar__account-status-bullet'); }
get accountStatusBulletOnline() { return browser.element('.sidebar__account-status-bullet--online'); }
get accountStatusBulletAway() { return browser.element('.sidebar__account-status-bullet--away'); }
Copy link
Member

Choose a reason for hiding this comment

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

Why did you add this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi, this was meant to be used in e2e tests, but I actually saw that there already were some tests for this functionality. I should have not commited this, I'm removing it.

@armand1m
Copy link
Contributor Author

armand1m commented Dec 2, 2017

Hey, sorry, I've been busy with work. Today I'll review this PR and update it accordingly, as well as fix the broken tests

@rodrigok
Copy link
Member

rodrigok commented Dec 4, 2017

@armand1m It's awesome to know that you are working on it again. Let me know if you can fix that things soon, I'm merging PRs to ship a new release candidate tomorrow and I'd love to include your PR.

@armand1m
Copy link
Contributor Author

armand1m commented Dec 4, 2017

@rodrigok nice, I'll give it some attention now so we can close this issue. Expect to have this PR prepared today.

@armand1m
Copy link
Contributor Author

armand1m commented Dec 5, 2017

@rodrigok Got the tests passing 😄

I've cleaned the dead code that I've left in the first version. I've also fixed some other tests mistakes.
I've implemented internationalization of this feature in 4 languages:

  • English (default)
    captura de tela 2017-12-04 as 23 04 00

  • Portuguese
    captura de tela 2017-12-04 as 23 04 12

  • Brazilian Portuguese
    captura de tela 2017-12-05 as 00 42 34

  • Dutch (Nederlands)
    captura de tela 2017-12-05 as 00 42 23

Here is a GIF demonstrating the feature.

enableautoaway

@armand1m
Copy link
Contributor Author

armand1m commented Dec 5, 2017

Hope to see it released tomorrow 😄

data.roomCounterSidebar = $('#roomCounterSidebar').find('input:checked').val();
data.messageCounterSidebar = $('#messageCounterSidebar').find('input:checked').val();
Copy link
Member

Choose a reason for hiding this comment

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

What is that item? I think it's old code, was replaced by roomCounterSidebar

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Must have been placed in the last merge conflict I needed to solve. Sorry about that.

Copy link
Member

Choose a reason for hiding this comment

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

No problem, it was fixed

@armand1m
Copy link
Contributor Author

armand1m commented Dec 5, 2017

Ok, guess it can be merged 😄

@rodrigok rodrigok merged commit 35a92a2 into RocketChat:develop Dec 5, 2017
@armand1m armand1m deleted the feature/user-presence branch December 5, 2017 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Option to enable/disable auto away and configure timer
4 participants