Skip to content
This repository was archived by the owner on May 25, 2021. It is now read-only.

adding redirect to route path description #1423

Merged
merged 2 commits into from
Nov 19, 2019
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
16 changes: 8 additions & 8 deletions src/backend/utils/parse-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ export function parseRoutes(router: any): Route {
isAux: false,
specificity: null,
data: null,
hash: null,
hash: null
};

return root;
}

function assignChildrenToParent(parentPath, children): [any] {
return children.map((child) => {
return children.map(child => {
const childName = childRouteName(child);
const childDescendents: [any] = child._loadedConfig ? child._loadedConfig.routes : child.children;

Expand All @@ -46,7 +46,7 @@ function assignChildrenToParent(parentPath, children): [any] {
name: childName,
path: `${parentPath ? parentPath : ''}/${pathFragment}`.split('//').join('/'),
isAux: isAuxRoute,
children: [],
children: []
};

if (childDescendents) {
Expand All @@ -58,7 +58,7 @@ function assignChildrenToParent(parentPath, children): [any] {
if (child.data.hasOwnProperty(el)) {
routeConfig.data.push({
key: el,
value: child.data[el],
value: child.data[el]
});
}
}
Expand All @@ -71,11 +71,11 @@ function assignChildrenToParent(parentPath, children): [any] {
function childRouteName(child): string {
if (child.component) {
return child.component.name;
}
else if (child.loadChildren) {
} else if (child.loadChildren) {
return `${child.path} [Lazy]`;
}
else {
} else if (child.redirectTo) {
return `${child.path} -> redirecting to -> "${child.redirectTo}"`;
} else {
return 'no-name-route';
}
}