This commit is contained in:
parent
df9ea7a9d5
commit
e243ce71c0
2
.dockerignore
Normal file
2
.dockerignore
Normal file
@ -0,0 +1,2 @@
|
||||
**/node_modules
|
||||
**/dist
|
||||
1
.env.development
Normal file
1
.env.development
Normal file
@ -0,0 +1 @@
|
||||
VITE_EO_SERVICES_URL=https://localhost:9000
|
||||
1
.env.production
Normal file
1
.env.production
Normal file
@ -0,0 +1 @@
|
||||
VITE_EO_SERVICES_URL=https://eo-services.mortons.site
|
||||
23
.gitignore
vendored
Normal file
23
.gitignore
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
.DS_Store
|
||||
node_modules
|
||||
/dist
|
||||
|
||||
|
||||
# local env files
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# Log files
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
.vscode
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
16
Dockerfile
16
Dockerfile
@ -1,4 +1,14 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
FROM baseImage
|
||||
LABEL site.mortons.author=""
|
||||
LABEL site.mortons.version="1.0"
|
||||
# build stage
|
||||
FROM node:lts-alpine as build-stage
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm install
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
# production stage
|
||||
FROM nginx:stable-alpine as production-stage
|
||||
COPY --from=build-stage /app/dist /usr/share/nginx/html
|
||||
EXPOSE 80
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
26
README.md
26
README.md
@ -1,10 +1,24 @@
|
||||
# eo-services-client
|
||||
# client
|
||||
|
||||
created from template docker-image-template
|
||||
## Project setup
|
||||
```
|
||||
npm install
|
||||
```
|
||||
|
||||
## Key Files
|
||||
### Compiles and hot-reloads for development
|
||||
```
|
||||
npm run serve
|
||||
```
|
||||
|
||||
* Jenkinsfile: Automation of build and deploy of docker image.
|
||||
* Dockerfile: Docker Image specification.
|
||||
* docker-bake.hcl: Docker build defintion file.
|
||||
### Compiles and minifies for production
|
||||
```
|
||||
npm run build
|
||||
```
|
||||
|
||||
### Lints and fixes files
|
||||
```
|
||||
npm run lint
|
||||
```
|
||||
|
||||
### Customize configuration
|
||||
See [Configuration Reference](https://cli.vuejs.org/config/).
|
||||
|
||||
13
index.html
Normal file
13
index.html
Normal file
@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Vite + Vue</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
30
nginx.conf
Normal file
30
nginx.conf
Normal file
@ -0,0 +1,30 @@
|
||||
user nginx;
|
||||
worker_processes 1;
|
||||
error_log /var/log/nginx/error.log warn;
|
||||
pid /var/run/nginx.pid;
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
access_log /var/log/nginx/access.log main;
|
||||
sendfile on;
|
||||
keepalive_timeout 65;
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
location / {
|
||||
root /app;
|
||||
index index.html;
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root /usr/share/nginx/html;
|
||||
}
|
||||
}
|
||||
}
|
||||
1197
package-lock.json
generated
Normal file
1197
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
18
package.json
Normal file
18
package.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "vite-project",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"vue": "^3.2.37"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vitejs/plugin-vue": "^3.1.0",
|
||||
"vite": "^3.1.0"
|
||||
}
|
||||
}
|
||||
1
public/vite.svg
Normal file
1
public/vite.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
44
src/App.vue
Normal file
44
src/App.vue
Normal file
@ -0,0 +1,44 @@
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import ContactTable from './components/ContactTable.vue'
|
||||
import ContactsSummary from './components/ContactsSummary.vue';
|
||||
|
||||
const threadId = ref('')
|
||||
const contactData = ref(null)
|
||||
|
||||
function onInput(e) {
|
||||
threadId.value = e.target.value
|
||||
}
|
||||
|
||||
async function fetchData() {
|
||||
console.log('fetchingData');
|
||||
contactData.value = null
|
||||
const res = await fetch(`${import.meta.env.VITE_EO_SERVICES_URL}/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)
|
||||
}
|
||||
|
||||
</script>
|
||||
<template>
|
||||
<div id="app">
|
||||
<header>
|
||||
<h1>Message Tracking Time</h1>
|
||||
</header>
|
||||
|
||||
<div>
|
||||
<label for="threadId">Reference ID: </label>
|
||||
<input id="threadId" :value="threadId" @input="onInput" placeholder="enter Reference ID here" />
|
||||
</div>
|
||||
|
||||
<div><button @click="fetchData">Fetch Contacts</button></div>
|
||||
|
||||
<ContactsSummary v-if="contactData" :results="contactData.data.findContactsCompletedBetween" />
|
||||
<div v-else>No Contacts Found</div>
|
||||
<ContactTable v-if="contactData" :tableData="contactData.data.findContactsCompletedBetween.edges" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<style scoped></style>
|
||||
|
||||
1
src/assets/vue.svg
Normal file
1
src/assets/vue.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="37.07" height="36" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 198"><path fill="#41B883" d="M204.8 0H256L128 220.8L0 0h97.92L128 51.2L157.44 0h47.36Z"></path><path fill="#41B883" d="m0 0l128 220.8L256 0h-51.2L128 132.48L50.56 0H0Z"></path><path fill="#35495E" d="M50.56 0L128 133.12L204.8 0h-47.36L128 51.2L97.92 0H50.56Z"></path></svg>
|
||||
|
After Width: | Height: | Size: 496 B |
47
src/components/ContactTable.vue
Normal file
47
src/components/ContactTable.vue
Normal file
@ -0,0 +1,47 @@
|
||||
<script setup>
|
||||
import HandledBy from './HandledBy.vue'
|
||||
import EmailInteraction from './EmailInteraction.vue'
|
||||
import DateTime from './DateTime.vue'
|
||||
import OutcomeList from './OutcomeList.vue'
|
||||
import CustomerList from './CustomerList.vue'
|
||||
import NotesList from './NotesList.vue'
|
||||
|
||||
// eslint-disable-next-line
|
||||
const props = defineProps(["tableData"]);
|
||||
console.log(props.tableData)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Contact ID</th>
|
||||
<th>Start Time</th>
|
||||
<th>End Time</th>
|
||||
<th>Direction</th>
|
||||
<th>Handled By</th>
|
||||
<th>Active Duration (s)</th>
|
||||
<th>Notes</th>
|
||||
<th>Interaction</th>
|
||||
<th>Outcome</th>
|
||||
<th>Customer</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="td in tableData" :key="td">
|
||||
<td>{{ td.node.systemId }}</td>
|
||||
<td><DateTime :date="td.node.startTime"/></td>
|
||||
<td><DateTime :date="td.node.endTime"/></td>
|
||||
<td>{{ td.node.direction }}</td>
|
||||
<td><HandledBy :handledBy="td.node.handledBy"/></td>
|
||||
<td>{{ td.node.activeDuration }}</td>
|
||||
<td><NotesList :notes="td.node.notes"/></td>
|
||||
<td>
|
||||
<EmailInteraction v-if="td.node.interaction.__typename === 'Email'" :email="td.node.interaction" />
|
||||
</td>
|
||||
<td><OutcomeList :outcomes="td.node.outcome"/></td>
|
||||
<td><CustomerList :customers="td.node.customer"/></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</template>
|
||||
62
src/components/ContactsSummary.vue
Normal file
62
src/components/ContactsSummary.vue
Normal file
@ -0,0 +1,62 @@
|
||||
<script setup>
|
||||
// eslint-disable-next-line
|
||||
defineProps(["results"]);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="stats">
|
||||
<div class="item">
|
||||
<div class="measure">{{ results.totalCount }}</div>
|
||||
<div class="label">Contacts Found</div>
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<div class="measure">{{ results.totalHTDays }}</div>
|
||||
<div class="label">Total Handle Time (days)</div>
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<div class="measure">{{ results.activeHTDays }}</div>
|
||||
<div class="label">Active Handle Time (days)</div>
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<div class="measure">{{ results.totalATHours }}</div>
|
||||
<div class="label">Total Active Time (days)</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<style>
|
||||
.stats {
|
||||
display: flex;
|
||||
}
|
||||
.item {
|
||||
width: 100%;
|
||||
border: 2px solid rgb(57, 145, 201);
|
||||
border-radius: 4px;
|
||||
background-color: #f7f9fc;
|
||||
font-weight: bold;
|
||||
white-space: normal;
|
||||
margin: 5px;
|
||||
padding: 5px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.measure {
|
||||
width: 100%;
|
||||
color: rgb(57,145,201);
|
||||
font-family: 'DejaVu Sans', Ariel, Helvetica, sans-serif;
|
||||
text-align: center;
|
||||
font-size: 16px;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.label {
|
||||
width: 100%;
|
||||
font-family: 'DejaVu Sans', Ariel, Helvetica, sans-serif;
|
||||
font-size: 11px;
|
||||
text-align: center;
|
||||
padding: 5px;
|
||||
}
|
||||
</style>
|
||||
11
src/components/CustomerList.vue
Normal file
11
src/components/CustomerList.vue
Normal file
@ -0,0 +1,11 @@
|
||||
<script setup>
|
||||
// eslint-disable-next-line
|
||||
defineProps(["customers"]);
|
||||
|
||||
</script>
|
||||
<template>
|
||||
<div v-if="customers">
|
||||
<ul v-for="customer in customers.edges" :key="customer.node.ref">{{ customer.node.firstName }} {{ customer.node.lastName }} ({{ customer.node.ref }})</ul>
|
||||
</div>
|
||||
<div v-else>No Customer</div>
|
||||
</template>
|
||||
12
src/components/DateTime.vue
Normal file
12
src/components/DateTime.vue
Normal file
@ -0,0 +1,12 @@
|
||||
<script setup>
|
||||
// eslint-disable-next-line
|
||||
const props = defineProps(["date"]);
|
||||
|
||||
const dateValue = new Date(props.date)
|
||||
const date = dateValue.toLocaleDateString()
|
||||
const time = dateValue.toLocaleTimeString()
|
||||
|
||||
</script>
|
||||
<template>
|
||||
<p>{{ date }} {{ time }}</p>
|
||||
</template>
|
||||
16
src/components/EmailInteraction.vue
Normal file
16
src/components/EmailInteraction.vue
Normal file
@ -0,0 +1,16 @@
|
||||
<script setup>
|
||||
// eslint-disable-next-line
|
||||
defineProps(["email"]);
|
||||
</script>
|
||||
<template>
|
||||
<p>Interaction ID {{ email.systemId }}</p>
|
||||
<p>To: <span v-for="address in email.toAddresses" :key="address">{{ address }} </span> </p>
|
||||
<p>From: {{ email.fromAddress }}</p>
|
||||
<p>Subject: {{ email.subject }}</p>
|
||||
<p>Thread ID: {{ email.threadId }}</p>
|
||||
</template>
|
||||
<style>
|
||||
p {
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
7
src/components/HandledBy.vue
Normal file
7
src/components/HandledBy.vue
Normal file
@ -0,0 +1,7 @@
|
||||
<script setup>
|
||||
// eslint-disable-next-line
|
||||
defineProps(["handledBy"]);
|
||||
</script>
|
||||
<template>
|
||||
<p>{{ handledBy.username }}</p>
|
||||
</template>
|
||||
9
src/components/NotesList.vue
Normal file
9
src/components/NotesList.vue
Normal file
@ -0,0 +1,9 @@
|
||||
<script setup>
|
||||
// eslint-disable-next-line
|
||||
defineProps(["notes"]);
|
||||
</script>
|
||||
<template>
|
||||
<div v-if="notes">
|
||||
<span v-for="note in notes.edges" :key="note">{{ note.node.text }}</span>
|
||||
</div>
|
||||
</template>
|
||||
8
src/components/OutcomeList.vue
Normal file
8
src/components/OutcomeList.vue
Normal file
@ -0,0 +1,8 @@
|
||||
<script setup>
|
||||
// eslint-disable-next-line
|
||||
defineProps(["outcomes"]);
|
||||
|
||||
</script>
|
||||
<template>
|
||||
<div v-for="outcome in outcomes.edges" :key="outcome">{{ outcome.node.text }} </div>
|
||||
</template>
|
||||
5
src/main.js
Normal file
5
src/main.js
Normal file
@ -0,0 +1,5 @@
|
||||
import { createApp } from 'vue'
|
||||
import './style.css'
|
||||
import App from './App.vue'
|
||||
|
||||
createApp(App).mount('#app')
|
||||
87
src/style.css
Normal file
87
src/style.css
Normal file
@ -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;
|
||||
}
|
||||
7
vite.config.js
Normal file
7
vite.config.js
Normal file
@ -0,0 +1,7 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [vue()]
|
||||
})
|
||||
Loading…
x
Reference in New Issue
Block a user