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

Comments feature fixes #5081

Merged
merged 35 commits into from
Jun 17, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
cf908c1
Refresh app comments list when a thread is pinned/unpinned
rishabhsaxena May 21, 2021
eb622d6
Fix profile image not uploaded at the profile form
rishabhsaxena May 21, 2021
b3f44a6
Fix resolve btn padding
rishabhsaxena May 21, 2021
4cd256d
Fix edit comments app sidevar
rishabhsaxena May 21, 2021
a496c29
Reduce transition duration
rishabhsaxena May 27, 2021
60d91ee
Ensure duplicate comments are removed
rishabhsaxena May 27, 2021
58b397e
Show only page comments (#4743)
rishabhsaxena May 27, 2021
c2bdacb
Merge remote-tracking branch 'origin/release' into comments-feature-f…
rishabhsaxena May 27, 2021
5875a83
Disable resize and drag in comment mode
rishabhsaxena May 27, 2021
08f7e2b
Merge remote-tracking branch 'origin/release' into comments-feature-f…
rishabhsaxena May 29, 2021
29af7b6
Profile image updates
rishabhsaxena May 29, 2021
39efa10
Move intro card to the left, add overlay and pulse for toggle comment…
rishabhsaxena Jun 10, 2021
537223e
Merge remote-tracking branch 'origin/release' into comments-tour-updates
rishabhsaxena Jun 10, 2021
c820f79
add comment
rishabhsaxena Jun 10, 2021
f5ed304
lint
rishabhsaxena Jun 10, 2021
c3eb05e
Merge remote-tracking branch 'origin/release' into profile-image-updates
rishabhsaxena Jun 10, 2021
caeb1e1
Use name or username for profile image
rishabhsaxena Jun 10, 2021
5c85e0f
Remove image option
rishabhsaxena Jun 10, 2021
1f4bdd1
add checks for tests
rishabhsaxena Jun 10, 2021
b3b2c10
Use name while adding mentions
rishabhsaxena Jun 10, 2021
daa22a9
Merge remote-tracking branch 'origin/comments-tour-updates' into comm…
rishabhsaxena Jun 10, 2021
95e5dc5
Use light theme at the viewer
rishabhsaxena Jun 10, 2021
532953b
Fix app comments section height
rishabhsaxena Jun 10, 2021
77aea23
Comment mode specific links
rishabhsaxena Jun 10, 2021
a2c2c4d
Add hotkeys for the viewer
rishabhsaxena Jun 10, 2021
13cd1f5
Update reset comment mode icon at the viewer
rishabhsaxena Jun 10, 2021
d2fc74f
Fix comment thread links across pages
rishabhsaxena Jun 11, 2021
43f9b46
Fix toggle comment mode position at the viewer and editor header
rishabhsaxena Jun 11, 2021
6c50c0b
Dont fetch member each time on adding a new comment
rishabhsaxena Jun 11, 2021
7dc0281
Dont allow comment with just spaces
rishabhsaxena Jun 11, 2021
1609538
Show toggle comment btn at just the canvas editor and viewer
rishabhsaxena Jun 11, 2021
dea7be0
Merge remote-tracking branch 'origin/release' into comments-feature-f…
rishabhsaxena Jun 11, 2021
89f8598
Update hotkey label
rishabhsaxena Jun 15, 2021
fe3b46d
Merge branch 'release' into comments-feature-fixes-1
rishabhsaxena Jun 16, 2021
8d79b5e
Merge branch 'release' into comments-feature-fixes-1
rishabhsaxena Jun 16, 2021
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
Prev Previous commit
Next Next commit
Update reset comment mode icon at the viewer
  • Loading branch information
rishabhsaxena committed Jun 10, 2021
commit 13cd1f5d754ac0c3a6f2dcf9b6fd9ce2ba0c9489
3 changes: 3 additions & 0 deletions app/client/src/assets/icons/comments/eye.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 40 additions & 12 deletions app/client/src/pages/Editor/ToggleModeButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useDispatch, useSelector } from "react-redux";
import TooltipComponent from "components/ads/Tooltip";
import TourTooltipWrapper from "components/ads/tour/TourTooltipWrapper";
import { ReactComponent as Pen } from "assets/icons/comments/pen.svg";
import { ReactComponent as Eye } from "assets/icons/comments/eye.svg";
import { ReactComponent as CommentModeUnread } from "assets/icons/comments/comment-mode-unread-indicator.svg";
import { ReactComponent as CommentMode } from "assets/icons/comments/chat.svg";
import { Indices } from "constants/Layers";
Expand All @@ -26,6 +27,8 @@ import { TourType } from "entities/Tour";
import useProceedToNextTourStep from "utils/hooks/useProceedToNextTourStep";
import { getCommentsIntroSeen } from "utils/storage";
import { User } from "constants/userConstants";
import { AppState } from "reducers";
import { APP_MODE } from "reducers/entityReducers/appReducer";

const ModeButton = styled.div<{ active: boolean }>`
position: relative;
Expand Down Expand Up @@ -117,6 +120,40 @@ export const setCommentModeInUrl = (isCommentMode: boolean) => {
});
};

function EditModeReset() {
return (
<TooltipComponent
content={
<>
Edit Mode
<span style={{ color: "#fff", marginLeft: 20 }}>V</span>
</>
}
hoverOpenDelay={1000}
position={Position.BOTTOM}
>
<Pen />
</TooltipComponent>
);
}

function ViewModeReset() {
return (
<TooltipComponent
content={
<>
View Mode
<span style={{ color: "#fff", marginLeft: 20 }}>V</span>
</>
}
hoverOpenDelay={1000}
position={Position.BOTTOM}
>
<Eye />
</TooltipComponent>
);
}

function ToggleCommentModeButton() {
const commentsEnabled = useSelector(areCommentsEnabledForUserAndAppSelector);
const isCommentMode = useSelector(commentModeSelector);
Expand All @@ -129,6 +166,8 @@ function ToggleCommentModeButton() {
0,
);

const mode = useSelector((state: AppState) => state.entities.app.mode);

if (!commentsEnabled) return null;

const CommentModeIcon = showUnreadIndicator ? CommentModeUnread : CommentMode;
Expand Down Expand Up @@ -168,18 +207,7 @@ function ToggleCommentModeButton() {
active={!isCommentMode}
onClick={() => setCommentModeInUrl(false)}
>
<TooltipComponent
content={
<>
Edit Mode
<span style={{ color: "#fff", marginLeft: 20 }}>V</span>
</>
}
hoverOpenDelay={1000}
position={Position.BOTTOM}
>
<Pen />
</TooltipComponent>
{mode === APP_MODE.EDIT ? <EditModeReset /> : <ViewModeReset />}
</ModeButton>
<ModeButton
active={isCommentMode}
Expand Down