Files
Przemyslaw Kukulski 58a9449209 feat: create a user template and list it in "Your templates" (#6421)
* feat(jobs): Opt-in lock so a job type can refuse a cancel after its commit

* feat(create-user-template): Create a user template and list it in "Your templates"

* fix(create-user-template): Address review feedback

- Only the owner can open a user template; the slug endpoint returns 404
  otherwise and includes `type`.
- List templates through `/api/templates/?view=flat` instead of `/own/`.
- Rename the job's copy to `template_workspace`, renumber the migration to
  0132 after develop's core migrations, guard it like 0128, and move
  revision fields and metadata to the update PR.
- Clear references outside the selection instead of failing the import,
  lock the owner row against a concurrent delete, and keep leftovers
  tracked until they're deleted.
- Load workspace permissions only for the wizard, handle instances without
  categories, restore a running job before a failed one, and open the
  default template again in the template modal.
- Reuse existing export, cancel and serializer code, keep one icon list,
  remove overlapping tests, and give template fixtures a unique slug.
2026-10-22 12:05:04 +02:00

116 lines
2.8 KiB
JavaScript

// The icons an author can pick for a user template. The backend only checks that
// an icon is an iconoir class, so this is the one list of them.
export const TEMPLATE_ICONS = [
'iconoir-add-user',
'iconoir-agile',
'iconoir-airplane',
'iconoir-airplane-rotation',
'iconoir-album-open',
'iconoir-antenna-signal',
'iconoir-app-window',
'iconoir-apple',
'iconoir-balcony',
'iconoir-bank',
'iconoir-barcode',
'iconoir-bathroom',
'iconoir-book',
'iconoir-book-stack',
'iconoir-bookmark-empty',
'iconoir-box-iso',
'iconoir-calendar',
'iconoir-car',
'iconoir-cart',
'iconoir-cart-alt',
'iconoir-chat-bubble-question',
'iconoir-chat-lines',
'iconoir-check',
'iconoir-check-circle',
'iconoir-city',
'iconoir-clipboard-check',
'iconoir-clutery',
'iconoir-code',
'iconoir-coffee-cup',
'iconoir-coin',
'iconoir-coins',
'iconoir-community',
'iconoir-computer',
'iconoir-cpu',
'iconoir-dashboard',
'iconoir-data-transfer-check',
'iconoir-delivery-truck',
'iconoir-dollar',
'iconoir-double-check',
'iconoir-ecology-book',
'iconoir-edit-pencil',
'iconoir-git-compare',
'iconoir-globe',
'iconoir-graduation-cap',
'iconoir-group',
'iconoir-health-shield',
'iconoir-heart',
'iconoir-home-hospital',
'iconoir-home-user',
'iconoir-hospital',
'iconoir-house-rooms',
'iconoir-industry',
'iconoir-input-field',
'iconoir-large-suitcase',
'iconoir-learning',
'iconoir-light-bulb-on',
'iconoir-link',
'iconoir-list-select',
'iconoir-lock',
'iconoir-locked-book',
'iconoir-mail-out',
'iconoir-math-book',
'iconoir-media-image-list',
'iconoir-money-square',
'iconoir-neighbourhood',
'iconoir-network',
'iconoir-numbered-list-left',
'iconoir-okrs',
'iconoir-open-book',
'iconoir-orthogonal-view',
'iconoir-paste-clipboard',
'iconoir-pc-check',
'iconoir-pen-tablet',
'iconoir-people-tag',
'iconoir-pharmacy-cross-circle',
'iconoir-phone-add',
'iconoir-phone-income',
'iconoir-pine-tree',
'iconoir-pizza-slice',
'iconoir-playlist-play',
'iconoir-potion',
'iconoir-profile-circle',
'iconoir-receive-dollars',
'iconoir-sea-and-sun',
'iconoir-search',
'iconoir-send-dollars',
'iconoir-shield-alert',
'iconoir-shield-eye',
'iconoir-shield-question',
'iconoir-shop-alt',
'iconoir-sigma-function',
'iconoir-sleeper-chair',
'iconoir-small-shop',
'iconoir-spock-hand-gesture',
'iconoir-stats-report',
'iconoir-strategy',
'iconoir-system-restart',
'iconoir-task-list',
'iconoir-test-tube',
'iconoir-timer',
'iconoir-timer-off',
'iconoir-tools',
'iconoir-user-scan',
'iconoir-user-square',
'iconoir-verified-user',
'iconoir-view-grid',
'iconoir-walking',
'iconoir-weight-alt',
'iconoir-wrench',
]
export const DEFAULT_TEMPLATE_ICON = 'iconoir-view-grid'