Skip to content

Commit

Permalink
fix(react): wrong settings order
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinechassagne committed Nov 22, 2023
1 parent 0720afb commit 13ac8c4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/core/lib/Builder/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ export default class Builder extends Emitter {

getComponentDisplayableSettings (element, { component }) {
return [
...this.#settings.getDisplayable?.(element) || [],
...this.#components
.getDisplayableSettings?.(element, { component }) || [],
...this.#settings.getDisplayable?.(element) || [],
];
}

Expand Down
11 changes: 4 additions & 7 deletions packages/react/lib/Editable/Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,10 @@ const Form = ({
.map((tab, t) => (
<Tab key={tab.id || t} title={<Text>{ tab.title }</Text>}>
<div className="fields oak-flex oak-flex-col oak-gap-4">
{ tab
.fields
.concat(
(component.settings?.fields || [])
.filter(field => (tab.id === 'general' && !field.tab) ||
field.tab === tab.id)
)
{ (component.settings?.fields || [])

Check warning on line 108 in packages/react/lib/Editable/Form.js

View check run for this annotation

Codecov / codecov/patch

packages/react/lib/Editable/Form.js#L108

Added line #L108 was not covered by tests
.filter(field => (tab.id === 'general' && !field.tab) ||
field.tab === tab.id)

Check warning on line 110 in packages/react/lib/Editable/Form.js

View check run for this annotation

Codecov / codecov/patch

packages/react/lib/Editable/Form.js#L110

Added line #L110 was not covered by tests
.concat(tab.fields)
.sort((a, b) => getFieldPriority(b) - getFieldPriority(a))

Check warning on line 112 in packages/react/lib/Editable/Form.js

View check run for this annotation

Codecov / codecov/patch

packages/react/lib/Editable/Form.js#L112

Added line #L112 was not covered by tests
.filter(f =>
!f.condition ||
Expand Down

0 comments on commit 13ac8c4

Please sign in to comment.