Add copy button for TD affordances (actions, properties, events)#181
Add copy button for TD affordances (actions, properties, events)#181AyushPrakash414 wants to merge 5 commits intoeclipse-editdor:masterfrom
Conversation
✅ Deploy Preview for editdor ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
egekorkan
left a comment
There was a problem hiding this comment.
- handleCopyXXX functions can be refactored to not copy paste the same thing
- You need to sign your commits and link your Eclipse account. Make sure to read https://github.com/eclipse/editdor/blob/master/CONTRIBUTING.md
- It would be muuuch better if the new affordance is just under the copied affordance. With longer TDs, it is very difficult to find it. Also, there is no visual confirmation that a new affordance is added.
Signed-off-by: Ayush <prakashayush414@gmail.com>
c92bfab to
d2879cf
Compare
Changes include:
All commits are signed and Eclipse Contributor Agreement requirements are fulfilled. |
|
Hi @egekorkan |
|
@AyushPrakash414 much better, thank you! I think the visual confirmation should be a bit more pronounced. Even with the expectation how this should work, I had to double check (<1s for me). Maybe highlighting the new affordance would be nice, like an animation. Also, code formatting check is failing :) |
|
Hello @AyushPrakash414 thanks for your contribution. The initial feedback is:
A review will follow. Thanks! |
Signed-off-by: Ayush <prakashayush414@gmail.com>
6156d33 to
49204b6
Compare
✅ Deploy Preview for editdor ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Hi @TejInaco and @egekorkan, Thank you for the feedback. ✅ Signed all commits using GPG (-S) Please let me know if any further improvements are needed. |
There was a problem hiding this comment.
Theres is some pending comments. Just small details. Good work @AyushPrakash414 . After the fix for those small details it is ready to be merged
src/utils/copyAffordance.ts
Outdated
| * SPDX-License-Identifier: EPL-2.0 OR W3C-20150513 | ||
| ********************************************************************************/ | ||
|
|
||
| type Section = "actions" | "properties" | "events"; |
There was a problem hiding this comment.
This type is defined in the IntersectionSection.tsx. You can move it to global.d.ts file now that is used in more files. And use the type InteractionKey in this file.
| </button> | ||
|
|
||
| <button | ||
| className="flex h-10 w-10 items-center justify-center self-stretch rounded-bl-md rounded-tr-md bg-gray-400 text-base" |
There was a problem hiding this comment.
Change to rounded-tr-lg instead of md. The rounded-bl-md should be in copy button, change it to -lg as well. The event.tsx and property.tsx files need the same updates
| <Copy size={16} color="white" /> | ||
| </button> | ||
|
|
||
| {/* DELETE BUTTON */} |
There was a problem hiding this comment.
Delete these comment. it is unnecessary. Please update the other files as well
| <Trash2 size={16} color="white" /> | ||
| </button> | ||
| <> | ||
| {/* COPY BUTTON */} |
There was a problem hiding this comment.
Delete these comment. it is unnecessary. Please update the other files as well
|
Hi @TejInaco, Thanks for the review! Moved InteractionKey type to global definitions The PR is now ready for review. |
TejInaco
left a comment
There was a problem hiding this comment.
Good work @AyushPrakash414, almost there. See the pending comments and marked them when you commit your changes
| [key: string]: any; | ||
| }; | ||
| propName: string; | ||
| } |
There was a problem hiding this comment.
@AyushPrakash414 Can you explain why did you delete the IProperty?
| contentType: string; | ||
| actualIndex: number; | ||
| [key: string]: any; | ||
| }[] = separateForms(structuredClone(props.prop.forms)); |
There was a problem hiding this comment.
Revert this change. Sometimes enforce typescript types is necessary.
| > | ||
| <Trash2 size={16} color="white" /> | ||
| </button> | ||
| <> |
There was a problem hiding this comment.
Make a subcomponent with the buttons, to be able to reuse it in these 3 files. It will reduce the duplication of code
Fixes #57
This PR adds a copy button for Thing Description affordances (actions, properties, and events) in the visual editor.
Users can now duplicate similar affordances directly from the UI without switching to the JSON editor, improving usability and workflow efficiency.