Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undo finish via API #4495

Merged
merged 3 commits into from
Mar 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.md).
[Commits](https://github.com/scalableminds/webknossos/compare/20.04.0...HEAD)

### Added
- Users can undo finishing a task when the task was finished via the API, e.g. by a user script. [#4495](https://github.com/scalableminds/webknossos/pull/4495)
- Added the magnification used for determining the segment ids in the segmentation tab to the table of the tab. [#4480](https://github.com/scalableminds/webknossos/pull/4480)
- Added support for ID mapping of segmentation layer based on HDF5 agglomerate files. [#4469](https://github.com/scalableminds/webknossos/pull/4469)

Expand Down
5 changes: 5 additions & 0 deletions frontend/javascripts/oxalis/api/api_latest.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ import dimensions from "oxalis/model/dimensions";
import messages from "messages";
import window, { location } from "libs/window";
import { type ElementClass } from "admin/api_flow_types";
import UserLocalStorage from "libs/user_local_storage";

type OutdatedDatasetConfigurationKeys = "segmentationOpacity" | "isSegmentationDisabled";

Expand Down Expand Up @@ -436,6 +437,10 @@ class TracingApi {

await Model.ensureSavedState();
await finishAnnotation(annotationId, annotationType);
UserLocalStorage.setItem(
"lastFinishedTask",
JSON.stringify({ annotationId, finishedTime: Date.now() }),
);
try {
const annotation = await requestTask();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,6 @@ class TracingActionsView extends React.PureComponent<Props, State> {
};

handleFinishAndGetNextTask = async () => {
UserLocalStorage.setItem(
"lastFinishedTask",
JSON.stringify({ annotationId: this.props.annotationId, finishedTime: Date.now() }),
);
api.tracing.finishAndGetNextTask();
};

Expand Down