Skip to content

Commit

Permalink
Merged in bugfix/SHIBUI-2388 (pull request #622)
Browse files Browse the repository at this point in the history
SHIBUI-2388 Fixed performance issue
  • Loading branch information
rmathis committed Oct 31, 2022
2 parents 1de8714 + 24d3a4a commit 928fc27
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ui/src/app/admin/component/ConfigurationForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ import { includes, uniqBy } from 'lodash';
export function ConfigurationForm({ configurations, configuration = {}, loading, onSave, onCancel }) {

const [names, setNames] = React.useState([]);

const { control, register, getValues, watch, formState: { errors, isValid }, handleSubmit } = useForm({
defaultValues: {
...configuration
},
reValidateMode: 'onChange',
mode: 'onChange',
});

const { fields, append, remove } = useFieldArray({
control,
name: "properties",
Expand All @@ -35,10 +35,11 @@ export function ConfigurationForm({ configurations, configuration = {}, loading,
});

const properties = useProperties();
const selected = watch('properties');

const addProperties = (props) => {

const selected = getValues('properties');

const parsed = props.reduce((coll, prop, idx) => {
if (prop.isCategory) {
return [...coll, ...properties.filter(p => p.category === prop.category)];
Expand Down Expand Up @@ -147,7 +148,7 @@ export function ConfigurationForm({ configurations, configuration = {}, loading,
</thead>
<tbody>
{fields.map((p, idx) => (
<tr key={p.id}>
<tr key={idx}>
<td>{ p.propertyName }</td>
<td>{ p.category }</td>
<td>{ p.displayType === 'number' ? 'integer' : p.displayType }</td>
Expand Down

0 comments on commit 928fc27

Please sign in to comment.