-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
345 additions
and
231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import React from "react"; | ||
|
||
import Form from "react-bootstrap/Form"; | ||
import ListGroup from "react-bootstrap/ListGroup"; | ||
|
||
import {Translate} from '../../i18n/components/translate'; | ||
|
||
export function CustomFieldTemplate ({ | ||
id, | ||
children, | ||
displayLabel, | ||
rawErrors = [], | ||
rawHelp, | ||
rawDescription, | ||
...props | ||
}) { | ||
|
||
console.log(props); | ||
return ( | ||
<>{!props.hidden ? <Form.Group> | ||
{children} | ||
{displayLabel && rawDescription ? ( | ||
<Form.Text className={rawErrors.length > 0 ? "text-danger" : "text-muted"}> | ||
<Translate value={rawDescription} /> | ||
</Form.Text> | ||
) : null} | ||
{rawErrors.length > 0 && ( | ||
<ListGroup as="ul"> | ||
{rawErrors.map((error) => { | ||
return ( | ||
<ListGroup.Item as="li" key={error} className="border-0 m-0 p-0"> | ||
<small className="m-0 text-danger"> | ||
{error} | ||
</small> | ||
</ListGroup.Item> | ||
); | ||
})} | ||
</ListGroup> | ||
)} | ||
{rawHelp && ( | ||
<Form.Text | ||
className={rawErrors.length > 0 ? "text-danger" : "text-muted"} | ||
id={id}> | ||
<Translate value={rawHelp} /> | ||
</Form.Text> | ||
)} | ||
</Form.Group> | ||
: <></>}</> | ||
); | ||
}; | ||
|
||
export default CustomFieldTemplate; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const fields = { | ||
// SchemaField: CustomSchemaField | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.