You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.0 KiB
TypeScript
41 lines
1.0 KiB
TypeScript
// Copyright (C) 2020 Intel Corporation
|
|
//
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { CombinedState } from 'reducers/interfaces';
|
|
import CreateTaskComponent from 'components/create-task-page/create-task-page';
|
|
import { CreateTaskData } from 'components/create-task-page/create-task-content';
|
|
import { createTaskAsync } from 'actions/tasks-actions';
|
|
|
|
interface StateToProps {
|
|
taskId: number | null;
|
|
status: string;
|
|
error: string;
|
|
installedGit: boolean;
|
|
}
|
|
|
|
interface DispatchToProps {
|
|
onCreate: (data: CreateTaskData) => void;
|
|
}
|
|
|
|
function mapDispatchToProps(dispatch: any): DispatchToProps {
|
|
return {
|
|
onCreate: (data: CreateTaskData): void => dispatch(createTaskAsync(data)),
|
|
};
|
|
}
|
|
|
|
function mapStateToProps(state: CombinedState): StateToProps {
|
|
const { creates } = state.tasks.activities;
|
|
return {
|
|
...creates,
|
|
installedGit: state.plugins.list.GIT_INTEGRATION,
|
|
};
|
|
}
|
|
|
|
export default connect(
|
|
mapStateToProps,
|
|
mapDispatchToProps,
|
|
)(CreateTaskComponent);
|