Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Directory search join button #496

Merged
merged 9 commits into from
Sep 26, 2016
Merged

Directory search join button #496

merged 9 commits into from
Sep 26, 2016

Conversation

dbkr
Copy link
Member

@dbkr dbkr commented Sep 23, 2016

Implement 'join' button that appears in room directory search box when you type a valid(ish) alias.

Also factors out the directory search box to a different component now it's a lot more complex (and also adds the clear button that was in the designs).

Fixes element-hq/element-web#2217

@dbkr dbkr changed the base branch from master to develop September 23, 2016 15:38
Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

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

some minor pedantry

}
}

_contentLooksLikeAlias() {
Copy link
Member

Choose a reason for hiding this comment

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

what's with some of the internal functions having _, and some not? I'd prefer it if they all had _, but at least be consistent.

Copy link
Member Author

Choose a reason for hiding this comment

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

The logic, ftr, was treating functions passed to other bits (ie. the react callbacks) as public facing.

Copy link
Member

Choose a reason for hiding this comment

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

yeah, but that's bogus :-p.

if (!this.input) return false;

// liberal test for things that look like room aliases
return /#.+:.+/.test(this.state.value);
Copy link
Member

Choose a reason for hiding this comment

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

this matches abc#def:abc. You probably want /^#.+:/

@dbkr
Copy link
Member Author

dbkr commented Sep 26, 2016

ptal

Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

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

lgtm otherwise

if (!this.input) return false;

// liberal test for things that look like room aliases
return /^#.+:.+/.test(this.state.value);
Copy link
Member

Choose a reason for hiding this comment

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

trailing .+ is redundant now

@richvdh richvdh assigned dbkr and unassigned richvdh Sep 26, 2016
@dbkr dbkr merged commit 2e16448 into develop Sep 26, 2016
@richvdh richvdh deleted the dbkr/directory_search_box branch February 15, 2017 13:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants