Skip to content
This repository has been archived by the owner on Mar 29, 2023. It is now read-only.

Commit

Permalink
feat: don't show non / blank elements initially
Browse files Browse the repository at this point in the history
Can be easily modeled via existing UI controls.
  • Loading branch information
nikku committed Mar 26, 2022
1 parent dbd298c commit e971679
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/append-menu/AppendMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,15 @@ AppendMenu.prototype._getDefaultEntries = function() {
actionName,
className,
label,
rating,
target
} = option;

return {
label,
id: `create-${actionName}`,
className,
rating,
action: () => {
return this._elementFactory.create('shape', { ...target });
}
Expand Down Expand Up @@ -194,7 +196,7 @@ function AppendMenuComponent(props) {

const filter = (template) => {
if (!value) {
return true;
return template.rating !== -1;
}

const search = [
Expand Down
4 changes: 3 additions & 1 deletion src/create-menu/CreateMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,15 @@ CreateMenu.prototype._getDefaultEntries = function() {
actionName,
className,
label,
rating,
target
} = option;

return {
label,
id: `create-${actionName}`,
className,
rating,
action: () => {
return this._elementFactory.create('shape', { ...target });
}
Expand Down Expand Up @@ -177,7 +179,7 @@ function CreateMenuComponent(props) {

const filter = (template) => {
if (!value) {
return true;
return template.rating !== -1;
}

const search = [
Expand Down
11 changes: 11 additions & 0 deletions src/create-menu/CreateOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export var NONE_EVENTS = [
label: 'Start Event',
actionName: 'replace-non-start-event',
className: 'bpmn-icon-start-event-none',
rating: -1,
target: {
type: 'bpmn:StartEvent'
}
Expand All @@ -11,6 +12,7 @@ export var NONE_EVENTS = [
label: 'Intermediate Throw Event',
actionName: 'replace-with-none-intermediate-throwing',
className: 'bpmn-icon-intermediate-event-none',
rating: -1,
target: {
type: 'bpmn:IntermediateThrowEvent'
}
Expand All @@ -19,6 +21,7 @@ export var NONE_EVENTS = [
label: 'Boundary Event',
actionName: 'replace-with-boundary-event',
className: 'bpmn-icon-intermediate-event-none',
rating: -1,
target: {
type: 'bpmn:IntermediateThrowEvent'
}
Expand All @@ -27,6 +30,7 @@ export var NONE_EVENTS = [
label: 'End Event',
actionName: 'replace-with-none-end',
className: 'bpmn-icon-end-event-none',
rating: -1,
target: {
type: 'bpmn:EndEvent'
}
Expand Down Expand Up @@ -383,6 +387,7 @@ export var GATEWAY = [
label: 'Inclusive Gateway',
actionName: 'replace-with-inclusive-gateway',
className: 'bpmn-icon-gateway-or',
rating: -1,
target: {
type: 'bpmn:InclusiveGateway'
}
Expand All @@ -391,6 +396,7 @@ export var GATEWAY = [
label: 'Complex Gateway',
actionName: 'replace-with-complex-gateway',
className: 'bpmn-icon-gateway-complex',
rating: -1,
target: {
type: 'bpmn:ComplexGateway'
}
Expand Down Expand Up @@ -452,6 +458,7 @@ export var TASK = [
label: 'Task',
actionName: 'replace-with-task',
className: 'bpmn-icon-task',
rating: -1,
target: {
type: 'bpmn:Task'
}
Expand All @@ -460,6 +467,7 @@ export var TASK = [
label: 'Send Task',
actionName: 'replace-with-send-task',
className: 'bpmn-icon-send',
rating: -1,
target: {
type: 'bpmn:SendTask'
}
Expand All @@ -468,6 +476,7 @@ export var TASK = [
label: 'Receive Task',
actionName: 'replace-with-receive-task',
className: 'bpmn-icon-receive',
rating: -1,
target: {
type: 'bpmn:ReceiveTask'
}
Expand All @@ -484,6 +493,7 @@ export var TASK = [
label: 'Manual Task',
actionName: 'replace-with-manual-task',
className: 'bpmn-icon-manual',
rating: -1,
target: {
type: 'bpmn:ManualTask'
}
Expand All @@ -508,6 +518,7 @@ export var TASK = [
label: 'Script Task',
actionName: 'replace-with-script-task',
className: 'bpmn-icon-script',
rating: -1,
target: {
type: 'bpmn:ScriptTask'
}
Expand Down

0 comments on commit e971679

Please sign in to comment.