-
Notifications
You must be signed in to change notification settings - Fork 116
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
Add 'Duplicate' action to elements. #770
Conversation
78f33fe
to
de7d25f
Compare
Nice! Awesome to see some more contributions to this React stuff. Hopefully you found it actually kind of fun and easy? This will need to be based on the
Assuming that you're checked out on the PR branch and "origin" in this case is a remote with an up to date copy of `4 (preferably origin is just this repo). You might have to solve conflicts with the rebase. Additionally, the tests are failing as you need to ensure you commit the dist files for the JavaScript. Just a I don't have time to check this out and play around sorry, I'll leave that to one of the SSLtd team. |
de7d25f
to
d4bc04c
Compare
Awesome! There's actually an open issue for this requirement that includes some light requirements from the Silverstripe UX team (I've just asked them to make the design link public). |
d4bc04c
to
fb0689d
Compare
Hey @ScopeyNZ and @brynwhyman, a few points/questions:
Cheers. |
Not unless it's a bugfix
Unfortunately, we can't put features like this in bugfix releases ( I hope that doesn't discourage contributing back though, because once it's merged then we have to maintain it for you 😅 |
@ScopeyNZ Thanks for the info. We'll stick to a fork for now and aim to re-target this to Cheers. |
fb0689d
to
69c176c
Compare
6bcb96f
to
69c176c
Compare
@ScopeyNZ Have re-targeted this PR to |
As long as you switch the base branch first, it should run the suite when you force-push. |
@ScopeyNZ You can see in the timeline that I switched branches and did a force push but that didn't seem to trigger the tests. |
Although it looks like the commit reference is different 🤔 . The branch and time match up though. |
- Duplicates element. - Adds ' copy' or ' copy {num}' to the Title. - Reorder duplicate to position after the cloned element.
69c176c
to
8617d61
Compare
@ScopeyNZ force pushed the top commit (no changes) to trigger. Displayed properly for me this time, so good to go afaik! |
Sure. I don't have a capability/bandwidth to give this a final once-over right now - so I'll see if I can call some favours with the SSLtd. team this week. |
Many thanks! |
Hey @ScopeyNZ Just checking for movement here. Cheers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @JoshuaCarter, thanks for taking the time to make a contribution back to the module. I've just had a look at what you've built compared with our initial designs and from a UX perspective I'm happy to approve this PR.
Depending on if this PR gets a review and test from a technical perspective and is merged, I'll create some issues and update our designs based off our initial thoughts now that we can see it work in practice.
Notes for @silverstripeux team for after this is merged:
Provide some direction/designs for the following scenarios:
- "Unsaved changes - Opened blocks will be saved before duplicate modal is copied".
- If you copy 'Content block copy 2' it becomes 'Content block copy 3', if you duplicate 'Content block copy 2' again it creates another 'Content block copy 3'. We'll look into some other options around naming conventions and what makes the most sense in this scenario.
Other:
- Toast confirm message missing from the top right
- Core Elemental (Impact High, UX issue) — "Copies will be set in a Draft state". After a block has been duplicated it's state indicator is 'Modified' rather than 'Draft'. I can see the colours on the class are the wrong way around. I'll look into creating a PR for this next week.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy from a technical perspective. Note that you don't need to bundle translations yourself, as these should be overwritten on release with values from Transifex. If you've done any manual translation, you'll need to update Transifex instead.
Thanks @JoshuaCarter
Oh, I've lost my merge ability. Lol. |
I've just chatted with the team at Silverstripe Ltd and it looks like they'll prioritise this issue in the next month or so unless a core contributor or an owner of this module gets to it first 🙂 Note for the team: It would be great if someone could test how this works with versioned-snapshots and check to see when duplicating a block if it adds a new block in History. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Duplicate operation does not trigger a snapshot in versioned-snapshots. When a block is next created, the duplicated block(s) will be included in the snapshot triggered by that operation. versioned-snapshots
is handling the Elemental integration itself, so we can raise a separate issue there to get this working correctly once it's merged.
There are also some UX improvements to tackle, but they're minor and we'll split those out into separate issues to tackle at a later date.
Overall, I'm happy to merge this! Thanks so much for your contribution @JoshuaCarter, and if you have any feedback about the development tooling involved in this change we'd love to hear it.
I just noticed that blocks with |
We are having similar issues. Has anyone been able to look into this? |
We're currently on 4.0.5 so I've PR'd this to the 4.0 branch. I tried a quick cherry-pick onto the 4 branch but it didn't work right off the bat and I'm lazy 😪
Direction/feedback welcome.