@configura/debug-react 2.0.0-alpha.18 → 2.0.0-alpha.20

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/.eslintrc.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "parser": "@typescript-eslint/parser",
3
+ "plugins": ["@typescript-eslint"],
4
+ "extends": [
5
+ "eslint:recommended",
6
+ "plugin:@typescript-eslint/recommended",
7
+ "prettier"
8
+
9
+ // TODO: Type-checking rules require a proper tsconfig-file to work,
10
+ // pointed at by the parserOption.project setting.
11
+ //
12
+ //"plugin:@typescript-eslint/recommended-requiring-type-checking"
13
+ ]
14
+ //"rules": { "@typescript-eslint/no-floating-promises": "error" }
15
+ //"parserOptions": {
16
+ // "project": "./tsconfig.json"
17
+ //}
18
+ }
@@ -1,16 +1,16 @@
1
- import { CatalogueAPI, DtoCatalogueParams, DtoCatalogueParamsWithoutCid, DtoCataloguePermission, DtoProductParams, DtoTOCResponse, GeneratedProductConfiguration, ProductRefParams } from "@configura/web-api";
1
+ import { CatalogueAPI, DtoCatalogueParams, DtoCatalogueParamsWithCid, DtoCataloguePermission, DtoProductParamsWithCid, DtoTOCResponse, GeneratedProductConfiguration, ProductRefParams } from "@configura/web-api";
2
2
  import { AggregatedLoadingObservable, Filter, Filters, LogLevel } from "@configura/web-utilities";
3
3
  import React from "react";
4
4
  export declare type ExerciserAction = "setup" | "run";
5
5
  export declare function validateAction(action: string): ExerciserAction;
6
- export declare function flattenCataloguePermissions(permissions: DtoCataloguePermission[]): DtoCatalogueParams[];
6
+ export declare function flattenCataloguePermissions(permissions: DtoCataloguePermission[]): DtoCatalogueParamsWithCid[];
7
7
  export declare function filtersKey(...filters: Filter[]): string;
8
- export declare function catalogueFiltersKey(filters: Filters<DtoCatalogueParamsWithoutCid>): string;
9
- export declare function useCatalogueFilters(props: ExerciserState): Filters<DtoCatalogueParamsWithoutCid>;
8
+ export declare function catalogueFiltersKey(filters: Filters<DtoCatalogueParams>): string;
9
+ export declare function useCatalogueFilters(props: ExerciserState): Filters<DtoCatalogueParams>;
10
10
  export declare function productFiltersKey(filters: Filters<ProductRefParams>): string;
11
11
  export declare function useProductFilters(props: ExerciserState): Filters<ProductRefParams>;
12
- export declare function useProductConfigurationIterator(api: CatalogueAPI, lang: string, result: DtoCatalogueParams[], productConditions: Filters<ProductRefParams>): AsyncIterableIterator<GeneratedProductConfiguration | Error>;
13
- export declare function useToc(api: CatalogueAPI, params: DtoCatalogueParamsWithoutCid | undefined, lang: string, setError: (err: unknown) => void, loadingObservable: AggregatedLoadingObservable): DtoTOCResponse | undefined;
12
+ export declare function useProductConfigurationIterator(api: CatalogueAPI, lang: string, result: DtoCatalogueParamsWithCid[], productConditions: Filters<ProductRefParams>): AsyncIterableIterator<GeneratedProductConfiguration | Error>;
13
+ export declare function useToc(api: CatalogueAPI, params: DtoCatalogueParams | undefined, lang: string, setError: (err: unknown) => void, loadingObservable: AggregatedLoadingObservable): DtoTOCResponse | undefined;
14
14
  export interface LogMessageCount {
15
15
  message: string;
16
16
  level: LogLevel;
@@ -29,7 +29,7 @@ export interface ExerciserState {
29
29
  interface Props {
30
30
  api: CatalogueAPI;
31
31
  exerciserState: ExerciserState;
32
- generateExerciserUrl: (action: ExerciserAction, lang: string, params: Partial<DtoProductParams>) => string;
32
+ generateExerciserUrl: (action: ExerciserAction, lang: string, params: Partial<DtoProductParamsWithCid>) => string;
33
33
  setError: (err: unknown) => void;
34
34
  setExerciserState: (next: ExerciserState) => void;
35
35
  }
@@ -67,14 +67,14 @@ export function useProductConfigurationIterator(api, lang, result, productCondit
67
67
  }), [api, lang, productConditions, result]);
68
68
  }
