1.9.13 • Published 3 years ago

vue-cli-plugin-clm-builder v1.9.13

Weekly downloads
1,120
License
MIT
Repository
-
Last release
3 years ago

vue-cli-plugin-clm-builder


vue-cli3

Status: release

:pray: Easy work with CLM presentations!

This is a vue-cli 3.x plugin to help developing with MI Touch, Kadrige, Pharma Touch, Veeva, QuadraSoft, OCE/OCE-separate, Bayer CRM systems.

:star: Features:

  • Automatically generate file structure.
  • Multi language
    • One slide-instance in development
    • Automatic import necessary text data
  • Build for necessary CRM system
    • Using regular expressions for selectively build
    • Thumbs creating
    • Creating archives
  • Development
    • QR-code for opening external link
    • Opportunity for display CRM system elements
    • Included basic functionality
    • Understanding excel structure
    • Restricted Workspace (for big projects)
  • Project config

Table of contents

Getting started

:warning: Make sure you have vue-cli 3.x.x, node <= 10.17.1 and yarn.

  1. Create

    Create with preset:

    vue create --preset serhiichuk/vue-preset-clm my-project

    Or create manually new project with following features: router, vuex, babel, scss, and add plugin to your project.

    vue add clm-builder
  2. Complete the configuration file clm.config.json.

    Put Exсel File with valid structure in root-folder, and convert structure from the excel file to clm.config.json, and fill in the remaining fields where you need it:

    yarn excel

    Or, Fill the clm.config file manually.

  1. Generate the necessary files to the project structure:

    yarn generate
  2. Start your app:

    yarn dev

Plugin CLI Commands

Plugin generator inject excel, generate, build and dev commands to package.json.

Plugin CLI commands can run with fully-named --clm veeva,mi-touch,quadra-soft,oce,oce-separate,bayer,kadrige or short-named -c v,mt,qs,oce,ocesep,br,kd syntax.

:information_source: For using standard vue build, just run yarn build-standard.

Excel

Convert valid structure from excel-file in root-folder to clm.config.json.

 yarn excel

Generate

Generating slide-components to src/slides, assets folders for each slide to src/assets and all text data files to src/data by scheme bellow:

+-- src
|   +-- slides
|   |    +-- <slide-path>
|   |    |    +-- media
|   |    |    +-- <lang>
|   |    |    |   +-- index.js
|   |    |    +-- index.vue
  • yarn generate [lang]

    • lang - optional parameter, regular expression, must match one or more of languages key in src/clm.config.json

:information_source: For correct passing regular expressions from terminal, please wrap it in double quotes.

yarn generate --lang "ua|ru" // will generated "ua" and "ru" templates

Dev

Running development server.

Actually, duplicates command yarn serve to customary command yarn dev and increase JavaScript heap of memory.

yarn dev

Build

Build slides for necessary CLM"s. Each slide will be built with webpack, have the necessary CLM files and be archived.

  • yarn build <clm> [options] [filter] [lang]

    • clm - required parameter, can be: veeva, mi-touch, pharma-touch, quadra-soft, oce, oce-separate, bayer, kadrige
    • options - optional, can be: no-screens, no-clear-js, no-clear-assets and local(for local build)
    • filter - optional, regular expression for filtering around slide ID
    • lang - optional, regular expression for filtering around slide language

Fully-named syntax:

yarn build --clm mi-touch --options local --filter "slide-1_1|slide-2_1" --lang ua

Short-named syntax:

yarn build -c mt -o lc -f "slide-1_1|slide-2_1" -l ua

Or

yarn b-mt -f "slide-1_1|slide-2_1" -l ua

All build commands

  • Mi Touch: build -c mt -o lc or b-mt
  • Veeva: build -c v -o lc or b-v
  • Pharma Touch: build -c pt -o lc or b-pt
  • Quadra Soft: build -c qs -o lc or b-qs
  • OCE: build -c oce -o lc or b-oce
  • Bayer: build -c br -o lc or b-br
  • Kadrige: build -c kd -o lc or b-kd

Configuration

Vue Config

Plugin generator create vue.config.js with necessary options.

See official documentation for full details.

Restricted Workspace

If you have a large project, you may have with the problem of too long compilation time.

So you can restrict your workspace by adding necessary filter to VUE_APP_RESTRICTED_WORKSPACE_REGEX in .env.development file;

For example:

