Skip to content

feat(reply): Integrate collaborators endpoint#484

Merged
mergify[bot] merged 1 commit intobox:masterfrom
mingzexiao6:collab-mentions-2
May 15, 2020
Merged

feat(reply): Integrate collaborators endpoint#484
mergify[bot] merged 1 commit intobox:masterfrom
mingzexiao6:collab-mentions-2

Conversation

@mingzexiao6
Copy link
Contributor

@mingzexiao6 mingzexiao6 commented May 11, 2020

  • Fix tests
  • More tests

@mingzexiao6 mingzexiao6 requested a review from a team as a code owner May 11, 2020 17:43
@mingzexiao6 mingzexiao6 marked this pull request as draft May 11, 2020 18:05
Copy link
Collaborator

@jstoffan jstoffan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strongly suggest breaking things up with less tight coupling between components.

@mingzexiao6 mingzexiao6 force-pushed the collab-mentions-2 branch 2 times, most recently from adce7c8 to 228ae85 Compare May 13, 2020 06:38
@mingzexiao6 mingzexiao6 marked this pull request as ready for review May 13, 2020 17:33
);
const PopupList = ({ items, reference, options, ...rest }: Props): JSX.Element => {
return (
<PopupBase className="ba-PopupList" options={{ ...defaultOptions, ...options }} reference={reference}>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will probably cause the popper to be re-rendered constantly due to the object reference changing per-render.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the finding here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the finding here?

I feel I eventually need to pass in options in the future. But since it's not used in this pr, I will remove it.

activeItemIndex?: number;
itemRowAs?: JSX.Element;
items: Record<string, unknown>[];
onSelect: (index: number, event: React.SyntheticEvent) => void;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the event used anywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the event used anywhere?

not now, but I think we should provide this info to the parent and parent can choose to use it or not.

componentDidMount(): void {
this.focusEditor();
// restore PopupList if it was active
this.updatePopupReference();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When would this occur?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When would this occur?

zoom in/out

Copy link
Contributor Author

@mingzexiao6 mingzexiao6 May 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it also has popper position problem when you zoom in/out. I'll remove this line in this pr and address popper issue in an another pr.

);
const PopupList = ({ items, reference, options, ...rest }: Props): JSX.Element => {
return (
<PopupBase className="ba-PopupList" options={{ ...defaultOptions, ...options }} reference={reference}>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the finding here?

@@ -0,0 +1,24 @@
import { CompositeDecorator, ContentBlock, ContentState, EditorState } from 'draft-js';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file probably move to a more common location, like src/components.

Copy link
Contributor Author

@mingzexiao6 mingzexiao6 May 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file probably move to a more common location, like src/components.

But it's only used in the ReplyField. Also MentionItem has to move to src/components with it, which may be confusing to people. It makes more sense to me to put it under its only consumer folder.

@jstoffan jstoffan self-requested a review May 14, 2020 22:33
<PopupBase className="ba-PopupList" options={{ ...defaultOptions, ...options }} reference={reference}>
{isEmpty(items) ? (
<div className="ba-PopupList-prompt">
<FormattedMessage {...messages.popupListPrompt} />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be a separate message for when a user has typed in a filter query but there are no results?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be a separate message for when a user has typed in a filter query but there are no results?

Waiting for designer's response.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rohit said that is ok

@mingzexiao6 mingzexiao6 requested a review from jstoffan May 15, 2020 20:59
@@ -1,12 +1,19 @@
import * as React from 'react';
import React from 'react';
import isEmpty from 'lodash/isEmpty';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this is a new import. Is it needed or can we do !items.length?

@mergify mergify bot merged commit 619e7be into box:master May 15, 2020
@mingzexiao6 mingzexiao6 deleted the collab-mentions-2 branch August 13, 2020 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants