mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-19 08:01:25 +00:00
fix(frontend): use normal password mask for the sensitive fields of the resource editor
This commit is contained in:
@@ -186,5 +186,13 @@
|
||||
fixedOverflowWidgets={false}
|
||||
/>
|
||||
{:else}
|
||||
<SchemaForm noDelete {linkedSecretCandidates} bind:linkedSecret isValid {schema} bind:args />
|
||||
<SchemaForm
|
||||
onlyMaskPassword
|
||||
noDelete
|
||||
{linkedSecretCandidates}
|
||||
bind:linkedSecret
|
||||
isValid
|
||||
{schema}
|
||||
bind:args
|
||||
/>
|
||||
{/if}
|
||||
|
||||
@@ -138,9 +138,15 @@
|
||||
}
|
||||
return r
|
||||
}
|
||||
$: linkedSecret = linkedSecretCandidates?.sort(
|
||||
(ua, ub) => linkedSecretValue(ub) - linkedSecretValue(ua)
|
||||
)?.[0]
|
||||
|
||||
function forceSecretValue(resourceType: string): string | undefined {
|
||||
if (resourceType == 'git_repository') {
|
||||
return 'url'
|
||||
}
|
||||
}
|
||||
$: linkedSecret =
|
||||
forceSecretValue(resourceType) ??
|
||||
linkedSecretCandidates?.sort((ua, ub) => linkedSecretValue(ub) - linkedSecretValue(ua))?.[0]
|
||||
|
||||
let scopes: string[] = []
|
||||
let extra_params: [string, string][] = []
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
import FileUpload from './common/fileUpload/FileUpload.svelte'
|
||||
import autosize from '$lib/autosize'
|
||||
import PasswordArgInput from './PasswordArgInput.svelte'
|
||||
import Password from './Password.svelte'
|
||||
|
||||
export let label: string = ''
|
||||
export let value: any
|
||||
@@ -70,6 +71,7 @@
|
||||
export let showSchemaExplorer = false
|
||||
export let simpleTooltip: string | undefined = undefined
|
||||
export let customErrorMessage: string | undefined = undefined
|
||||
export let onlyMaskPassword = false
|
||||
|
||||
let seeEditable: boolean = enum_ != undefined || pattern != undefined
|
||||
const dispatch = createEventDispatcher()
|
||||
@@ -651,7 +653,11 @@
|
||||
<div class="flex flex-col w-full">
|
||||
<div class="flex flex-row w-full items-center justify-between relative">
|
||||
{#if password || extra?.['password'] == true}
|
||||
<PasswordArgInput {disabled} bind:value />
|
||||
{#if onlyMaskPassword}
|
||||
<Password {disabled} bind:password={value} placeholder={defaultValue ?? ''} />
|
||||
{:else}
|
||||
<PasswordArgInput {disabled} bind:value />
|
||||
{/if}
|
||||
{:else}
|
||||
{#key extra?.['minRows']}
|
||||
<textarea
|
||||
|
||||
@@ -203,6 +203,7 @@
|
||||
<Skeleton layout={[[4]]} />
|
||||
{:else if !viewJsonSchema && resourceSchema && resourceSchema?.properties}
|
||||
<SchemaForm
|
||||
onlyMaskPassword
|
||||
noDelete
|
||||
disabled={!can_write}
|
||||
compact
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
export let disablePortal = false
|
||||
export let showSchemaExplorer = false
|
||||
export let showReset = false
|
||||
export let onlyMaskPassword = false
|
||||
|
||||
let clazz: string = ''
|
||||
export { clazz as class }
|
||||
@@ -156,6 +157,7 @@
|
||||
extra={schema.properties[argName]}
|
||||
{showSchemaExplorer}
|
||||
simpleTooltip={schemaFieldTooltip[argName]}
|
||||
{onlyMaskPassword}
|
||||
>
|
||||
<svelte:fragment slot="actions">
|
||||
{#if linkedSecretCandidates?.includes(argName)}
|
||||
|
||||
@@ -218,6 +218,7 @@
|
||||
<Alert type="warning" title="Adding a form to the approval page is an EE feature" />
|
||||
{:else}
|
||||
<SchemaForm
|
||||
onlyMaskPassword
|
||||
noVariablePicker
|
||||
bind:isValid={valid}
|
||||
schema={mergeSchema(schema, enum_payload)}
|
||||
|
||||
Reference in New Issue
Block a user