lint & format

This commit is contained in:
Peter Morton 2023-10-12 18:01:17 -05:00
parent 9728959b5e
commit 300abb5360
9 changed files with 59 additions and 50 deletions

View File

@ -2,7 +2,7 @@
The is a single page application built using Vite (<https://vitejs.dev/>) The is a single page application built using Vite (<https://vitejs.dev/>)
Example URL for Account View <http://localhost:5173/customerAccount/1234/?ani=+13125138223&dnis=unknown&queue=GeneralInquires&direction=INBOUND&channel=AmazonConnect&type=Voice&_sessionIdentifier=bc93f1fc> Example URL for Account View <http://localhost:5173/telephonyContext/?ani=+13125138223&dnis=unknown&queue=GeneralInquires&direction=INBOUND&channel=AmazonConnect&type=Voice&_sessionIdentifier=bc93f1fc>
## Project setup ## Project setup

View File

@ -4,10 +4,9 @@ export default {
}; };
</script> </script>
<template> <template>
<!-- <router-view class="view sidebar" name="SideBarView"></router-view> --> <!-- <router-view class="view sidebar" name="SideBarView"></router-view> -->
<router-view class="view main-content"></router-view>
<router-view class="view main-content"></router-view>
</template> </template>
<style lang="scss"> <style lang="scss">
@import url("https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600"); @import url("https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600");

View File

@ -1,27 +1,26 @@
<script> <script>
// This template uses https://vuejs.org/guide/extras/render-function.html to // This template uses https://vuejs.org/guide/extras/render-function.html to
// create DOM elements from properties // create DOM elements from properties
import { h } from 'vue' import { h } from "vue";
export default { export default {
props: { props: {
summary: { type: String, default: "<h2>Summary Should go here</h2>" } summary: { type: String, default: "<h2>Summary Should go here</h2>" },
}, },
setup(props) { setup(props) {
// return the render function
// return the render function return () => h("div", { class: "bar", innerHTML: props.summary });
return () => h('div', { class: 'bar', innerHTML: props.summary }) },
} };
}
</script> </script>
<style> <style>
span.customer { span.customer {
color: #ff0000; color: #ff0000;
font-weight: bold; font-weight: bold;
} }
span.iva { span.iva {
color: #0000a0; color: #0000a0;
font-weight: bold; font-weight: bold;
} }
</style> </style>

View File

@ -1,17 +1,24 @@
<script setup> <script setup>
// eslint-disable-next-line // eslint-disable-next-line
const props = defineProps(["label", "value"]); const props = defineProps(["label", "value"]);
const rows = Math.ceil(props.value.length/18); const rows = Math.ceil(props.value.length / 18);
</script> </script>
<template> <template>
<div class="vertical-layout-cell"> <div class="vertical-layout-cell">
<div class="GTTextLabel GTRTextLabel" :title="label" style="">{{ label }}</div> <div class="GTTextLabel GTRTextLabel" :title="label" style="">
</div> {{ label }}
<div class="vertical-layout-cell">
<textarea
:value="value" class="GTTextField read-only" :title="label" type="textarea" readonly="" :rows="rows"
maxlength="1024" />
</div> </div>
</div>
<div class="vertical-layout-cell">
<textarea
:value="value"
class="GTTextField read-only"
:title="label"
type="textarea"
readonly=""
:rows="rows"
maxlength="1024"
/>
</div>
</template> </template>
<style></style> <style></style>

View File

@ -1,12 +1,14 @@
export function getAuthKeyFromProperties(props) { export function getAuthKeyFromProperties(props) {
var authKey; var authKey;
if (props.sessionIdentifier && props.sessionIdentifier.length > 0) { if (props.sessionIdentifier && props.sessionIdentifier.length > 0) {
authKey = props.sessionIdentifier; authKey = props.sessionIdentifier;
} else if (props.username && props.username.length > 0) { } else if (props.username && props.username.length > 0) {
authKey = props.username; authKey = props.username;
} else { } else {
throw new Error('_sessionIdentifier or username properties not found (check query params)'); throw new Error(
"_sessionIdentifier or username properties not found (check query params)"
);
} }
return authKey return authKey;
} }

View File

@ -49,7 +49,7 @@ const routes = [
default: (route) => ({ default: (route) => ({
...route.params, ...route.params,
...route.query, ...route.query,
sessionIdentifier: route.query._sessionIdentifier sessionIdentifier: route.query._sessionIdentifier,
}), }),
}, },
}, },

View File

