Giter VIP home page Giter VIP logo

Comments (3)

irrbd avatar irrbd commented on July 28, 2024

The example of a scheme:

{
  type: 'object',
  properties: {
    informationMethod: {
      type: 'object',
      title: 'Способ информирования о готовности результатов услуги',
      oneOfFieldName: 'id',
      oneOfFieldTitle: 'Способ информирования о готовности результатов услуги',
      oneOf: [
        {
          type: 'object',
          title: 'По электронной почте',
          id: 'Email',
          properties: {
            Email: {
              title: 'Адрес электронной почты',
              type: 'string',
            },
          },
          required: ['Email'],
        },
        {
          type: 'object',
          title: 'По телефону',
          id: 'Phone',
          properties: {
            Phone: {
              title:
                'Номер телефона (10 цифр без восьмёрки и дополнительных обозначений)',
              type: 'string',
            },
          },
          required: ['Phone'],
        },
      ],
    },
  },
}

from reagent-js.

irrbd avatar irrbd commented on July 28, 2024

In this case we have same key-names into oneOf-objects:

{
  type: 'object',
  title: 'Способ предоставления результата оказания услуги',
  oneOfFieldName: 'issue_method',
  oneOfFieldTitle: 'Способ предоставления результата оказания услуги',
  oneOf: [
    {
      type: 'object',
      title: 'По электронной почте',
      id: 'Email',
      properties: {
        issue_place_id: {
          title: 'Адрес электронной почты',
          type: 'string',
        },
      },
      required: ['issue_place_id'],
    },
    {
      type: 'object',
      title: 'МФЦ',
      id: 'MFC',
      properties: {
        issue_place_id: {
          title: 'Офис МФЦ',
          type: 'radio',
          items: mfcOffices,
        },
      },
      required: ['issue_place_id'],
    },
  ],
}

In this case we don't use auto substitution from the property value from <Form />.
And we use resulting issue_method and issue_place_id from data as special attributes of a case.

The problem
If we fill the second radio-field, then check at the first email-input,
we have the value from the second field into the first input (a some id, 64 for example, in our case).

from reagent-js.

VitaliyMatveev avatar VitaliyMatveev commented on July 28, 2024

@irrbd The most reasonable solution in this case is change scheme to

    {
      type: 'object',
      title: 'По электронной почте',
      id: 'Email',
      properties: {
        email: {
          title: 'Адрес электронной почты',
          type: 'string',
        },
      },
      required: ['email'],
    },
    {
      type: 'object',
      title: 'МФЦ',
      id: 'MFC',
      properties: {
        office_id: {
          title: 'Офис МФЦ',
          type: 'radio',
          items: mfcOffices,
        },
      },
      required: ['office_id'],
    },
  ],```
and handle result

from reagent-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.