swoop-common 2.0.49 → 2.0.50

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.
@@ -15,17 +15,7 @@ import { registerComponent } from '../registry/components';
15
15
  import { ComponentPool } from '../registry/types';
16
16
  import { CoreService } from '../../api/generated/core';
17
17
  const FormTemplatePicker = ({ templates, selectedTemplates, onChange, label, enabled }) => {
18
- // Very ugly chain, just temp as the data is ass right now.
19
- const cleanSelected = typeof selectedTemplates === "string"
20
- ?
21
- [selectedTemplates]
22
- :
23
- Array.isArray(selectedTemplates)
24
- ?
25
- selectedTemplates
26
- :
27
- [];
28
- const selectedValues = templates.filter(t => cleanSelected.includes(t.id));
18
+ const selectedValues = templates.filter(t => selectedTemplates.includes(t.id));
29
19
  return (React.createElement(Paper, { component: "form", sx: { display: 'flex', flexDirection: 'column', gap: 2, p: 2, mb: 1 }, noValidate: true, autoComplete: "off" },
30
20
  React.createElement(Typography, { variant: "h6" }, label),
31
21
  React.createElement(Autocomplete, { multiple: true, options: templates, getOptionLabel: (option) => option.name, getOptionKey: o => o.id, value: selectedValues, onChange: (_, newValue) => {
@@ -52,6 +42,6 @@ const FormRendererTemplatePicker = ({ data, handleChange, path, label, enabled }
52
42
  });
53
43
  load();
54
44
  }, []);
55
- return (React.createElement(FormTemplatePicker, { templates: templates, selectedTemplates: data || [], onChange: (ids) => handleChange(path, { templateIds: ids }), getError: getError, label: label, enabled: enabled }));
45
+ return (React.createElement(FormTemplatePicker, { templates: templates, selectedTemplates: data.templateIds || [], onChange: (ids) => handleChange(path, { templateIds: ids }), getError: getError, label: label, enabled: enabled }));
56
46
  };
57
47
  registerComponent("componentOptions", FormRendererTemplatePicker, ComponentPool.FORM);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "swoop-common",
3
- "version": "2.0.49",
3
+ "version": "2.0.50",
4
4
  "main": "dist/api/index.js",
5
5
  "types": "dist/api/index.d.ts",
6
6
  "exports": {