-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚚 [#4908] Move relative api endpoint admin field to separate file
Will be easier to add new fields
- Loading branch information
1 parent
451061e
commit 4024bf6
Showing
2 changed files
with
35 additions
and
25 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
30 changes: 30 additions & 0 deletions
30
...penforms/js/components/admin/form_design/registrations/json/fields/RelativeAPIEndpoint.js
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,30 @@ | ||
import {useField} from 'formik'; | ||
import React from 'react'; | ||
import {FormattedMessage} from 'react-intl'; | ||
|
||
import Field from 'components/admin/forms/Field'; | ||
import FormRow from 'components/admin/forms/FormRow'; | ||
import {TextInput} from 'components/admin/forms/Inputs'; | ||
|
||
|
||
const RelativeAPIEndpoint = () => { | ||
// TODO-4098: is this the serializer name? | ||
const [fieldProps] = useField('relativeApiEndpoint'); | ||
return ( | ||
<FormRow> | ||
<Field | ||
name="relativeApiEndpoint" | ||
label={ | ||
<FormattedMessage | ||
description="JSON registration options 'relativeApiEndpoint' label" | ||
defaultMessage="Relative API Endpoint" | ||
/> | ||
} | ||
> | ||
<TextInput id="id_relativeApiEndpoint" {...fieldProps} /> | ||
</Field> | ||
</FormRow> | ||
); | ||
}; | ||
|
||
export default RelativeAPIEndpoint; |