@jaspero/jmsp-help v1.5.4
JMS Plugins
A set of plugins for JMS.
Notes
A custom element intended for use on overview pages. It's a way for
adding notes to any document. You would typically use it in layout.table.actions like this:
{
"actions": [{
"value": "it => '<jms-e-notes data-id=' + it.id + '></jms-e-notes>'"
}]
}or you can use the note-view element in a single instance:
{
"instance": {
"segments": [
{
"components": [{
"selector": "note-view"
}]
}
]
}
}Setup
- Install the plugin
npm i --save @jaspero/jmsp-notes - Import the
JMSPNotesModulein theModuleInstanceModulein your JMS project.
Quick Edit
Adds the capability for editing documents through a dialog.
Setup
- Install the plugin
npm i --save @jaspero/jmsp-quick-edit - Import the
JMSPQuickEditModulein theModuleInstanceModulein your JMS project. For translations add the following to your
transloco.config.js:module.exports = { scopedLibs: [ { src: './node_modules/@jaspero/jmsp-qe', dist: ['./projects/cms/src/assets/i18n/'] } ] };Import translations by running:
transloco:extract-scoped-libs.
You can now use <jms-e-quick-edit data-id="some-id"></jms-e-quick-edit>.
It's also possible to override which segments are shown in quick edit by using metadata.quickEditSegments.
Help FlyOut
A popup for help articles. It's module based and changes dynamically based on what module the user is currently on.
Setup
- Install the plugin
npm i --save @jaspero/jmsp-help - Import the
JMSPHelpModulein theDashboardModulein your JMS project. You can useJMSPHelpModule.forRoot()to configure height, width as well as top and left position. - Add
<jmsp-help-toggle></jmsp-help-toggle>somewhere in your project (it's mainly intended to go in the layout navigation). - In order to be able to add articles through JMS you will need to install the projects module
npm i --save @jaspero/jmsp-modulesinsetupas well and addHELP_PLUGIN_MODULEtomodules.ts. For translations add the following to your
transloco.config.js:module.exports = { scopedLibs: [ { src: './node_modules/@jaspero/jmsp-help', dist: ['./projects/cms/src/assets/i18n/'] } ] };Import translations by running:
transloco:extract-scoped-libs.You will also need to add the following firestore index:
{ "collectionGroup": "help", "queryScope": "COLLECTION", "fields": [ { "fieldPath": "module", "order": "ASCENDING" }, { "fieldPath": "order", "order": "ASCENDING" } ] }
You can find an example implementation here.
GitHub Issues
A set of components for working with github issues.
Development
Creating a plugin
- Run
ng g library [plugin-name] --prefix=jmsp - Add
@jaspero/jmsp-prefix in the projectspackage.json - Add a
releaseproperty. Example fromnotesplugin (remember to replace all references of "notes")."release": { "pkgRoot": "../../dist/@jaspero/jmsp-notes", "branch": "master", "verifyConditions": [ "@semantic-release/changelog", "@semantic-release/npm", "@semantic-release/git" ], "prepare": [ "@semantic-release/changelog", "@semantic-release/npm", "@semantic-release/git" ], "publish": [ "@semantic-release/npm", [ "@semantic-release/github", { "assets": [ "dist/@jaspero/jmsp-notes" ] } ] ], "plugins": [ "@semantic-release/commit-analyzer", "@semantic-release/release-notes-generator" ] } - Create
ng-package.prod.json. Example from notes plugin (remember to replace all references of "notes").{ "$schema": "../../node_modules/ng-packagr/ng-package.schema.json", "dest": "../../dist/@jaspero/jmsp-notes", "lib": { "entryFile": "src/public-api.ts" } } - In
angular.jsonextend thearchitect.configurations.productionwithng-package.prod.json"configurations": { "production": { "tsConfig": "projects/notes/tsconfig.lib.prod.json", "project": "projects/notes/ng-package.prod.json" } } - Add build scripts for the library in to the root
package.json - Build the library and publish an initial version manually. This is required because since it's a scoped
package it needs to be explicitly flagged as public. You can do this by running
npm publish --access publicindist/@jaspero/[package-name].
License
MIT © Jaspero Ltd