Skip to content

Commit 6950495

Browse files
committed
LPS-101063 - Don't merge into master - just a POC
1 parent 6a44da5 commit 6950495

File tree

1 file changed

+31
-14
lines changed
  • modules/apps/segments/segments-web/src/main/resources/META-INF/resources/js/components/inputs

1 file changed

+31
-14
lines changed

modules/apps/segments/segments-web/src/main/resources/META-INF/resources/js/components/inputs/StringInput.es.js

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,19 @@ class StringInput extends React.Component {
9494
event => {
9595
onChange({
9696
displayValue: event.entityname,
97-
value: event.entityid
97+
value: event.entityid, options: [{label: 'test', value: 1234}]
9898
});
9999
}
100100
);
101101
}
102102
};
103103

104104
render() {
105-
const {disabled, options, value} = this.props;
105+
let {disabled, displayValue, options, value} = this.props;
106+
107+
if (value) {
108+
options = [{label: 'test', value: 1234}];
109+
}
106110

107111
return options.length === 0 ? (
108112
<div className="criterion-input input-group">
@@ -127,19 +131,32 @@ class StringInput extends React.Component {
127131
</div>
128132
</div>
129133
) : (
130-
<ClaySelectWithOption
131-
className="criterion-input form-control"
132-
data-testid="options-string"
133-
disabled={disabled}
134-
onChange={this._handleChange}
135-
options={options.map(o => ({
136-
label: o.label,
137-
value: o.value
138-
}))}
139-
value={value}
140-
/>
134+
<div className="criterion-input input-group">
135+
<div className="input-group-prepend">
136+
<button
137+
className="btn btn-secondary"
138+
id="button-addon1"
139+
onClick={this._handleSelectEntity}
140+
type="button"
141+
>
142+
{displayValue}
143+
</button>
144+
</div>
145+
146+
<ClaySelectWithOption
147+
className="criterion-input form-control input-group-item input-group-append input-group-item-shrink"
148+
data-testid="options-string"
149+
disabled={disabled}
150+
onChange={this._handleChange}
151+
options={options.map(o => ({
152+
label: o.label,
153+
value: o.value
154+
}))}
155+
value={value}
156+
/>
157+
</div>
141158
);
142159
}
143160
}
144161

145-
export default StringInput;
162+
export default StringInput;

0 commit comments

Comments
 (0)