69
69
  export function useToc(api, params, lang, setError, loadingObservable) {
70
- let [response, setResponse] = useState();
70
+ const [response, setResponse] = useState();
71
71
  useEffect(() => {
72
72
  if (!params) {
73
73
  setResponse(undefined);
74
74
  return;
75
75
  }
76
76
  let canceled = false;
77
- let token = loadingObservable.startChildLoading();
77
+ const token = loadingObservable.startChildLoading();
78
78
  api.getTocFlat(Object.assign(Object.assign({}, params), { lang }))
79
79
  .then((res) => !canceled && setResponse(res))
80
80
  .catch((err) => !canceled && setError(err))
@@ -1,4 +1,4 @@
1
- import { DtoProductParams, GeneratedProductConfiguration } from "@configura/web-api";
1
+ import { DtoProductParamsWithCid, GeneratedProductConfiguration } from "@configura/web-api";
2
2
  import { AggregatedLoadingObservable, LogLevel } from "@configura/web-utilities";
3
3
  import { ExerciserAction } from "./Exerciser.js";
4
4
  import { ExerciserReportItem } from "./ExerciserReportItem.js";
@@ -13,7 +13,7 @@ interface Props {
13
13
  addReportItem: (item: ExerciserReportItem) => void;
14
14
  loadingObservable: AggregatedLoadingObservable;
15
15
  productIterator: AsyncIterableIterator<GeneratedProductConfiguration | Error>;
16
- generateExerciserUrl: (action: ExerciserAction, lang: string, params: Partial<DtoProductParams>) => string;
16
+ generateExerciserUrl: (action: ExerciserAction, lang: string, params: Partial<DtoProductParamsWithCid>) => string;
17
17
  }
18
18
  export declare function ExerciserRunner(props: Props): JSX.Element | null;
19
19
  export {};
@@ -1,15 +1,16 @@
1
- import { CatalogueAPI, DtoProductParams, GeneratedProductConfiguration } from "@configura/web-api";
1
+ import { CatalogueAPI, DtoProductParamsWithCid, GeneratedProductConfiguration } from "@configura/web-api";
2
2
  import { AggregatedLoadingObservable } from "@configura/web-utilities";
3
+ import React from "react";
3
4
  import { ExerciserAction, ExerciserState } from "./Exerciser.js";
4
5
  interface Props {
5
6
  api: CatalogueAPI;
6
7
  exerciserState: ExerciserState;
7
- generateExerciserUrl: (action: ExerciserAction, lang: string, params: Partial<DtoProductParams>) => string;
8
+ generateExerciserUrl: (action: ExerciserAction, lang: string, params: Partial<DtoProductParamsWithCid>) => string;
8
9
  loadingObservable: AggregatedLoadingObservable;
9
10
  setError: (err: unknown) => void;
10
11
  setExerciserState: (next: ExerciserState) => void;
11
12
  setProductIterator: (next: AsyncIterableIterator<GeneratedProductConfiguration | Error>) => void;
12
13
  }
13
- export declare function ExerciserSetup(props: Props): JSX.Element;
14
+ export declare const ExerciserSetup: React.FC<Props>;
14
15
  export {};
15
16
  //# sourceMappingURL=ExerciserSetup.d.ts.map
@@ -5,7 +5,7 @@ import { Link } from "react-router-dom";
5
5
  import { useMemoized, useMemoized2 } from "../hooks.js";
6
6
  import { flattenCataloguePermissions, useCatalogueFilters, useProductConfigurationIterator, useProductFilters, useToc, } from "./Exerciser.js";
7
7
  import { FilterSelect } from "./FilterSelect.js";
8
- export function ExerciserSetup(props) {
8
+ export const ExerciserSetup = (props) => {
9
9
  var _a;
10
10
  const { loadingObservable, exerciserState, setProductIterator, api, setError } = props;
11
11
  const { action, lang } = exerciserState;
@@ -51,4 +51,4 @@ export function ExerciserSetup(props) {
51
51
  p.priceList))))),
52
52
  React.createElement("h2", { className: "cfgExerciserHeader" }, "Products Preview"),
53
53
  toc !== undefined ? (React.createElement("ol", null, filteredProducts.map((p) => (React.createElement("li", { key: p.partNr }, p.partNr))))) : filteredCatalogues.length === 1 ? (React.createElement(Loading, { small: true })) : (React.createElement("p", null, "Product preview is only available if a single catalogue is selected"))))));
54
- }
54
+ };
@@ -7,12 +7,13 @@ const Formatted = (props) => {
7
7
  return React.createElement(React.Fragment, null, "-");
8
8
  case "boolean":
9
9
  return React.createElement(React.Fragment, null, trueFalseToText(value));
10
- default:
10
+ default: {
11
11
  const asString = `${value}`;
12
12
  if (asString.indexOf("http") === 0) {
13
13
  return React.createElement("a", { href: asString }, asString);
14
14
  }
15
15
  return React.createElement(React.Fragment, null, asString);
16
+ }
16
17
  }
17
18
  };
18
19
  export const DebugRow = (props) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@configura/debug-react",
3
- "version": "2.0.0-alpha.18",
3
+ "version": "2.0.0-alpha.20",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -19,10 +19,10 @@
19
19
  "test": "echo \"Error: run tests from root\" && exit 1"
20
20
  },
21
21
  "dependencies": {
22
- "@configura/babylon-view": "2.0.0-alpha.18",
23
- "@configura/babylon-view-react": "2.0.0-alpha.18",
24
- "@configura/web-ui": "2.0.0-alpha.18",
25
- "@configura/web-utilities": "2.0.0-alpha.18",
22
+ "@configura/babylon-view": "2.0.0-alpha.20",
23
+ "@configura/babylon-view-react": "2.0.0-alpha.20",
24
+ "@configura/web-ui": "2.0.0-alpha.20",
25
+ "@configura/web-utilities": "2.0.0-alpha.20",
26
26
  "react": "17.x || ^16.12.0",
27
27
  "react-dom": "17.x || ^16.12.0",
28
28
  "react-router-dom": "^5.2.0"
@@ -44,5 +44,5 @@
44
44
  "publishConfig": {
45
45
  "access": "public"
46
46
  },
47
- "gitHead": "6771998ca63444a51edc9eb35f31bf2f767a356a"
47
+ "gitHead": "74b8fd6c45f392b9133843b409f7662dbf93c47e"
48
48
  }