@ -1,6 +1,6 @@
<script setup> <script setup>
import { ref, onMounted } from "vue"; import { ref, onMounted } from "vue";
import { getAuthKeyFromProperties } from '../helpers/index' import { getAuthKeyFromProperties } from "../helpers/index";
import * as d3 from "d3"; import * as d3 from "d3";
import * as align from "d3-sankey"; import * as align from "d3-sankey";
@ -43,7 +43,8 @@ function fetchData() {
return; return;
} }
fetch( fetch(
`${import.meta.env.VITE_EO_SERVICES_URL}/api/interactions-flow?filter=${multiSelected.value `${import.meta.env.VITE_EO_SERVICES_URL}/api/interactions-flow?filter=${
multiSelected.value
}&authKey=${authKey}`, }&authKey=${authKey}`,
{ {
credentials: "include", // fetch won't send cookies unless you set credentials credentials: "include", // fetch won't send cookies unless you set credentials
@ -99,9 +100,9 @@ function generateSankey(data) {
.nodeId((d) => d.name) .nodeId((d) => d.name)
.nodeAlign( .nodeAlign(
align[ align[
`sankey${alignSelected.value[0].toUpperCase()}${alignSelected.value.slice( `sankey${alignSelected.value[0].toUpperCase()}${alignSelected.value.slice(
1 1
)}` )}`
] ]
) // d3.sankeyLeft, etc. ) // d3.sankeyLeft, etc.
.nodeWidth(15) .nodeWidth(15)
@ -173,10 +174,10 @@ function generateSankey(data) {
linkColor === "source-target" linkColor === "source-target"
? (d) => `url(#${d.uid})` ? (d) => `url(#${d.uid})`
: linkColor === "source" : linkColor === "source"
? (d) => color(d.source.category) ? (d) => color(d.source.category)
: linkColor === "target" : linkColor === "target"
? (d) => color(d.target.category) ? (d) => color(d.target.category)
: linkColor : linkColor
) )
.attr("stroke-width", (d) => Math.max(1, d.width)); .attr("stroke-width", (d) => Math.max(1, d.width));

View File

@ -1,6 +1,6 @@
<script setup> <script setup>
import { ref } from "vue"; import { ref } from "vue";
import { getAuthKeyFromProperties } from '../helpers/index' import { getAuthKeyFromProperties } from "../helpers/index";
import ContactTable from "../components/ContactTable.vue"; import ContactTable from "../components/ContactTable.vue";
import ContactsSummary from "../components/ContactsSummary.vue"; import ContactsSummary from "../components/ContactsSummary.vue";

View File

@ -1,7 +1,7 @@
<script setup> <script setup>
import { ref, onMounted, h } from "vue"; import { ref, onMounted } from "vue";
import VerticalLabelValue from "../components/VerticalLabelValue.vue"; import VerticalLabelValue from "../components/VerticalLabelValue.vue";
import { getAuthKeyFromProperties } from '../helpers/index' import { getAuthKeyFromProperties } from "../helpers/index";
import ErrorMessage from "../components/ErrorMessage.vue"; import ErrorMessage from "../components/ErrorMessage.vue";
import TransferSummary from "../components/TransferSummary.vue"; import TransferSummary from "../components/TransferSummary.vue";
@ -36,9 +36,11 @@ function fetchData() {
errorMessage.value = error; errorMessage.value = error;
return; return;
} }
console.log(`Fetching TPS Property ${props.transferSummary}`) console.log(`Fetching TPS Property ${props.transferSummary}`);
fetch( fetch(
`${import.meta.env.VITE_EO_SERVICES_URL}/api/tps?propertyName=${props.transferSummary}&authKey=${authKey}`, `${import.meta.env.VITE_EO_SERVICES_URL}/api/tps?propertyName=${
props.transferSummary
}&authKey=${authKey}`,
{ {
credentials: "include", // fetch won't send cookies unless you set credentials credentials: "include", // fetch won't send cookies unless you set credentials
} }
@ -51,7 +53,7 @@ function fetchData() {
return Promise.reject(error); return Promise.reject(error);
} }
response.json().then((data) => { response.json().then((data) => {
console.log("Found Property:" + JSON.stringify(data)) console.log("Found Property:" + JSON.stringify(data));
transferSummaryBlock.value = data.data.value; transferSummaryBlock.value = data.data.value;
}); });
}) })
@ -60,7 +62,6 @@ function fetchData() {
errorMessage.value = `${error} for TPS property ${props.transferSummary}`; errorMessage.value = `${error} for TPS property ${props.transferSummary}`;
}); });
} }
</script> </script>
<template> <template>
<h2>Summary</h2> <h2>Summary</h2>
@ -97,7 +98,7 @@ function fetchData() {
style="width: 25%" style="width: 25%"
> >
<h3>Da Vinci Transfer Summary</h3> <h3>Da Vinci Transfer Summary</h3>
<TransferSummary :summary="transferSummaryBlock"/> <TransferSummary :summary="transferSummaryBlock" />
</div> </div>
<div <div
class="blockOuterSpacingRight col3 column-layout-cell" class="blockOuterSpacingRight col3 column-layout-cell"