Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI refresh #9

Merged
merged 9 commits into from
Mar 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
dist
public
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
public
public
dist
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Changelog

All notable changes to [@bpmn-io/element-template-chooser](https://github.com/camunda/element-template-chooser) are documented here. We use [semantic versioning](http://semver.org/) for releases.

## Unreleased

___Note:__ Yet to be released changes appear here._

## 0.0.2

* `FEAT`: update styles
* `FEAT`: provide pre-built distribution + styles ([#1](https://github.com/bpmn-io/element-template-chooser/issues/1))
* `FEAT`: make agnostic of `elementTemplates` implementation ([#2](https://github.com/bpmn-io/element-template-chooser/issues/2))
* `FIX`: scroll to keyboard selected entries ([#6](https://github.com/bpmn-io/element-template-chooser/issues/6))
* `CHORE`: change programmatic API

## 0.0.1

_Initial release._
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ A simple element template chooser for [`properties-panel >= 1`](https://github.c
```javascript
import BpmnModeler from 'bpmn-js/lib/Modeler';

import '@bpmn-io/element-template-chooser/dist/element-template-chooser.css';

import ElementTemplateChooserModule from '@bpmn-io/element-template-chooser';

const modeler = new BpmnModeler({
Expand All @@ -35,8 +37,8 @@ modeler.get('elementTemplatesLoader').setTemplates(ELEMENT_TEMPLATES_JSON);
// from a given list of element templates
const task = modeler.get('elementRegistry').get('MyTask');

const task = await (
modeler.get('elementTemplateChooser').choose(task, ELEMENT_TEMPLATES_JSON)
const template = await (
modeler.get('elementTemplateChooser').open(task, ELEMENT_TEMPLATES_JSON)
);
```

Expand Down
142 changes: 142 additions & 0 deletions example/.camunda/element-templates/example.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,148 @@
}
}
]
}, {
"$schema": "https://unpkg.com/@camunda/zeebe-element-templates-json-schema/resources/schema.json",
"name": "REST Task 1",
"id": "io.camunda.examples.RestTask1",
"description": "A REST API invocation task.",
"appliesTo": [
"bpmn:ServiceTask"
],
"properties": [
{
"type": "Hidden",
"value": "http",
"binding": {
"type": "zeebe:taskDefinition:type"
}
},
{
"label": "REST Endpoint URL",
"description": "Specify the url of the REST API to talk to.",
"type": "String",
"binding": {
"type": "zeebe:taskHeader",
"key": "url"
},
"constraints": {
"notEmpty": true,
"pattern": {
"value": "^https?://.*",
"message": "Must be http(s) URL."
}
}
},
{
"label": "REST Method",
"description": "Specify the HTTP method to use.",
"type": "Dropdown",
"value": "get",
"choices": [
{ "name": "GET", "value": "get" },
{ "name": "POST", "value": "post" },
{ "name": "PATCH", "value": "patch" },
{ "name": "DELETE", "value": "delete" }
],
"binding": {
"type": "zeebe:taskHeader",
"key": "method"
}
},
{
"label": "Request Body",
"description": "Data to send to the endpoint.",
"value": "",
"type": "String",
"optional": true,
"binding": {
"type": "zeebe:input",
"name": "body"
}
},
{
"label": "Result Variable",
"description": "Name of variable to store the response data in.",
"value": "response",
"type": "String",
"optional": true,
"binding": {
"type": "zeebe:output",
"source": "= body"
}
}
]
}, {
"$schema": "https://unpkg.com/@camunda/zeebe-element-templates-json-schema/resources/schema.json",
"name": "REST Task 2",
"id": "io.camunda.examples.RestTask2",
"description": "A REST API invocation task.",
"appliesTo": [
"bpmn:ServiceTask"
],
"properties": [
{
"type": "Hidden",
"value": "http",
"binding": {
"type": "zeebe:taskDefinition:type"
}
},
{
"label": "REST Endpoint URL",
"description": "Specify the url of the REST API to talk to.",
"type": "String",
"binding": {
"type": "zeebe:taskHeader",
"key": "url"
},
"constraints": {
"notEmpty": true,
"pattern": {
"value": "^https?://.*",
"message": "Must be http(s) URL."
}
}
},
{
"label": "REST Method",
"description": "Specify the HTTP method to use.",
"type": "Dropdown",
"value": "get",
"choices": [
{ "name": "GET", "value": "get" },
{ "name": "POST", "value": "post" },
{ "name": "PATCH", "value": "patch" },
{ "name": "DELETE", "value": "delete" }
],
"binding": {
"type": "zeebe:taskHeader",
"key": "method"
}
},
{
"label": "Request Body",
"description": "Data to send to the endpoint.",
"value": "",
"type": "String",
"optional": true,
"binding": {
"type": "zeebe:input",
"name": "body"
}
},
{
"label": "Result Variable",
"description": "Name of variable to store the response data in.",
"value": "response",
"type": "String",
"optional": true,
"binding": {
"type": "zeebe:output",
"source": "= body"
}
}
]
},
{
"$schema": "https://unpkg.com/@camunda/zeebe-element-templates-json-schema/resources/schema.json",
Expand Down
2 changes: 1 addition & 1 deletion example/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import fileOpen from 'file-open';

import download from 'downloadjs';

import ElementTemplateChooserModule from '..';
import ElementTemplateChooserModule from '../src';

import TEMPLATES from './.camunda/element-templates/example.json';

Expand Down
1 change: 0 additions & 1 deletion index.js

This file was deleted.

111 changes: 0 additions & 111 deletions lib/ElementTemplateChooser.css

This file was deleted.