Sort topic params (#994)

This commit is contained in:
Stuart Hinson 2021-10-25 06:36:52 -04:00 committed by GitHub
parent 8a36af12b1
commit cf3708a3e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -63,15 +63,17 @@ const CustomParamField: React.FC<Props> = ({
defaultValue={field.name}
>
<option value="">Select</option>
{Object.keys(TOPIC_CUSTOM_PARAMS).map((opt) => (
<option
key={opt}
value={opt}
disabled={existingFields.includes(opt)}
>
{opt}
</option>
))}
{Object.keys(TOPIC_CUSTOM_PARAMS)
.sort()
.map((opt) => (
<option
key={opt}
value={opt}
disabled={existingFields.includes(opt)}
>
{opt}
</option>
))}
</select>
<p className="help is-danger">
<ErrorMessage errors={errors} name={`customParams.${index}.name`} />