Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ancestorKeysForKey always returns an array #6205

Merged
merged 2 commits into from
Aug 1, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ui/app/components/key-value-header.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default Component.extend({
const showCurrent = this.get('showCurrent');
const ancestors = utils.ancestorKeysForKey(baseKey);
const parts = utils.keyPartsForKey(baseKey);
if (!ancestors) {
if (ancestors.length === 0) {
crumbs.push({
label: baseKey,
text: this.stripTrailingSlash(baseKey),
Expand Down
2 changes: 1 addition & 1 deletion ui/app/components/namespace-picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +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');
let leaves = ancestorKeysForKey(ns) || [];
let leaves = ancestorKeysForKey(ns);
leaves.push(ns);
leaves = this.maybeAddRoot(leaves);

Expand Down
2 changes: 1 addition & 1 deletion ui/app/lib/key-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function ancestorKeysForKey(key) {
parentKey = parentKeyForKey(parentKey);
}

return ancestors.length ? ancestors : null;
return ancestors;
}

export default {
Expand Down
2 changes: 1 addition & 1 deletion ui/app/mixins/with-nav-to-nearest-ancestor.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default Mixin.create({
navToNearestAncestor: task(function*(key) {
let ancestors = utils.ancestorKeysForKey(key);
let errored = false;
let nearest = ancestors && ancestors.pop();
let nearest = ancestors.pop();
while (nearest) {
try {
let transition = this.transitionToRoute('vault.cluster.secrets.backend.list', nearest);
Expand Down