-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[PLT-91] Change URLs of Direct Messages to usernames and more+ #189
Conversation
Thanks @cometkim! Looks like there is a build failure, can you help resolve them? |
1f32e02
to
d8bc771
Compare
I resolved! @jasonblais |
Have asked @lindalumitchell's help with testing |
d8bc771
to
5a9d737
Compare
Please wait for a few more changes. |
OK. Looks fine to me now. Let me know if anyone finds more legacy URLs on the UI. |
Worked on team routes. - Channel Route: /channels/{channel_name} - GM Route: /messages/{group_id} - DM Route: /messages/@{username} - Fail Route: /channels/{default_channel_name} Worked on redirection rules. - /channels/{channel_id} -> Channel Route - /channels/{id1}__{id2} -> DM Route - /messages/{user_id} -> DM Route - /messages/{user_email} -> DM Route - /channels/{group_id} -> GM Route - Any other routes -> Fail Route (Let me know if needs more handling)
4495e7c
to
f58ee94
Compare
f58ee94
to
689d09a
Compare
@jwilander Can I add the |
I just set the value to Please review and let me know if needs more changes then |
import ChannelView from 'components/channel_view'; | ||
import UserStore from 'stores/user_store.jsx'; | ||
import ChannelStore from 'stores/channel_store.jsx'; | ||
import TeamStore from 'stores/team_store.jsx'; |
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 is minor and up to you since the code was already doing this, but it would nice if we could use redux in here instead of these flux stores
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.
Ah, to make router container using redux would be better.
Yeah, actually it was same means above.
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.
@jwilander Can you check the channel_identifier_router.jsx
on the latest commit?
Still use the flux stores to effectively select entities so I'm not sure it makes sense for your comment. (ex: getByName)
GlobalActions.emitChannelClickEvent()
seems to not work properly after connecting to redux store.
But if you like this style, I'd try to switch to this one.
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.
Nah, that's fine. We can deal with that in another PR in the future
|
||
const LengthOfId = 26; | ||
const LengthOfGroupId = 40; | ||
const LengthOfUserIdPair = 54; |
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.
Also minor, but can we use all capitals for constants like so LENGTH_OF_ID
? Just to be consistent with the rest of the codebase
const {path, identifier} = match.params; | ||
|
||
if (path === 'channels') { | ||
if (identifier.length === LengthOfId) { |
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.
What happens if I have a channel name that happens to be 26 characters long? Is it going to try it as a channel ID and fail?
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've found I cannot enter more than 22 characters for a channel name in the webapp. if it could be in another way and that has not same length as specified, it will going to try it as a channel name, and fail (replaced to fallback URL).
history.push(team ? `/${team}/channels/${Constants.DEFAULT_CHANNEL}` : '/'); | ||
} | ||
|
||
export default class NeedsTeam extends React.PureComponent { |
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.
NeedsTeam? You mean MessageIdentifierRouter?
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.
Right? I've wondered about why the previous is
I will change
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.
@crspeller I have changed that to ChannelIdentiferRouter on latest commit
} | ||
|
||
render() { | ||
return <ChannelView/>; |
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 a case where we actually render somthing or do we just redirect? If we just redirect then maybe we should just render nil 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.
There is no redirect here, so I think it should keep returning channel view.
Actually, I'm not sure it can be called "router".
It is just a bunch of onEnter callback to select a channel and it does call an action, does not switch a route.
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.
LGTM once @crspeller's comments are addressed
0005e4e
to
cb8b1af
Compare
Thanks @cometkim ! Great work on this |
* Changed getProfilesAndStatusesForPosts to get at mentioned users in posts * Fix loop format * Changed Object.keys to Object.values * Exported getProfilesAndStatusesForPost * Fix merge * Switch emoji endpoints to v4 * Add license upload and remove actions * Add analytics actions and reducers * Add action for creating group channel * Add functions to v4 client * Fix execute command * Update addToTeamFromInvite function * Update analytics reducers * Add client function to get public file link * Add default headers and oauth route to client * Add action to get user by email * Add team import client function * Set last viewed at for channel members in viewChannel * Remove current user from by ids and usernames actions * General clean-up in preparation for merge to master * Add telemetry tracking * Updates to telemetry * Remove accidentl test code * Always include cookies in fetch requests * Updates per feedback * Minor fix
* Changed getProfilesAndStatusesForPosts to get at mentioned users in posts * Fix loop format * Changed Object.keys to Object.values * Exported getProfilesAndStatusesForPost * Fix merge * Switch emoji endpoints to v4 * Add license upload and remove actions * Add analytics actions and reducers * Add action for creating group channel * Add functions to v4 client * Fix execute command * Update addToTeamFromInvite function * Update analytics reducers * Add client function to get public file link * Add default headers and oauth route to client * Add action to get user by email * Add team import client function * Set last viewed at for channel members in viewChannel * Remove current user from by ids and usernames actions * General clean-up in preparation for merge to master * Add telemetry tracking * Updates to telemetry * Remove accidentl test code * Always include cookies in fetch requests * Updates per feedback * Minor fix
Summary
Worked on team routes.
/channels/{channel_name}
/messages/{group_id}
/messages/@{username}
/channels/{default_channel_name}
Worked on redirection rules.
/channels/{channel_id}
-> Channel Route/channels/{id1}__{id2}
-> DM Route/messages/{user_id}
-> DM Route/messages/{user_email}
-> DM Route/channels/{group_id}
-> GM RouteAnd Clean up codes.
Ticket Link
Checklist