mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-19 00:03:19 +00:00
* Add button to edit in workspace fork * Remove old fork from script row * Remove fork button from approw * fix frontend check
23 lines
622 B
TypeScript
23 lines
622 B
TypeScript
import { base } from '$lib/base'
|
|
|
|
type ItemType = 'script' | 'flow' | 'app' | 'raw_app'
|
|
|
|
export function buildForkEditUrl(itemType: ItemType, itemPath: string): string {
|
|
let editPath: string
|
|
switch (itemType) {
|
|
case 'script':
|
|
editPath = `${base}/scripts/edit/${itemPath}`
|
|
break
|
|
case 'flow':
|
|
editPath = `${base}/flows/edit/${itemPath}?nodraft=true`
|
|
break
|
|
case 'app':
|
|
editPath = `${base}/apps/edit/${itemPath}?nodraft=true`
|
|
break
|
|
case 'raw_app':
|
|
editPath = `${base}/apps_raw/edit/${itemPath}?nodraft=true`
|
|
break
|
|
}
|
|
return `${base}/user/fork_workspace?rd=${encodeURIComponent(editPath)}`
|
|
}
|