Skip to content
This repository has been archived by the owner on Jun 6, 2022. It is now read-only.

THCLab/oca-form

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

oca.js-vue

As a reference of using this dependency check OCA Editor or Aries TDA

Functions

Zip files

  • resolveZipFile(file)

    • arguments
    • returns
      array of OCA Array1, each element matches one OCA schema
  • exportToZip(schema)

    • arguments
      • schema - OCA Schema2
    • returns
      zip file in OCA format

Forms

  • renderForm(schemaObjects)

    • arguments
      • schemaObjects - OCA Array1
    • returns
      object with two attributes: schema3 and form4
  • renderEmptyForm(uuid, label)

    • arguments
      • uuid
      • label
    • returns
      form4 object of mapped OCA schema
  • createSchemaFromForm(baseForm, form)

    • arguments
      • baseForm3
      • form4
    • returns
      OCA Schema2

Events

  • EventHandlerConstant
    provides constants of emited events:
    • ADD_CONTROL
    • REMOVE_CONTROL
    • CHANGE_DATA_OPTION_IN_CONTROL
    • EXPORT_FORM
    • PUBLISH_FORM
    • SAVE_PREVIEW
    • REJECT_PREVIEW
    • ON_LANGUAGE_CHANGE
    • ERROR
    • ACTIVATE_EDITOR_SIDEBAR
    • DEACTIVATE_EDITOR_SIDEBAR
    • ON_APPLY_EDITOR_SIDEBAR
  • eventBus

Vue Components

  • PreviewComponent
    shows dialog of OCA form

    • props

      • form
      • alternatives
      • readonly
      • confirmLabel
      • confirmProcessing
    • methods

      • openModal(formData, formInput)
      • closeModal()
  • MultiPreviewComponent
    shows dialog of many OCA forms

    • props

      • forms
      • label
      • readonly
      • confirmLabel
      • confirmProcessing
      • rejectLabel
      • rejectProcessing
    • methods

      • openModal()
      • closeModal()
  • FormBuilder

    • props
      • form
      • standards
      • standard

vuex

  • vuexModulesPlugin
    Add it to Vuex.Store constructor in plugins array

Schemas

1) OCA Array: Array of OCA JSONs, first object is schema_base JSON and the rest are overlays JSONs, ex.:

[<schema base json>, <overlay json>, <overlay json>, ...]

2) OCA Schema: JSON of OCA data, ex.:

{
  "schemaBase": <schema base json>,
  "overlay1Name-DRI": <overlay json>,
  "overlay2Name-DRI": <overlay json>,
  ...
}

3) schema: JSON of base OCA schema data, ex.:

{
  "name": string,
  "description": string,
  "classification": string,
  "uuid": string,
  "did": string,
  "version": string
}

4) form: JSON of OCA schema mapped into form format, ex.:

{
  "uuid": string,
  "label": string,
  "sections": array of Sections (see below),
  "type": string
}