Skip to content

Commit

Permalink
fix: user ui credential inputs styling (#1674)
Browse files Browse the repository at this point in the history
* fix: user ui credential inputs styling

* feat: render markdown as html for credential auth prompts
  • Loading branch information
ryanhopperlowe authored Feb 6, 2025
1 parent 3fd5098 commit f028467
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
3 changes: 1 addition & 2 deletions ui/admin/app/components/chat/Message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { Button } from "~/components/ui/button";
import {
Dialog,
DialogContent,
DialogDescription,
DialogHeader,
DialogTitle,
DialogTrigger,
Expand Down Expand Up @@ -263,7 +262,7 @@ export function PromptMessage({
<DialogTitle>{getCtaText()}</DialogTitle>
</DialogHeader>

<DialogDescription>{prompt.message}</DialogDescription>
<Markdown>{prompt.message}</Markdown>

<PromptAuthForm
prompt={prompt}
Expand Down
12 changes: 9 additions & 3 deletions ui/user/src/lib/components/messages/Message.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -258,20 +258,26 @@
}
}}
>
<p>{msg.message}</p>
{@html toHTMLFromMarkdown(msg.message.join('\n'))}

{#each msg.fields as field}
<div class="flex flex-col gap-1">
<label for={field.name} class="text-sm font-medium">{field.name}</label>
<input
class="rounded-lg border border-gray-300 p-2"
class="rounded-lg bg-gray-100 p-2 outline-none dark:bg-gray-900"
type={field.sensitive ? 'password' : 'text'}
name={field.name}
bind:value={promptCredentials[field.name]}
/>
</div>
{/each}

<button type="submit">Submit</button>
<button
class="self-end rounded-full px-4 py-2 text-black hover:bg-gray-500 hover:text-white dark:text-white"
type="submit"
>
Submit
</button>
</form>
{/if}
{/snippet}
Expand Down

0 comments on commit f028467

Please sign in to comment.