Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Marishka17 committed Nov 10, 2020
1 parent 7309d99 commit 143fe28
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,13 @@ export interface AdvancedConfiguration {
useZipChunks: boolean;
dataChunkSize?: number;
useCache: boolean;
activeTab: string;
copyData?: boolean;
}

type Props = FormComponentProps & {
onSubmit(values: AdvancedConfiguration): void;
installedGit: boolean;
activeTab: string;
activeFileManagerTab: string;
};

function isPositiveInteger(_: any, value: any, callback: any): void {
Expand Down Expand Up @@ -81,7 +80,7 @@ function isIntegerRange(min: number, max: number, _: any, value: any, callback:
class AdvancedConfigurationForm extends React.PureComponent<Props> {
public submit(): Promise<void> {
return new Promise((resolve, reject) => {
const { form, onSubmit, activeTab } = this.props;
const { form, onSubmit } = this.props;

form.validateFields((error, values): void => {
if (!error) {
Expand All @@ -103,7 +102,6 @@ class AdvancedConfigurationForm extends React.PureComponent<Props> {
onSubmit({
...values,
frameFilter: values.frameStep ? `step=${values.frameStep}` : undefined,
activeTab: activeTab,
});
resolve();
} else {
Expand Down Expand Up @@ -410,11 +408,11 @@ class AdvancedConfigurationForm extends React.PureComponent<Props> {
}

public render(): JSX.Element {
const { installedGit, activeTab } = this.props;
const { installedGit, activeFileManagerTab } = this.props;
return (
<Form>

{activeTab === 'share' ? this.renderCopyDataChechbox() : null}
{activeFileManagerTab === 'share' ? this.renderCopyDataChechbox() : null}

<Row>
<Col>{this.renderUzeZipChunks()}</Col>
Expand Down
13 changes: 6 additions & 7 deletions cvat-ui/src/components/create-task-page/create-task-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export interface CreateTaskData {
advanced: AdvancedConfiguration;
labels: any[];
files: Files;
activeFileManagerTab: string;
}

interface Props {
Expand All @@ -42,14 +43,14 @@ const defaultState = {
lfs: false,
useZipChunks: true,
useCache: true,
activeTab: 'local',
},
labels: [],
files: {
local: [],
share: [],
remote: [],
},
activeFileManagerTab: 'local',
};

class CreateTaskContent extends React.PureComponent<Props & RouteComponentProps, State> {
Expand Down Expand Up @@ -116,12 +117,10 @@ class CreateTaskContent extends React.PureComponent<Props & RouteComponentProps,
};

private changeFileManagerTab = (key: string): void => {
const values = this.state.advanced;
const values = this.state;
this.setState({
advanced: {
...values,
activeTab: key
}
...values,
activeFileManagerTab: key
});
};

Expand Down Expand Up @@ -221,7 +220,7 @@ class CreateTaskContent extends React.PureComponent<Props & RouteComponentProps,
<Collapse.Panel key='1' header={<Text className='cvat-title'>Advanced configuration</Text>}>
<AdvancedConfigurationForm
installedGit={installedGit}
activeTab={this.state.advanced.activeTab}
activeFileManagerTab={this.state.activeFileManagerTab}
wrappedComponentRef={(component: any): void => {
this.advancedConfigurationComponent = component;
}}
Expand Down

0 comments on commit 143fe28

Please sign in to comment.