fullstack-lang / gong

Gong (go+ng) is a go sub-language that compiles to go and angular. All valid go is valid gong and vice versa. Gong enables fast development of web applications. Gong is model centric and by default, a UML diagram editor of the model is embedded in each application.
MIT License
12 stars 1 forks source link

Probe/Form Add a reverse field editor #405

Closed thomaspeugeot closed 12 months ago

thomaspeugeot commented 1 year ago

As for the legacy material stuff

thomaspeugeot commented 12 months ago

problem, the generated code does not work properly.

For B1, The Form for the Astruct.Annarayofb is not filled with A1.

thomaspeugeot commented 12 months ago

While investigating

[
  {
    "ID": 1,
    "CreatedAt": "0001-01-01T00:00:00Z",
    "UpdatedAt": "0001-01-01T00:00:00Z",
    "DeletedAt": null,
    "Name": "association",
    "Value": null,
    "Options": null,
    "CanBeEmpty": true,
    "ValueID": {
      "Int64": 4,
      "Valid": true
    }
  },
  {
    "ID": 2,
    "CreatedAt": "0001-01-01T00:00:00Z",
    "UpdatedAt": "0001-01-01T00:00:00Z",
    "DeletedAt": null,
    "Name": "association",
    "Value": null,
    "Options": null,
    "CanBeEmpty": true,
    "ValueID": {
      "Int64": 2,
      "Valid": true
    }
  },
  {
    "ID": 3,
    "CreatedAt": "0001-01-01T00:00:00Z",
    "UpdatedAt": "0001-01-01T00:00:00Z",
    "DeletedAt": null,
    "Name": "association",
    "Value": null,
    "Options": null,
    "CanBeEmpty": true,
    "ValueID": {
      "Int64": 3,
      "Valid": true
    }
  }
]

All selects seem to have a Value that is set. Poblem, the name of the formselect is not sufficient. Let's make it better to investigate.

thomaspeugeot commented 12 months ago
[
  {
    "ID": 1,
    "CreatedAt": "0001-01-01T00:00:00Z",
    "UpdatedAt": "0001-01-01T00:00:00Z",
    "DeletedAt": null,
    "Name": "Astruct:Anarrayofb",
    "Value": null,
    "Options": null,
    "CanBeEmpty": true,
    "ValueID": {
      "Int64": 2,
      "Valid": true
    }
  },
  {
    "ID": 2,
    "CreatedAt": "0001-01-01T00:00:00Z",
    "UpdatedAt": "0001-01-01T00:00:00Z",
    "DeletedAt": null,
    "Name": "Astruct:Anotherarrayofb",
    "Value": null,
    "Options": null,
    "CanBeEmpty": true,
    "ValueID": {
      "Int64": 7,
      "Valid": true
    }
  },
  {
    "ID": 3,
    "CreatedAt": "0001-01-01T00:00:00Z",
    "UpdatedAt": "0001-01-01T00:00:00Z",
    "DeletedAt": null,
    "Name": "Dstruct:Anarrayofb",
    "Value": null,
    "Options": null,
    "CanBeEmpty": true,
    "ValueID": {
      "Int64": 1,
      "Valid": true
    }
  }
]
thomaspeugeot commented 12 months ago

options:

[
  {
    "ID": 1,
    "CreatedAt": "0001-01-01T00:00:00Z",
    "UpdatedAt": "0001-01-01T00:00:00Z",
    "DeletedAt": null,
    "Name": "D1",
    "FormFieldSelect_OptionsDBID": {
      "Int64": 3,
      "Valid": true
    },
    "FormFieldSelect_OptionsDBID_Index": {
      "Int64": 0,
      "Valid": true
    }
  },
  {
    "ID": 2,
    "CreatedAt": "0001-01-01T00:00:00Z",
    "UpdatedAt": "0001-01-01T00:00:00Z",
    "DeletedAt": null,
    "Name": "A1",
    "FormFieldSelect_OptionsDBID": {
      "Int64": 1,
      "Valid": true
    },
    "FormFieldSelect_OptionsDBID_Index": {
      "Int64": 0,
      "Valid": true
    }
  },
  {
    "ID": 3,
    "CreatedAt": "0001-01-01T00:00:00Z",
    "UpdatedAt": "0001-01-01T00:00:00Z",
    "DeletedAt": null,
    "Name": "A2",
    "FormFieldSelect_OptionsDBID": {
      "Int64": 1,
      "Valid": true
    },
    "FormFieldSelect_OptionsDBID_Index": {
      "Int64": 1,
      "Valid": true
    }
  },
  {
    "ID": 4,
    "CreatedAt": "0001-01-01T00:00:00Z",
    "UpdatedAt": "0001-01-01T00:00:00Z",
    "DeletedAt": null,
    "Name": "A3",
    "FormFieldSelect_OptionsDBID": {
      "Int64": 1,
      "Valid": true
    },
    "FormFieldSelect_OptionsDBID_Index": {
      "Int64": 2,
      "Valid": true
    }
  },
  {
    "ID": 5,
    "CreatedAt": "0001-01-01T00:00:00Z",
    "UpdatedAt": "0001-01-01T00:00:00Z",
    "DeletedAt": null,
    "Name": "A2",
    "FormFieldSelect_OptionsDBID": {
      "Int64": 2,
      "Valid": true
    },
    "FormFieldSelect_OptionsDBID_Index": {
      "Int64": 0,
      "Valid": true
    }
  },
  {
    "ID": 6,
    "CreatedAt": "0001-01-01T00:00:00Z",
    "UpdatedAt": "0001-01-01T00:00:00Z",
    "DeletedAt": null,
    "Name": "A3",
    "FormFieldSelect_OptionsDBID": {
      "Int64": 2,
      "Valid": true
    },
    "FormFieldSelect_OptionsDBID_Index": {
      "Int64": 1,
      "Valid": true
    }
  },
  {
    "ID": 7,
    "CreatedAt": "0001-01-01T00:00:00Z",
    "UpdatedAt": "0001-01-01T00:00:00Z",
    "DeletedAt": null,
    "Name": "A1",
    "FormFieldSelect_OptionsDBID": {
      "Int64": 2,
      "Valid": true
    },
    "FormFieldSelect_OptionsDBID_Index": {
      "Int64": 2,
      "Valid": true
    }
  }
]
thomaspeugeot commented 12 months ago

From the back end, everything seems all right. In the front, the code seems to say that the Value is correctly set.