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 => { private handleSubmitClick = (): void => {
if (!this.validateLabels()) { if (!this.validateLabels()) {
notification.error({ notification.error({
@ -192,6 +199,7 @@ class CreateTaskContent extends React.PureComponent<Props & RouteComponentProps,
<Text type='danger'>* </Text> <Text type='danger'>* </Text>
<Text className='cvat-text-color'>Select files:</Text> <Text className='cvat-text-color'>Select files:</Text>
<ConnectedFileManager <ConnectedFileManager
onChangeActiveKey={this.changeFileManagerTab}
ref={(container: any): void => { ref={(container: any): void => {
this.fileManagerContainer = container; this.fileManagerContainer = container;
}} }}

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

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

Loading…
Cancel
Save