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

Always activate group after creating it #4282

Merged
merged 2 commits into from
Sep 16, 2019
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 @@ -16,6 +16,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.md).

- Renamed "Expected Time" to "Time Limit" in the project table. [#4278](https://github.com/scalableminds/webknossos/pull/4278)
- Clicking on an experience domain of a user, while multiple users are selected will edit the domain of all selected users (instead of only the domain of the clicked row). [#4280](https://github.com/scalableminds/webknossos/pull/4280)
- Creating a new group will always activate that group. [#4282](https://github.com/scalableminds/webknossos/pull/4282)

### Fixed
- When creating tasks from zip, the individual nml names are used again, rather than the zip name. [#4277](https://github.com/scalableminds/webknossos/pull/4277)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,18 @@ export default function DeleteGroupModalView({
title={messages["tracing.group_deletion_message"]}
onOk={onJustDeleteGroup}
onCancel={onCancel}
width={620}
footer={[
<Button key="back" onClick={onCancel}>
Cancel
</Button>,
<Button key="submit-all" onClick={onDeleteGroupAndTrees}>
Remove group recursively
Remove group including all children
</Button>,
<Button key="submit-groups-only" type="primary" onClick={onJustDeleteGroup}>
Remove group only
Remove group and keep children
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

</Button>,
]}
>
Do you really want to remove the selected group? If you want to remove the group with all its
trees and subgroups recursively, select &quot;Remove group recursively&quot;. If you want to
remove just the group and keep the subtrees and subgroups select &quot;Remove group
only&quot;.
When selecting &quot;Remove group and keep children&quot;, the children will be moved to the
level of the original group.
</Modal>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -149,26 +149,27 @@ class TreeHierarchyView extends React.PureComponent<Props, State> {
}
};

selectGroupById = (groupId: number) => {
this.props.deselectAllTrees();
this.props.onSetActiveGroup(groupId);
};

onSelectGroup = (evt: SyntheticMouseEvent<*>) => {
// $FlowFixMe .dataset is unknown to flow
const groupId = parseInt(evt.target.dataset.id, 10);
const numberOfSelectedTrees = this.props.selectedTrees.length;
const selectGroup = () => {
this.props.deselectAllTrees();
this.props.onSetActiveGroup(groupId);
};
if (numberOfSelectedTrees > 0) {
Modal.confirm({
title: "Do you really want to select this group?",
content: `You have ${numberOfSelectedTrees} selected Trees. Do you really want to select this group?
This will deselect all selected trees.`,
onOk() {
selectGroup();
this.selectGroupById(groupId);
},
onCancel() {},
});
} else {
selectGroup();
this.selectGroupById(groupId);
}
};

Expand Down Expand Up @@ -240,6 +241,7 @@ class TreeHierarchyView extends React.PureComponent<Props, State> {
});
}
this.props.onUpdateTreeGroups(newTreeGroups);
this.selectGroupById(newGroupId);
}

deleteGroup(groupId: number) {
Expand Down