Skip to content
This repository has been archived by the owner on Oct 30, 2023. It is now read-only.

Commit

Permalink
Merge pull request #357 from FlowzPlatform/QA
Browse files Browse the repository at this point in the history
Qa
  • Loading branch information
chiragob committed Sep 4, 2018
2 parents b6f5f95 + 0b5685c commit 7f8637a
Show file tree
Hide file tree
Showing 31 changed files with 3,098 additions and 957 deletions.
3 changes: 3 additions & 0 deletions client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
<script src="/static/js/grapesjs-component-countdown.min.js"></script>
<script src="/static/js/grapesjs-navbar.min.js"></script>

<!-- CanvasJS -->
<script type="text/javascript" src="https://canvasjs.com/assets/script/canvasjs.min.js"></script>

<!-- Grapes MJML COmponent -->
<!-- <link href="http://grapesjs.com/stylesheets/grapes.min.css?v0.12.25" rel="stylesheet"/>
<script src="http://grapesjs.com/js/grapes.min.js?v0.12.25"></script>
Expand Down
1 change: 1 addition & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"dependencies": {
"@deveodk/vue-tinymce": "^1.0.0",
"@feathersjs/errors": "^3.3.0",
"@tinymce/tinymce-vue": "^1.0.8",
"FormData": "^0.10.1",
"animate.css": "^3.5.2",
"aws": "0.0.3-2",
Expand Down
341 changes: 265 additions & 76 deletions client/src/area/Dashboard.vue
Original file line number Diff line number Diff line change
@@ -1,89 +1,278 @@
<template>
<div class="dashboard">
Dashboard {{$store.state.role}}
<div v-if="$store.state.role === 1">

<div class="row">
<div class="col-md-3">
<div class="card-counter primary">
<i class="fa fa-code-fork"></i>
<span class="count-numbers">{{countFlowz}}</span>
<span class="count-name">Flowz</span>
</div>
</div>

<div class="col-md-3">
<div class="card-counter danger">
<i class="fa fa-ticket"></i>
<span class="count-numbers">{{countInstances}}</span>
<span class="count-name">Instances</span>
</div>
</div>

<div class="col-md-3">
<div class="card-counter success">
<i class="fa fa-database"></i>
<span class="count-numbers">{{countData}}</span>
<span class="count-name">Data</span>
</div>
</div>

<div class="col-md-3">
<div class="card-counter info">
<i class="fa fa-users"></i>
<span class="count-numbers">{{countUsers}}</span>
<span class="count-name">Users</span>
</div>
</div>
</div>
<!-- <div class="row">
<div id="chartContainer" style="height: 370px; width: 100%;"></div>
<button class="btn " id="backButton" @click="backButton">&lt; Back</button>
</div> -->
</div>
</div>
</template>

<script>
/*eslint-disable*/
import flowzModel from '../api/flowz'
import finstanceModel from '../api/finstance'
import flowzDataModel from '../api/flowzdata'
export default {
name: 'dashboard'
}
</script>

<!-- <template>
<Form ref="formDynamic" :model="formDy" :label-width="80">
<FormItem
v-for="(item, index) in formDy.items"
:key="index"
:label="'name ' + (index + 1)"
:prop="'items.' + index + '[' + "'candidate name'" + ']'"
:rules="{required: true, message: 'name' + (index + 1) +'required', trigger: 'blur'}">
<Row>
<Col span="18">
<Input type="text" v-model="item['candidate name']" placeholder="Enter..."></Input>
</Col>
<Col span="4" offset="1">
<Button type="ghost" @click="handleRemove(index)">Del</Button>
</Col>
</Row>
</FormItem>
<FormItem>
<Row>
<Col span="12">
<Button type="dashed" long @click="handleAdd('formDynamic')" icon="plus-round">Add</Button>
</Col>
</Row>
</FormItem>
<FormItem>
<Button type="primary" @click="handleSubmit('formDynamic')">Submit</Button>
<Button type="ghost" @click="handleReset('formDynamic')" style="margin-left: 8px">Cancel</Button>
</FormItem>
</Form>
</template>
<script>
export default {
name: 'dashboard',
data () {
return {
formDy: {
items: [
{
'candidate name': ''
}
]
}
}
name: 'dashboard',
data () {
return {
countFlowz: null,
countInstances: null,
countData: null,
countUsers: null,
// chart: {
totalVisitors: 883000,
visitorsData: {
"New vs Returning Visitors": [{
click: this.visitorsChartDrilldownHandler,
cursor: "pointer",
explodeOnClick: false,
innerRadius: "75%",
legendMarkerType: "square",
name: "New vs Returning Visitors",
radius: "100%",
showInLegend: true,
startAngle: 90,
type: "doughnut",
dataPoints: [
{ y: 519960, name: "New Visitors", color: "#E7823A" },
{ y: 363040, name: "Returning Visitors", color: "#546BC1" }
]
}],
"New Visitors": [{
color: "#E7823A",
name: "New Visitors",
type: "column",
dataPoints: [
{ x: new Date("1 Jan 2015"), y: 33000 },
{ x: new Date("1 Feb 2015"), y: 35960 },
{ x: new Date("1 Mar 2015"), y: 42160 },
{ x: new Date("1 Apr 2015"), y: 42240 },
{ x: new Date("1 May 2015"), y: 43200 },
{ x: new Date("1 Jun 2015"), y: 40600 },
{ x: new Date("1 Jul 2015"), y: 42560 },
{ x: new Date("1 Aug 2015"), y: 44280 },
{ x: new Date("1 Sep 2015"), y: 44800 },
{ x: new Date("1 Oct 2015"), y: 48720 },
{ x: new Date("1 Nov 2015"), y: 50840 },
{ x: new Date("1 Dec 2015"), y: 51600 }
]
}],
"Returning Visitors": [{
color: "#546BC1",
name: "Returning Visitors",
type: "column",
dataPoints: [
{ x: new Date("1 Jan 2015"), y: 22000 },
{ x: new Date("1 Feb 2015"), y: 26040 },
{ x: new Date("1 Mar 2015"), y: 25840 },
{ x: new Date("1 Apr 2015"), y: 23760 },
{ x: new Date("1 May 2015"), y: 28800 },
{ x: new Date("1 Jun 2015"), y: 29400 },
{ x: new Date("1 Jul 2015"), y: 33440 },
{ x: new Date("1 Aug 2015"), y: 37720 },
{ x: new Date("1 Sep 2015"), y: 35200 },
{ x: new Date("1 Oct 2015"), y: 35280 },
{ x: new Date("1 Nov 2015"), y: 31160 },
{ x: new Date("1 Dec 2015"), y: 34400 }
]
}]
},
methods: {
handleSubmit (name) {
// alert(name)
this.$refs[name].validate((valid) => {
if (valid) {
this.$Message.success('Success!')
} else {
this.$Message.error('Error!')
}
})
// },
newVSReturningVisitorsOptions: {
animationEnabled: true,
theme: "light2",
title: {
text: "New VS Returning Visitors"
},
handleReset (name) {
this.$refs[name].resetFields()
subtitles: [{
text: "Click on Any Segment to Drilldown",
backgroundColor: "#2eacd1",
fontSize: 16,
fontColor: "white",
padding: 5
}],
legend: {
fontFamily: "calibri",
fontSize: 14,
itemTextFormatter: (e) => {
return e.dataPoint.name + ": " + Math.round(e.dataPoint.y / this.totalVisitors * 100) + "%";
}
},
handleAdd (name) {
this.$refs[name].validate((valid) => {
// alert(valid)
if (valid) {
// this.$Message.success('Success!')
this.formDy.items.push({
'candidate name': ''
})
} else {
this.$Message.error('Error!')
}
})
data: []
},
visitorsDrilldownedChartOptions: {
animationEnabled: true,
theme: "light2",
axisX: {
labelFontColor: "#717171",
lineColor: "#a2a2a2",
tickColor: "#a2a2a2"
},
handleRemove (index) {
this.formDy.items.splice(index, 1)
}
}
axisY: {
gridThickness: 0,
includeZero: false,
labelFontColor: "#717171",
lineColor: "#a2a2a2",
tickColor: "#a2a2a2",
lineThickness: 1
},
data: []
},
chart: null
}
</script> -->
},
methods: {
init () {
flowzModel.get(null, {})
.then((res) => {
this.countFlowz = res.data.total
})
finstanceModel.get(null, {})
.then((res) => {
this.countInstances = res.data.total
})
flowzDataModel.get(null, {})
.then((res) => {
console.log('resp data:', res)
this.countData = res.total
})
},
visitorsChartDrilldownHandler(e) {
this.chart = new CanvasJS.Chart("chartContainer", this.visitorsDrilldownedChartOptions);
this.chart.options.data = this.visitorsData[e.dataPoint.name];
this.chart.options.title = { text: e.dataPoint.name }
this.chart.render();
// $("#backButton").toggleClass("invisiblex")
},
backButton () {
this.chart = new CanvasJS.Chart("chartContainer", this.newVSReturningVisitorsOptions);
this.chart.options.data = this.visitorsData["New vs Returning Visitors"];
this.chart.render()
}
},
mounted () {
this.init()
this.chart = new CanvasJS.Chart("chartContainer", this.newVSReturningVisitorsOptions);
this.chart.options.data = this.visitorsData["New vs Returning Visitors"];
this.chart.render();
}
}
</script>
<style scoped>
.card-counter{
box-shadow: 2px 2px 10px #DADADA;
margin: 5px;
padding: 20px 10px;
background-color: #fff;
height: 100px;
border-radius: 5px;
transition: .3s linear all;
}
.card-counter:hover{
box-shadow: 4px 4px 20px #DADADA;
transition: .3s linear all;
}
.card-counter.primary{
background-color: #007bff;
color: #FFF;
}
.card-counter.danger{
background-color: #ef5350;
color: #FFF;
}
.card-counter.success{
background-color: #66bb6a;
color: #FFF;
}
.card-counter.info{
background-color: #26c6da;
color: #FFF;
}
.card-counter i{
font-size: 5em;
opacity: 0.2;
}
.card-counter .count-numbers{
position: absolute;
right: 35px;
top: 20px;
font-size: 32px;
display: block;
}
.card-counter .count-name{
position: absolute;
right: 35px;
top: 65px;
font-style: italic;
text-transform: capitalize;
opacity: 0.5;
display: block;
font-size: 18px;
}
</style>
<style>
#backButton {
border-radius: 4px;
padding: 8px;
border: none;
font-size: 16px;
background-color: #2eacd1;
color: white;
position: absolute;
top: 10px;
right: 10px;
cursor: pointer;
}
.invisiblex {
display: none;
}
</style>
5 changes: 3 additions & 2 deletions client/src/components/ListInstances.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,9 @@ export default {
// // let currentState = resp.currentStatus.toLowerCase()
// // let schemaId = resp[currentState].schemaId
let currentObj = _.find(this.flowzData.json.processList, {id: item.currentStatus})
// console.log('this.flowzData.schema', this.flowzData)
let values = {
id: currentObj.inputProperty[0].entityschema.id,
id: this.flowzData.schema,
item: item,
formName: currentObj.name,
currentState: currentObj.id,
Expand Down Expand Up @@ -148,7 +149,7 @@ export default {
query.currentStatus = stateid
}
await flowzModal.get(id, {
$select: ['json']
$select: ['json', 'schema']
}).then(async res => {
this.flowzData = res.data
this.breadItem.name = this.flowzData.json.name
Expand Down
Loading

0 comments on commit 7f8637a

Please sign in to comment.