clear namespaces on logout and properly render nested namespaces in the namepace picker (#7186)

* reset namespace cache when a user logs out

* fix issue where if you log in to a namespace with an initial /, nested namespaces would not show up in the navigation

* set an empty list of namespaces instead of ignoring error

* add tests for namespace bugs

* use this consistently in template
This commit is contained in:
Matthew Irish
2019-08-01 16:53:57 -05:00
committed by GitHub
parent a9a6f7dd6b
commit aaefdc1137
6 changed files with 88 additions and 14 deletions

View File

@@ -126,6 +126,7 @@ export default Component.extend({
// gets set as 'lastMenuLeaves' in the ember concurrency task above
menuLeaves: computed('namespacePath', 'namespaceTree', function() {
let ns = this.get('namespacePath');
ns = ns.replace(/^\//, '');
let leaves = ancestorKeysForKey(ns);
leaves.push(ns);
leaves = this.maybeAddRoot(leaves);