Aller au contenu

Behavior

Description of the behavior field

interface BehaviorState {
    behaviors: Behavior[]
}

behaviors

Updated by: UI

List of the Behaviors that exist on the current file.

A Behavior is applied only if the currently active Configuration (see /configuration/currentConfigurationId) satisfies both following conditions:

  • Has its field behaviorsEnabled set to true.
  • Contains the ID of the Behavior in its field enabledBehaviors.

Data model

interface Behavior {
    id: string
    name: string
    search: string
    modifiers: Modifier[]
    file: string
    order: number
    folders: string[]
    enabledByDefault: boolean
    readPermissions: string[]
    writePermissions: string[]
}

interface Modifier {
    _id: string
    details: {
        colorId: number | undefined
        lockedActions: string[]
        enabled: boolean
        id: string | null
    }
    node: string
    type: 'hidden' | 'color' | 'transparent' | 'lock'
    nodeName: string
    depth: number
}

Examples

Delete all behaviors

{
  "behaviors":{
    ...
    "behaviors":[]
  ...
  }
}

Add one Behavior

{
  "behaviors": {
    ...
    "behaviors": [
      {
        "enabledByDefault": false,
        "file": "61f8f80d5d3c8d000b021eaf",
        "folders": [],
        "id": "61f94fc95d3c8d000b026c67",
        "modifiers": [
          {
            "_id": "61f94fc95d3c8d000b026c68",
            "details": {
              "colorId": 9,
              "enabled": true,
              "id": null,
              "lockedActions": [
                "select",
                "annotate",
                "quote"
              ]
            },
            "type": "color"
          }
        ],
        "name": "test",
        "order": 0,
        "readPermissions": [],
        "search": "name=Cone*",
        "writePermissions": []
      }
    ]
  ...
  }
}

November 24, 2022 March 8, 2022