feat: duplicate cron job with form pre-fill#1225
feat: duplicate cron job with form pre-fill#1225bergeouss wants to merge 2 commits intonesquena:masterfrom
Conversation
- Add duplicate button in cron detail header - Pre-fills create form with original job settings - New job created as paused copy with '(copy)' suffix - i18n keys in all 7 locales
|
Thanks for the PR, @bergeouss! Duplicate cron job with form pre-fill is a quality-of-life feature that makes it much faster to set up similar recurring jobs. Pre-filling the create form and defaulting the clone to paused is the right UX — the user reviews and enables deliberately rather than accidentally running a duplicate. A few things to confirm before merge:
The change is lean (3 files, 41 additions). Once the above are confirmed this looks solid! |
- Name dedup: 'Job (copy)', 'Job (copy 2)', 'Job (copy 3)' etc. - Duplicates explicitly pass enabled:false to backend - Normal cron create is unaffected (no enabled field sent) Addresses reviewer feedback on nesquena#1225 (points 1 + 4).
|
Thanks for the thorough review! Updated the PR to address points 1 and 4: 1. Name collision → Fixed. The duplicate now checks 2. Schedule field → The schedule is actually pre-filled (not cleared). It uses 3. Data source → Extracted from 4. enabled: false → Fixed. Added |
|
Thanks for following up, @bergeouss! All four points are addressed:
All four points are solid. This looks ready for maintainer merge review. |
|
Merged in v0.50.237 via #1243. Thank you @bergeouss! 🎉 |
- Name dedup: 'Job (copy)', 'Job (copy 2)', 'Job (copy 3)' etc. - Duplicates explicitly pass enabled:false to backend - Normal cron create is unaffected (no enabled field sent) Addresses reviewer feedback on nesquena#1225 (points 1 + 4).
- Name dedup: 'Job (copy)', 'Job (copy 2)', 'Job (copy 3)' etc. - Duplicates explicitly pass enabled:false to backend - Normal cron create is unaffected (no enabled field sent) Addresses reviewer feedback on nesquena#1225 (points 1 + 4).
Fixes #528
What
Add a Duplicate button in the cron detail header that clones the current job.
How
btnDuplicateTaskDetailbutton (copy icon) shown alongside Edit/DeleteduplicateCurrentCron()extracts job settings, clears ID/schedule/enabled, appends'(copy)'to name, pre-fills the create form_setCronHeaderButtons()Changes
static/index.html: duplicate button SVG in cron headerstatic/panels.js:duplicateCurrentCron(), button visibility in_setCronHeaderButtons()static/i18n.js:cron_duplicate,cron_duplicatedkeys in all 7 localesTesting
2828 passed, 0 failed (full suite).