VUE_APP_RESTRICTED_WORKSPACE_REGEX = slide-1_1$ // workking only with slide-1_1

CLM Config

All project depend of src/clm.config.json

:warning: All unique assets(public) for a particular slide must match the specified path in the path key for necessary slide in structure key in clm.config.

CLM platform options:

  • clm

  • productId

    String, Reauired, must be named under rule: <PROJECT-NAME>_<CYCLE>_<YEAR>.

    During build to productId will added language and slide id parts.

  • productName

    String, Required, Usually this is the same name as the root folder (only for Veeva and Pharma Touch)

  • disableSwipeBetweenFlows

    Boolean, Optional, enable/disable auto preventing swipes between flows

    :warning: At the moment, work only with MI Touch.

  • csv

    Object, Optional, contains information for creating a CSV file (only for Veeva)

    • country

    String, default: "Ukraine"

    • product

    String, default: "INCH"

  • languages

    Array, Required, to build different language versions just add necessary language.

    Valid values for cyrilic languages: ua, ru.

      languages: ["ua", "ru", "fr"]
  • device

    • resolution

      Object, Required, device resolution will export to shared styles.

      Also resolution using for creating slide screenshots.

        "device": {
          "resolution": { // Pixels
            "width": "2048",
            "height": "1536"
          }
        },
  • structure

    Array, Required, each slide must be specified in the structure with following keys:

    OptionTypeSpecifyDescription
    idStringRequiredUnique slide identifier, must be named under rule: slide-<flow-number/name>_<slide-number>
    pathStringRequiredPath to slide. All slide-components must contain in src/slides, and you can create difference folders structure here.
    nameString/ObjectRequiredSlide name. Required for creating "slides.json" in Pharma Touch build, usualy using in navigation-components. If object - keys names must match with languages items.
    flowNameString/ObjectOptionalFlow name, have the same rules as name key.
    swipeObjectOptionalDefine swipe rules. Can have next and prev keys.
    swipe.next, swipe.prevStringOptionalAppropriate swipe will navigate to or prevented CLM swipe with "prevent" value.
    callDialogArrayOptionalList of questions for call dialog definition. (Only fo MI Touch).
    isHiddenBooleanOptionalSet true to hide slide in menu list. (Only fo MI Touch).
    structure: [
      // required keys
      {
        "id": "slide-main",
        "path": "slide-main",
        "name": {"ua": "Назва", "ru": "Название"}
      },
      ...
      {
        "id": "slide-1_3",
        "path": "flow-3/slide-1_3",
        "name": {"ua": "Назва", "ru": "Название"}
        "callDialog": "[
          "My Question 1", // this question will have automatic generated quiesion-id (Q1)
          {
            "id": "custon_id", // custom question id
            "question": "My Question 2"
          }
        ]
      },
      ...
      {
        "id": "slide-4_20",
        "path": "flow-4/slide-4_20",
        "name": "Назва", // the same name for all languages
        "swipe": {
    	    "next": "slide-5_10", // custon next swipe
          "prev": "prevent" // block back swipe
        },
        "isHidden": true // This slide not be displayed
      }
    ]

Additional Info

Slide Component

Each slide-component have global and slide functionality and must be named under rule: slide-<flow-number/name>_<slide-number>.

All slide-components must contain in src/slides, and you can create difference folders structure here, just describe that in clm.config.json.

Basic Functionality

This plugin adds basic functions for CLM presentations and useful utilities for development.

Most of the basic functions defined in src/app-helper.

Global Functionality

// main.js
import mixins from "@/app-helper/mixins"
...
Vue.mixin(mixins.global);

$navigateTo

A global method that performs the function of navigating to the desired slide.

Takes required parameter id.

Have different functional for each CLM system or development.

During development, $navigateTo will check on existing parameter id in structure.

Using in template:

<button class="some-navigation-button" @touchend="$navigateTo("slide-1_4")"></button>

Using in vue instance:

methods: {
  someNavigateMethod() {
    ...
    this.$navigateTo("slide-1_4")
  }
}

$routeQuadraTo

A global method that performs the function of navigating to the desired slide for Quadra Soft CLM.

$routeBayerTo

A global method that performs the function of navigating to the desired slide for Bayer CLM.

$addData

Global method that sends calldialog response to required clm database for Mi Touch CLM and Pharma Touch CLM.

In development method $addData will check on existing callDialog key in current slide.

Using in vue instance:

