pollination-react-io 1.86.2 → 1.87.0

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.
@@ -6,7 +6,7 @@ export declare const _defaultConfig: {
6
6
  isLocalJob: boolean;
7
7
  cloudProjectName: any;
8
8
  cloudProjectOwner: any;
9
- validationWithHandlers: boolean;
9
+ useHandlers: boolean;
10
10
  };
11
11
  export declare const ConfigureLocalRun: React.FC<ConfigureLocalRunProps>;
12
12
  export default ConfigureLocalRun;
@@ -29,11 +29,11 @@ export interface LocalConfig {
29
29
  isLocalJob: boolean;
30
30
  cloudProjectName: string;
31
31
  cloudProjectOwner: string;
32
- validationWithHandlers: boolean;
32
+ useHandlers: boolean;
33
33
  }
34
34
  export declare const useCreateStudy: (accountName: string, projectName: string, client: APIClient) => {
35
35
  host: string;
36
36
  createStudy: ({ name, recipe, description }: JobArgs, data: object, onSuccess?: (projectJobInfo: ProjectJobInfo) => void) => Promise<void>;
37
- createLocalStudy: ({ name, description, recipe, recipeFilter, authUserName }: JobArgs, data: object, { localCPUCount, localRunFolder, isLocalJob, cloudProjectName, cloudProjectOwner, validationWithHandlers }: LocalConfig, onSuccess?: (projectJobInfo: ProjectJobInfo) => void, key?: string) => Promise<any>;
37
+ createLocalStudy: ({ name, description, recipe, recipeFilter, authUserName }: JobArgs, data: object, { localCPUCount, localRunFolder, isLocalJob, cloudProjectName, cloudProjectOwner, useHandlers }: LocalConfig, onSuccess?: (projectJobInfo: ProjectJobInfo) => void, key?: string) => Promise<any>;
38
38
  };
39
39
  export {};
@@ -38870,7 +38870,7 @@ var useCreateStudy = function (accountName, projectName, client) {
38870
38870
  }, [accountName, client, processEntryCloud, projectName]);
