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 28, 2022
1 parent 0e8352f commit e7247ec
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
6 changes: 4 additions & 2 deletions src/append-menu/AppendMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ AppendMenu.prototype._getDefaultEntries = function() {
target,
description,
category,
search
search,
rating
} = option;

return {
Expand All @@ -75,6 +76,7 @@ AppendMenu.prototype._getDefaultEntries = function() {
description,
category,
search,
rating,
action: () => {
return this._elementFactory.create('shape', { ...target });
}
Expand Down Expand Up @@ -213,7 +215,7 @@ function AppendMenuComponent(props) {

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

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

return {
Expand Down Expand Up @@ -188,7 +188,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 @@ -33,6 +33,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 @@ -41,6 +42,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 @@ -49,6 +51,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 @@ -57,6 +60,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 @@ -414,6 +418,7 @@ export var GATEWAY = [
search: 'or',
actionName: 'replace-with-inclusive-gateway',
className: 'bpmn-icon-gateway-or',
rating: -1,
target: {
type: 'bpmn:InclusiveGateway'
}
Expand All @@ -422,6 +427,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 @@ -486,6 +492,7 @@ export var TASK = [
label: 'Task',
actionName: 'replace-with-task',
className: 'bpmn-icon-task',
rating: -1,
target: {
type: 'bpmn:Task'
}
Expand All @@ -494,6 +501,7 @@ export var TASK = [
label: 'Send Task',
actionName: 'replace-with-send-task',
className: 'bpmn-icon-send',
rating: -1,
target: {
type: 'bpmn:SendTask'
}
Expand All @@ -502,6 +510,7 @@ export var TASK = [
label: 'Receive Task',
actionName: 'replace-with-receive-task',
className: 'bpmn-icon-receive',
rating: -1,
target: {
type: 'bpmn:ReceiveTask'
}
Expand All @@ -518,6 +527,7 @@ export var TASK = [
label: 'Manual Task',
actionName: 'replace-with-manual-task',
className: 'bpmn-icon-manual',
rating: -1,
target: {
type: 'bpmn:ManualTask'
}
Expand All @@ -542,6 +552,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 e7247ec

Please sign in to comment.