Boris Sekachev 5 years ago
parent 3531316d52
commit aecbb5a7dd

@ -114,6 +114,13 @@ class CreateTaskContent extends React.PureComponent<Props & RouteComponentProps,
});
};
private changeFileManagerTab = (key: string): void => {
// todo
// add field to state CreateTaskData.AdvancedConfiguration
// change state here
// draw checkbox depending on the state
};
private handleSubmitClick = (): void => {
if (!this.validateLabels()) {
notification.error({
@ -192,6 +199,7 @@ class CreateTaskContent extends React.PureComponent<Props & RouteComponentProps,
<Text type='danger'>* </Text>
<Text className='cvat-text-color'>Select files:</Text>
<ConnectedFileManager
onChangeActiveKey={this.changeFileManagerTab}
ref={(container: any): void => {
this.fileManagerContainer = container;
}}

@ -31,6 +31,7 @@ interface Props {
withRemote: boolean;
treeData: TreeNodeNormal[];
onLoadData: (key: string, success: () => void, failure: () => void) => void;
onChangeActiveKey(key: string): void;
}
export default class FileManager extends React.PureComponent<Props, State> {
@ -215,7 +216,7 @@ export default class FileManager extends React.PureComponent<Props, State> {
}
public render(): JSX.Element {
const { withRemote } = this.props;
const { withRemote, onChangeActiveKey } = this.props;
const { active } = this.state;
return (
@ -224,11 +225,12 @@ export default class FileManager extends React.PureComponent<Props, State> {
type='card'
activeKey={active}
tabBarGutter={5}
onChange={(activeKey: string): void =>
onChange={(activeKey: string): void => {
onChangeActiveKey(activeKey);
this.setState({
active: activeKey as any,
})
}
});
}}
>
{this.renderLocalSelector()}
{this.renderShareSelector()}

@ -14,6 +14,7 @@ import { ShareItem, CombinedState } from 'reducers/interfaces';
interface OwnProps {
ref: any;
withRemote: boolean;
onChangeActiveKey(key: string): void;
}
interface StateToProps {
@ -68,12 +69,13 @@ export class FileManagerContainer extends React.PureComponent<Props> {
}
public render(): JSX.Element {
const { treeData, getTreeData, withRemote } = this.props;
const { treeData, getTreeData, withRemote, onChangeActiveKey } = this.props;
return (
<FileManagerComponent
treeData={treeData}
onLoadData={getTreeData}
onChangeActiveKey={onChangeActiveKey}
withRemote={withRemote}
ref={(component): void => {
this.managerComponentRef = component;

Loading…
Cancel
Save