diff --git a/packages/form-js-editor/src/features/properties-panel/Util.js b/packages/form-js-editor/src/features/properties-panel/Util.js index 0e06f7019..36428c75f 100644 --- a/packages/form-js-editor/src/features/properties-panel/Util.js +++ b/packages/form-js-editor/src/features/properties-panel/Util.js @@ -67,7 +67,8 @@ export const LABELED_NON_INPUTS = [ 'button', 'group', 'dynamiclist', - 'iframe' + 'iframe', + 'table' ]; export const INPUTS = [ diff --git a/packages/form-js-editor/src/features/properties-panel/entries/LabelEntry.js b/packages/form-js-editor/src/features/properties-panel/entries/LabelEntry.js index 70edc6882..a28e64df0 100644 --- a/packages/form-js-editor/src/features/properties-panel/entries/LabelEntry.js +++ b/packages/form-js-editor/src/features/properties-panel/entries/LabelEntry.js @@ -1,4 +1,4 @@ -import { INPUTS } from '../Util'; +import { INPUTS, LABELED_NON_INPUTS } from '../Util'; import { DATETIME_SUBTYPES, DATE_LABEL_PATH, TIME_LABEL_PATH } from '@bpmn-io/form-js-viewer'; import { useService, useVariables } from '../hooks'; import { FeelTemplatingEntry, isFeelEntryEdited } from '@bpmn-io/properties-panel'; @@ -44,6 +44,10 @@ export function LabelEntry(props) { } ); + const isSimplyLabled = (field) => { + return [ ...INPUTS.filter(input => input !== 'datetime'), ...LABELED_NON_INPUTS ].includes(field.type); + }; + entries.push( { id: 'label', @@ -51,7 +55,7 @@ export function LabelEntry(props) { editField, field, isEdited: isFeelEntryEdited, - isDefaultVisible: (field) => [ ...INPUTS, 'button', 'group', 'table', 'iframe', 'dynamiclist' ].includes(field.type) + isDefaultVisible: isSimplyLabled } ); diff --git a/packages/form-js-editor/test/spec/features/properties-panel/groups/GeneralGroup.spec.js b/packages/form-js-editor/test/spec/features/properties-panel/groups/GeneralGroup.spec.js index 3815b6ab7..207485779 100644 --- a/packages/form-js-editor/test/spec/features/properties-panel/groups/GeneralGroup.spec.js +++ b/packages/form-js-editor/test/spec/features/properties-panel/groups/GeneralGroup.spec.js @@ -115,6 +115,21 @@ describe('GeneralGroup', function() { }); + it('should NOT render for datetime', function() { + + // given + const field = { type: 'datetime' }; + + // when + const { container } = renderGeneralGroup({ field }); + + // then + const labelInput = findFeelers('label', container); + + expect(labelInput).to.not.exist; + }); + + it('should render for button', function() { // given