-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add merger mode tasks * fix evolution and add changelog * try to fix schema issues * fix schema * Merge branch 'master' of github.com:scalableminds/webknossos into merger-mode-tasks * update migrations * update documentation and fix #4273 * new snapshots (new mergerMode field in tasktype settings) * change width of experience domain column * Merge branch 'merger-mode-tasks' of github.com:scalableminds/webknossos into merger-mode-tasks
- Loading branch information
1 parent
f126028
commit f1fe3ca
Showing
26 changed files
with
213 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
-- https://github.com/scalableminds/webknossos/pull/??? | ||
|
||
START TRANSACTION; | ||
|
||
DROP VIEW webknossos.taskTypes_; | ||
ALTER TABLE webknossos.taskTypes ADD COLUMN settings_mergerMode BOOLEAN NOT NULL DEFAULT false; | ||
|
||
CREATE VIEW webknossos.taskTypes_ AS SELECT * FROM webknossos.taskTypes WHERE NOT isDeleted; | ||
|
||
UPDATE webknossos.releaseInformation SET schemaVersion = 45; | ||
|
||
COMMIT TRANSACTION; |
10 changes: 10 additions & 0 deletions
10
conf/evolutions/reversions/045-annotationsettings-mergerMode.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
START TRANSACTION; | ||
|
||
DROP VIEW webknossos.taskTypes_; | ||
ALTER TABLE webknossos.taskTypes DROP settings_mergerMode; | ||
|
||
CREATE VIEW webknossos.taskTypes_ AS SELECT * FROM webknossos.taskTypes WHERE NOT isDeleted; | ||
|
||
UPDATE webknossos.releaseInformation SET schemaVersion = 44; | ||
|
||
COMMIT TRANSACTION; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 82 additions & 0 deletions
82
frontend/javascripts/oxalis/controller/merger_mode_controller.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
// @flow | ||
|
||
import { connect } from "react-redux"; | ||
import React, { PureComponent } from "react"; | ||
import _ from "lodash"; | ||
|
||
import type { OxalisState } from "oxalis/store"; | ||
import { enableMergerMode, disableMergerMode } from "oxalis/merger_mode"; | ||
|
||
import MergerModeModalView from "oxalis/view/settings/merger_mode_modal_view"; | ||
|
||
type MergerModeControllerProps = { | ||
isMergerModeEnabled: boolean, | ||
}; | ||
|
||
type State = { | ||
isMergerModeModalVisible: boolean, | ||
isMergerModeModalClosable: boolean, | ||
mergerModeProgress: number, | ||
}; | ||
|
||
class MergerModeController extends PureComponent<MergerModeControllerProps, State> { | ||
state = { | ||
isMergerModeModalVisible: false, | ||
isMergerModeModalClosable: false, | ||
mergerModeProgress: 0, | ||
}; | ||
|
||
componentDidMount() { | ||
if (this.props.isMergerModeEnabled) this.handleMergerModeChange(true); | ||
} | ||
|
||
componentDidUpdate(prevProps: MergerModeControllerProps) { | ||
if (prevProps.isMergerModeEnabled !== this.props.isMergerModeEnabled) { | ||
this.handleMergerModeChange(this.props.isMergerModeEnabled); | ||
} | ||
} | ||
|
||
handleMergerModeChange = async (active: boolean) => { | ||
if (active) { | ||
this.setState({ | ||
isMergerModeModalVisible: true, | ||
isMergerModeModalClosable: false, | ||
mergerModeProgress: 0, | ||
}); | ||
const onUpdateProgress = mergerModeProgress => this.setState({ mergerModeProgress }); | ||
await enableMergerMode(onUpdateProgress); | ||
// The modal is only closeable after the merger mode is fully enabled | ||
// and finished preprocessing | ||
this.setState({ isMergerModeModalClosable: true }); | ||
} else { | ||
this.setState({ | ||
isMergerModeModalVisible: false, | ||
isMergerModeModalClosable: false, | ||
}); | ||
disableMergerMode(); | ||
} | ||
}; | ||
|
||
render() { | ||
const { isMergerModeModalVisible, isMergerModeModalClosable } = this.state; | ||
return ( | ||
<React.Fragment> | ||
{isMergerModeModalVisible ? ( | ||
<MergerModeModalView | ||
isCloseable={isMergerModeModalClosable} | ||
onClose={() => this.setState({ isMergerModeModalVisible: false })} | ||
progress={this.state.mergerModeProgress} | ||
/> | ||
) : null} | ||
</React.Fragment> | ||
); | ||
} | ||
} | ||
|
||
const mapStateToProps = (state: OxalisState) => ({ | ||
isMergerModeEnabled: state.temporaryConfiguration.isMergerModeEnabled, | ||
}); | ||
|
||
export default connect<MergerModeControllerProps, {||}, _, _, _, _>(mapStateToProps)( | ||
MergerModeController, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.