@singularsystems/neo-react 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
This file details all new features and changes to functionality. If you only need to see changes that require updates to your project, see the [breaking changes](./Breaking.md) readme.
|
|
4
4
|
|
|
5
|
+
## Version 1.3.1
|
|
6
|
+
|
|
7
|
+
- Routing - Fixed an issue where the base route would take precedence over other routes if it had parameters, and was declared before other routes.
|
|
8
|
+
|
|
5
9
|
## Version 1.3.0
|
|
6
10
|
|
|
7
11
|
- ViewBase and ViewComponentBase now require that the linked view model has a `TaskRunner` as the first argument. See breaking changes for more info.
|
|
@@ -22,9 +22,7 @@ var RouteProvider = /** @class */ (function () {
|
|
|
22
22
|
this.staticRoutes = this.allRoutes.filter(function (c) { return c.params.length === 0; });
|
|
23
23
|
this.parameterisedRoutes = this.allRoutes
|
|
24
24
|
.filter(function (c) { return c.params.length > 0; })
|
|
25
|
-
.
|
|
26
|
-
.sortBy(function (c) { return c.order; }, "desc")
|
|
27
|
-
.map(function (c) { return c.route; });
|
|
25
|
+
.sortBy(function (c) { return c.order; }, "desc");
|
|
28
26
|
}
|
|
29
27
|
/** Gets the path the component is bound to. If the component is bound to multiple paths, the first path is returned. */
|
|
30
28
|
RouteProvider.prototype.getPathForComponent = function (component) {
|
|
@@ -108,7 +106,7 @@ var RouteProvider = /** @class */ (function () {
|
|
|
108
106
|
* Adds a unique key, and adds route parameters extracted from the component static params object.
|
|
109
107
|
*/
|
|
110
108
|
RouteProvider.prototype.processRoute = function (into, route) {
|
|
111
|
-
var processed = __assign(__assign({}, route), { path: route.path, params: [], key: this.key
|
|
109
|
+
var processed = __assign(__assign({}, route), { path: route.path, params: [], key: this.key++, order: 0 });
|
|
112
110
|
if (route instanceof MenuRoute) {
|
|
113
111
|
processed.path = route.basePath;
|
|
114
112
|
}
|
|
@@ -116,6 +114,9 @@ var RouteProvider = /** @class */ (function () {
|
|
|
116
114
|
if (processed.path.length > 1 && processed.path.endsWith("/")) {
|
|
117
115
|
processed.path = processed.path.substring(0, processed.path.length - 1);
|
|
118
116
|
}
|
|
117
|
+
if (processed.path.length > 1) {
|
|
118
|
+
processed.order = processed.path.split("/").length;
|
|
119
|
+
}
|
|
119
120
|
var viewBaseComponent = route.component;
|
|
120
121
|
if (viewBaseComponent.params) {
|
|
121
122
|
for (var param in viewBaseComponent.params) {
|