38871
38871
  var createLocalStudy = useCallback(function (_a, data, _b, onSuccess, key) {
38872
38872
  var name = _a.name, description = _a.description, recipe = _a.recipe, recipeFilter = _a.recipeFilter, authUserName = _a.authUserName;
38873
- var localCPUCount = _b.localCPUCount, localRunFolder = _b.localRunFolder, isLocalJob = _b.isLocalJob, cloudProjectName = _b.cloudProjectName, cloudProjectOwner = _b.cloudProjectOwner, validationWithHandlers = _b.validationWithHandlers;
38873
+ var localCPUCount = _b.localCPUCount, localRunFolder = _b.localRunFolder, isLocalJob = _b.isLocalJob, cloudProjectName = _b.cloudProjectName, cloudProjectOwner = _b.cloudProjectOwner, useHandlers = _b.useHandlers;
38874
38874
  if (key === void 0) { key = performance.now().toString(); }
38875
38875
  return __awaiter$1(void 0, void 0, void 0, function () {
38876
38876
  var job, author, data_1, err_1, jobInfo, response;
@@ -38926,9 +38926,10 @@ var useCreateStudy = function (accountName, projectName, client) {
38926
38926
  LocalRunFolder: localRunFolder,
38927
38927
  Platform: host,
38928
38928
  JobAuthor: author,
38929
+ UseHandlers: useHandlers
38929
38930
  };
38930
38931
  console.log(jobInfo);
38931
- response = window.parent.chrome.webview.hostObjects.study.RunSimulation(JSON.stringify(jobInfo), validationWithHandlers)
38932
+ response = window.parent.chrome.webview.hostObjects.study.RunSimulation(JSON.stringify(jobInfo))
38932
38933
  .then(function (value) {
38933
38934
  onSuccess && onSuccess({
38934
38935
  accountName: cloudProjectOwner,
@@ -41904,7 +41905,7 @@ var _defaultConfig = {
41904
41905
  isLocalJob: false,
41905
41906
  cloudProjectName: undefined,
41906
41907
  cloudProjectOwner: undefined,
41907
- validationWithHandlers: false
41908
+ useHandlers: false
41908
41909
  };
41909
41910
  var ConfigureLocalRun = function (_a) {
41910
41911
  var _b = _a.disabled, disabled = _b === void 0 ? false : _b, defaultVal = _a.defaultVal, onChange = _a.onChange;
@@ -41943,26 +41944,6 @@ var ConfigureLocalRun = function (_a) {
41943
41944
  } },
41944
41945
  React__default.createElement(Laptop$1, null),
41945
41946
  "Local"))),
41946
- React__default.createElement(Label, { label: "Enable Validation" },
41947
- React__default.createElement(ButtonGroup, { wrapperProps: {
41948
- style: {
41949
- width: 'fit-content'
41950
- }
41951
- } },
41952
- React__default.createElement("button", { type: 'button', disabled: disabled, onClick: function () { return setLocalConfig(function (state) { return (__assign(__assign({}, state), { validationWithHandlers: false })); }); }, style: {
41953
- display: 'flex',
41954
- boxShadow: !disabled && !localConfig.validationWithHandlers ?
41955
- 'inset 0px 0px 9px 4px #096dd9' : undefined
41956
- } },
41957
- React__default.createElement(X$3, { size: 16 }),
41958
- "No"),
41959
- React__default.createElement("button", { type: 'button', disabled: disabled, onClick: function () { return setLocalConfig(function (state) { return (__assign(__assign({}, state), { validationWithHandlers: true })); }); }, style: {
41960
- display: 'flex',
41961
- boxShadow: !disabled && localConfig.validationWithHandlers ?
41962
- 'inset 0px 0px 9px 4px #096dd9' : undefined
41963
- } },
41964
- React__default.createElement(Check$1, { size: 16 }),
41965
- "Yes"))),
41966
41947
  localConfig.isLocalJob && React__default.createElement(Label, { label: "Number of CPUs", disabled: !localConfig.isLocalJob, style: {
41967
41948
  backgroundColor: 'white'
41968
41949
  } },
@@ -45386,7 +45367,8 @@ var RecipeForm = function (_a) {
45386
45367
  if (!val)
45387
45368
  delete data[key];
45388
45369
  });
45389
- onSubmit(studyName, data, studyDescription, localConfig)
45370
+ // Update useHandlers attribute
45371
+ onSubmit(studyName, data, studyDescription, __assign(__assign({}, localConfig), { useHandlers: handlers }))
45390
45372
  .finally(function () {
45391
45373
  setLoading(false);
45392
45374
  });
@@ -45442,7 +45424,8 @@ var RecipeForm = function (_a) {
45442
45424
  /**
45443
45425
  * Local study
45444
45426
  */
45445
- var _k = useState(__assign(__assign({}, _defaultConfig), { isLocalJob: initAsLocal, cloudProjectName: projectName, cloudProjectOwner: projectOwner, localRunFolder: simulationPath })), localConfig = _k[0], setLocalConfig = _k[1];
45427
+ var _k = useState(true), handlers = _k[0], setHandlers = _k[1];
45428
+ var _l = useState(__assign(__assign({}, _defaultConfig), { isLocalJob: initAsLocal, cloudProjectName: projectName, cloudProjectOwner: projectOwner, localRunFolder: simulationPath, useHandlers: handlers })), localConfig = _l[0], setLocalConfig = _l[1];
45446
45429
  /**
45447
45430
  * Warning for local study folder
45448
45431
  */
@@ -45492,7 +45475,25 @@ var RecipeForm = function (_a) {
45492
45475
  default: "".concat(recipe.metadata.name, " study") }); } })),
45493
45476
  React__default.createElement(FormInput, { name: 'study-description', description: 'Study description is a optional field.', errorMessage: errors['studydescription'] ? (_c = errors['study-description']) === null || _c === void 0 ? void 0 : _c.message : undefined },
45494
45477
  React__default.createElement(TextInput, { inputProps: __assign(__assign({}, register('study-description')), { defaultValue: '' }), asTextArea: true, reset: function () { return handleReset({ name: 'study-description',
45495
- default: '' }); } })))),
45478
+ default: '' }); } })),
45479
+ host !== 'web' && React__default.createElement(FormInput, { name: 'use-handlers', description: 'Enable handlers for an additional validation and/or to convert inputs to objects that are needed by the recipe.' },
45480
+ React__default.createElement(ButtonGroup, { wrapperProps: {
45481
+ style: {
45482
+ width: 'fit-content'
45483
+ }
45484
+ } },
45485
+ React__default.createElement("button", { type: 'button', onClick: function () { return setHandlers(false); }, style: {
45486
+ display: 'flex',
45487
+ boxShadow: !handlers ?
45488
+ 'inset 0px 0px 9px 4px #096dd9' : undefined
45489
+ } },
45490
+ React__default.createElement(X$3, { size: 16 })),
45491
+ React__default.createElement("button", { type: 'button', onClick: function () { return setHandlers(true); }, style: {
45492
+ display: 'flex',
45493
+ boxShadow: handlers ?
45494
+ 'inset 0px 0px 9px 4px #096dd9' : undefined
45495
+ } },
45496
+ React__default.createElement(Check$1, { size: 16 })))))),
45496
45497
  React__default.createElement(Tabs, { forceRenderTabPanel: true },
45497
45498
  React__default.createElement(TabList, { style: {
45498
45499
  flex: 1,