2020-10-14 10:35:19 +00:00
|
|
|
import React, { forwardRef, Ref } from "react";
|
2020-08-10 04:54:33 +00:00
|
|
|
import { ReactComponent as DeleteIcon } from "assets/icons/ads/delete.svg";
|
2021-02-11 06:36:07 +00:00
|
|
|
import { ReactComponent as BookIcon } from "assets/icons/ads/book.svg";
|
2021-04-23 13:50:55 +00:00
|
|
|
import { ReactComponent as BugIcon } from "assets/icons/ads/bug.svg";
|
|
|
|
|
import { ReactComponent as CancelIcon } from "assets/icons/ads/cancel.svg";
|
|
|
|
|
import { ReactComponent as CrossIcon } from "assets/icons/ads/cross.svg";
|
|
|
|
|
import { ReactComponent as OpenIcon } from "assets/icons/ads/open.svg";
|
2020-08-10 04:54:33 +00:00
|
|
|
import { ReactComponent as UserIcon } from "assets/icons/ads/user.svg";
|
2020-08-14 07:11:38 +00:00
|
|
|
import { ReactComponent as GeneralIcon } from "assets/icons/ads/general.svg";
|
|
|
|
|
import { ReactComponent as BillingIcon } from "assets/icons/ads/billing.svg";
|
2020-08-26 09:04:58 +00:00
|
|
|
import { ReactComponent as EditIcon } from "assets/icons/ads/edit.svg";
|
|
|
|
|
import { ReactComponent as ErrorIcon } from "assets/icons/ads/error.svg";
|
2021-02-11 06:36:07 +00:00
|
|
|
import { ReactComponent as ShineIcon } from "assets/icons/ads/shine.svg";
|
2020-08-26 09:04:58 +00:00
|
|
|
import { ReactComponent as SuccessIcon } from "assets/icons/ads/success.svg";
|
2020-08-26 07:25:27 +00:00
|
|
|
import { ReactComponent as SearchIcon } from "assets/icons/ads/search.svg";
|
|
|
|
|
import { ReactComponent as CloseIcon } from "assets/icons/ads/close.svg";
|
2020-11-24 07:01:37 +00:00
|
|
|
import { ReactComponent as WarningIcon } from "assets/icons/ads/warning.svg";
|
2021-04-23 13:50:55 +00:00
|
|
|
import { ReactComponent as WarningTriangleIcon } from "assets/icons/ads/warning-triangle.svg";
|
2020-09-02 06:46:02 +00:00
|
|
|
import { ReactComponent as DownArrow } from "assets/icons/ads/down_arrow.svg";
|
2020-08-31 04:59:18 +00:00
|
|
|
import { ReactComponent as ShareIcon } from "assets/icons/ads/share.svg";
|
2020-09-01 07:24:53 +00:00
|
|
|
import { ReactComponent as RocketIcon } from "assets/icons/ads/launch.svg";
|
2020-08-31 04:59:18 +00:00
|
|
|
import { ReactComponent as WorkspaceIcon } from "assets/icons/ads/workspace.svg";
|
|
|
|
|
import { ReactComponent as CreateNewIcon } from "assets/icons/ads/create-new.svg";
|
|
|
|
|
import { ReactComponent as InviteUserIcon } from "assets/icons/ads/invite-users.svg";
|
|
|
|
|
import { ReactComponent as ViewAllIcon } from "assets/icons/ads/view-all.svg";
|
2021-01-19 06:17:15 +00:00
|
|
|
import { ReactComponent as ViewLessIcon } from "assets/icons/ads/view-less.svg";
|
2020-09-16 11:50:47 +00:00
|
|
|
import { ReactComponent as ContextMenuIcon } from "assets/icons/ads/context-menu.svg";
|
|
|
|
|
import { ReactComponent as DuplicateIcon } from "assets/icons/ads/duplicate.svg";
|
2020-09-22 11:56:11 +00:00
|
|
|
import { ReactComponent as LogoutIcon } from "assets/icons/ads/logout.svg";
|
2020-10-12 07:15:35 +00:00
|
|
|
import { ReactComponent as ManageIcon } from "assets/icons/ads/manage.svg";
|
2021-02-04 07:02:36 +00:00
|
|
|
import { ReactComponent as ArrowLeft } from "assets/icons/ads/arrow-left.svg";
|
|
|
|
|
import { ReactComponent as Fork } from "assets/icons/ads/fork.svg";
|
|
|
|
|
import { ReactComponent as ChevronLeft } from "assets/icons/ads/chevron_left.svg";
|
|
|
|
|
import { ReactComponent as ChevronRight } from "assets/icons/ads/chevron_right.svg";
|
2021-03-08 08:24:12 +00:00
|
|
|
import { ReactComponent as LinkIcon } from "assets/icons/ads/link.svg";
|
|
|
|
|
import { ReactComponent as HelpIcon } from "assets/icons/help/help.svg";
|
2021-02-11 12:54:00 +00:00
|
|
|
import { ReactComponent as CloseModalIcon } from "assets/icons/ads/close-modal.svg";
|
|
|
|
|
import { ReactComponent as NoResponseIcon } from "assets/icons/ads/no-response.svg";
|
|
|
|
|
import { ReactComponent as LightningIcon } from "assets/icons/ads/lightning.svg";
|
|
|
|
|
import { ReactComponent as AddMoreIcon } from "assets/icons/ads/add-more.svg";
|
|
|
|
|
import { ReactComponent as RightArrowIcon } from "assets/icons/ads/right-arrow.svg";
|
|
|
|
|
import { ReactComponent as DatasourceIcon } from "assets/icons/ads/datasource.svg";
|
|
|
|
|
import { ReactComponent as PlayIcon } from "assets/icons/ads/play.svg";
|
2021-03-03 05:26:47 +00:00
|
|
|
import { ReactComponent as DesktopIcon } from "assets/icons/ads/desktop.svg";
|
2021-04-23 13:50:55 +00:00
|
|
|
import { ReactComponent as WandIcon } from "assets/icons/ads/wand.svg";
|
2021-03-03 05:26:47 +00:00
|
|
|
import { ReactComponent as MobileIcon } from "assets/icons/ads/mobile.svg";
|
|
|
|
|
import { ReactComponent as TabletIcon } from "assets/icons/ads/tablet.svg";
|
|
|
|
|
import { ReactComponent as FluidIcon } from "assets/icons/ads/fluid.svg";
|
Initialise comments (#3328)
* Initial scaffolding for comments CRUD APIs
* add actions
* add assets
* state management for existing comments and creating new
* add ui components
* add overlay comments wrapper to baseWidget
* add toggle comment mode button at editor header
* trigger tests
* Disallow commenting as someone else
* Add applicationId for comments
* lint
* Add overlay blacklist to prevent component interaction while adding comments
* Comment thread style updates
* Placeholder comment context menu
* Controlled comment thread visibility for making new comments visible by default
* Update comment type description
* Reset input on save
* Resolve comment thread button ui
* fix close on esc key, dont create new comment on outside click
* Submit on enter
* add emoji picker
* Attempt at adding a websocket server in Java
* CRUD APIs for comment threads
* Add API for getting all threads in application
* Move types to a separate file
* Initial commit for real time server (RTS)
* Add script to start RTS
* Fix position property
* Use create comment thread API
* Use add comment to thread API
* Add custom cursor
* Dispatch logout init on 401 errors
* Allow CORS for real time connection
* Add more logs to RTS
* Fix construction of MongoClient
* WIP: Real time comments
* Enable comments
* Minor updates
* Read backend API base URL from environment
* Escape to reset comments mode
* Set popover position as auto and boundary as scroll parent
* Disable warning
* Added permissions for comment threads
* Add resolved API for comment threads
* Migration to set commenting permission on existing apps
* Fix updates bringing the RTS down
* Show view latest button, scroll to bottom on creating a new comment
* Cleanup comment reducer
* Move to typescript for RTS
* Add missing server.ts and tsconfig files
* Resolve / unresolve comment
* Scaffold app comments
* Minor fixes: comment on top of all widgets, add toggle button at viewer header
* Reconnect socket on creating a new app, set connected status in store
* Retry socket connection flow
* Integration tests for comments with api mocks using msw
* Fix circular depependency
* rm file
* Minor cleanup and comments
* Minor refactors: move isScrolledToBottom to common hooks, decouple prevent interactions overlay from comments wrapper
* Use policies when pushing updates in RTS
* ENV var to set if comments are enabled
* Fix: check if editor/viewer is initialised before waiting for init action
* Add tests for comments reducer
* Revert "ENV var to set if comments are enabled"
This reverts commit 988efeaa69d378d943a387e1e73510334958adc5.
* Enable comments for users with appsmith email
* lint
* fix
* Try running a socket.io server inside backend
* Update comment reducer tests
* Init mentions within comments
* Fix comment thread updates with email rooms
* Minor fixes
* Refactors / review suggestions
* lint
* increase cache limit for builds
* Comment out tests for feature that's under development
* Add Dockerfile for RTS
* Fix policies missing for first comment in threads
* Use draftJS for comments input with mentions support
* fix fixtures
* Use thread's policies when querying for threads
* Update socket.io to v4
* Add support for richer body with mentions
* Update comment body type to RawDraftContentState
* fix stale method
* Fix mentions search
* Minor cleanups
* Comment context menu and thread UI updates
* revert: Scaffold app comments
* Yarn dependencies
* Delete comment using id api added
* Init app comments
* Add test for creating thread
* Api for delete comment with id
* Test comment creation response and policies
* Copy comment links
* Fix reset editor state
* Delete valid comment testcase added
* Delete comment TC : code refactor
* Don't allow creating comments with an empty body
* Pin comments WIP[]
* Ignore dependency-reduced-pom.xml files from VCS
* Cleanup of some dev-only files, for review
* Delete comment
* Update socket.io to v4 in RTS
* Pin and resolve comment thread object added in commentThread
* Pin and resolve comment thread object added in commentThread
* Update comment thread API
* Added creationTime and updationTime in comment thread response
* Added creationTime and updationTime in comment thread response
* Added human readable id to comment threads, fallback to username for null name in user document
* Refactor
* lint
* fix test, rm duplicate selector
* comment out saga used for dev
* CommentThread viewed status, username fallback for getName=null, username field added in pin & resolve status
* lint
* trigger tests
Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
Co-authored-by: Abhijeet <abhi.nagarnaik@gmail.com>
2021-04-29 10:33:51 +00:00
|
|
|
import { ReactComponent as CardContextMenu } from "assets/icons/ads/card-context-menu.svg";
|
|
|
|
|
import { ReactComponent as SendButton } from "assets/icons/comments/send-button.svg";
|
|
|
|
|
import { ReactComponent as Emoji } from "assets/icons/comments/emoji.svg";
|
|
|
|
|
import { ReactComponent as Pin } from "assets/icons/comments/pin.svg";
|
|
|
|
|
import { ReactComponent as OvalCheck } from "assets/icons/comments/check-oval.svg";
|
|
|
|
|
import { ReactComponent as ContextMenu } from "assets/icons/ads/context-menu.svg";
|
|
|
|
|
import { ReactComponent as Trash } from "assets/icons/comments/trash.svg";
|
2021-05-20 12:03:08 +00:00
|
|
|
import { ReactComponent as ReadPin } from "assets/icons/comments/read-pin.svg";
|
|
|
|
|
import { ReactComponent as UnreadPin } from "assets/icons/comments/unread-pin.svg";
|
Initialise comments (#3328)
* Initial scaffolding for comments CRUD APIs
* add actions
* add assets
* state management for existing comments and creating new
* add ui components
* add overlay comments wrapper to baseWidget
* add toggle comment mode button at editor header
* trigger tests
* Disallow commenting as someone else
* Add applicationId for comments
* lint
* Add overlay blacklist to prevent component interaction while adding comments
* Comment thread style updates
* Placeholder comment context menu
* Controlled comment thread visibility for making new comments visible by default
* Update comment type description
* Reset input on save
* Resolve comment thread button ui
* fix close on esc key, dont create new comment on outside click
* Submit on enter
* add emoji picker
* Attempt at adding a websocket server in Java
* CRUD APIs for comment threads
* Add API for getting all threads in application
* Move types to a separate file
* Initial commit for real time server (RTS)
* Add script to start RTS
* Fix position property
* Use create comment thread API
* Use add comment to thread API
* Add custom cursor
* Dispatch logout init on 401 errors
* Allow CORS for real time connection
* Add more logs to RTS
* Fix construction of MongoClient
* WIP: Real time comments
* Enable comments
* Minor updates
* Read backend API base URL from environment
* Escape to reset comments mode
* Set popover position as auto and boundary as scroll parent
* Disable warning
* Added permissions for comment threads
* Add resolved API for comment threads
* Migration to set commenting permission on existing apps
* Fix updates bringing the RTS down
* Show view latest button, scroll to bottom on creating a new comment
* Cleanup comment reducer
* Move to typescript for RTS
* Add missing server.ts and tsconfig files
* Resolve / unresolve comment
* Scaffold app comments
* Minor fixes: comment on top of all widgets, add toggle button at viewer header
* Reconnect socket on creating a new app, set connected status in store
* Retry socket connection flow
* Integration tests for comments with api mocks using msw
* Fix circular depependency
* rm file
* Minor cleanup and comments
* Minor refactors: move isScrolledToBottom to common hooks, decouple prevent interactions overlay from comments wrapper
* Use policies when pushing updates in RTS
* ENV var to set if comments are enabled
* Fix: check if editor/viewer is initialised before waiting for init action
* Add tests for comments reducer
* Revert "ENV var to set if comments are enabled"
This reverts commit 988efeaa69d378d943a387e1e73510334958adc5.
* Enable comments for users with appsmith email
* lint
* fix
* Try running a socket.io server inside backend
* Update comment reducer tests
* Init mentions within comments
* Fix comment thread updates with email rooms
* Minor fixes
* Refactors / review suggestions
* lint
* increase cache limit for builds
* Comment out tests for feature that's under development
* Add Dockerfile for RTS
* Fix policies missing for first comment in threads
* Use draftJS for comments input with mentions support
* fix fixtures
* Use thread's policies when querying for threads
* Update socket.io to v4
* Add support for richer body with mentions
* Update comment body type to RawDraftContentState
* fix stale method
* Fix mentions search
* Minor cleanups
* Comment context menu and thread UI updates
* revert: Scaffold app comments
* Yarn dependencies
* Delete comment using id api added
* Init app comments
* Add test for creating thread
* Api for delete comment with id
* Test comment creation response and policies
* Copy comment links
* Fix reset editor state
* Delete valid comment testcase added
* Delete comment TC : code refactor
* Don't allow creating comments with an empty body
* Pin comments WIP[]
* Ignore dependency-reduced-pom.xml files from VCS
* Cleanup of some dev-only files, for review
* Delete comment
* Update socket.io to v4 in RTS
* Pin and resolve comment thread object added in commentThread
* Pin and resolve comment thread object added in commentThread
* Update comment thread API
* Added creationTime and updationTime in comment thread response
* Added creationTime and updationTime in comment thread response
* Added human readable id to comment threads, fallback to username for null name in user document
* Refactor
* lint
* fix test, rm duplicate selector
* comment out saga used for dev
* CommentThread viewed status, username fallback for getName=null, username field added in pin & resolve status
* lint
* trigger tests
Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
Co-authored-by: Abhijeet <abhi.nagarnaik@gmail.com>
2021-04-29 10:33:51 +00:00
|
|
|
import { ReactComponent as Link2 } from "assets/icons/comments/link.svg";
|
2021-05-20 12:03:08 +00:00
|
|
|
import { ReactComponent as CommentContextMenu } from "assets/icons/comments/context-menu.svg";
|
|
|
|
|
import { ReactComponent as DownArrow2 } from "assets/icons/comments/down-arrow.svg";
|
|
|
|
|
import { ReactComponent as Filter } from "assets/icons/comments/filter.svg";
|
|
|
|
|
import { ReactComponent as Chat } from "assets/icons/comments/chat.svg";
|
|
|
|
|
import { ReactComponent as Pin3 } from "assets/icons/comments/pin_3.svg";
|
|
|
|
|
import { ReactComponent as Unpin } from "assets/icons/comments/unpin.svg";
|
|
|
|
|
import { ReactComponent as Reaction } from "assets/icons/comments/reaction.svg";
|
|
|
|
|
import { ReactComponent as Reaction2 } from "assets/icons/comments/reaction-2.svg";
|
2021-06-03 06:18:08 +00:00
|
|
|
import { ReactComponent as Upload } from "assets/icons/ads/upload.svg";
|
|
|
|
|
import { ReactComponent as Download } from "assets/icons/ads/download.svg";
|
2020-08-10 04:54:33 +00:00
|
|
|
import styled from "styled-components";
|
2020-09-01 07:24:53 +00:00
|
|
|
import { CommonComponentProps, Classes } from "./common";
|
2020-08-28 18:51:16 +00:00
|
|
|
import { noop } from "lodash";
|
2020-08-31 04:59:18 +00:00
|
|
|
import { theme } from "constants/DefaultTheme";
|
2020-10-14 10:35:19 +00:00
|
|
|
import Spinner from "./Spinner";
|
2021-03-17 20:36:26 +00:00
|
|
|
import { ControlIcons } from "icons/ControlIcons";
|
2020-08-10 04:54:33 +00:00
|
|
|
|
2020-08-31 04:59:18 +00:00
|
|
|
export enum IconSize {
|
2020-09-16 11:50:47 +00:00
|
|
|
XXS = "extraExtraSmall",
|
|
|
|
|
XS = "extraSmall",
|
2020-08-31 04:59:18 +00:00
|
|
|
SMALL = "small",
|
|
|
|
|
MEDIUM = "medium",
|
|
|
|
|
LARGE = "large",
|
|
|
|
|
XL = "extraLarge",
|
|
|
|
|
XXL = "extraExtraLarge",
|
|
|
|
|
XXXL = "extraExtraExtraLarge",
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const sizeHandler = (size?: IconSize) => {
|
|
|
|
|
let iconSize = 0;
|
|
|
|
|
switch (size) {
|
2020-09-16 11:50:47 +00:00
|
|
|
case IconSize.XXS:
|
|
|
|
|
iconSize = theme.iconSizes.XXS;
|
|
|
|
|
break;
|
|
|
|
|
case IconSize.XS:
|
|
|
|
|
iconSize = theme.iconSizes.XS;
|
|
|
|
|
break;
|
2020-08-31 04:59:18 +00:00
|
|
|
case IconSize.SMALL:
|
|
|
|
|
iconSize = theme.iconSizes.SMALL;
|
|
|
|
|
break;
|
|
|
|
|
case IconSize.MEDIUM:
|
|
|
|
|
iconSize = theme.iconSizes.MEDIUM;
|
|
|
|
|
break;
|
|
|
|
|
case IconSize.LARGE:
|
|
|
|
|
iconSize = theme.iconSizes.LARGE;
|
|
|
|
|
break;
|
|
|
|
|
case IconSize.XL:
|
|
|
|
|
iconSize = theme.iconSizes.XL;
|
|
|
|
|
break;
|
|
|
|
|
case IconSize.XXL:
|
|
|
|
|
iconSize = theme.iconSizes.XXL;
|
|
|
|
|
break;
|
|
|
|
|
case IconSize.XXXL:
|
|
|
|
|
iconSize = theme.iconSizes.XXXL;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
iconSize = theme.iconSizes.SMALL;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return iconSize;
|
|
|
|
|
};
|
|
|
|
|
|
2020-09-01 07:24:53 +00:00
|
|
|
export const IconCollection = [
|
2021-06-03 06:18:08 +00:00
|
|
|
"upload",
|
|
|
|
|
"download",
|
2021-02-11 06:36:07 +00:00
|
|
|
"book",
|
2021-04-23 13:50:55 +00:00
|
|
|
"bug",
|
|
|
|
|
"cancel",
|
|
|
|
|
"cross",
|
2020-09-01 07:24:53 +00:00
|
|
|
"delete",
|
2021-04-23 13:50:55 +00:00
|
|
|
"open",
|
2020-09-01 07:24:53 +00:00
|
|
|
"user",
|
|
|
|
|
"general",
|
|
|
|
|
"billing",
|
|
|
|
|
"edit",
|
|
|
|
|
"error",
|
2021-02-11 06:36:07 +00:00
|
|
|
"shine",
|
2021-02-11 12:54:00 +00:00
|
|
|
"danger",
|
2020-09-01 07:24:53 +00:00
|
|
|
"success",
|
|
|
|
|
"search",
|
|
|
|
|
"close",
|
|
|
|
|
"share",
|
|
|
|
|
"rocket",
|
|
|
|
|
"workspace",
|
|
|
|
|
"plus",
|
|
|
|
|
"invite-user",
|
|
|
|
|
"view-all",
|
2021-01-19 06:17:15 +00:00
|
|
|
"view-less",
|
2020-11-24 07:01:37 +00:00
|
|
|
"warning",
|
2021-04-23 13:50:55 +00:00
|
|
|
"warning-triangle",
|
2020-09-02 06:46:02 +00:00
|
|
|
"downArrow",
|
2020-09-16 11:50:47 +00:00
|
|
|
"context-menu",
|
|
|
|
|
"duplicate",
|
2020-09-22 11:56:11 +00:00
|
|
|
"logout",
|
2020-10-12 07:15:35 +00:00
|
|
|
"manage",
|
2021-02-04 07:02:36 +00:00
|
|
|
"arrow-left",
|
|
|
|
|
"fork",
|
|
|
|
|
"chevron-left",
|
|
|
|
|
"chevron-right",
|
2021-03-08 08:24:12 +00:00
|
|
|
"link",
|
|
|
|
|
"help",
|
2021-02-11 12:54:00 +00:00
|
|
|
"close-modal",
|
|
|
|
|
"no-response",
|
|
|
|
|
"lightning",
|
|
|
|
|
"add-more",
|
|
|
|
|
"right-arrow",
|
|
|
|
|
"datasource",
|
|
|
|
|
"play",
|
2021-03-03 05:26:47 +00:00
|
|
|
"desktop",
|
2021-04-23 13:50:55 +00:00
|
|
|
"wand",
|
2021-03-03 05:26:47 +00:00
|
|
|
"mobile",
|
|
|
|
|
"tablet",
|
|
|
|
|
"fluid",
|
Initialise comments (#3328)
* Initial scaffolding for comments CRUD APIs
* add actions
* add assets
* state management for existing comments and creating new
* add ui components
* add overlay comments wrapper to baseWidget
* add toggle comment mode button at editor header
* trigger tests
* Disallow commenting as someone else
* Add applicationId for comments
* lint
* Add overlay blacklist to prevent component interaction while adding comments
* Comment thread style updates
* Placeholder comment context menu
* Controlled comment thread visibility for making new comments visible by default
* Update comment type description
* Reset input on save
* Resolve comment thread button ui
* fix close on esc key, dont create new comment on outside click
* Submit on enter
* add emoji picker
* Attempt at adding a websocket server in Java
* CRUD APIs for comment threads
* Add API for getting all threads in application
* Move types to a separate file
* Initial commit for real time server (RTS)
* Add script to start RTS
* Fix position property
* Use create comment thread API
* Use add comment to thread API
* Add custom cursor
* Dispatch logout init on 401 errors
* Allow CORS for real time connection
* Add more logs to RTS
* Fix construction of MongoClient
* WIP: Real time comments
* Enable comments
* Minor updates
* Read backend API base URL from environment
* Escape to reset comments mode
* Set popover position as auto and boundary as scroll parent
* Disable warning
* Added permissions for comment threads
* Add resolved API for comment threads
* Migration to set commenting permission on existing apps
* Fix updates bringing the RTS down
* Show view latest button, scroll to bottom on creating a new comment
* Cleanup comment reducer
* Move to typescript for RTS
* Add missing server.ts and tsconfig files
* Resolve / unresolve comment
* Scaffold app comments
* Minor fixes: comment on top of all widgets, add toggle button at viewer header
* Reconnect socket on creating a new app, set connected status in store
* Retry socket connection flow
* Integration tests for comments with api mocks using msw
* Fix circular depependency
* rm file
* Minor cleanup and comments
* Minor refactors: move isScrolledToBottom to common hooks, decouple prevent interactions overlay from comments wrapper
* Use policies when pushing updates in RTS
* ENV var to set if comments are enabled
* Fix: check if editor/viewer is initialised before waiting for init action
* Add tests for comments reducer
* Revert "ENV var to set if comments are enabled"
This reverts commit 988efeaa69d378d943a387e1e73510334958adc5.
* Enable comments for users with appsmith email
* lint
* fix
* Try running a socket.io server inside backend
* Update comment reducer tests
* Init mentions within comments
* Fix comment thread updates with email rooms
* Minor fixes
* Refactors / review suggestions
* lint
* increase cache limit for builds
* Comment out tests for feature that's under development
* Add Dockerfile for RTS
* Fix policies missing for first comment in threads
* Use draftJS for comments input with mentions support
* fix fixtures
* Use thread's policies when querying for threads
* Update socket.io to v4
* Add support for richer body with mentions
* Update comment body type to RawDraftContentState
* fix stale method
* Fix mentions search
* Minor cleanups
* Comment context menu and thread UI updates
* revert: Scaffold app comments
* Yarn dependencies
* Delete comment using id api added
* Init app comments
* Add test for creating thread
* Api for delete comment with id
* Test comment creation response and policies
* Copy comment links
* Fix reset editor state
* Delete valid comment testcase added
* Delete comment TC : code refactor
* Don't allow creating comments with an empty body
* Pin comments WIP[]
* Ignore dependency-reduced-pom.xml files from VCS
* Cleanup of some dev-only files, for review
* Delete comment
* Update socket.io to v4 in RTS
* Pin and resolve comment thread object added in commentThread
* Pin and resolve comment thread object added in commentThread
* Update comment thread API
* Added creationTime and updationTime in comment thread response
* Added creationTime and updationTime in comment thread response
* Added human readable id to comment threads, fallback to username for null name in user document
* Refactor
* lint
* fix test, rm duplicate selector
* comment out saga used for dev
* CommentThread viewed status, username fallback for getName=null, username field added in pin & resolve status
* lint
* trigger tests
Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
Co-authored-by: Abhijeet <abhi.nagarnaik@gmail.com>
2021-04-29 10:33:51 +00:00
|
|
|
"card-context-menu",
|
|
|
|
|
"send-button",
|
|
|
|
|
"emoji",
|
|
|
|
|
"pin",
|
|
|
|
|
"oval-check",
|
2021-03-17 20:36:26 +00:00
|
|
|
"HEADING_ONE",
|
|
|
|
|
"HEADING_TWO",
|
|
|
|
|
"HEADING_THREE",
|
|
|
|
|
"PARAGRAPH",
|
|
|
|
|
"PARAGRAPH_TWO",
|
Initialise comments (#3328)
* Initial scaffolding for comments CRUD APIs
* add actions
* add assets
* state management for existing comments and creating new
* add ui components
* add overlay comments wrapper to baseWidget
* add toggle comment mode button at editor header
* trigger tests
* Disallow commenting as someone else
* Add applicationId for comments
* lint
* Add overlay blacklist to prevent component interaction while adding comments
* Comment thread style updates
* Placeholder comment context menu
* Controlled comment thread visibility for making new comments visible by default
* Update comment type description
* Reset input on save
* Resolve comment thread button ui
* fix close on esc key, dont create new comment on outside click
* Submit on enter
* add emoji picker
* Attempt at adding a websocket server in Java
* CRUD APIs for comment threads
* Add API for getting all threads in application
* Move types to a separate file
* Initial commit for real time server (RTS)
* Add script to start RTS
* Fix position property
* Use create comment thread API
* Use add comment to thread API
* Add custom cursor
* Dispatch logout init on 401 errors
* Allow CORS for real time connection
* Add more logs to RTS
* Fix construction of MongoClient
* WIP: Real time comments
* Enable comments
* Minor updates
* Read backend API base URL from environment
* Escape to reset comments mode
* Set popover position as auto and boundary as scroll parent
* Disable warning
* Added permissions for comment threads
* Add resolved API for comment threads
* Migration to set commenting permission on existing apps
* Fix updates bringing the RTS down
* Show view latest button, scroll to bottom on creating a new comment
* Cleanup comment reducer
* Move to typescript for RTS
* Add missing server.ts and tsconfig files
* Resolve / unresolve comment
* Scaffold app comments
* Minor fixes: comment on top of all widgets, add toggle button at viewer header
* Reconnect socket on creating a new app, set connected status in store
* Retry socket connection flow
* Integration tests for comments with api mocks using msw
* Fix circular depependency
* rm file
* Minor cleanup and comments
* Minor refactors: move isScrolledToBottom to common hooks, decouple prevent interactions overlay from comments wrapper
* Use policies when pushing updates in RTS
* ENV var to set if comments are enabled
* Fix: check if editor/viewer is initialised before waiting for init action
* Add tests for comments reducer
* Revert "ENV var to set if comments are enabled"
This reverts commit 988efeaa69d378d943a387e1e73510334958adc5.
* Enable comments for users with appsmith email
* lint
* fix
* Try running a socket.io server inside backend
* Update comment reducer tests
* Init mentions within comments
* Fix comment thread updates with email rooms
* Minor fixes
* Refactors / review suggestions
* lint
* increase cache limit for builds
* Comment out tests for feature that's under development
* Add Dockerfile for RTS
* Fix policies missing for first comment in threads
* Use draftJS for comments input with mentions support
* fix fixtures
* Use thread's policies when querying for threads
* Update socket.io to v4
* Add support for richer body with mentions
* Update comment body type to RawDraftContentState
* fix stale method
* Fix mentions search
* Minor cleanups
* Comment context menu and thread UI updates
* revert: Scaffold app comments
* Yarn dependencies
* Delete comment using id api added
* Init app comments
* Add test for creating thread
* Api for delete comment with id
* Test comment creation response and policies
* Copy comment links
* Fix reset editor state
* Delete valid comment testcase added
* Delete comment TC : code refactor
* Don't allow creating comments with an empty body
* Pin comments WIP[]
* Ignore dependency-reduced-pom.xml files from VCS
* Cleanup of some dev-only files, for review
* Delete comment
* Update socket.io to v4 in RTS
* Pin and resolve comment thread object added in commentThread
* Pin and resolve comment thread object added in commentThread
* Update comment thread API
* Added creationTime and updationTime in comment thread response
* Added creationTime and updationTime in comment thread response
* Added human readable id to comment threads, fallback to username for null name in user document
* Refactor
* lint
* fix test, rm duplicate selector
* comment out saga used for dev
* CommentThread viewed status, username fallback for getName=null, username field added in pin & resolve status
* lint
* trigger tests
Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
Co-authored-by: Abhijeet <abhi.nagarnaik@gmail.com>
2021-04-29 10:33:51 +00:00
|
|
|
"context-menu",
|
|
|
|
|
"trash",
|
|
|
|
|
"link-2",
|
|
|
|
|
"close-x",
|
2021-05-20 12:03:08 +00:00
|
|
|
"comment-context-menu",
|
|
|
|
|
"down-arrow-2",
|
|
|
|
|
"read-pin",
|
|
|
|
|
"unread-pin",
|
|
|
|
|
"filter",
|
|
|
|
|
"chat",
|
|
|
|
|
"pin-3",
|
|
|
|
|
"unpin",
|
|
|
|
|
"reaction",
|
|
|
|
|
"reaction-2",
|
2020-09-01 07:24:53 +00:00
|
|
|
] as const;
|
|
|
|
|
|
|
|
|
|
export type IconName = typeof IconCollection[number];
|
2020-08-10 04:54:33 +00:00
|
|
|
|
2021-02-04 07:02:36 +00:00
|
|
|
export const IconWrapper = styled.span<IconProps>`
|
2020-08-10 04:54:33 +00:00
|
|
|
&:focus {
|
|
|
|
|
outline: none;
|
|
|
|
|
}
|
2020-08-14 07:11:38 +00:00
|
|
|
display: flex;
|
2020-10-12 07:15:35 +00:00
|
|
|
align-items: center;
|
2020-08-10 04:54:33 +00:00
|
|
|
svg {
|
2020-12-24 04:32:25 +00:00
|
|
|
width: ${(props) => sizeHandler(props.size)}px;
|
|
|
|
|
height: ${(props) => sizeHandler(props.size)}px;
|
2021-04-23 13:50:55 +00:00
|
|
|
${(props) =>
|
|
|
|
|
!props.keepColors
|
|
|
|
|
? `
|
2020-08-17 03:25:35 +00:00
|
|
|
path {
|
2021-04-23 13:50:55 +00:00
|
|
|
fill: ${props.fillColor || props.theme.colors.icon.normal};
|
2020-08-17 03:25:35 +00:00
|
|
|
}
|
2021-04-23 13:50:55 +00:00
|
|
|
circle {
|
|
|
|
|
fill: ${props.fillColor || props.theme.colors.icon.normal};
|
|
|
|
|
}
|
|
|
|
|
`
|
|
|
|
|
: ""}
|
2020-12-24 04:32:25 +00:00
|
|
|
${(props) => (props.invisible ? `visibility: hidden;` : null)};
|
2020-08-17 03:25:35 +00:00
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
cursor: pointer;
|
2021-04-23 13:50:55 +00:00
|
|
|
${(props) =>
|
|
|
|
|
!props.keepColors
|
|
|
|
|
? `
|
2020-08-17 03:25:35 +00:00
|
|
|
path {
|
2021-05-20 12:03:08 +00:00
|
|
|
fill: ${props.hoverFillColor || props.theme.colors.icon.hover};
|
2020-08-17 03:25:35 +00:00
|
|
|
}
|
2021-04-23 13:50:55 +00:00
|
|
|
`
|
|
|
|
|
: ""}
|
2020-08-17 03:25:35 +00:00
|
|
|
}
|
|
|
|
|
|
2021-05-20 12:03:08 +00:00
|
|
|
&:hover {
|
2020-08-17 03:25:35 +00:00
|
|
|
cursor: pointer;
|
2021-05-20 12:03:08 +00:00
|
|
|
${(props) =>
|
|
|
|
|
!props.keepColors
|
|
|
|
|
? `
|
2020-08-17 03:25:35 +00:00
|
|
|
path {
|
2021-05-20 12:03:08 +00:00
|
|
|
fill: ${props.hoverFillColor || props.theme.colors.icon.hover};
|
2020-08-17 03:25:35 +00:00
|
|
|
}
|
2021-05-20 12:03:08 +00:00
|
|
|
`
|
|
|
|
|
: ""}
|
2020-08-17 03:25:35 +00:00
|
|
|
}
|
2020-08-10 04:54:33 +00:00
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
export type IconProps = {
|
2020-08-31 04:59:18 +00:00
|
|
|
size?: IconSize;
|
2020-08-10 04:54:33 +00:00
|
|
|
name?: IconName;
|
|
|
|
|
invisible?: boolean;
|
2020-08-26 07:18:04 +00:00
|
|
|
className?: string;
|
2021-02-11 12:54:00 +00:00
|
|
|
onClick?: (e: React.MouseEvent) => void;
|
2021-01-19 06:17:15 +00:00
|
|
|
fillColor?: string;
|
2021-05-20 12:03:08 +00:00
|
|
|
hoverFillColor?: string;
|
2021-04-23 13:50:55 +00:00
|
|
|
keepColors?: boolean;
|
2020-08-10 04:54:33 +00:00
|
|
|
};
|
|
|
|
|
|
2020-10-14 10:35:19 +00:00
|
|
|
const Icon = forwardRef(
|
|
|
|
|
(props: IconProps & CommonComponentProps, ref: Ref<HTMLSpanElement>) => {
|
|
|
|
|
let returnIcon;
|
|
|
|
|
switch (props.name) {
|
2021-02-11 06:36:07 +00:00
|
|
|
case "book":
|
|
|
|
|
returnIcon = <BookIcon />;
|
|
|
|
|
break;
|
2021-04-23 13:50:55 +00:00
|
|
|
case "bug":
|
|
|
|
|
returnIcon = <BugIcon />;
|
|
|
|
|
break;
|
|
|
|
|
case "cancel":
|
|
|
|
|
returnIcon = <CancelIcon />;
|
|
|
|
|
break;
|
|
|
|
|
case "cross":
|
|
|
|
|
returnIcon = <CrossIcon />;
|
|
|
|
|
break;
|
2020-10-14 10:35:19 +00:00
|
|
|
case "delete":
|
|
|
|
|
returnIcon = <DeleteIcon />;
|
|
|
|
|
break;
|
2021-04-23 13:50:55 +00:00
|
|
|
case "open":
|
|
|
|
|
returnIcon = <OpenIcon />;
|
|
|
|
|
break;
|
2020-10-14 10:35:19 +00:00
|
|
|
case "user":
|
|
|
|
|
returnIcon = <UserIcon />;
|
|
|
|
|
break;
|
|
|
|
|
case "general":
|
|
|
|
|
returnIcon = <GeneralIcon />;
|
|
|
|
|
break;
|
|
|
|
|
case "billing":
|
|
|
|
|
returnIcon = <BillingIcon />;
|
|
|
|
|
break;
|
|
|
|
|
case "edit":
|
|
|
|
|
returnIcon = <EditIcon />;
|
|
|
|
|
break;
|
|
|
|
|
case "error":
|
|
|
|
|
returnIcon = <ErrorIcon />;
|
|
|
|
|
break;
|
2021-02-11 12:54:00 +00:00
|
|
|
case "danger":
|
|
|
|
|
returnIcon = <ErrorIcon />;
|
|
|
|
|
break;
|
2021-02-11 06:36:07 +00:00
|
|
|
case "shine":
|
|
|
|
|
returnIcon = <ShineIcon />;
|
|
|
|
|
break;
|
2020-10-14 10:35:19 +00:00
|
|
|
case "success":
|
|
|
|
|
returnIcon = <SuccessIcon />;
|
|
|
|
|
break;
|
|
|
|
|
case "search":
|
|
|
|
|
returnIcon = <SearchIcon />;
|
|
|
|
|
break;
|
|
|
|
|
case "close":
|
|
|
|
|
returnIcon = <CloseIcon />;
|
|
|
|
|
break;
|
|
|
|
|
case "downArrow":
|
|
|
|
|
returnIcon = <DownArrow />;
|
|
|
|
|
break;
|
|
|
|
|
case "share":
|
|
|
|
|
returnIcon = <ShareIcon />;
|
|
|
|
|
break;
|
|
|
|
|
case "rocket":
|
|
|
|
|
returnIcon = <RocketIcon />;
|
|
|
|
|
break;
|
2021-04-23 13:50:55 +00:00
|
|
|
case "wand":
|
|
|
|
|
returnIcon = <WandIcon />;
|
|
|
|
|
break;
|
2020-10-14 10:35:19 +00:00
|
|
|
case "workspace":
|
|
|
|
|
returnIcon = <WorkspaceIcon />;
|
|
|
|
|
break;
|
|
|
|
|
case "plus":
|
|
|
|
|
returnIcon = <CreateNewIcon />;
|
|
|
|
|
break;
|
|
|
|
|
case "invite-user":
|
|
|
|
|
returnIcon = <InviteUserIcon />;
|
|
|
|
|
break;
|
|
|
|
|
case "view-all":
|
|
|
|
|
returnIcon = <ViewAllIcon />;
|
|
|
|
|
break;
|
2021-01-19 06:17:15 +00:00
|
|
|
case "view-less":
|
|
|
|
|
returnIcon = <ViewLessIcon />;
|
|
|
|
|
break;
|
2020-10-14 10:35:19 +00:00
|
|
|
case "context-menu":
|
|
|
|
|
returnIcon = <ContextMenuIcon />;
|
|
|
|
|
break;
|
|
|
|
|
case "duplicate":
|
|
|
|
|
returnIcon = <DuplicateIcon />;
|
|
|
|
|
break;
|
|
|
|
|
case "logout":
|
|
|
|
|
returnIcon = <LogoutIcon />;
|
|
|
|
|
break;
|
|
|
|
|
case "manage":
|
|
|
|
|
returnIcon = <ManageIcon />;
|
|
|
|
|
break;
|
2020-11-24 07:01:37 +00:00
|
|
|
case "warning":
|
|
|
|
|
returnIcon = <WarningIcon />;
|
|
|
|
|
break;
|
2021-04-23 13:50:55 +00:00
|
|
|
case "warning-triangle":
|
|
|
|
|
returnIcon = <WarningTriangleIcon />;
|
|
|
|
|
break;
|
2021-02-04 07:02:36 +00:00
|
|
|
case "arrow-left":
|
|
|
|
|
returnIcon = <ArrowLeft />;
|
|
|
|
|
break;
|
|
|
|
|
case "fork":
|
|
|
|
|
returnIcon = <Fork />;
|
|
|
|
|
break;
|
|
|
|
|
case "chevron-left":
|
|
|
|
|
returnIcon = <ChevronLeft />;
|
|
|
|
|
break;
|
|
|
|
|
case "chevron-right":
|
|
|
|
|
returnIcon = <ChevronRight />;
|
|
|
|
|
break;
|
2021-03-08 08:24:12 +00:00
|
|
|
case "link":
|
|
|
|
|
returnIcon = <LinkIcon />;
|
|
|
|
|
break;
|
|
|
|
|
case "help":
|
|
|
|
|
returnIcon = <HelpIcon />;
|
|
|
|
|
break;
|
2021-02-11 12:54:00 +00:00
|
|
|
case "close-modal":
|
Initialise comments (#3328)
* Initial scaffolding for comments CRUD APIs
* add actions
* add assets
* state management for existing comments and creating new
* add ui components
* add overlay comments wrapper to baseWidget
* add toggle comment mode button at editor header
* trigger tests
* Disallow commenting as someone else
* Add applicationId for comments
* lint
* Add overlay blacklist to prevent component interaction while adding comments
* Comment thread style updates
* Placeholder comment context menu
* Controlled comment thread visibility for making new comments visible by default
* Update comment type description
* Reset input on save
* Resolve comment thread button ui
* fix close on esc key, dont create new comment on outside click
* Submit on enter
* add emoji picker
* Attempt at adding a websocket server in Java
* CRUD APIs for comment threads
* Add API for getting all threads in application
* Move types to a separate file
* Initial commit for real time server (RTS)
* Add script to start RTS
* Fix position property
* Use create comment thread API
* Use add comment to thread API
* Add custom cursor
* Dispatch logout init on 401 errors
* Allow CORS for real time connection
* Add more logs to RTS
* Fix construction of MongoClient
* WIP: Real time comments
* Enable comments
* Minor updates
* Read backend API base URL from environment
* Escape to reset comments mode
* Set popover position as auto and boundary as scroll parent
* Disable warning
* Added permissions for comment threads
* Add resolved API for comment threads
* Migration to set commenting permission on existing apps
* Fix updates bringing the RTS down
* Show view latest button, scroll to bottom on creating a new comment
* Cleanup comment reducer
* Move to typescript for RTS
* Add missing server.ts and tsconfig files
* Resolve / unresolve comment
* Scaffold app comments
* Minor fixes: comment on top of all widgets, add toggle button at viewer header
* Reconnect socket on creating a new app, set connected status in store
* Retry socket connection flow
* Integration tests for comments with api mocks using msw
* Fix circular depependency
* rm file
* Minor cleanup and comments
* Minor refactors: move isScrolledToBottom to common hooks, decouple prevent interactions overlay from comments wrapper
* Use policies when pushing updates in RTS
* ENV var to set if comments are enabled
* Fix: check if editor/viewer is initialised before waiting for init action
* Add tests for comments reducer
* Revert "ENV var to set if comments are enabled"
This reverts commit 988efeaa69d378d943a387e1e73510334958adc5.
* Enable comments for users with appsmith email
* lint
* fix
* Try running a socket.io server inside backend
* Update comment reducer tests
* Init mentions within comments
* Fix comment thread updates with email rooms
* Minor fixes
* Refactors / review suggestions
* lint
* increase cache limit for builds
* Comment out tests for feature that's under development
* Add Dockerfile for RTS
* Fix policies missing for first comment in threads
* Use draftJS for comments input with mentions support
* fix fixtures
* Use thread's policies when querying for threads
* Update socket.io to v4
* Add support for richer body with mentions
* Update comment body type to RawDraftContentState
* fix stale method
* Fix mentions search
* Minor cleanups
* Comment context menu and thread UI updates
* revert: Scaffold app comments
* Yarn dependencies
* Delete comment using id api added
* Init app comments
* Add test for creating thread
* Api for delete comment with id
* Test comment creation response and policies
* Copy comment links
* Fix reset editor state
* Delete valid comment testcase added
* Delete comment TC : code refactor
* Don't allow creating comments with an empty body
* Pin comments WIP[]
* Ignore dependency-reduced-pom.xml files from VCS
* Cleanup of some dev-only files, for review
* Delete comment
* Update socket.io to v4 in RTS
* Pin and resolve comment thread object added in commentThread
* Pin and resolve comment thread object added in commentThread
* Update comment thread API
* Added creationTime and updationTime in comment thread response
* Added creationTime and updationTime in comment thread response
* Added human readable id to comment threads, fallback to username for null name in user document
* Refactor
* lint
* fix test, rm duplicate selector
* comment out saga used for dev
* CommentThread viewed status, username fallback for getName=null, username field added in pin & resolve status
* lint
* trigger tests
Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
Co-authored-by: Abhijeet <abhi.nagarnaik@gmail.com>
2021-04-29 10:33:51 +00:00
|
|
|
case "close-x":
|
2021-02-11 12:54:00 +00:00
|
|
|
returnIcon = <CloseModalIcon />;
|
|
|
|
|
break;
|
|
|
|
|
case "no-response":
|
|
|
|
|
returnIcon = <NoResponseIcon />;
|
|
|
|
|
break;
|
|
|
|
|
case "lightning":
|
|
|
|
|
returnIcon = <LightningIcon />;
|
|
|
|
|
break;
|
|
|
|
|
case "add-more":
|
|
|
|
|
returnIcon = <AddMoreIcon />;
|
|
|
|
|
break;
|
|
|
|
|
case "right-arrow":
|
|
|
|
|
returnIcon = <RightArrowIcon />;
|
|
|
|
|
break;
|
|
|
|
|
case "datasource":
|
|
|
|
|
returnIcon = <DatasourceIcon />;
|
|
|
|
|
break;
|
|
|
|
|
case "play":
|
|
|
|
|
returnIcon = <PlayIcon />;
|
|
|
|
|
break;
|
2021-03-03 05:26:47 +00:00
|
|
|
case "desktop":
|
|
|
|
|
returnIcon = <DesktopIcon />;
|
|
|
|
|
break;
|
|
|
|
|
case "mobile":
|
|
|
|
|
returnIcon = <MobileIcon />;
|
|
|
|
|
break;
|
|
|
|
|
case "tablet":
|
|
|
|
|
returnIcon = <TabletIcon />;
|
|
|
|
|
break;
|
|
|
|
|
case "fluid":
|
|
|
|
|
returnIcon = <FluidIcon />;
|
|
|
|
|
break;
|
Initialise comments (#3328)
* Initial scaffolding for comments CRUD APIs
* add actions
* add assets
* state management for existing comments and creating new
* add ui components
* add overlay comments wrapper to baseWidget
* add toggle comment mode button at editor header
* trigger tests
* Disallow commenting as someone else
* Add applicationId for comments
* lint
* Add overlay blacklist to prevent component interaction while adding comments
* Comment thread style updates
* Placeholder comment context menu
* Controlled comment thread visibility for making new comments visible by default
* Update comment type description
* Reset input on save
* Resolve comment thread button ui
* fix close on esc key, dont create new comment on outside click
* Submit on enter
* add emoji picker
* Attempt at adding a websocket server in Java
* CRUD APIs for comment threads
* Add API for getting all threads in application
* Move types to a separate file
* Initial commit for real time server (RTS)
* Add script to start RTS
* Fix position property
* Use create comment thread API
* Use add comment to thread API
* Add custom cursor
* Dispatch logout init on 401 errors
* Allow CORS for real time connection
* Add more logs to RTS
* Fix construction of MongoClient
* WIP: Real time comments
* Enable comments
* Minor updates
* Read backend API base URL from environment
* Escape to reset comments mode
* Set popover position as auto and boundary as scroll parent
* Disable warning
* Added permissions for comment threads
* Add resolved API for comment threads
* Migration to set commenting permission on existing apps
* Fix updates bringing the RTS down
* Show view latest button, scroll to bottom on creating a new comment
* Cleanup comment reducer
* Move to typescript for RTS
* Add missing server.ts and tsconfig files
* Resolve / unresolve comment
* Scaffold app comments
* Minor fixes: comment on top of all widgets, add toggle button at viewer header
* Reconnect socket on creating a new app, set connected status in store
* Retry socket connection flow
* Integration tests for comments with api mocks using msw
* Fix circular depependency
* rm file
* Minor cleanup and comments
* Minor refactors: move isScrolledToBottom to common hooks, decouple prevent interactions overlay from comments wrapper
* Use policies when pushing updates in RTS
* ENV var to set if comments are enabled
* Fix: check if editor/viewer is initialised before waiting for init action
* Add tests for comments reducer
* Revert "ENV var to set if comments are enabled"
This reverts commit 988efeaa69d378d943a387e1e73510334958adc5.
* Enable comments for users with appsmith email
* lint
* fix
* Try running a socket.io server inside backend
* Update comment reducer tests
* Init mentions within comments
* Fix comment thread updates with email rooms
* Minor fixes
* Refactors / review suggestions
* lint
* increase cache limit for builds
* Comment out tests for feature that's under development
* Add Dockerfile for RTS
* Fix policies missing for first comment in threads
* Use draftJS for comments input with mentions support
* fix fixtures
* Use thread's policies when querying for threads
* Update socket.io to v4
* Add support for richer body with mentions
* Update comment body type to RawDraftContentState
* fix stale method
* Fix mentions search
* Minor cleanups
* Comment context menu and thread UI updates
* revert: Scaffold app comments
* Yarn dependencies
* Delete comment using id api added
* Init app comments
* Add test for creating thread
* Api for delete comment with id
* Test comment creation response and policies
* Copy comment links
* Fix reset editor state
* Delete valid comment testcase added
* Delete comment TC : code refactor
* Don't allow creating comments with an empty body
* Pin comments WIP[]
* Ignore dependency-reduced-pom.xml files from VCS
* Cleanup of some dev-only files, for review
* Delete comment
* Update socket.io to v4 in RTS
* Pin and resolve comment thread object added in commentThread
* Pin and resolve comment thread object added in commentThread
* Update comment thread API
* Added creationTime and updationTime in comment thread response
* Added creationTime and updationTime in comment thread response
* Added human readable id to comment threads, fallback to username for null name in user document
* Refactor
* lint
* fix test, rm duplicate selector
* comment out saga used for dev
* CommentThread viewed status, username fallback for getName=null, username field added in pin & resolve status
* lint
* trigger tests
Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
Co-authored-by: Abhijeet <abhi.nagarnaik@gmail.com>
2021-04-29 10:33:51 +00:00
|
|
|
case "card-context-menu":
|
|
|
|
|
returnIcon = <CardContextMenu />;
|
|
|
|
|
break;
|
|
|
|
|
case "send-button":
|
|
|
|
|
returnIcon = <SendButton />;
|
|
|
|
|
break;
|
|
|
|
|
case "emoji":
|
|
|
|
|
returnIcon = <Emoji />;
|
|
|
|
|
break;
|
|
|
|
|
case "pin":
|
|
|
|
|
returnIcon = <Pin />;
|
|
|
|
|
break;
|
|
|
|
|
case "oval-check":
|
|
|
|
|
returnIcon = <OvalCheck />;
|
|
|
|
|
break;
|
2021-03-03 05:26:47 +00:00
|
|
|
|
2021-03-17 20:36:26 +00:00
|
|
|
case "HEADING_ONE":
|
|
|
|
|
case "HEADING_TWO":
|
|
|
|
|
case "HEADING_THREE":
|
|
|
|
|
case "PARAGRAPH":
|
|
|
|
|
case "PARAGRAPH_TWO":
|
|
|
|
|
const ControlIcon = ControlIcons[props.name];
|
2021-04-28 10:28:39 +00:00
|
|
|
returnIcon = <ControlIcon height={24} width={24} />;
|
2021-03-17 20:36:26 +00:00
|
|
|
break;
|
|
|
|
|
|
Initialise comments (#3328)
* Initial scaffolding for comments CRUD APIs
* add actions
* add assets
* state management for existing comments and creating new
* add ui components
* add overlay comments wrapper to baseWidget
* add toggle comment mode button at editor header
* trigger tests
* Disallow commenting as someone else
* Add applicationId for comments
* lint
* Add overlay blacklist to prevent component interaction while adding comments
* Comment thread style updates
* Placeholder comment context menu
* Controlled comment thread visibility for making new comments visible by default
* Update comment type description
* Reset input on save
* Resolve comment thread button ui
* fix close on esc key, dont create new comment on outside click
* Submit on enter
* add emoji picker
* Attempt at adding a websocket server in Java
* CRUD APIs for comment threads
* Add API for getting all threads in application
* Move types to a separate file
* Initial commit for real time server (RTS)
* Add script to start RTS
* Fix position property
* Use create comment thread API
* Use add comment to thread API
* Add custom cursor
* Dispatch logout init on 401 errors
* Allow CORS for real time connection
* Add more logs to RTS
* Fix construction of MongoClient
* WIP: Real time comments
* Enable comments
* Minor updates
* Read backend API base URL from environment
* Escape to reset comments mode
* Set popover position as auto and boundary as scroll parent
* Disable warning
* Added permissions for comment threads
* Add resolved API for comment threads
* Migration to set commenting permission on existing apps
* Fix updates bringing the RTS down
* Show view latest button, scroll to bottom on creating a new comment
* Cleanup comment reducer
* Move to typescript for RTS
* Add missing server.ts and tsconfig files
* Resolve / unresolve comment
* Scaffold app comments
* Minor fixes: comment on top of all widgets, add toggle button at viewer header
* Reconnect socket on creating a new app, set connected status in store
* Retry socket connection flow
* Integration tests for comments with api mocks using msw
* Fix circular depependency
* rm file
* Minor cleanup and comments
* Minor refactors: move isScrolledToBottom to common hooks, decouple prevent interactions overlay from comments wrapper
* Use policies when pushing updates in RTS
* ENV var to set if comments are enabled
* Fix: check if editor/viewer is initialised before waiting for init action
* Add tests for comments reducer
* Revert "ENV var to set if comments are enabled"
This reverts commit 988efeaa69d378d943a387e1e73510334958adc5.
* Enable comments for users with appsmith email
* lint
* fix
* Try running a socket.io server inside backend
* Update comment reducer tests
* Init mentions within comments
* Fix comment thread updates with email rooms
* Minor fixes
* Refactors / review suggestions
* lint
* increase cache limit for builds
* Comment out tests for feature that's under development
* Add Dockerfile for RTS
* Fix policies missing for first comment in threads
* Use draftJS for comments input with mentions support
* fix fixtures
* Use thread's policies when querying for threads
* Update socket.io to v4
* Add support for richer body with mentions
* Update comment body type to RawDraftContentState
* fix stale method
* Fix mentions search
* Minor cleanups
* Comment context menu and thread UI updates
* revert: Scaffold app comments
* Yarn dependencies
* Delete comment using id api added
* Init app comments
* Add test for creating thread
* Api for delete comment with id
* Test comment creation response and policies
* Copy comment links
* Fix reset editor state
* Delete valid comment testcase added
* Delete comment TC : code refactor
* Don't allow creating comments with an empty body
* Pin comments WIP[]
* Ignore dependency-reduced-pom.xml files from VCS
* Cleanup of some dev-only files, for review
* Delete comment
* Update socket.io to v4 in RTS
* Pin and resolve comment thread object added in commentThread
* Pin and resolve comment thread object added in commentThread
* Update comment thread API
* Added creationTime and updationTime in comment thread response
* Added creationTime and updationTime in comment thread response
* Added human readable id to comment threads, fallback to username for null name in user document
* Refactor
* lint
* fix test, rm duplicate selector
* comment out saga used for dev
* CommentThread viewed status, username fallback for getName=null, username field added in pin & resolve status
* lint
* trigger tests
Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
Co-authored-by: Abhijeet <abhi.nagarnaik@gmail.com>
2021-04-29 10:33:51 +00:00
|
|
|
case "context-menu":
|
|
|
|
|
returnIcon = <ContextMenu />;
|
|
|
|
|
break;
|
|
|
|
|
|
2021-05-20 12:03:08 +00:00
|
|
|
case "read-pin":
|
|
|
|
|
returnIcon = <ReadPin />;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case "unread-pin":
|
|
|
|
|
returnIcon = <UnreadPin />;
|
Initialise comments (#3328)
* Initial scaffolding for comments CRUD APIs
* add actions
* add assets
* state management for existing comments and creating new
* add ui components
* add overlay comments wrapper to baseWidget
* add toggle comment mode button at editor header
* trigger tests
* Disallow commenting as someone else
* Add applicationId for comments
* lint
* Add overlay blacklist to prevent component interaction while adding comments
* Comment thread style updates
* Placeholder comment context menu
* Controlled comment thread visibility for making new comments visible by default
* Update comment type description
* Reset input on save
* Resolve comment thread button ui
* fix close on esc key, dont create new comment on outside click
* Submit on enter
* add emoji picker
* Attempt at adding a websocket server in Java
* CRUD APIs for comment threads
* Add API for getting all threads in application
* Move types to a separate file
* Initial commit for real time server (RTS)
* Add script to start RTS
* Fix position property
* Use create comment thread API
* Use add comment to thread API
* Add custom cursor
* Dispatch logout init on 401 errors
* Allow CORS for real time connection
* Add more logs to RTS
* Fix construction of MongoClient
* WIP: Real time comments
* Enable comments
* Minor updates
* Read backend API base URL from environment
* Escape to reset comments mode
* Set popover position as auto and boundary as scroll parent
* Disable warning
* Added permissions for comment threads
* Add resolved API for comment threads
* Migration to set commenting permission on existing apps
* Fix updates bringing the RTS down
* Show view latest button, scroll to bottom on creating a new comment
* Cleanup comment reducer
* Move to typescript for RTS
* Add missing server.ts and tsconfig files
* Resolve / unresolve comment
* Scaffold app comments
* Minor fixes: comment on top of all widgets, add toggle button at viewer header
* Reconnect socket on creating a new app, set connected status in store
* Retry socket connection flow
* Integration tests for comments with api mocks using msw
* Fix circular depependency
* rm file
* Minor cleanup and comments
* Minor refactors: move isScrolledToBottom to common hooks, decouple prevent interactions overlay from comments wrapper
* Use policies when pushing updates in RTS
* ENV var to set if comments are enabled
* Fix: check if editor/viewer is initialised before waiting for init action
* Add tests for comments reducer
* Revert "ENV var to set if comments are enabled"
This reverts commit 988efeaa69d378d943a387e1e73510334958adc5.
* Enable comments for users with appsmith email
* lint
* fix
* Try running a socket.io server inside backend
* Update comment reducer tests
* Init mentions within comments
* Fix comment thread updates with email rooms
* Minor fixes
* Refactors / review suggestions
* lint
* increase cache limit for builds
* Comment out tests for feature that's under development
* Add Dockerfile for RTS
* Fix policies missing for first comment in threads
* Use draftJS for comments input with mentions support
* fix fixtures
* Use thread's policies when querying for threads
* Update socket.io to v4
* Add support for richer body with mentions
* Update comment body type to RawDraftContentState
* fix stale method
* Fix mentions search
* Minor cleanups
* Comment context menu and thread UI updates
* revert: Scaffold app comments
* Yarn dependencies
* Delete comment using id api added
* Init app comments
* Add test for creating thread
* Api for delete comment with id
* Test comment creation response and policies
* Copy comment links
* Fix reset editor state
* Delete valid comment testcase added
* Delete comment TC : code refactor
* Don't allow creating comments with an empty body
* Pin comments WIP[]
* Ignore dependency-reduced-pom.xml files from VCS
* Cleanup of some dev-only files, for review
* Delete comment
* Update socket.io to v4 in RTS
* Pin and resolve comment thread object added in commentThread
* Pin and resolve comment thread object added in commentThread
* Update comment thread API
* Added creationTime and updationTime in comment thread response
* Added creationTime and updationTime in comment thread response
* Added human readable id to comment threads, fallback to username for null name in user document
* Refactor
* lint
* fix test, rm duplicate selector
* comment out saga used for dev
* CommentThread viewed status, username fallback for getName=null, username field added in pin & resolve status
* lint
* trigger tests
Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
Co-authored-by: Abhijeet <abhi.nagarnaik@gmail.com>
2021-04-29 10:33:51 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case "link-2":
|
|
|
|
|
returnIcon = <Link2 />;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case "trash":
|
|
|
|
|
returnIcon = <Trash />;
|
|
|
|
|
break;
|
|
|
|
|
|
2021-05-20 12:03:08 +00:00
|
|
|
case "comment-context-menu":
|
|
|
|
|
returnIcon = <CommentContextMenu />;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case "down-arrow-2":
|
|
|
|
|
returnIcon = <DownArrow2 />;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case "filter":
|
|
|
|
|
returnIcon = <Filter />;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case "chat":
|
|
|
|
|
returnIcon = <Chat />;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case "pin-3":
|
|
|
|
|
returnIcon = <Pin3 />;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case "unpin":
|
|
|
|
|
returnIcon = <Unpin />;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case "reaction":
|
|
|
|
|
returnIcon = <Reaction />;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case "reaction-2":
|
|
|
|
|
returnIcon = <Reaction2 />;
|
|
|
|
|
break;
|
|
|
|
|
|
2021-06-03 06:18:08 +00:00
|
|
|
case "upload":
|
|
|
|
|
returnIcon = <Upload />;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case "download":
|
|
|
|
|
returnIcon = <Download />;
|
|
|
|
|
break;
|
|
|
|
|
|
2020-10-14 10:35:19 +00:00
|
|
|
default:
|
|
|
|
|
returnIcon = null;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return returnIcon && !props.isLoading ? (
|
|
|
|
|
<IconWrapper
|
|
|
|
|
className={Classes.ICON}
|
|
|
|
|
data-cy={props.cypressSelector}
|
|
|
|
|
ref={ref}
|
|
|
|
|
{...props}
|
|
|
|
|
onClick={props.onClick || noop}
|
|
|
|
|
>
|
|
|
|
|
{returnIcon}
|
|
|
|
|
</IconWrapper>
|
|
|
|
|
) : props.isLoading ? (
|
|
|
|
|
<Spinner size={props.size} />
|
|
|
|
|
) : null;
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
Icon.displayName = "Icon";
|
2020-08-26 07:18:04 +00:00
|
|
|
|
|
|
|
|
export default Icon;
|