goto('/schedules')} bind:this={scheduleEditor} /> {#if lock_error_logs} Deployment failed {/if} {#if archived} archived {/if}
{ let owner = isOwner(path, $userStore, $workspaceStore) if (draft_only) { return [ { displayName: 'View code', icon: faCode, action: () => { showCode(script.path, script.summary) } }, { displayName: 'Delete', icon: faTrashAlt, action: (event) => { if (event?.shiftKey) { deleteScript(path) } else { deleteConfirmedCallback = () => { deleteScript(path) } } }, type: dlt, disabled: !canWrite } ] } return [ { displayName: 'View code', icon: faCode, action: () => { showCode(script.path, script.summary) } }, { displayName: 'Duplicate/Fork', icon: faCodeFork, href: `/scripts/add?template=${path}` }, { displayName: 'Move/Rename', icon: faFileExport, action: () => { moveDrawer.openDrawer(path, summary, 'script') }, disabled: !owner || archived }, { displayName: 'Deploy to staging/prod', icon: faFileExport, action: () => { deploymentDrawer.openDrawer(path, 'script') }, disabled: archived }, { displayName: 'View runs', icon: faList, href: `/runs/${path}` }, { displayName: 'Schedule', icon: faCalendarAlt, action: () => { scheduleEditor.openNew(false, path) }, disabled: archived }, { displayName: owner ? 'Share' : 'See Permissions', icon: faShare, action: () => { shareModal.openDrawer && shareModal.openDrawer(path, 'script') }, disabled: archived }, { displayName: 'Copy path', icon: faCopy, action: () => { copyToClipboard(path) } }, { displayName: archived ? 'Unarchive' : 'Archive', icon: faArchive, action: () => { archived ? path && unarchiveScript(path) : path && archiveScript(path) }, type: 'delete', disabled: !owner }, ...(has_draft ? [ { displayName: 'Delete Draft', icon: faTrashAlt, action: async () => { await DraftService.deleteDraft({ workspace: $workspaceStore ?? '', path, kind: 'script' }) dispatch('change') }, type: DELETE, disabled: !owner } ] : []), ...($userStore?.is_admin || $userStore?.is_super_admin ? [ { displayName: 'Delete', icon: faTrashAlt, action: (event) => { if (event?.shiftKey) { deleteScript(path) } else { deleteConfirmedCallback = () => { deleteScript(path) } } }, type: dlt, disabled: !canWrite } ] : []) ] }} />