Skip to content

Commit

Permalink
Merge pull request #22 from iceljc/bugfix/fix-router
Browse files Browse the repository at this point in the history
revert end conv
  • Loading branch information
Oceania2018 authored Jan 23, 2024
2 parents 749e897 + 172bde2 commit 3312997
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 34 deletions.
25 changes: 4 additions & 21 deletions src/routes/chat/[agentId]/[conversationId]/chat-box.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
DropdownMenu,
DropdownItem,
} from '@sveltestrap/sveltestrap';
import 'overlayscrollbars/overlayscrollbars.css';
import { OverlayScrollbars } from 'overlayscrollbars';
import { page } from '$app/stores';
Expand All @@ -19,8 +18,6 @@
import RcQuickReply from './rc-quick-reply.svelte';
import { PUBLIC_LIVECHAT_ENTRY_ICON } from '$env/static/public';
import ContentLog from './content-log.svelte';
import Swal from 'sweetalert2/dist/sweetalert2.js';
import "sweetalert2/src/sweetalert2.scss";
import { replaceNewLine } from '$lib/helpers/http';
import _ from "lodash";
Expand Down Expand Up @@ -105,7 +102,7 @@
/** @param {import('$types').ContentLogModel} log */
function onContentLogGenerated(log) {
contentLogs.push(log);
contentLogs = contentLogs.map(log => { return { ...log }; });
contentLogs = contentLogs.map(x => { return { ...x }; });
}
function viewFullLogHandler() {
Expand Down Expand Up @@ -143,22 +140,8 @@
await sendMessageToHub(params.agentId, params.conversationId, text);
}
function endChat() {
// @ts-ignore
Swal.fire({
title: 'Are you sure?',
text: "You will exit this conversation.",
icon: 'warning',
customClass: 'conv-delete-modal',
showCancelButton: true,
confirmButtonText: 'Yes',
cancelButtonText: 'No'
// @ts-ignore
}).then((result) => {
if (result.value) {
window.close();
}
});
function close() {
window.parent.postMessage({ action: "close" }, "*");
}
function closeLog() {
Expand Down Expand Up @@ -194,7 +177,7 @@
{/if}
<li class="list-inline-item d-sm-inline-block">
<button type="submit" class="btn btn-primary btn-rounded chat-send waves-effect waves-light"
on:click={() => endChat()}
on:click={close}
>
<span class="d-none d-sm-inline-block me-2" >End Conversation</span> <i class="mdi mdi-window-close"></i>
</button>
Expand Down
22 changes: 11 additions & 11 deletions src/routes/page/agent/evaluator/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,34 @@
import { Col, Row } from '@sveltestrap/sveltestrap';
import Breadcrumb from '$lib/common/Breadcrumb.svelte';
import HeadTitle from '$lib/common/HeadTitle.svelte';
import { getAgents } from '$lib/services/agent-service.js';
import { onMount } from 'svelte';
import { getAgents } from '$lib/services/agent-service.js';
import { onMount } from 'svelte';
import PlainPagination from '$lib/common/PlainPagination.svelte';
const firstPage = 1;
const firstPage = 1;
const pageSize = 12;
/** @type {import('$types').PagedItems<import('$types').AgentModel>} */
let agents = { items: [], count: 0 };
let agents = { items: [], count: 0 };
/** @type {import('$types').AgentFilter} */
const initFilter = {
pager: { page: firstPage, size: pageSize, count: 0 },
isEvaluator: true
};
/** @type {import('$types').AgentFilter} */
let filter = { ... initFilter };
/** @type {import('$types').AgentFilter} */
let filter = { ... initFilter };
/** @type {import('$types').Pagination} */
let pager = filter.pager;
onMount(async () => {
await getPagedAgents();
});
onMount(async () => {
await getPagedAgents();
});
async function getPagedAgents() {
agents = await getAgents(filter);
async function getPagedAgents() {
agents = await getAgents(filter);
refresh();
}
Expand Down
4 changes: 2 additions & 2 deletions src/routes/page/agent/router/routing-flow.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import { getAgents } from '$lib/services/agent-service.js';
import { onMount, createEventDispatcher } from 'svelte';
/** @type any[]} */
/** @type {any[]} */
let agents = [];
/** @type {import('$types').AgentFilter} */
Expand All @@ -14,7 +14,7 @@
isRouter: false,
isEvaluator: false,
disabled: false,
allowRouting: false
allowRouting: true
};
/** @type {import('$types').AgentModel} */
Expand Down

0 comments on commit 3312997

Please sign in to comment.