Merge "Add support for /groups"
This commit is contained in:
@@ -277,8 +277,7 @@
|
||||
if (!account) { return; }
|
||||
|
||||
this.$.restAPI.getPreferences().then(prefs => {
|
||||
this._userLinks =
|
||||
prefs.my.map(this._fixCustomMenuItem).filter(this._isSupportedLink);
|
||||
this._userLinks = prefs.my.map(this._fixCustomMenuItem);
|
||||
});
|
||||
},
|
||||
|
||||
@@ -318,11 +317,6 @@
|
||||
return linkObj;
|
||||
},
|
||||
|
||||
_isSupportedLink(linkObj) {
|
||||
// Groups are not yet supported.
|
||||
return !linkObj.url.startsWith('/groups');
|
||||
},
|
||||
|
||||
_generateSettingsLink() {
|
||||
return this.getBaseUrl() + '/settings/';
|
||||
},
|
||||
|
||||
@@ -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', () => {
|
||||
const defaultLinks = [{
|
||||
title: 'Faves',
|
||||
|
||||
Reference in New Issue
Block a user