@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.
@@ -118,5 +118,6 @@ var neoFontAwesomeMappings = [
118
118
  ["greater-than-equal", ""],
119
119
  ["stamp", "approval"],
120
120
  ["circle-notch", "progress_activity"],
121
- ["cube", "deployed_code"]
121
+ ["cube", "deployed_code"],
122
+ ["paper-plane", "send"]
122
123
  ];
@@ -10,6 +10,7 @@ export interface IProcessedRoute extends Routing.IRoute {
10
10
  path: string;
11
11
  /** Route params in order, excluding query parameters. */
12
12
  params: INamedRouteParameter[];
13
+ order: number;
13
14
  }
14
15
  type ParamsObject = {
15
16
  [index: string]: string | undefined;
@@ -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
- .map(function (route) { return ({ route: route, order: route.path.split("/").length }); })
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@singularsystems/neo-react",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "React application logic and components for the Neo client library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",