Merge "Add support for /groups"

This commit is contained in:
Ben Rohlfs
2019-06-27 08:53:38 +00:00
committed by Gerrit Code Review
2 changed files with 1 additions and 18 deletions

View File

@@ -277,8 +277,7 @@
if (!account) { return; } if (!account) { return; }
this.$.restAPI.getPreferences().then(prefs => { this.$.restAPI.getPreferences().then(prefs => {
this._userLinks = this._userLinks = prefs.my.map(this._fixCustomMenuItem);
prefs.my.map(this._fixCustomMenuItem).filter(this._isSupportedLink);
}); });
}, },
@@ -318,11 +317,6 @@
return linkObj; return linkObj;
}, },
_isSupportedLink(linkObj) {
// Groups are not yet supported.
return !linkObj.url.startsWith('/groups');
},
_generateSettingsLink() { _generateSettingsLink() {
return this.getBaseUrl() + '/settings/'; return this.getBaseUrl() + '/settings/';
}, },

View File

@@ -93,17 +93,6 @@ limitations under the License.
]); ]);
}); });
test('filter unsupported urls', () => {
assert.deepEqual([
{url: '/c/331788/'},
{url: '/groups/self'},
{url: 'https://awesometown.com/#hashyhash'},
].filter(element._isSupportedLink), [
{url: '/c/331788/'},
{url: 'https://awesometown.com/#hashyhash'},
]);
});
test('user links', () => { test('user links', () => {
const defaultLinks = [{ const defaultLinks = [{
title: 'Faves', title: 'Faves',