Remove edit in fork button for app.windmill.dev (#8213)
* Remove edit in fork button for app.windmill.dev * remove duplicate import
This commit is contained in:
@@ -98,6 +98,7 @@
|
||||
import FlowAssetsHandler, { initFlowGraphAssetsCtx } from './flows/FlowAssetsHandler.svelte'
|
||||
import { isRuleActive } from '$lib/workspaceProtectionRules.svelte'
|
||||
import { buildForkEditUrl } from '$lib/utils/editInFork'
|
||||
import { isCloudHosted } from '$lib/cloud'
|
||||
|
||||
let {
|
||||
initialPath = $bindable(''),
|
||||
@@ -818,7 +819,7 @@
|
||||
})
|
||||
}
|
||||
|
||||
if (!newFlow && !isRuleActive('DisableWorkspaceForking')) {
|
||||
if (!newFlow && !isCloudHosted() && !isRuleActive('DisableWorkspaceForking')) {
|
||||
dropdownItems.push({
|
||||
label: 'Edit in workspace fork',
|
||||
onClick: () => window.open(buildForkEditUrl('flow', initialPath))
|
||||
|
||||
@@ -771,7 +771,7 @@
|
||||
window.open(`/scripts/add?template=${initialPath}`)
|
||||
}
|
||||
},
|
||||
...(!isRuleActive('DisableWorkspaceForking')
|
||||
...(!isCloudHosted() && !isRuleActive('DisableWorkspaceForking')
|
||||
? [
|
||||
{
|
||||
label: 'Edit in workspace fork',
|
||||
|
||||
@@ -65,6 +65,7 @@
|
||||
import { updatePolicy } from './appPolicy'
|
||||
import { isRuleActive } from '$lib/workspaceProtectionRules.svelte'
|
||||
import { buildForkEditUrl } from '$lib/utils/editInFork'
|
||||
import { isCloudHosted } from '$lib/cloud'
|
||||
|
||||
interface Props {
|
||||
policy: Policy
|
||||
@@ -1121,7 +1122,7 @@
|
||||
window.open(`/apps/add?template=${appPath}`)
|
||||
}
|
||||
},
|
||||
...(!isRuleActive('DisableWorkspaceForking')
|
||||
...(!isCloudHosted() && !isRuleActive('DisableWorkspaceForking')
|
||||
? [
|
||||
{
|
||||
label: 'Edit in workspace fork',
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
import { getDeployUiSettings } from '$lib/components/home/deploy_ui'
|
||||
import { isRuleActive } from '$lib/workspaceProtectionRules.svelte'
|
||||
import { buildForkEditUrl } from '$lib/utils/editInFork'
|
||||
import { isCloudHosted } from '$lib/cloud'
|
||||
|
||||
interface Props {
|
||||
app: ListableApp & { has_draft?: boolean; draft_only?: boolean; canWrite: boolean }
|
||||
@@ -114,7 +115,7 @@
|
||||
</Button>
|
||||
</div>
|
||||
{/if}
|
||||
{#if !isRuleActive('DisableWorkspaceForking') && (!showEditButton || !app.canWrite)}
|
||||
{#if !isCloudHosted() && !isRuleActive('DisableWorkspaceForking') && (!showEditButton || !app.canWrite)}
|
||||
<div>
|
||||
<Button
|
||||
variant={!showEditButton ? 'default' : 'subtle'}
|
||||
@@ -179,7 +180,7 @@
|
||||
displayName: 'Edit in workspace fork',
|
||||
icon: GitFork,
|
||||
href: buildForkEditUrl(app.raw_app ? 'raw_app' : 'app', path),
|
||||
hide: $userStore?.operator || isRuleActive('DisableWorkspaceForking')
|
||||
hide: $userStore?.operator || isCloudHosted() || isRuleActive('DisableWorkspaceForking')
|
||||
},
|
||||
{
|
||||
displayName: 'Move/Rename',
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
import { getDeployUiSettings } from '$lib/components/home/deploy_ui'
|
||||
import { isRuleActive } from '$lib/workspaceProtectionRules.svelte'
|
||||
import { buildForkEditUrl } from '$lib/utils/editInFork'
|
||||
import { isCloudHosted } from '$lib/cloud'
|
||||
|
||||
interface Props {
|
||||
flow: Flow & { has_draft?: boolean; draft_only?: boolean; canWrite: boolean }
|
||||
@@ -138,7 +139,7 @@
|
||||
</Button>
|
||||
</div>
|
||||
{/if}
|
||||
{#if !isRuleActive('DisableWorkspaceForking') && (!showEditButton || !flow.canWrite)}
|
||||
{#if !isCloudHosted() && !isRuleActive('DisableWorkspaceForking') && (!showEditButton || !flow.canWrite)}
|
||||
<div>
|
||||
<Button
|
||||
variant={!showEditButton ? 'default' : 'subtle'}
|
||||
@@ -199,7 +200,7 @@
|
||||
displayName: 'Edit in workspace fork',
|
||||
icon: GitFork,
|
||||
href: buildForkEditUrl('flow', path),
|
||||
hide: $userStore?.operator || isRuleActive('DisableWorkspaceForking')
|
||||
hide: $userStore?.operator || isCloudHosted() || isRuleActive('DisableWorkspaceForking')
|
||||
},
|
||||
{
|
||||
displayName: 'Audit logs',
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
import { scriptToHubUrl } from '$lib/hub'
|
||||
import { isRuleActive } from '$lib/workspaceProtectionRules.svelte'
|
||||
import { buildForkEditUrl } from '$lib/utils/editInFork'
|
||||
import { isCloudHosted } from '$lib/cloud'
|
||||
|
||||
interface Props {
|
||||
script: Script & { canWrite: boolean; use_codebase: boolean }
|
||||
@@ -176,7 +177,7 @@
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
{#if !isRuleActive('DisableWorkspaceForking') && (!showEditButton || !script.canWrite)}
|
||||
{#if !isCloudHosted() && !isRuleActive('DisableWorkspaceForking') && (!showEditButton || !script.canWrite)}
|
||||
<div>
|
||||
<Button
|
||||
variant={!showEditButton ? 'default' : 'subtle'}
|
||||
@@ -244,7 +245,7 @@
|
||||
displayName: 'Edit in workspace fork',
|
||||
icon: GitFork,
|
||||
href: buildForkEditUrl('script', script.path),
|
||||
hide: $userStore?.operator || isRuleActive('DisableWorkspaceForking')
|
||||
hide: $userStore?.operator || isCloudHosted() || isRuleActive('DisableWorkspaceForking')
|
||||
},
|
||||
{
|
||||
displayName: 'Move/Rename',
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
import type { RawAppData } from './dataTableRefUtils'
|
||||
import { isRuleActive } from '$lib/workspaceProtectionRules.svelte'
|
||||
import { buildForkEditUrl } from '$lib/utils/editInFork'
|
||||
import { isCloudHosted } from '$lib/cloud'
|
||||
|
||||
// async function hash(message) {
|
||||
// try {
|
||||
@@ -934,7 +935,7 @@
|
||||
window.open(`/apps/add?template=${appPath}`)
|
||||
}
|
||||
},
|
||||
...(!isRuleActive('DisableWorkspaceForking')
|
||||
...(!isCloudHosted() && !isRuleActive('DisableWorkspaceForking')
|
||||
? [
|
||||
{
|
||||
label: 'Edit in workspace fork',
|
||||
|
||||
@@ -69,6 +69,7 @@
|
||||
import NoDirectDeployAlert from '$lib/components/NoDirectDeployAlert.svelte'
|
||||
import { isRuleActive } from '$lib/workspaceProtectionRules.svelte'
|
||||
import { buildForkEditUrl } from '$lib/utils/editInFork'
|
||||
import { isCloudHosted } from '$lib/cloud'
|
||||
|
||||
let flow: Flow | undefined = $state()
|
||||
let can_write = $state(false)
|
||||
@@ -255,7 +256,7 @@
|
||||
})
|
||||
}
|
||||
|
||||
if (flow && !$userStore?.operator && !isRuleActive('DisableWorkspaceForking')) {
|
||||
if (flow && !$userStore?.operator && !isCloudHosted() && !isRuleActive('DisableWorkspaceForking')) {
|
||||
buttons.push({
|
||||
label: 'Edit in fork',
|
||||
buttonProps: {
|
||||
|
||||
@@ -88,6 +88,7 @@
|
||||
import JobOtelTraces from '$lib/components/JobOtelTraces.svelte'
|
||||
import { isRuleActive } from '$lib/workspaceProtectionRules.svelte'
|
||||
import { buildForkEditUrl } from '$lib/utils/editInFork'
|
||||
import { isCloudHosted } from '$lib/cloud'
|
||||
let job: (Job & { result?: any; result_stream?: string }) | undefined = $state()
|
||||
let jobUpdateLastFetch: Date | undefined = $state()
|
||||
|
||||
@@ -656,7 +657,7 @@
|
||||
startIcon={{ icon: Pen }}>Edit</Button
|
||||
>
|
||||
{/if}
|
||||
{#if !showEditButton && !isRuleActive('DisableWorkspaceForking')}
|
||||
{#if !showEditButton && !isCloudHosted() && !isRuleActive('DisableWorkspaceForking')}
|
||||
<Button
|
||||
href={buildForkEditUrl(isScript ? 'script' : 'flow', job?.script_path ?? '')}
|
||||
unifiedSize="md"
|
||||
|
||||
@@ -88,6 +88,7 @@
|
||||
import { page } from '$app/state'
|
||||
import { isRuleActive } from '$lib/workspaceProtectionRules.svelte'
|
||||
import { buildForkEditUrl } from '$lib/utils/editInFork'
|
||||
import { isCloudHosted } from '$lib/cloud'
|
||||
|
||||
let script: Script | undefined = $state()
|
||||
let topHash: string | undefined = $state()
|
||||
@@ -351,7 +352,7 @@
|
||||
})
|
||||
}
|
||||
|
||||
if (script && !$userStore?.operator && !isRuleActive('DisableWorkspaceForking')) {
|
||||
if (script && !$userStore?.operator && !isCloudHosted() && !isRuleActive('DisableWorkspaceForking')) {
|
||||
buttons.push({
|
||||
label: 'Edit in fork',
|
||||
buttonProps: {
|
||||
|
||||
Reference in New Issue
Block a user