Giter Site home page Giter Site logo

Comments (6)

ecarriou avatar ecarriou commented on June 9, 2024

Hello,

Did you check first the documentation for creating schemas, models and types ?

If you want a description of the properties you can have a look in the MSON core definition files of System Runtime. For example, here is the description of a type schema:

{
  "_id": {
    "type": "string",
    "mandatory": true
  },
  "name": {
    "type": "string",
    "mandatory": true
  },
  "type": {
    "type": "string",
    "mandatory": true
  },
  "schema": {
    "type": "object",
    "mandatory": false
  },
  "value": {
    "type": ["any"],
    "mandatory": false
  },
  "core": {
    "type": "boolean",
    "mandatory": false
  },
  "description": {
    "type": "string",
    "mandatory": false
  }
}

For information there are also many checks done on save to help you to write valid schemas.

About your questions, there is not only one way to do what you want but here some tips.

If you have for example this definition for this new type:

{
  "_id": "d82472ce-3034-4bd2-ad55-ad25eb04c09c",
  "name": "eyeColor",
  "description": "eye colors",
  "type": "string",
  "value": ["blue", "green", "maroon", "other"]
}

and this model:

{
  "_id": "bdce6d04-d68f-4c2a-b36a-565ff06d3cb9",
  "_name": "Person",
  "_description": "",
  "eyeColor": {
    "description": "",
    "type": "eyeColor",
    "readOnly": false,
    "mandatory": false,
    "default": "maroon"
  }
}

To get the list of values to fill a dropdown where you can select an eye color:

// in a behavior you can require the Datastore to get the type definition
const db = this.require('db')
const eyeColorDefinition = db.collections()._Type.find({name: 'eyeColor'})[0]
const values = eyeColorDefinition.value

When a value is selected in the dropdown you can update the component:

this.require('id_of_the_component').eyeColor('blue')

Also remember that you can export your system and use it in any JS Framework. For example you can define your UI with React, import your system and then use create/edit/delete components.

Is that answer to your questions ?

from system-designer.

ryuliantoro avatar ryuliantoro commented on June 9, 2024

from system-designer.

ecarriou avatar ecarriou commented on June 9, 2024

You are welcome.

Do not hesitate, if something is not clear I will update the documentation.

from system-designer.

ecarriou avatar ecarriou commented on June 9, 2024

For information I have just updated documentation for creating schemas, models and types.

from system-designer.

ryuliantoro avatar ryuliantoro commented on June 9, 2024

Where can I find the PWA version?

from system-designer.

ecarriou avatar ecarriou commented on June 9, 2024

You have just to click on Try it online button on https://designfirst.io/systemdesigner/ .

Direct links:

from system-designer.

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.