kopia lustrzana https://github.com/OpenDroneMap/WebODM
minor changes to TaskView.jsx; TaskDialoge still needs some work as its just a clear modal in the background hard to visualize
rodzic
c8b579215f
commit
61b8fa44fb
|
@ -32,8 +32,11 @@ export default class TaskView extends Component {
|
||||||
|
|
||||||
onOpenUploadDialog(asset) {
|
onOpenUploadDialog(asset) {
|
||||||
this.setState({ currentAsset: asset });
|
this.setState({ currentAsset: asset });
|
||||||
|
if (this.uploadDialog != null)
|
||||||
|
{
|
||||||
this.uploadDialog.show();
|
this.uploadDialog.show();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onHideUploadDialog = () =>
|
onHideUploadDialog = () =>
|
||||||
this.setState({ currentAsset: null, isUploadDialogLoading: false });
|
this.setState({ currentAsset: null, isUploadDialogLoading: false });
|
||||||
|
@ -42,7 +45,8 @@ export default class TaskView extends Component {
|
||||||
|
|
||||||
hideTaskDialog = () => this.setState({ isTasksDialog: false });
|
hideTaskDialog = () => this.setState({ isTasksDialog: false });
|
||||||
|
|
||||||
onUploadAsset = data => {
|
onUploadAsset = async data => {
|
||||||
|
console.log("TASKVIEW onUploadAsset data: ", data);
|
||||||
const { task, token, apiURL } = this.props;
|
const { task, token, apiURL } = this.props;
|
||||||
const { currentAsset } = this.state;
|
const { currentAsset } = this.state;
|
||||||
const payload = Object.assign({}, data);
|
const payload = Object.assign({}, data);
|
||||||
|
@ -56,7 +60,7 @@ export default class TaskView extends Component {
|
||||||
payload.asset_type = currentAsset;
|
payload.asset_type = currentAsset;
|
||||||
|
|
||||||
this.setState({ isUploadDialogLoading: true });
|
this.setState({ isUploadDialogLoading: true });
|
||||||
this.cancelableFetch = fetchCancelable(
|
this.cancelableFetch = await fetchCancelable(
|
||||||
`/api${apiURL}/task/${task.id}/share`,
|
`/api${apiURL}/task/${task.id}/share`,
|
||||||
{
|
{
|
||||||
method: "POST",
|
method: "POST",
|
||||||
|
@ -193,7 +197,7 @@ export default class TaskView extends Component {
|
||||||
</IonAssetButton>
|
</IonAssetButton>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* {exported.length > 0 && (
|
{exported.length > 0 && (
|
||||||
<IonAssetButton
|
<IonAssetButton
|
||||||
assets={exported}
|
assets={exported}
|
||||||
onSelect={this.handleAssetSelect(
|
onSelect={this.handleAssetSelect(
|
||||||
|
@ -220,13 +224,13 @@ export default class TaskView extends Component {
|
||||||
<i className={"fa fa-cesium"} />
|
<i className={"fa fa-cesium"} />
|
||||||
View ion Tasks
|
View ion Tasks
|
||||||
</button>
|
</button>
|
||||||
)} */}
|
)}
|
||||||
{/* <TasksDialog
|
<TasksDialog
|
||||||
show={isTasksDialog}
|
show={isTasksDialog}
|
||||||
tasks={processing}
|
tasks={processing}
|
||||||
onHide={this.hideTaskDialog}
|
onHide={this.hideTaskDialog}
|
||||||
onClearFailed={this.onClearFailedAssets}
|
onClearFailed={this.onClearFailedAssets}
|
||||||
/> */}
|
/>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
|
@ -237,11 +241,18 @@ export default class TaskView extends Component {
|
||||||
{({ isLoading, isError, data }) => {
|
{({ isLoading, isError, data }) => {
|
||||||
const initialValues = {};
|
const initialValues = {};
|
||||||
|
|
||||||
|
if (isLoading || assetName === "")
|
||||||
|
{
|
||||||
|
console.log("TASKVIEW Loading project data");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
if (!isLoading && !isError && data?.length > 0) {
|
if (!isLoading && !isError && data?.length > 0) {
|
||||||
const project = data[0];
|
const project = data[0];
|
||||||
initialValues.name = `${project.name} | ${task.name} — ${assetName}`;
|
initialValues.name = `${project.name} | ${task.name} — ${assetName}`;
|
||||||
initialValues.description = project.description;
|
initialValues.description = project.description;
|
||||||
}
|
}
|
||||||
|
console.log("TASKVIEW initialValues: ", initialValues);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<UploadDialog
|
<UploadDialog
|
||||||
|
@ -258,12 +269,12 @@ export default class TaskView extends Component {
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
</APIFetcher>
|
</APIFetcher>
|
||||||
{/* <TaskFetcher
|
<TaskFetcher
|
||||||
method={"POST"}
|
method={"POST"}
|
||||||
path={"refresh"}
|
path={"refresh"}
|
||||||
body={JSON.stringify({ token })}
|
body={JSON.stringify({ token })}
|
||||||
onLoad={this.onCleanStatus}
|
onLoad={this.onCleanStatus}
|
||||||
/> */}
|
/>
|
||||||
</AppContext.Provider>
|
</AppContext.Provider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue