Merge "Add support for /groups"
This commit is contained in:
@@ -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/';
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -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',
|
||||||
|
|||||||
Reference in New Issue
Block a user