Skip to content

Commit

Permalink
[BeatsCM] Fixes elastic#26016 - beat type always updates in command now
Browse files Browse the repository at this point in the history
To test, select a beat type, select an OS, then re-select a diferent beat type
  • Loading branch information
mattapperson committed Dec 6, 2018
1 parent 301491d commit ca6082b
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions x-pack/plugins/beats_management/public/components/enroll_beats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* you may not use this file except in compliance with the Elastic License.
*/
import {
// @ts-ignore typings for EuiBasicTable not present in current version
EuiBasicTable,
EuiFlexGroup,
EuiFlexItem,
Expand Down Expand Up @@ -144,17 +143,17 @@ export class EnrollBeat extends React.Component<ComponentProps, ComponentState>
value={this.state.command}
options={[
{
value: `sudo ${this.state.beatType}`,
value: `sudo {{beatType}}`,
text: 'DEB / RPM',
},
{
value: `PS C:\\Program Files\\${capitalize(this.state.beatType)}> ${
value: `PS C:\\Program Files\\${capitalize(
this.state.beatType
}.exe`,
)}> {{beatType}}.exe`,
text: 'Windows',
},
{
value: `./${this.state.beatType}`,
value: `./{{beatType}}`,
text: 'MacOS',
},
]}
Expand Down Expand Up @@ -188,17 +187,12 @@ export class EnrollBeat extends React.Component<ComponentProps, ComponentState>
className="euiFieldText euiFieldText--fullWidth"
style={{ textAlign: 'left' }}
>
<FormattedMessage
id="xpack.beatsManagement.enrollBeat.stateCommandEnrollLocationProtocolTitle"
defaultMessage="$ {stateCommand} enroll {locationProtocol}"
values={{
stateCommand: this.state.command,
locationProtocol: window.location.protocol,
}}
/>
{`//`}
{window.location.host}
{this.props.frameworkBasePath} {this.props.enrollmentToken}
{`$ ${this.state.command.replace(
'{{beatType}}',
this.state.beatType
)} enroll ${window.location.protocol}://${window.location.host} ${
this.props.frameworkBasePath
} ${this.props.enrollmentToken}`}
</div>
</div>
<br />
Expand Down

0 comments on commit ca6082b

Please sign in to comment.