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(designer): Scope Copy + Paste #4668

Merged
merged 32 commits into from Apr 23, 2024
Merged

feat(designer): Scope Copy + Paste #4668

merged 32 commits into from Apr 23, 2024

Conversation

Eric-B-Wu
Copy link
Contributor

@Eric-B-Wu Eric-B-Wu commented Apr 22, 2024

  • Please check if the PR fulfills these requirements
  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes/features)
  • Docs have been added / updated (for bug fixes / features)
  1. Copy Paste now uses clipboard API instead of local storage. There are some pros and cons with this, the main pro is that because portal uses indexeddb to emulate local storage, this should work better. Another pro is that users can actually see what is copied + paste. Con is that we can not detect changes in the copied/ pasted value in realtime, as clipboard api will not let us detect change - therefore the paste option is always active, and if tried to paste with an invalid paste object, it will just show a popup that it's not invalid. Fixes: Copy/paste not working across workflows #4308
  2. Fixes error message when adding Microsoft Bookings trigger: The renderComponentIntoRoot component encountered an error while loading. #4630
  3. Some small custom code C# changes
  4. Adds a "no items" header for combobox when there are no items
  • What is the current behavior? (You can also link to an open issue here)
    Was a feature request

  • What is the new behavior (if this is a feature change)?
    Feature Now implemented

  • Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)

  • Please Include Screenshots or Videos of the intended change:
    Zip file cause too large, but this one shows the copy + paste experience
    scopesuccess.zip

This one shows the benefits of clipboard api
clipboardpaste

e2e/designer/copypastescope.spec.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@rllyy97 rllyy97 left a comment

Choose a reason for hiding this comment

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

Great job with this!

@rllyy97
Copy link
Contributor

rllyy97 commented Apr 22, 2024

Comment on your therefore the paste option is always active, can we check the clipboard object for a valid copy/paste item when opening the (+) button menu and show the paste option based on validity?
We might not need to like check the entire data structure if that takes too long for larger scope nodes, but as a start just saying like "is this a json object string" or anything

@Eric-B-Wu
Copy link
Contributor Author

Comment on your therefore the paste option is always active, can we check the clipboard object for a valid copy/paste item when opening the (+) button menu and show the paste option based on validity? We might not need to like check the entire data structure if that takes too long for larger scope nodes, but as a start just saying like "is this a json object string" or anything

yeah we probably can, was worried this may delay the popup to show up, but we have a very simple property of the parsed clipboard value, which we can probably get rather quickly

@Eric-B-Wu
Copy link
Contributor Author

also another con to the clipboard api, is the copied action/scope gets replaced easily. Everytime the user copies another item, it gets replaced.

@hartra344
Copy link
Contributor

also another con to the clipboard api, is the copied action/scope gets replaced easily. Everytime the user copies another item, it gets replaced.

I think this is fine/expected. It has pros and cons but generally windows users can use Clipboard History (Windows + V) to paste and most Mac Users use something like RayCast or Paste for clipboard history management. So in those cases, it won't overwrite the copied value but just push it down the stack.

@kisubedi
Copy link
Contributor

This is fantastic! Thank you Eric and team.

@Eric-B-Wu Eric-B-Wu merged commit 0429c55 into main Apr 23, 2024
10 checks passed
@Eric-B-Wu Eric-B-Wu deleted the eric/scopePaste branch April 23, 2024 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants