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

🔒 Using pageCategoryprop to assemble the list of settings routes in… #3562

Merged
merged 1 commit into from
Jun 20, 2022
Merged
Changes from all commits
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
12 changes: 5 additions & 7 deletions packages/editor-ui/src/components/MainSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,6 @@ import {
} from '@/constants';
import { userHelpers } from './mixins/userHelpers';

const settingsRoutes = [
VIEWS.PERSONAL_SETTINGS,
VIEWS.USERS_SETTINGS,
VIEWS.API_SETTINGS,
VIEWS.COMMUNITY_NODES,
];

export default mixins(
genericHelpers,
restApi,
Expand Down Expand Up @@ -628,6 +621,11 @@ export default mixins(
}
},
findFirstAccessibleSettingsRoute() {
// Get all settings rotes by filtering them by pageCategory property
const settingsRoutes = this.$router.getRoutes().filter(
category => category.meta.telemetry &&
category.meta.telemetry.pageCategory === 'settings',
).map(route => route.name || '');
let defaultSettingsRoute = null;

for (const route of settingsRoutes) {
Expand Down