Skip to content

Commit

Permalink
Always activate group after creating it (#4282)
Browse files Browse the repository at this point in the history
* always activate group after creating it
* update changelog
  • Loading branch information
philippotto authored and bulldozer-boy[bot] committed Sep 16, 2019
1 parent dedc347 commit 7708a79
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
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
</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

0 comments on commit 7708a79

Please sign in to comment.