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] Automatically select the first channel #7350

Merged
merged 7 commits into from
Aug 21, 2017

Conversation

antaryami-sahoo
Copy link
Contributor

@antaryami-sahoo antaryami-sahoo commented Jun 27, 2017

Automatically select the first channel after login.

Issue URL:
https://www.bountysource.com/issues/44518290-enter-instantly-to-first-room-after-login
closes #6794

@RocketChat RocketChat deleted a comment Jun 27, 2017
@RocketChat RocketChat deleted a comment Jun 27, 2017
@RocketChat RocketChat deleted a comment Jun 27, 2017
@RocketChat RocketChat deleted a comment Jun 27, 2017
@RocketChat RocketChat deleted a comment Jun 27, 2017
@@ -73,6 +73,15 @@ Template.roomList.helpers({
}
});

Template.roomList.rendered = function() {
if (this.data.identifier !== undefined && this.data.identifier === 'c') {
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs to be optional. Not everyone wants this. Some want to make use of the home page to show off news and other items. Also perhaps it could let an admin choose to either take them to a specific channel, or the first channel in the list.

if (this.data.identifier !== undefined && this.data.identifier === 'c') {
const _first_child = this.find('.channelItemLists').children[0];
if (_first_child !== '' && _first_child !== undefined) {
_first_child.children[0].click();
Copy link
Contributor

@geekgonecrazy geekgonecrazy Jun 27, 2017

Choose a reason for hiding this comment

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

Please look at room manager to open channels. The DOM elements here are going to change. If this class goes away the functionality breaks. This kind of thing would be ok for a user to add in custom javascript. But for including in our code... We wouldn't be able to accept 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.

So I'll add one textbox in Admin ~~ General section with label "First Channel After Login". User can provide the channel he want. If no channel is provided or invalid channel is provided then default home page will be loaded.

will this be fine?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, that is fine. You should remove these changes on this file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Anything else needed here? If not then let me know the next step to proceed further.

@antaryami-sahoo
Copy link
Contributor Author

So I'll add one textbox in Admin ~~ General section with label "First Channel After Login". User can provide the channel he want. If no channel is provided or invalid channel is provided then default home page will be loaded.

will this be fine?

@geekgonecrazy
Copy link
Contributor

That should do the trick. Just make sure to use RoomManager or something of that sort to do the loading of the channel. Doing things via the DOM is bound to result in things breaking.

@geekgonecrazy
Copy link
Contributor

Looks better! @RocketChat/core what should we do if they aren't in the channel any more? Should we keep showing it?

@antaryami-sahoo
Copy link
Contributor Author

If the channel is not available now or a invalid one then it will show the default home screen.

@antaryami-sahoo
Copy link
Contributor Author

If everything is ok, please let me know I will merge the code.

@RocketChat RocketChat deleted a comment Jul 7, 2017
@RocketChat RocketChat deleted a comment Jul 7, 2017
if (this.data.identifier !== undefined && this.data.identifier === 'c') {
const _first_child = this.find('.channelItemLists').children[0];
if (_first_child !== '' && _first_child !== undefined) {
_first_child.children[0].click();
Copy link
Member

Choose a reason for hiding this comment

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

Yes, that is fine. You should remove these changes on this file

@antaryami-sahoo
Copy link
Contributor Author

Ok. I will remove changes from roomList.js and roomList.html

@antaryami-sahoo
Copy link
Contributor Author

Removed from roomList.js

@designgurudotorg
Copy link
Contributor

Anyone still working on this - looks like a great (and much asked for) feature! :)

@engelgabriel engelgabriel added this to the 0.59.0 milestone Aug 7, 2017
@rodrigok rodrigok merged commit 3fcaedc into RocketChat:develop Aug 21, 2017
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.

Enter instantly to first room after login
5 participants