methods: {
  sendSomeData() {
    ...
    this.$addData("Q1", "Response for quiesion with automatic generated quiesion-id");
    this.$addData("custon_id", "Response for quiesion with custon id");
  }
}

$addData

Global method that sends calldialog response to required clm database for Veeva CLM.

The method can receive arguments: type, value, description, id, duration.

$openPdfIos

Global Method to Open PDF Files on iOS Devices for MI Touch CLM.

Using in vue instance:

methods: {
  showPdf() {
    this.$openPdfIos("pdf/instructions.pdf");
  }
}

Slide Functionality

// each slide-component
import mixins from "@/app-helper/mixins"
...
export default {
  mixins: [ ...mixins.slide ],
}
Text data

For import text data for current language just call: getData with relative (from language folder to file) path:

import getData from '@/data'

const myData = getData('/my-data.js')
+-- src
|   +-- slides
|   |   +-- <path-to-slide>
|   |   |   +-- <lang>
|   |   |   |   +-- index.js

Each slide already has appropriate imported text data in data key.

The text data file must have the same path as slide-component.

Also, for convenience, each slide-component have computed property t for data and l for current language.

Some slide-component:

mounted() {
  /* Text data for current slide, "content" and "popup" is required */
	console.log(this.data);
  // =>
  {
  	content: {
      	title: "This is Awesome Documentations"
    },
    popup: {...}
  }

  /* Easy way to get "data.content" */
  console.log(this.t);
  // =>
  {
  	title: "This is Awesome Documentations"
  }
}

Using computed property t in template:

<h1 class="awesome-title" v-html="t.title"></h1>
Slide info data

Each slide-component already has "personal info" in slide key. This is just an object from the current slide in the structure.

:information_source: In addition, Text data, and Slide info data will be passed to the vuex store as currentData and currentSlide.

App Functionality

// App.vue
import mixins from "@/app-helper/mixins"
...
export default {
  mixins: [...mixins.app]
}

In App.vue has functional for swipe control: v-touch:swipe="swipeHandler".

swipeHandler will get disableSwipeBetweenFlows, and swipe keys from clm.config, and depending on their values will call $navigateTo or prevent necessary swipe.

In addition, App.vue contains some development functionality, do not worry about it, all development functions will be deleted/disabled during the production build.

Acknowledgments

Thank Vue CLI Team for the excellent tool and documents.

Thank vue-cli-plugin-apollo and Nuxt.org for great documentation example.

1.9.13

3 years ago

1.9.12

3 years ago

1.9.11

3 years ago

1.9.10

3 years ago

1.9.9

3 years ago

1.9.1

3 years ago

1.9.8

3 years ago

1.9.7

3 years ago

1.9.6

3 years ago

1.9.5

3 years ago

1.9.4

3 years ago

1.9.3

3 years ago

1.9.2

3 years ago

1.9.0

3 years ago

1.8.13

3 years ago

1.8.14

3 years ago

1.8.11

3 years ago

1.8.12

3 years ago

1.8.10

3 years ago

1.8.9

3 years ago

1.8.8

3 years ago

1.8.7

3 years ago

1.8.6

3 years ago

1.8.5

3 years ago

1.8.4

3 years ago

1.8.3

3 years ago

1.8.2

3 years ago

1.8.1

3 years ago

1.8.0

3 years ago

1.7.35

4 years ago

1.7.34

4 years ago

1.7.33

4 years ago

1.7.32

4 years ago

1.7.31

4 years ago

1.7.30

4 years ago

1.7.29

4 years ago

1.7.28

4 years ago

1.7.27

4 years ago

1.7.26

4 years ago

1.7.25

4 years ago

1.7.24

4 years ago

1.7.23

4 years ago

1.7.21

4 years ago

1.7.22

4 years ago

1.7.20

4 years ago

1.7.19

4 years ago

1.7.18

4 years ago

1.7.17

4 years ago

1.7.16

4 years ago

1.7.15

4 years ago

1.7.14

4 years ago

1.7.13

4 years ago

1.7.12

4 years ago

1.7.10

4 years ago

1.7.11

4 years ago

1.7.9

4 years ago

1.7.8

4 years ago

1.7.7

4 years ago

1.7.6

4 years ago

1.7.5

4 years ago

1.7.4

4 years ago

1.7.3

4 years ago

1.7.1

4 years ago

1.7.0

4 years ago

1.6.57

4 years ago

1.6.58

4 years ago

1.6.55

4 years ago

1.6.54

4 years ago

1.6.56

4 years ago

1.6.53

4 years ago

1.6.52

4 years ago

1.6.51

4 years ago

1.6.50

4 years ago

1.6.48

4 years ago

1.6.49

4 years ago

1.6.47

4 years ago

1.6.46

4 years ago

1.6.45

4 years ago

1.6.44

4 years ago

1.6.43

4 years ago

1.6.42

4 years ago

1.6.41

4 years ago

1.6.40

4 years ago

1.6.39

4 years ago

1.6.37

4 years ago

1.6.36

4 years ago

1.6.38

4 years ago

1.6.33

4 years ago

1.6.35

4 years ago

1.6.34

4 years ago

1.6.32

4 years ago

1.6.24

4 years ago

1.6.26

4 years ago

1.6.25

4 years ago

1.6.28

4 years ago

1.6.29

4 years ago

1.6.31

4 years ago

1.6.30

4 years ago

1.6.23

4 years ago

1.6.22

4 years ago

1.6.21

4 years ago

1.6.20

4 years ago

1.6.19

4 years ago

1.6.18

4 years ago

1.6.17

4 years ago

1.6.16

4 years ago

1.6.15

4 years ago

1.6.14

4 years ago

1.6.13

4 years ago

1.6.12

4 years ago

1.6.11

4 years ago

1.6.10

4 years ago

1.6.9

4 years ago

1.6.8

4 years ago

1.6.7

4 years ago

1.6.6

4 years ago

1.6.5

4 years ago

1.6.4

4 years ago

1.6.3

4 years ago

1.6.2

4 years ago

1.6.1

4 years ago

1.6.0

4 years ago

1.5.6

4 years ago

1.5.5

4 years ago

1.5.4

4 years ago

1.5.3

4 years ago

1.5.2

4 years ago

1.5.1

4 years ago

1.5.0

4 years ago

1.4.9

4 years ago

1.4.8

4 years ago

1.4.7

4 years ago

1.4.6

4 years ago

1.4.5

4 years ago

1.4.4

4 years ago

1.4.3

4 years ago

1.4.2

4 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.3.72

4 years ago

1.3.71

4 years ago

1.3.70

4 years ago

1.3.69

4 years ago

1.3.68

4 years ago

1.3.67

4 years ago

1.3.65

4 years ago

1.3.64

4 years ago

1.3.63

4 years ago

1.3.62

4 years ago

1.3.61

4 years ago

1.3.60

4 years ago

1.3.59

4 years ago

1.3.58

4 years ago

1.3.57

4 years ago

1.3.56

4 years ago

1.3.55

4 years ago

1.3.54

4 years ago

1.3.53

4 years ago

1.3.52

4 years ago

1.3.51

4 years ago

1.3.50

4 years ago

1.3.49

4 years ago

1.3.48

4 years ago

1.3.47

4 years ago

1.3.46

4 years ago

1.3.45

4 years ago

1.3.44

4 years ago

1.3.43

4 years ago

1.3.42

4 years ago

1.3.41

4 years ago

1.3.40

4 years ago

1.3.39

4 years ago

1.3.38

4 years ago

1.3.37

4 years ago

1.3.36

4 years ago

1.3.35

4 years ago

1.3.34

4 years ago

1.3.33

4 years ago

1.3.32

4 years ago

1.3.31

4 years ago

1.3.30

4 years ago

1.3.29

4 years ago

1.3.28

4 years ago

1.3.27

4 years ago

1.3.26

4 years ago

1.3.25

4 years ago

1.3.24

4 years ago

1.3.23

4 years ago

1.3.21

4 years ago

1.3.20

4 years ago

1.3.19

4 years ago

1.3.18

4 years ago

1.3.17

4 years ago

1.3.16

4 years ago

1.3.15

4 years ago

1.3.14

4 years ago

1.3.13

4 years ago

1.3.12

4 years ago

1.3.11

4 years ago

1.3.10

4 years ago

1.3.9

4 years ago

1.3.8

4 years ago

1.3.7

4 years ago

1.3.6

4 years ago

1.3.5

4 years ago

1.3.4

4 years ago

1.3.3

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.9

4 years ago

1.2.8

4 years ago

1.2.7

4 years ago

1.2.6

5 years ago

1.2.5

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.9

5 years ago

1.1.8

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago