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

Refactor Comments as Antd <Tree/> #7802

Merged
merged 19 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released

### Changed
- From now on only project owner get a notification email upon project overtime. The organization specific email list `overTimeMailingList` was removed. [#7842](https://github.com/scalableminds/webknossos/pull/7842)
- Replaced skeleton comment tab component with antd's `<Tree />`component. [#7802](https://github.com/scalableminds/webknossos/pull/7802)

### Fixed
- Fixed a bug where brushing on a fallback segmentation with active mapping and with segment index file would lead to failed saves. [#7833](https://github.com/scalableminds/webknossos/pull/7833)
Expand Down
14 changes: 0 additions & 14 deletions frontend/javascripts/oxalis/view/guards.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ function linkify(comment: string) {
type CommentProps = {
isActive: boolean;
comment: CommentType;
style: Record<string, any>;
};
export const commentListId = "commentList";

Expand Down Expand Up @@ -54,49 +53,42 @@ function ActiveCommentPopover({
);
}

export function Comment({ comment, isActive, style }: CommentProps) {
export function Comment({ comment, isActive }: CommentProps) {
const handleClick = () => {
Store.dispatch(setActiveNodeAction(comment.nodeId));
};

const liClassName = classNames("markdown", "markdown-small", "nowrap", "comment", {
"comment-active": isActive,
});
const iClassName = classNames("fa", "fa-fw", {
"fa-angle-right": isActive,
});
const liClassName = classNames("markdown", "markdown-small", "nowrap");

const isMultiLine = comment.content.indexOf("\n") !== -1;

return (
<li style={style}>
hotzenklotz marked this conversation as resolved.
Show resolved Hide resolved
<div className={liClassName}>
<span>
<i className={iClassName} />
<a onClick={handleClick}>{comment.nodeId}</a>
{" - "}
</span>
<span
style={{
display: "inline-block",
}}
>
<MarkdownWrapper source={linkify(comment.content)} singleLine />
</span>
{isMultiLine ? (
<ActiveCommentPopover comment={comment} isActive={isActive}>
<span
style={{
marginLeft: 5,
}}
>
<a onClick={handleClick}>
<i className="far fa-comment-dots" />
</a>
</span>
</ActiveCommentPopover>
) : null}
</div>
</li>
<div className={liClassName}>
<span>
<a onClick={handleClick}>{comment.nodeId}</a>
{" - "}
</span>
<span
style={{
display: "inline-block",
}}
>
<MarkdownWrapper source={linkify(comment.content)} singleLine />
</span>
{isMultiLine ? (
<ActiveCommentPopover comment={comment} isActive={isActive}>
<span
style={{
marginLeft: 5,
}}
>
<a onClick={handleClick}>
<i className="far fa-comment-dots" />
</a>
</span>
</ActiveCommentPopover>
) : null}
</div>
);
}
export default Comment;
Loading