ballerina-core 1.0.210 → 1.0.211

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "ballerina-core",
3
3
  "author": "Dr. Giuseppe Maggiore",
4
4
  "private": false,
5
- "version": "1.0.210",
5
+ "version": "1.0.211",
6
6
  "main": "main.ts",
7
7
  "scripts": {
8
8
  "prettier": "prettier --write ."
@@ -6,6 +6,7 @@ import {
6
6
  DispatchPrimitiveType,
7
7
  CommonAbstractRendererState,
8
8
  CommonAbstractRendererViewOnlyReadonlyContext,
9
+ ValueUnit,
9
10
  } from "../../../../../../../../main";
10
11
  import { Unit } from "../../../../../../../fun/domains/unit/state";
11
12
 
@@ -14,7 +15,7 @@ export type BoolAbstractRendererReadonlyContext<
14
15
  ExtraContext,
15
16
  > = CommonAbstractRendererReadonlyContext<
16
17
  DispatchPrimitiveType<any>,
17
- boolean,
18
+ boolean | ValueUnit,
18
19
  CustomPresentationContext,
19
20
  ExtraContext
20
21
  >;
@@ -36,15 +36,18 @@ export const BoolAbstractRenderer = <
36
36
  >((props) => {
37
37
  const domNodeId = props.context.domNodeAncestorPath + "[boolean]";
38
38
 
39
- if (!PredicateValue.Operations.IsBoolean(props.context.value)) {
39
+ if (
40
+ !PredicateValue.Operations.IsBoolean(props.context.value) &&
41
+ !PredicateValue.Operations.IsUnit(props.context.value)
42
+ ) {
40
43
  console.error(
41
- `Boolean expected but got: ${JSON.stringify(
44
+ `Boolean or unit value expected but got: ${JSON.stringify(
42
45
  props.context.value,
43
46
  )}\n...When rendering \n...${domNodeId}`,
44
47
  );
45
48
  return (
46
49
  <ErrorRenderer
47
- message={`${domNodeId}: Boolean expected but got ${JSON.stringify(
50
+ message={`${domNodeId}: Boolean or unit value expected but got ${JSON.stringify(
48
51
  props.context.value,
49
52
  )}`}
50
53
  />
@@ -7,6 +7,7 @@ import {
7
7
  SingleSelectionType,
8
8
  CommonAbstractRendererState,
9
9
  CommonAbstractRendererViewOnlyReadonlyContext,
10
+ ValueUnit,
10
11
  } from "../../../../../../../../main";
11
12
  import { View } from "../../../../../../../template/state";
12
13
  import { Synchronized } from "../../../../../../../async/domains/synchronized/state";
@@ -24,7 +25,7 @@ export type EnumAbstractRendererReadonlyContext<
24
25
  ExtraContext,
25
26
  > = CommonAbstractRendererReadonlyContext<
26
27
  SingleSelectionType<any>,
27
- ValueOption,
28
+ ValueOption | ValueUnit,
28
29
  CustomPresentationContext,
29
30
  ExtraContext
30
31
  > &
@@ -50,15 +50,18 @@ export const EnumAbstractRenderer = <
50
50
  >((props) => {
51
51
  const domNodeId = props.context.domNodeAncestorPath + "[enum]";
52
52
 
53
- if (!PredicateValue.Operations.IsOption(props.context.value)) {
53
+ if (
54
+ !PredicateValue.Operations.IsOption(props.context.value) &&
55
+ !PredicateValue.Operations.IsUnit(props.context.value)
56
+ ) {
54
57
  console.error(
55
- `Option expected but got: ${JSON.stringify(
58
+ `Option or unit value expected but got: ${JSON.stringify(
56
59
  props.context.value,
57
60
  )}\n...When rendering \n...${domNodeId}`,
58
61
  );
59
62
  return (
60
63
  <ErrorRenderer
61
- message={`${domNodeId}: Option value expected but got ${JSON.stringify(
64
+ message={`${domNodeId}: Option or unit value expected but got ${JSON.stringify(
62
65
  props.context.value,
63
66
  )}`}
64
67
  />
@@ -9,6 +9,7 @@ import {
9
9
  DispatchOnChange,
10
10
  Unit,
11
11
  CommonAbstractRendererViewOnlyReadonlyContext,
12
+ ValueUnit,
12
13
  } from "../../../../../../../../main";
13
14
  import { SumType } from "../../../../deserializer/domains/specification/domains/types/state";
14
15
 
@@ -17,7 +18,7 @@ export type SumAbstractRendererReadonlyContext<
17
18
  ExtraContext = Unit,
18
19
  > = CommonAbstractRendererReadonlyContext<
19
20
  SumType<any>,
20
- ValueSum,
21
+ ValueSum | ValueUnit,
21
22
  CustomPresentationContext,
22
23
  ExtraContext
23
24
  >;
@@ -66,7 +66,9 @@ export const SumAbstractRenderer = <
66
66
  ..._.customFormState.left,
67
67
  disabled: _.disabled,
68
68
  locked: _.locked,
69
- value: _.value.value.value,
69
+ value: PredicateValue.Operations.IsUnit(_.value)
70
+ ? _.value
71
+ : _.value.value.value,
70
72
  bindings: _.bindings,
71
73
  extraContext: _.extraContext,
72
74
  type: _.type.args[0],
@@ -147,7 +149,9 @@ export const SumAbstractRenderer = <
147
149
  ..._.customFormState.right,
148
150
  disabled: _.disabled,
149
151
  locked: _.locked,
150
- value: _.value.value.value,
152
+ value: PredicateValue.Operations.IsUnit(_.value)
153
+ ? _.value
154
+ : _.value.value.value,
151
155
  bindings: _.bindings,
152
156
  extraContext: _.extraContext,
153
157
  type: _.type.args[1],
@@ -219,15 +223,18 @@ export const SumAbstractRenderer = <
219
223
  >((props) => {
220
224
  const domNodeId = props.context.domNodeAncestorPath + "[sum]";
221
225
 
222
- if (!PredicateValue.Operations.IsSum(props.context.value)) {
226
+ if (
227
+ !PredicateValue.Operations.IsSum(props.context.value) &&
228
+ !PredicateValue.Operations.IsUnit(props.context.value)
229
+ ) {
223
230
  console.error(
224
- `Sum expected but got: ${JSON.stringify(
231
+ `Sum or unit value expected but got: ${JSON.stringify(
225
232
  props.context.value,
226
233
  )}\n...When rendering \n...${domNodeId}`,
227
234
  );
228
235
  return (
229
236
  <ErrorRenderer
230
- message={`${domNodeId}: Sum value expected but got ${JSON.stringify(
237
+ message={`${domNodeId}: Sum or unit value expected but got ${JSON.stringify(
231
238
  props.context.value,
232
239
  )}`}
233
240
  />
@@ -38,21 +38,26 @@ export const TableLoadWithRetries =
38
38
  ? Co<CustomPresentationContext, ExtraContext>()
39
39
  .GetState()
40
40
  .then((current) =>
41
- Co<CustomPresentationContext, ExtraContext>().Await(
42
- () =>
43
- tableApiSource.getMany(fromTableApiParser)({
44
- chunkSize: DEFAULT_CHUNK_SIZE,
45
- from:
46
- current.customFormState.loadingState == "reload from 0"
47
- ? 0
48
- : current.value.to + 1,
49
- filtersAndSorting:
50
- current.customFormState.filterAndSortParam === ""
51
- ? undefined
52
- : current.customFormState.filterAndSortParam,
53
- }),
54
- () => "error" as const,
55
- ),
41
+ Co<CustomPresentationContext, ExtraContext>()
42
+ .Wait(attempt > 0 ? 1000 : 0)
43
+ .then(() =>
44
+ Co<CustomPresentationContext, ExtraContext>().Await(
45
+ () =>
46
+ tableApiSource.getMany(fromTableApiParser)({
47
+ chunkSize: DEFAULT_CHUNK_SIZE,
48
+ from:
49
+ current.customFormState.loadingState ==
50
+ "reload from 0" || current.value.to == 0
51
+ ? 0
52
+ : current.value.to + 1,
53
+ filtersAndSorting:
54
+ current.customFormState.filterAndSortParam === ""
55
+ ? undefined
56
+ : current.customFormState.filterAndSortParam,
57
+ }),
58
+ () => "error" as const,
59
+ ),
60
+ ),
56
61
  )
57
62
  .then((apiResult) =>
58
63
  apiResult.kind == "l"