How can I add `json` type field input on Admin User?

System Information
  • Strapi Version: 3.3.4
  • Operating System: Mac OS
  • Database: mongo
  • Node Version: 12.18
  • NPM Version: 6
  • Yarn Version:

I added settings field on model & validation logic.
Editing through api works well.

But I wanted to show this field on Admin Panel so I modified two files below.

On strapi-admin/admin/src/containers/Users/EditPage/utils/form.js

  // added
  settings: {
    label: 'Settings',
    type: 'json',
  },

On strapi-admin/admin/src/containers/Users/EditPage/index.js

useUsersForm(`/admin/users/${id}`, editValidation, cbSuccess, [
    'email',
    'firstname',
    'lastname',
    'username',
    'isActive',
    'roles',
    'registrationToken',
    // added
    'settings',
  ]);

But the field shows error text This json is not available.

What should I do next?

I solved it by copying InputJSON and InputJSONWithErrors component from strapi-plugin-content-manager.

And use it on strapi-admin/admin/src/components/IntlInput/index.js like below.

    <Inputs
      {...rest}
      label={label}
      error={translatedError}
      translatedErrors={formattedErrors}
      // register as customInput
      customInputs={{
        json: InputJSONWithErrors,
      }}
    />