tradle / tim

mobile and web app that talks to Tradle backend infrastructure and the blockchain. Tim stands for Trust in Motion
GNU General Public License v3.0
20 stars 12 forks source link

properties with showIf annotation do not get cleared when the property they depend on is reset #26

Closed pgmemk closed 3 years ago

pgmemk commented 3 years ago

Say you are creating resource of the type below.

{
  "id": "t.CompanyInformation",
  "type": "tradle.Model",
  "title": "Company Information",
  "subClassOf": "tradle.Form",
  "properties": {
    "companyNumber": {
      "type": "string"
    },
    "residentialAddress": {
      "type": "boolean",
      "title": "Separate residential address",
      "description": "Is there a different residential address to the registered address given"
    },
    "residentialStreetAddress": {
      "type": "string",
      "showIf": "residentialAddress"
    },
    "residentialCity": {
      "type": "string",
      "showIf": "residentialAddress"
    },
    "residentialPostalCode": {
      "type": "string",
      "showIf": "residentialAddress"
    },
    ...
  },
  ...
}
pgmemk commented 3 years ago

fixed 😀. Know when you are resetting the property, all the properties that have this one in their showIf will be cleared up.