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

feat: create reusable plugin #3706

Merged
merged 6 commits into from
Jul 13, 2023

Conversation

sashuk
Copy link
Contributor

@sashuk sashuk commented Jul 6, 2023

FX-4109

⚠️ Pull requests were split

Please note that this pull request covers only component API-part of uploading implementation and implements full cycle of image uploading and insertion in Rich Text Editor. Tests (successful and failed uploading, validations) are added in #3717.

Description

This pull request covers component API-part of uploading implementation and implements full cycle of image uploading and insertion in Rich Text Editor.

Design was confirmed in https://toptal-core.slack.com/archives/C04H62YP84F/p1688734127377339.

How to test

Screenshots

Kapture.2023-07-11.at.12.58.33.mp4

Development checks

  • [N/A] Add changeset according to guidelines (if needed)
  • Read CONTRIBUTING.md and Component API principles
  • Make sure that additions and changes on design follow Toptal's BASE design, and it's been already discussed with designers at #-base-core
  • Annotate all props in component with documentation
  • Create examples for component
  • Ensure that deployed demo has expected results and good examples
  • Ensure the changed/created components have not caused accessibility issues. How to use accessibility plugin in storybook.
  • Self reviewed
  • [N/A] Covered with tests (⚠️ will be done in a separate pull request)

All development checks should be done and set checked to pass the
GitHub Bot: TODOLess action

PR commands

List of available commands:

  • @toptal-bot run package:alpha-release - Release alpha version
  • @toptal-anvil ping reviewers - Ping FX team for review
PR Review Guidelines

When to approve? ✅

You are OK with merging this PR and

  1. You have no extra requests.
  2. You have optional requests.
    1. Add nit: to your comment. (ex. nit: I'd rename this variable from makeCircle to getCircle)

When to request changes? ❌

You are not OK with merging this PR because

  1. Something is broken after the changes.
  2. Acceptance criteria is not reached.
  3. Code is dirty.

When to comment (neither ✅ nor ❌)

You want your comments to be addressed before merging this PR in cases like:

  1. There are leftovers like unnecessary logs, comments, etc.
  2. You have an opinionated comment regarding the code that requires a discussion.
  3. You have questions.

How to handle the comments?

  1. An owner of a comment is the only one who can resolve it.
  2. An owner of a comment must resolve it when it's addressed.
  3. A PR owner must reply with ✅ when a comment is addressed.

@sashuk sashuk self-assigned this Jul 6, 2023
@toptal-devbot toptal-devbot temporarily deployed to temploy July 6, 2023 18:34 Inactive
@toptal-devbot toptal-devbot temporarily deployed to temploy July 6, 2023 19:13 Inactive
@toptal-devbot toptal-devbot temporarily deployed to temploy July 6, 2023 19:29 Inactive
@toptal-devbot toptal-devbot temporarily deployed to temploy July 7, 2023 12:03 Inactive
@toptal-devbot toptal-devbot temporarily deployed to temploy July 7, 2023 15:58 Inactive
@toptal-devbot toptal-devbot temporarily deployed to temploy July 7, 2023 17:04 Inactive
@sashuk sashuk force-pushed the fx-4109-image-create-reusable-plugin branch from d390aff to 968e739 Compare July 10, 2023 16:23
@toptal-devbot toptal-devbot temporarily deployed to temploy July 10, 2023 16:35 Inactive
@sashuk sashuk force-pushed the fx-4109-image-create-reusable-plugin branch from 968e739 to 9b0301b Compare July 10, 2023 17:01
@toptal-devbot toptal-devbot temporarily deployed to temploy July 10, 2023 17:13 Inactive
@sashuk sashuk changed the base branch from feature/image-upload to fx-4108-image-create-custom-imagenode July 10, 2023 18:00
@sashuk sashuk force-pushed the fx-4109-image-create-reusable-plugin branch 3 times, most recently from dc5dd2c to db8f33c Compare July 11, 2023 10:50
@toptal toptal deleted a comment from toptal-devbot Jul 11, 2023
@toptal toptal deleted a comment from changeset-bot bot Jul 11, 2023
@sashuk sashuk marked this pull request as ready for review July 11, 2023 11:06
@sashuk sashuk requested a review from a team as a code owner July 11, 2023 11:06
@sashuk sashuk mentioned this pull request Jul 11, 2023
3 tasks
Base automatically changed from fx-4108-image-create-custom-imagenode to feature/image-upload July 12, 2023 13:30
@sashuk sashuk requested a review from a team July 12, 2023 14:17
@sashuk sashuk force-pushed the fx-4109-image-create-reusable-plugin branch from a7cf83e to fea7b0f Compare July 12, 2023 14:58
@toptal toptal deleted a comment from toptal-devbot Jul 12, 2023
@toptal toptal deleted a comment from changeset-bot bot Jul 12, 2023
@toptal-devbot toptal-devbot temporarily deployed to temploy July 12, 2023 15:13 Inactive
@sashuk
Copy link
Contributor Author

sashuk commented Jul 13, 2023

@toptal-anvil ping reviewers

@sashuk sashuk requested review from mkrl and dmaklygin July 13, 2023 14:20
@sashuk
Copy link
Contributor Author

sashuk commented Jul 13, 2023

@toptal-anvil ping reviewers

@toptal toptal deleted a comment from toptal-devbot Jul 13, 2023
@toptal toptal deleted a comment from changeset-bot bot Jul 13, 2023
@toptal-devbot toptal-devbot temporarily deployed to temploy July 13, 2023 14:32 Inactive
Copy link
Member

@mkrl mkrl left a comment

Choose a reason for hiding this comment

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

Awesome job! There's one more thing that I think is good to change.
We provide two ways of enabling plugins:

  1. By passing a React Element with the plugin and all the props
  2. By referencing a text name of the plugin that is baked into the list of "default" plugins

Currently, ImagePlugin can be imported in both ways, but I think the second option should not be available anymore because it is not possible to pass props (in particular, onUpload).

It can be found here


(and also a story for RichText => HTML has to be adjusted to have image plugin with React element)

@sashuk
Copy link
Contributor Author

sashuk commented Jul 13, 2023

@mkrl Thank you for noticing, added!

@toptal-devbot toptal-devbot temporarily deployed to temploy July 13, 2023 15:05 Inactive
@toptal toptal deleted a comment from toptal-devbot Jul 13, 2023
@toptal toptal deleted a comment from changeset-bot bot Jul 13, 2023
@toptal toptal deleted a comment from changeset-bot bot Jul 13, 2023
@toptal toptal deleted a comment from changeset-bot bot Jul 13, 2023
@toptal toptal deleted a comment from toptal-devbot Jul 13, 2023
@toptal-devbot toptal-devbot temporarily deployed to temploy July 13, 2023 19:13 Inactive
@sashuk sashuk merged commit 4fe301a into feature/image-upload Jul 13, 2023
12 of 14 checks passed
@sashuk sashuk deleted the fx-4109-image-create-reusable-plugin branch July 13, 2023 19:19
TomasSlama pushed a commit that referenced this pull request Jul 14, 2023
TomasSlama pushed a commit that referenced this pull request Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants