Skip to content

Commit

Permalink
fix after test-1
Browse files Browse the repository at this point in the history
  • Loading branch information
pan feng committed Feb 9, 2017
1 parent 4a7cebd commit 5a8600d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions webapp/components/rename_channel_modal.jsx
Expand Up @@ -28,7 +28,7 @@ const holders = defineMessages({
},
url: {
id: 'rename_channel.url',
defaultMessage: 'Url'
defaultMessage: 'URL'
},
defaultError: {
id: 'rename_channel.defaultError',
Expand Down Expand Up @@ -224,7 +224,7 @@ export class RenameChannelModal extends React.Component {
}

const fullUrl = TeamStore.getCurrentTeamUrl() + '/channels';
const shortUrl = getShortenedURL(fullUrl);
const shortUrl = getShortenedURL(fullUrl, 35);
const urlTooltip = (
<Tooltip id='urlTooltip'>{fullUrl}</Tooltip>
);
Expand Down
5 changes: 3 additions & 2 deletions webapp/utils/url.jsx
Expand Up @@ -9,9 +9,10 @@ export function cleanUpUrlable(input) {
return cleaned;
}

export function getShortenedURL(url = '') {
export function getShortenedURL(url = '', getLength = 27) {
if (url.length > 35) {
return url.substring(0, 10) + '...' + url.substring(url.length - 12, url.length) + '/';
const subLength = getLength - 14;
return url.substring(0, 10) + '...' + url.substring(url.length - subLength, url.length) + '/';
}
return url + '/';
}
Expand Down

0 comments on commit 5a8600d

Please sign in to comment.