Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
);
// Props
SideToolbar.propTypes = {
isTestQueryOutputPanelVisible: PropTypes.bool.isRequired,
onShowTestQueryOutputPanel: PropTypes.func.isRequired
};
export default SideToolbar;
// Styles
const panelStyle = {
position: 'fixed',
right: 0,
backgroundColor: Colors.neutralTertiaryAlt,
width: 39
};
const itemContainerStyle = {
transform: 'rotate(90deg) translateX(39px)',
transformOrigin: '39px 0 0',
height: 39,
display: 'flex'
};
const itemStyle = {
backgroundColor: Colors.customBlueDarker,
color: Colors.white,
fontSize: 15,
paddingTop: 9,
paddingBottom: 9,
onUpdateBatchEndTime: value => dispatch(Actions.updateBatchEndTime(value)),
onUpdateBatchIntervalValue: value => dispatch(Actions.updateBatchIntervalValue(value)),
onUpdateBatchIntervalType: value => dispatch(Actions.updateBatchIntervalType(value)),
onUpdateBatchDelayValue: value => dispatch(Actions.updateBatchDelayValue(value)),
onUpdateBatchDelayType: value => dispatch(Actions.updateBatchDelayType(value)),
onUpdateBatchWindowValue: value => dispatch(Actions.updateBatchWindowValue(value)),
onUpdateBatchWindowType: value => dispatch(Actions.updateBatchWindowType(value))
});
// Styles
const contentStyle = {
paddingTop: 20,
paddingLeft: 20,
paddingRight: 20,
paddingBottom: 20,
backgroundColor: Colors.neutralTertiaryAlt,
display: 'flex',
flexDirection: 'column',
overflowX: 'hidden',
overflowY: 'hidden',
flex: 1
};
const tabContainerStyle = {
display: 'flex',
flexDirection: 'column',
overflowX: 'hidden',
overflowY: 'hidden',
flex: 1
};
const modelHeaderStyle = {
// State Props
const mapStateToProps = state => ({
userInfo: UserSelectors.getUserInfo(state)
});
// Dispatch Props
const mapDispatchToProps = dispatch => ({
onGetUserInfo: () => dispatch(UserActions.getUserInfo())
});
// Styles
const contentStyle = {
flex: 1,
overflow: 'hidden',
backgroundColor: Colors.neutralLighterAlt
};
export default withRouter(
connect(
mapStateToProps,
mapDispatchToProps
)(Layout)
);
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>
export const deleteFlow = flow =>
servicePostApi(Constants.serviceRouteApi, Constants.serviceApplication, Constants.services.flow, 'flow/delete', {
subscription: flow.subscription,
name: flow.name,
displayName: flow.displayName,
userName: flow.owner,
eventhubConnectionString: flow.input.properties.inputEventhubConnection,
inputSubscriptionId: flow.input.properties.inputSubscriptionId,
inputResourceGroup: flow.input.properties.inputResourceGroup,
eventHubNames: flow.input.properties.inputEventhubName,
inputType: flow.input.type
});
export const restartSparkJob = name =>
servicePostApi(Constants.serviceRouteApi, Constants.serviceApplication, Constants.services.flow, 'job/restart', name);
export const executeQuery = (queryMetadata, selectedQuery, kernelId) =>
servicePostApi(Constants.serviceRouteApi, Constants.serviceApplication, Constants.services.interactiveQuery, 'kernel/executequery', {
name: queryMetadata.name,
displayName: queryMetadata.displayName,
query: selectedQuery,
kernelId: kernelId,
rules: queryMetadata.rules,
outputTemplates: queryMetadata.outputTemplates
});
export const getInputSchema = flow =>
servicePostApi(Constants.serviceRouteApi, Constants.serviceApplication, Constants.services.schemaInference, 'inputdata/inferschema', {
name: flow.name,
displayName: flow.displayName,
userName: flow.owner,
eventhubConnectionString: flow.input.properties.inputEventhubConnection,
inputSubscriptionId: flow.input.properties.inputSubscriptionId,
inputResourceGroup: flow.input.properties.inputResourceGroup,
eventHubNames: flow.input.properties.inputEventhubName,
inputType: flow.input.type,
seconds: flow.samplingInputDuration
});
export const saveFlow = (config, query) =>
servicePostApi(Constants.serviceRouteApi, Constants.serviceApplication, Constants.services.flow, 'flow/save', config, query);