mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-26 00:01:37 +00:00
UX nits
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
import { initFlow } from '$lib/components/flows/flowStore'
|
||||
import { FlowService, type Flow } from '$lib/gen'
|
||||
import { workspaceStore } from '$lib/stores'
|
||||
import { decodeState, emptySchema, sendUserToast } from '$lib/utils'
|
||||
import { decodeState, emptySchema } from '$lib/utils'
|
||||
|
||||
const initialState = $page.url.searchParams.get('state')
|
||||
const hubId = $page.url.searchParams.get('hub')
|
||||
@@ -44,13 +44,11 @@
|
||||
Object.assign(flow, template)
|
||||
flow = flow
|
||||
$page.url.searchParams.delete('template')
|
||||
sendUserToast('Code & arguments have been loaded from template.')
|
||||
} else if (hubId) {
|
||||
const hub = (await FlowService.getHubFlowById({ id: Number(hubId) })).flow
|
||||
Object.assign(flow, hub)
|
||||
flow = flow
|
||||
$page.url.searchParams.delete('hub')
|
||||
sendUserToast(`Flow has been loaded from hub flow id ${hubId}.`)
|
||||
}
|
||||
initFlow(flow)
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
import { workspaceStore } from '$lib/stores'
|
||||
import ScriptBuilder from '$lib/components/ScriptBuilder.svelte'
|
||||
import type { Schema } from '$lib/common'
|
||||
import { decodeState, emptySchema, getScriptByPath, sendUserToast } from '$lib/utils'
|
||||
import { decodeState, emptySchema } from '$lib/utils'
|
||||
import { dirtyStore } from '$lib/components/common/confirmationModal/dirtyStore'
|
||||
|
||||
// Default
|
||||
@@ -54,17 +54,15 @@
|
||||
script.content = template.content
|
||||
script.schema = template.schema
|
||||
script.language = template.language
|
||||
sendUserToast('Code & arguments have been loaded from template.')
|
||||
}
|
||||
}
|
||||
|
||||
async function loadHub(): Promise<void> {
|
||||
if (hubPath) {
|
||||
const template = await getScriptByPath(hubPath)
|
||||
const { content, language } = await ScriptService.getHubScriptByPath({ path: hubPath })
|
||||
script.description = `Fork of ${hubPath}`
|
||||
script.content = template.content
|
||||
script.language = template.language as Script.language
|
||||
sendUserToast(`Code has been loaded from hub script ${hubPath}.`)
|
||||
script.content = content
|
||||
script.language = language as Script.language
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
workspace_id
|
||||
}
|
||||
})
|
||||
sendUserToast(`Invitation to ${workspace_id} accepted as ${username}`)
|
||||
usersWorkspaceStore.set(await WorkspaceService.listUserWorkspaces())
|
||||
workspaceStore.set(workspace_id)
|
||||
goto($page.url.searchParams.get('rd') ?? '/scripts')
|
||||
|
||||
Reference in New Issue
Block a user