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 8 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 @@ -21,6 +21,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
- Non-admin or -manager users can no longer start long-running jobs that create datasets. This includes annotation materialization and AI inferrals. [#7753](https://github.com/scalableminds/webknossos/pull/7753)
- In the time tracking view, all annotations and tasks can be shown for each user by expanding the table. The individual time spans spent with a task or annotating an explorative annotation can be accessed via CSV export. The detail view including a chart for the individual spans has been removed. [#7733](https://github.com/scalableminds/webknossos/pull/7733)
- Slightly refactored the `<FixExpandleTable/>`component to use columns as props. [#7772](https://github.com/scalableminds/webknossos/pull/7772)
- Replaced skeleton comment tab component with antd's `<Tree />`component. [#7802](https://github.com/scalableminds/webknossos/pull/7802)

### Fixed
- Fixed a bug where a toast that was reopened had a flickering effect during the reopening animation. [#7793](https://github.com/scalableminds/webknossos/pull/7793)
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