diff --git a/client/src/App.vue b/client/src/App.vue index 65f4165..d4b6def 100644 --- a/client/src/App.vue +++ b/client/src/App.vue @@ -3,8 +3,6 @@ import { ref } from 'vue' import ContactTable from './components/ContactTable.vue' import ContactsSummary from './components/ContactsSummary.vue'; -const titleClass = ref('title') - const threadId = ref('') const contactData = ref(null) @@ -15,41 +13,31 @@ function onInput(e) { async function fetchData() { console.log('fetchingData'); contactData.value = null - const res = await fetch(`http://localhost:9000/thread-tracker`, { + const res = await fetch(`http://localhost:9000/thread-tracker?threadId=${ threadId.value }`, { credentials: "include" // fetch won't send cookies unless you set credentials }) contactData.value = await res.json() + console.log(contactData.value) } - diff --git a/client/src/assets/eo.css b/client/src/assets/eo.css new file mode 100644 index 0000000..191f727 --- /dev/null +++ b/client/src/assets/eo.css @@ -0,0 +1,87 @@ +h1 { + font-size: 18px; + line-height: 19px; + overflow: hidden; + padding: 6px 0 12px 0; + min-height: 23px; + vertical-align: middle; + font-family: "Lato", sans-serif; + font-weight: 400; + border-bottom: 1px solid #c7c7c7; +} + +h3 { + border-bottom: 1px solid rgb(199, 199, 199); + display: block; + font-family: "Lato", sans-serif; + font-weight: 400; + font-size: 14px; + line-height: 23px; + min-height: 23px; + overflow: hidden; +} + +body { + font: 12px/18px "OpenSans", Ariel, sans-serif; +} + +p { + color: rgb(51, 51, 51); + display: block; + font: normal normal normal normal 12px/18px OpenSans, Arial, sans-serif; + font-variant: normal; + text-align: left; + visibility: visible; + white-space: normal; +} + +table { + border-collapse: collapse; + font: normal normal normal normal 12px/18px OpenSans, Arial, sans-serif; + width: 100%; +} + +th { + background: rgb(238, 238, 238) none repeat-x scroll 0px 0px / auto padding-box border-box; + border-right: 2px solid rgb(255, 255, 255); + border-bottom: 1px solid rgb(255, 255, 255); + padding: 3px 6px 2px; + text-align: left; + vertical-align: bottom; +} + +td { + margin: 0px; + padding: 0px; + text-align: left; +} + +tr { + border-bottom: 1px solid rgb(199, 199, 199); + padding: 4px 0px 3px; +} + +button { + margin-left: 5px; + color: #333333; + background-color: #ccc; + background-image: none; + border: 2px solid transparent; + height: 24px; + line-height: 22px; + white-space: nowrap; + width: auto; + min-width: 0px; + font-size: 12px; + padding: 0 6px !important; + margin: 0; + font-family: "OpenSans", Arial, sans-serif; + text-align: center; + background-repeat: no-repeat; + box-sizing: border-box; + box-shadow: 0 0 0 1px transparent inset; + writing-mode: horizontal-tb !important; + appearance: auto; + text-rendering: auto; + align-items: flex-start; +} diff --git a/client/src/components/ContactTable.vue b/client/src/components/ContactTable.vue index 2edbd74..78f5a56 100644 --- a/client/src/components/ContactTable.vue +++ b/client/src/components/ContactTable.vue @@ -7,14 +7,15 @@ import CustomerList from './CustomerList.vue' import NotesList from './NotesList.vue' // eslint-disable-next-line -defineProps(["tableData"]); +const props = defineProps(["tableData"]); +console.log(props.tableData) + \ No newline at end of file diff --git a/client/src/components/OutcomeList.vue b/client/src/components/OutcomeList.vue index 1301de9..e176e19 100644 --- a/client/src/components/OutcomeList.vue +++ b/client/src/components/OutcomeList.vue @@ -4,5 +4,5 @@ defineProps(["outcomes"]); \ No newline at end of file diff --git a/client/src/main.js b/client/src/main.js index 01433bc..fe1bcb6 100644 --- a/client/src/main.js +++ b/client/src/main.js @@ -1,4 +1,5 @@ -import { createApp } from 'vue' -import App from './App.vue' +import { createApp } from "vue"; +import App from "./App.vue"; +import "./assets/eo.css"; -createApp(App).mount('#app') +createApp(App).mount("#app"); diff --git a/server/routes/threadTracker.js b/server/routes/threadTracker.js index d043022..7eda590 100644 --- a/server/routes/threadTracker.js +++ b/server/routes/threadTracker.js @@ -2,12 +2,12 @@ const express = require("express"); const router = express.Router(); const axios = require("axios"); const qs = require("querystring"); -const { threadId } = require("worker_threads"); +const util = require("util"); router.get("/", (req, res) => { // token in session -> get user data and send it back to the vue app if (req.session.token) { - query(); + query(req.query.threadId); } // no token -> send nothing else { @@ -33,14 +33,14 @@ router.get("/", (req, res) => { req.session.token = result.data.access_token; console.log(result); //redirect to Vue app - query(); + query(req.query.threadId); }) .catch((err) => { console.error(err); }); } - function query() { + function query(threadId) { console.log("Executing Query"); var query = `query ($startTime: DateTime, $endTime: DateTime) { @@ -137,7 +137,6 @@ router.get("/", (req, res) => { } ) .then((result) => { - const threadId = "1000503"; var contacts = result.data.data.findContactsCompletedBetween.edges; var filteredContacts = []; for (const contact of contacts) { @@ -184,6 +183,14 @@ router.get("/", (req, res) => { totalATHours.toPrecision(5); if (result.data) { + console.log( + util.inspect(result.data, { + showHidden: false, + depth: null, + colors: true, + }) + ); + res.send(result.data); }