mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-06 08:01:35 +00:00
use workspace_id of the script itself
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
export let starred: boolean
|
||||
|
||||
export let shareModal: ShareModal
|
||||
const { summary, path, extra_perms, canWrite } = flow
|
||||
const { summary, path, extra_perms, canWrite, workspace_id } = flow
|
||||
|
||||
async function archiveFlow(path: string): Promise<void> {
|
||||
try {
|
||||
@@ -58,7 +58,13 @@
|
||||
<div class="flex flex-row justify-between w-full grow gap-2 items-start">
|
||||
<div class="text-gray-700 text-xs flex flex-row flex-wrap gap-x-1 items-center"
|
||||
>{path}
|
||||
<Star kind="flow" {path} {starred} on:starred={() => dispatch('change')} />
|
||||
<Star
|
||||
workspace_id={workspace_id ?? $workspaceStore ?? ''}
|
||||
kind="flow"
|
||||
{path}
|
||||
{starred}
|
||||
on:starred={() => dispatch('change')}
|
||||
/>
|
||||
<SharedBadge {canWrite} extraPerms={extra_perms} />
|
||||
</div>
|
||||
<div class="flex flex-row-reverse place gap-x-2 pt-4">
|
||||
|
||||
@@ -26,7 +26,17 @@
|
||||
export let marked: string | undefined
|
||||
export let starred: boolean
|
||||
export let shareModal: ShareModal
|
||||
let { summary, path, hash, language, extra_perms, canWrite, lock_error_logs, kind } = script
|
||||
let {
|
||||
summary,
|
||||
path,
|
||||
hash,
|
||||
language,
|
||||
extra_perms,
|
||||
canWrite,
|
||||
lock_error_logs,
|
||||
kind,
|
||||
workspace_id
|
||||
} = script
|
||||
|
||||
const dispatch = createEventDispatcher()
|
||||
async function archiveScript(path: string): Promise<void> {
|
||||
@@ -53,7 +63,13 @@
|
||||
<div class="flex flex-row justify-between w-full grow gap-2 items-start">
|
||||
<div class="text-gray-700 text-xs flex flex-row flex-wrap gap-x-1 items-center">
|
||||
{path}
|
||||
<Star kind="script" {path} {starred} on:starred={() => dispatch('change')} />
|
||||
<Star
|
||||
kind="script"
|
||||
{path}
|
||||
{starred}
|
||||
workspace_id={workspace_id ?? $workspaceStore ?? ''}
|
||||
on:starred={() => dispatch('change')}
|
||||
/>
|
||||
<SharedBadge {canWrite} extraPerms={extra_perms} />
|
||||
<div><LanguageIcon height={16} lang={language} /></div>
|
||||
{#if kind != 'script'}
|
||||
|
||||
@@ -10,18 +10,19 @@
|
||||
export let path: string
|
||||
export let kind: 'flow' | 'app' | 'script'
|
||||
export let starred = false
|
||||
export let workspace_id: string
|
||||
|
||||
async function onClick() {
|
||||
if (starred) {
|
||||
await FavoriteService.unstar({
|
||||
workspace: $workspaceStore!,
|
||||
workspace: workspace_id,
|
||||
requestBody: { path, favorite_kind: kind }
|
||||
})
|
||||
sendUserToast('Unstarred')
|
||||
$starStore = $starStore + 1
|
||||
} else {
|
||||
await FavoriteService.star({
|
||||
workspace: $workspaceStore!,
|
||||
workspace: workspace_id,
|
||||
requestBody: { path, favorite_kind: kind }
|
||||
})
|
||||
sendUserToast('Marked as favorite, it will appear first')
|
||||
|
||||
Reference in New Issue
Block a user