-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #91 from iceljc/features/refine-chat-window
Features/refine chat window
- Loading branch information
Showing
13 changed files
with
222 additions
and
28 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<script> | ||
import { createEventDispatcher } from 'svelte' | ||
import collapse from 'svelte-collapse'; | ||
/** @type {boolean} */ | ||
export let open = true; | ||
/** @type {number} */ | ||
export let duration = 0.2; | ||
/** @type {string} */ | ||
export let easing = 'ease'; | ||
const dispatch = createEventDispatcher() | ||
function handleToggle () { | ||
open = !open; | ||
if (open) { | ||
dispatch('open'); | ||
} | ||
else { | ||
dispatch('close'); | ||
} | ||
} | ||
</script> | ||
|
||
<div class='collapsible-card' class:open aria-expanded={open}> | ||
<button type="button" class='collapsible-card-header' on:click={handleToggle}> | ||
<slot name='header'/> | ||
</button> | ||
|
||
<div class='collapsible-card-body' use:collapse={{open, duration, easing}}> | ||
<slot name='body'/> | ||
</div> | ||
</div> | ||
|
||
<style> | ||
.collapsible-card { | ||
margin-top: 10px; | ||
margin-bottom: 10px; | ||
} | ||
.collapsible-card-header { | ||
cursor: pointer; | ||
user-select: none; | ||
width: 100%; | ||
text-align: left; | ||
} | ||
button { | ||
background: transparent; | ||
border: none !important; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
.agent-prop-key { | ||
width: 45%; | ||
} | ||
|
||
.agent-profile-container { | ||
.profile-name { | ||
font-size: 1.1em; | ||
} | ||
} | ||
|
||
.routing-rule-container { | ||
.rule-header { | ||
margin-top: 5px; | ||
margin-bottom: 5px; | ||
padding-left: 10px; | ||
} | ||
|
||
.rule-title { | ||
border: none; | ||
padding-bottom: 0; | ||
} | ||
|
||
.rule-body { | ||
padding: 0px 10px; | ||
|
||
table tbody tr:last-child { | ||
border: none; | ||
th, td { | ||
border: none; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<script> | ||
import CollapsibleCard from "$lib/common/CollapsibleCard.svelte"; | ||
import { Card, CardBody, Table } from "@sveltestrap/sveltestrap"; | ||
/** @type {import('$types').AgentModel} */ | ||
export let agent; | ||
/** @param {string} agentId */ | ||
function redirectToAgent(agentId) { | ||
window.open(`/page/agent/${agentId}`); | ||
} | ||
</script> | ||
|
||
<Card> | ||
<CardBody> | ||
<div class="text-center"> | ||
<h5 class="mt-1 mb-3">Routing Rules</h5> | ||
</div> | ||
|
||
{#each agent.routing_rules as rule, idx (idx)} | ||
<div class="routing-rule-container"> | ||
<CollapsibleCard> | ||
<div slot='header'> | ||
<h5 class="rule-header">{`Rule #${idx + 1}`}</h5> | ||
</div> | ||
<div slot='body'> | ||
<div class="table-responsive rule-body"> | ||
<Table> | ||
<tbody> | ||
<tr> | ||
<th class="agent-prop-key">Field</th> | ||
<td>{rule.field}</td> | ||
</tr> | ||
<tr> | ||
<th class="agent-prop-key">Description</th> | ||
<td>{rule.description}</td> | ||
</tr> | ||
{#if !!rule.fieldType} | ||
<tr> | ||
<th class="agent-prop-key">Field Type</th> | ||
<td>{rule.fieldType}</td> | ||
</tr> | ||
{/if} | ||
<tr> | ||
<th class="agent-prop-key">Required</th> | ||
<td>{!!rule.required ? `Yes` : `No`}</td> | ||
</tr> | ||
{#if !!rule.redirectTo} | ||
<tr> | ||
<th class="agent-prop-key">Redirect to Agent</th> | ||
<td style="cursor: pointer;" on:click={() => redirectToAgent(rule.redirectTo)}> | ||
{rule.redirectToAgentName} | ||
</td> | ||
</tr> | ||
{/if} | ||
{#if !!rule.type} | ||
<tr> | ||
<th class="agent-prop-key">Type</th> | ||
<td>{rule.type}</td> | ||
</tr> | ||
{/if} | ||
</tbody> | ||
</Table> | ||
</div> | ||
</div> | ||
</CollapsibleCard> | ||
</div> | ||
{/each} | ||
</CardBody> | ||
</Card> |