Skip to content

Commit

Permalink
feat: support placeholder entity type
Browse files Browse the repository at this point in the history
  • Loading branch information
harshpatel-crest committed Jun 8, 2021
1 parent 08f3929 commit dd79c29
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
15 changes: 15 additions & 0 deletions ui/src/main/webapp/components/PlaceholderComponent.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react';
import PropTypes from 'prop-types';
import StaticContent from '@splunk/react-ui/StaticContent';

function PlaceholderComponent(props) {
const { defaultValue } = props.controlOptions;

return <StaticContent>{defaultValue}</StaticContent>;
}

PlaceholderComponent.propTypes = {
controlOptions: PropTypes.object,
};

export default PlaceholderComponent;
16 changes: 9 additions & 7 deletions ui/src/main/webapp/constants/ControlTypeMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ import SingleInputComponent from '../components/SingleInputComponent';
import MultiInputComponent from '../components/MultiInputComponent';
import CheckBoxComponent from '../components/CheckBoxComponent';
import RadioComponent from '../components/RadioComponent';
import PlaceholderComponent from '../components/PlaceholderComponent';
import CustomControl from '../components/CustomControl';

export default {
'text': TextComponent,
'singleSelect': SingleInputComponent,
'helpLink':HelpLinkComponent,
'multipleSelect':MultiInputComponent,
'checkbox':CheckBoxComponent,
'radio':RadioComponent,
'custom':CustomControl
text: TextComponent,
singleSelect: SingleInputComponent,
helpLink: HelpLinkComponent,
multipleSelect: MultiInputComponent,
checkbox: CheckBoxComponent,
radio: RadioComponent,
placeholder: PlaceholderComponent,
custom: CustomControl,
};

0 comments on commit dd79c29

Please sign in to comment.