Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
renderDeleteSinkerButton() {
// enable only if there is a sinker selected and its not a metric sinker.
// we do not allow the user to delete our provided metric sinker.
const sinker = this.getSinker();
const enableButton = sinker !== undefined && !Helpers.isMetricSinker(sinker) && this.props.deleteOutputSinkButtonEnabled;
return (
this.props.onDeleteSinker(this.props.selectedSinkerIndex)}
>
<i style="{enableButton">
Delete
</i><i style="{enableButton">
);
}
</i>
renderBackButton() {
const buttonTooltip = this.props.flow.isDirty || this.props.isQueryDirty ? 'Discard Changes' : 'Go Back';
let buttonText = this.props.flow.isDirty || this.props.isQueryDirty ? 'Cancel' : 'Back';
let buttonIcon = <i style="{IconButtonStyles.neutralStyle}">;
if (this.state.loading) {
// render the button as empty during load but keep it existing so that button toolbar is visible
buttonText = '';
buttonIcon = null;
}
return (
this.onCancel()}>
{buttonIcon}
{buttonText}
);
}
</i>
renderDeleteBatchButton() {
const batch = this.getBatch();
const enableButton = batch !== undefined && this.props.deleteBatchButtonEnabled;
return (
this.props.onDeleteBatch(this.props.selectedBatchIndex)}
>
<i style="{enableButton">
Delete
</i><i style="{enableButton">
);
}
</i>
renderDeleteParamButton(index) {
return (
this.onDeleteParam(index)}
>
<i style="{IconButtonStyles.neutralStyle}">
</i><i style="{IconButtonStyles.neutralStyle}">
);
}
</i>
renderPreviewCodeGenQueryButton() {
const display = 'Preview';
return (
<div style="{toggleStyle}">
this.onUpdatePreviewCodeGenQuery()}
>
<i style="{this.props.previewQueryButtonEnabled">
{display}
</i><i style="{this.props.previewQueryButtonEnabled">
</i></div><i style="{this.props.previewQueryButtonEnabled">
);
}
</i>
renderDeleteFunctionButton() {
const enableButton = this.props.selectedFunctionIndex !== undefined && this.props.deleteFunctionButtonEnabled;
return (
this.props.onDeleteFunction(this.props.selectedFunctionIndex)}
>
<i style="{enableButton">
Delete
</i><i style="{enableButton">
);
}
</i>