Skip to content

Commit

Permalink
try to allow agent field
Browse files Browse the repository at this point in the history
  • Loading branch information
LeosPrograms committed Mar 11, 2024
1 parent 5fdbe76 commit 9b1196b
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ui/src/BoardEditor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@
<sl-option value={ColumnType.Date}>Date</sl-option>
<sl-option value={ColumnType.Email}>Email</sl-option>
<sl-option value={ColumnType.URL}>URL</sl-option>
<sl-option value={ColumnType.TableLink}>Table Link</sl-option>
<sl-option value={ColumnType.User}>User</sl-option>
<!-- <sl-option value={ColumnType.TableLink}>Table Link</sl-option> -->
<sl-option value={ColumnType.WeaveAsset}>Weave Asset</sl-option>
</sl-select>
</div>
Expand Down
33 changes: 33 additions & 0 deletions ui/src/CellEdit.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
import { createEventDispatcher } from "svelte";
import AttachmentsList from './AttachmentsList.svelte';
import type { TablesStore } from './store';
import "@holochain-open-dev/profiles/dist/elements/search-agent.js";
import "@holochain-open-dev/profiles/dist/elements/profiles-context.js";
import SvgIcon from './SvgIcon.svelte';
const dispatch = createEventDispatcher()
Expand All @@ -18,6 +22,7 @@
export let cell:Cell
export let width
let searchAgentOpen = false;
let origValue = ""
let closing = ""
Expand Down Expand Up @@ -74,6 +79,34 @@
}
}}
/>
{:else if type==ColumnType.User}
<div style="display:flex"
>
{#if value}
<div style="display:flex;align-items:center">
<img src={value.avatar} style="border-radius:50%;width:20px;height:20px;margin-right:5px"/>
{value.name}
</div>
{/if}
<button title="Search For User" class="attachment-button" style="margin-right:10px" on:click={
()=>{
searchAgentOpen = !searchAgentOpen
}
} >
<SvgIcon icon="faUser" size="16px"/>
</button>
{#if searchAgentOpen}
<!-- <profiles-context store={store.profilesStore}> -->
<search-agent
on:agent-selected={(e)=>{
console.log("Agent selected", e.detail)
dispatch("save", e.detail)
searchAgentOpen = false
}}
></search-agent>
<!-- </profiles-context> -->
{/if}
</div>
{:else if type==ColumnType.WeaveAsset}
<div style="display:flex"
>
Expand Down
1 change: 1 addition & 0 deletions ui/src/board.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export enum ColumnType {
Date,
Email,
URL,
User,
// TableLink,
WeaveAsset,
}
Expand Down

0 comments on commit 9b1196b

Please sign in to comment.