Skip to content
Prev Previous commit
Next Next commit
Start on process info
  • Loading branch information
nolanpro committed Jun 6, 2024
commit 75f373d77f30429f6890268169568a59a6561301
160 changes: 158 additions & 2 deletions resources/js/processes-catalogue/components/ProcessInfo.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
<template>
<div class="process-info-main">
<div class="mobile-process-nav bg-primary">
<div class="left">
<a href="#" @click.prevent="goBackCategory">
<i class="fas fa-arrow-left" />
</a>
</div>
<div>
<a href="#" @click.prevent="showDetails = !showDetails">
<i class="fas fa-info-circle" />
</a>
</div>
<div class="right">
<a href="#">
<i class="fas fa-bookmark" />
</a>
</div>
</div>
<div class="mobile-process-details" v-if="showDetails">
<h1>{{ $t('Details') }}</h1>
<h2>{{ process.name }}</h2>
<p>{{ process.description }}</p>
<h3>{{ $t('Version') }} {{ processVersion }}</h3>
<h1 class="started-cases-title">{{ $t('Started Cases') }}</h1>
<p class="started-cases">1,234</p>
<div class="mini-charts">
<div class="pie" :style="inProgressPie"></div>
<div>{{ inProgressPercent }}% {{ $t('In Progress') }}</div>
<div class="pie" :style="completedPie"></div>
<div>{{ completedPercent }}% {{ $t('Completed') }}</div>
</div>
</div>
<process-collapse-info
v-show="hideLaunchpad"
:process="process"
Expand Down Expand Up @@ -55,6 +86,7 @@ export default {
firstImage: 0,
lastImage: null,
indexSelectedImage: 0,
showDetails: false,
};
},
mounted() {
Expand All @@ -71,6 +103,40 @@ export default {
this.$root.$on("carouselImageSelected", (pos) => {
this.firstImage = pos + 1;
});

// this.$refs.pie.$el.style.backgroundImage = "conic-gradient(white 75%, green 25%)";

window.ProcessMaker.navbarMobile.display = false;
},
beforeDestroy() {
window.ProcessMaker.navbarMobile.display = true;
Comment thread
gproly marked this conversation as resolved.
Resolved
},
computed: {
processVersion() {
return moment(this.process.updated_at).format();
},
inProgressPercent() {
return 25;
},
completedPercent() {
return 75;
},
inProgressPie() {
const color = "#4EA075";
const percent = this.inProgressPercent;
return {
backgroundImage: `conic-gradient(${color} 0%, ${color} ${percent}%, white ${percent}%, white 100%)`,
borderColor: color,
};
},
completedPie() {
const color = "#478FCC";
const percent = this.completedPercent;
return {
backgroundImage: `conic-gradient(${color} 0%, ${color} ${percent}%, white ${percent}%, white 100%)`,
borderColor: color,
};
},
},
methods: {
/**
Expand All @@ -81,13 +147,103 @@ export default {
},
closeFullCarousel() {
this.$root.$emit("clickCarouselImage", false);
}
},
},
};
</script>

<style lang="css" scoped>
<style scoped lang="scss">
@import '~styles/variables';
.process-info-main {
overflow-y: auto;
}

.mobile-process-nav {
display: none;

div {
flex: 1;
text-align: center;
}

.left {
text-align: left;
}

.right {
text-align: right;
}

i {
display: block;
color: #FFFFFF;
padding: 1em;
font-size: 1.5em;
}

@media (max-width: $lp-breakpoint) {
display: flex;
flex-direction: row;
}
}

.mobile-process-details {
@media (min-width: $lp-breakpoint) {
display: none;
}

width: 100%;
position: absolute;
z-index: 5;
padding: 1em;
background-color: white;
box-shadow: 0px 8px 8px #00000021;

h1 {
font-size: 1.5em;
font-weight: 600;
color: $primary;
}

h2 {
font-size: 1em;
font-weight: 600;
color: $primary;
}

p {
font-size: 1em;
}

p.started-cases {
font-size: 3em;
}

h1.started-cases-title {
margin-bottom: 0;
padding-top: 0.5em;
}

h3 {
font-size: 1em;
color: $secondary;
}
}

.mini-charts {
display: flex;
align-items: center;
font-style: italic;
color: $secondary;

div {
margin-right: 8px;
}
}
.pie {
width: 20px;
height: 20px;
border-radius: 50%;
border: 2px solid;
}
</style>
15 changes: 13 additions & 2 deletions resources/js/processes-catalogue/components/ProcessListing.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div>
<div class="process-listing">

<CardProcess
v-if="!isTemplateCategory"
Expand Down Expand Up @@ -29,4 +29,15 @@ export default {
},
}
};
</script>
</script>

<style lang="scss" scoped>
@import '~styles/variables';

.process-listing {
@media (max-width: $lp-breakpoint) {
padding-left: 1em;
padding-right: 1em;
}
}
</style>
75 changes: 14 additions & 61 deletions resources/js/processes-catalogue/components/ProcessesCatalogue.vue
Original file line number Diff line number Diff line change
@@ -1,22 +1,5 @@
<template>
<div>
<div class="mobile-process-nav bg-primary" v-if="showCustomMobileNav">
<div class="left">
<a href="#" @click.prevent="goBackCategory">
<i class="fas fa-arrow-left" />
</a>
</div>
<div>
<a href="#" @click.prevent="showDetails = !showDetails">
<i class="fas fa-info-circle" />
</a>
</div>
<div class="right">
<a href="#">
<i class="fas fa-bookmark" />
</a>
</div>
</div>
<breadcrumbs
ref="breadcrumb"
:category="category ? category.name : ''"
Expand Down Expand Up @@ -122,8 +105,6 @@ export default {
fromProcessList: false,
categoryCount: 0,
hideLaunchpad: true,
showCustomMobileNav: false,
showDetails: false,
};
},
mounted() {
Expand All @@ -136,19 +117,19 @@ export default {
}
},
watch: {
$route: {
immediate: true,
handler() {
// if we are viewing a process, use our custom mobile nav
if (this.$route?.name === "show") {
this.showCustomMobileNav = true;
window.ProcessMaker.navbarMobile.display = false;
} else {
this.showCustomMobileNav = false;
window.ProcessMaker.navbarMobile.display = true;
}
}
},
// $route: {
// immediate: true,
// handler() {
// // if we are viewing a process, use our custom mobile nav
// if (this.$route?.name === "show") {
// this.showCustomMobileNav = true;
// window.ProcessMaker.navbarMobile.display = false;
// } else {
// this.showCustomMobileNav = false;
// window.ProcessMaker.navbarMobile.display = true;
// }
// }
// },
Comment thread
gproly marked this conversation as resolved.
Resolved
category: {
deep: true,
handler() {
Expand Down Expand Up @@ -399,6 +380,7 @@ export default {
color: #6A7887;
font-size: 1.3em;
margin-top: 10px;
margin-left: 1em;
i {
margin-right: 3px;
}
Expand Down Expand Up @@ -438,33 +420,4 @@ export default {
// }
// }


.mobile-process-nav {
display: none;

div {
flex: 1;
text-align: center;
}

.left {
text-align: left;
}

.right {
text-align: right;
}

i {
display: block;
color: #FFFFFF;
padding: 1em;
font-size: 1.5em;
}

@media (max-width: $lp-breakpoint) {
display: flex;
flex-direction: row;
}
}
</style>