diff --git a/.github/workflows/frontend-check.yml b/.github/workflows/frontend-check.yml index 845d03146dd1a..64883cb30397d 100644 --- a/.github/workflows/frontend-check.yml +++ b/.github/workflows/frontend-check.yml @@ -15,7 +15,6 @@ jobs: with: node-version: 18 - name: "npm check" - timeout-minutes: 2 - run: - cd frontend && npm ci && npm run generate-backend-client && npm run + timeout-minutes: 5 + run: cd frontend && npm ci && npm run generate-backend-client && npm run check diff --git a/frontend/src/lib/components/AssignableTags.svelte b/frontend/src/lib/components/AssignableTags.svelte index 1e6c7eb35949c..2326a0dd96e0b 100644 --- a/frontend/src/lib/components/AssignableTags.svelte +++ b/frontend/src/lib/components/AssignableTags.svelte @@ -7,14 +7,16 @@ export let placement: 'bottom-end' | 'top-end' = 'bottom-end' export let color: 'nord' | 'dark' = 'dark' + export let disabled = false - {/if} diff --git a/frontend/src/lib/components/ScheduleEditorInner.svelte b/frontend/src/lib/components/ScheduleEditorInner.svelte index 1ad3e93598159..8921acb2cf68b 100644 --- a/frontend/src/lib/components/ScheduleEditorInner.svelte +++ b/frontend/src/lib/components/ScheduleEditorInner.svelte @@ -218,11 +218,13 @@ async function loadScript(p: string | undefined): Promise { if (p) { runnable = undefined - if (is_flow) { - runnable = await FlowService.getFlowByPath({ workspace: $workspaceStore!, path: p }) - } else { - runnable = await ScriptService.getScriptByPath({ workspace: $workspaceStore!, path: p }) - } + try { + if (is_flow) { + runnable = await FlowService.getFlowByPath({ workspace: $workspaceStore!, path: p }) + } else { + runnable = await ScriptService.getScriptByPath({ workspace: $workspaceStore!, path: p }) + } + } catch (err) {} } else { runnable = undefined } @@ -524,7 +526,11 @@ @@ -541,22 +547,24 @@ View runs -
- { - await ScheduleService.setScheduleEnabled({ - path: initialPath, - workspace: $workspaceStore ?? '', - requestBody: { enabled: e.detail } - }) - dispatch('update') - sendUserToast(`${e.detail ? 'enabled' : 'disabled'} schedule ${initialPath}`) - }} - /> -
+ {#if can_write} +
+ { + await ScheduleService.setScheduleEnabled({ + path: initialPath, + workspace: $workspaceStore ?? '', + requestBody: { enabled: e.detail } + }) + dispatch('update') + sendUserToast(`${e.detail ? 'enabled' : 'disabled'} schedule ${initialPath}`) + }} + /> +
+ {/if} {/if} {/if} - + {#if allowView} + + {/if} {:else if itemKind == 'app'}
@@ -163,16 +166,18 @@ Edit {/if} - + {#if allowView} + + {/if}
{:else}
@@ -188,20 +193,22 @@ Edit {/if} - + {#if allowView} + + {/if}
{/if} {/if} diff --git a/frontend/src/lib/components/WorkerTagPicker.svelte b/frontend/src/lib/components/WorkerTagPicker.svelte index aad96ee956349..0aabbeaa2e5a3 100644 --- a/frontend/src/lib/components/WorkerTagPicker.svelte +++ b/frontend/src/lib/components/WorkerTagPicker.svelte @@ -8,6 +8,7 @@ export let tag: string | undefined export let popupPlacement: 'bottom-end' | 'top-end' = 'bottom-end' + export let disabled = false loadWorkerGroups() async function loadWorkerGroups() { @@ -21,7 +22,7 @@
{#if $workerTags} {#if $workerTags?.length ?? 0 > 0} - + {:else}
No custom worker group tag defined on this instance in "Workers {'->'} Custom tags" @@ -50,6 +51,7 @@ loadWorkerGroups() }} startIcon={{ icon: RotateCw }} + {disabled} /> - +
diff --git a/frontend/src/lib/components/WorkerTagSelect.svelte b/frontend/src/lib/components/WorkerTagSelect.svelte index bbe96d03cb527..232b86b98f235 100644 --- a/frontend/src/lib/components/WorkerTagSelect.svelte +++ b/frontend/src/lib/components/WorkerTagSelect.svelte @@ -5,6 +5,7 @@ export let tag: string | undefined export let noLabel: boolean = false export let nullTag: string | undefined = undefined + export let disabled = false loadWorkerGroups() @@ -28,6 +29,7 @@ tag = undefined } }} + {disabled} > {#if tag} diff --git a/frontend/src/lib/components/common/menu/MenuV2.svelte b/frontend/src/lib/components/common/menu/MenuV2.svelte index c4a79f5429567..708224ee13b8a 100644 --- a/frontend/src/lib/components/common/menu/MenuV2.svelte +++ b/frontend/src/lib/components/common/menu/MenuV2.svelte @@ -11,6 +11,7 @@ export let justifyEnd: boolean = false export let lightMode: boolean = false export let maxHeight: number = 900 + export let disabled = false const [floatingRef, floatingContent] = createFloatingActions({ strategy: 'fixed', middleware: [offset(), flip(), shift()], @@ -18,10 +19,10 @@ }) - +
- +
diff --git a/frontend/src/lib/components/common/popup/Popup.svelte b/frontend/src/lib/components/common/popup/Popup.svelte index a559509d158fc..6bbceccec7fe1 100644 --- a/frontend/src/lib/components/common/popup/Popup.svelte +++ b/frontend/src/lib/components/common/popup/Popup.svelte @@ -18,10 +18,11 @@ export let noTransition = false export let popupHover = false export let preventPopupClosingOnClickInside = false + export let disabled = false - +
diff --git a/frontend/src/lib/components/sidebar/OperatorMenu.svelte b/frontend/src/lib/components/sidebar/OperatorMenu.svelte index ae915b562e7e4..2c447600cd182 100644 --- a/frontend/src/lib/components/sidebar/OperatorMenu.svelte +++ b/frontend/src/lib/components/sidebar/OperatorMenu.svelte @@ -10,14 +10,15 @@ Code2, LayoutDashboard, Building, - Calendar + Calendar, + ServerCog } from 'lucide-svelte' import { base } from '$lib/base' import Menu from '../common/menu/MenuV2.svelte' import MultiplayerMenu from './MultiplayerMenu.svelte' - import { enterpriseLicense } from '$lib/stores' + import { enterpriseLicense, superadmin } from '$lib/stores' import MenuButton from './MenuButton.svelte' import { MenuItem } from '@rgossiaux/svelte-headlessui' import MenuLink from './MenuLink.svelte' @@ -43,10 +44,6 @@ ] let secondMenuLinks = [ - { - label: 'Schedules', - href: `${base}/schedules` - }, { label: 'Resources', href: `${base}/resources` @@ -55,6 +52,18 @@ label: 'Variables', href: `${base}/variables` }, + { + label: 'Custom HTTP Routes', + href: `${base}/routes` + }, + { + label: 'Websocket Triggers', + href: `${base}/websockets` + }, + { + label: 'Kafka Triggers', + href: `${base}/kafka` + }, { label: 'Audit Logs', href: `${base}/audit_logs` @@ -158,6 +167,20 @@ All Workspaces + {#if $superadmin} + + + Instance settings + + {/if} + logout()} diff --git a/frontend/src/lib/components/triggers/KafkaTriggerEditorInner.svelte b/frontend/src/lib/components/triggers/KafkaTriggerEditorInner.svelte index c65bdbc32c253..c934cb0e1e8f5 100644 --- a/frontend/src/lib/components/triggers/KafkaTriggerEditorInner.svelte +++ b/frontend/src/lib/components/triggers/KafkaTriggerEditorInner.svelte @@ -151,7 +151,7 @@ on:close={drawer.closeDrawer} > - {#if !drawerLoading && can_write} + {#if !drawerLoading} {#if edit}
{/if} - + {#if can_write} + + {/if} {/if}
{#if drawerLoading} @@ -300,7 +302,8 @@ allowFlow={true} bind:itemKind bind:scriptPath={script_path} - allowRefresh + allowRefresh={can_write} + allowEdit={!$userStore?.operator} />
diff --git a/frontend/src/lib/components/triggers/RouteEditorInner.svelte b/frontend/src/lib/components/triggers/RouteEditorInner.svelte index 127d48ab75fba..a25939e7bef7f 100644 --- a/frontend/src/lib/components/triggers/RouteEditorInner.svelte +++ b/frontend/src/lib/components/triggers/RouteEditorInner.svelte @@ -21,6 +21,8 @@ import JsonEditor from '../apps/editor/settingsPanel/inputEditor/JsonEditor.svelte' import FileUpload from '../common/fileUpload/FileUpload.svelte' import SimpleEditor from '../SimpleEditor.svelte' + import { json } from 'svelte-highlight/languages' + import { Highlight } from 'svelte-highlight' let is_flow: boolean = false let initialPath = '' @@ -341,36 +343,48 @@ {#if static_asset_config}
- - {#if s3FileUploadRawMode} - { - dispatch('focus') - }} - on:blur={(e) => { - dispatch('blur') - }} - code={JSON.stringify(static_asset_config ?? { s3: '' }, null, 2)} - bind:value={static_asset_config} - /> - + options={{ left: 'Existing file' }} + disabled={!can_write} + /> + {/if} + {#if s3FileUploadRawMode} + {#if can_write} + { + dispatch('focus') + }} + on:blur={(e) => { + dispatch('blur') + }} + code={JSON.stringify(static_asset_config ?? { s3: '' }, null, 2)} + bind:value={static_asset_config} + /> + {:else} + + {/if} + {#if can_write} + + {/if} {:else} {#if script_path === undefined} diff --git a/frontend/src/lib/components/triggers/WebsocketTriggerEditorInner.svelte b/frontend/src/lib/components/triggers/WebsocketTriggerEditorInner.svelte index 208bbf92fc6cf..d8001197abf14 100644 --- a/frontend/src/lib/components/triggers/WebsocketTriggerEditorInner.svelte +++ b/frontend/src/lib/components/triggers/WebsocketTriggerEditorInner.svelte @@ -253,7 +253,7 @@ on:close={drawer.closeDrawer} > - {#if !drawerLoading && can_write} + {#if !drawerLoading} {#if edit}
{/if} - + {#if can_write} + + {/if} {/if}
{#if drawerLoading} @@ -411,7 +413,8 @@ allowFlow={true} bind:itemKind bind:scriptPath={script_path} - allowRefresh + allowRefresh={can_write} + allowEdit={!$userStore?.operator} />
diff --git a/frontend/src/routes/(root)/(logged)/schedules/+page.svelte b/frontend/src/routes/(root)/(logged)/schedules/+page.svelte index 1f8c9e84a5c79..f440e546006aa 100644 --- a/frontend/src/routes/(root)/(logged)/schedules/+page.svelte +++ b/frontend/src/routes/(root)/(logged)/schedules/+page.svelte @@ -384,10 +384,10 @@ { scheduleEditor?.openEdit(path, is_flow) }