Skip to content

feature/FOUR-12111: Process Browser - List Available Process #5707

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions resources/js/processes-catalogue/components/CardProcess.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<template>
<b-card>
title
</b-card>
</template>
25 changes: 25 additions & 0 deletions resources/js/processes-catalogue/components/CatalogueEmpty.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<template>
<div>
<div class="d-flex justify-content-center my-5">
<img
class="image d-flex"
src="/img/processes-catalogue-empty.svg"
alt="recent projects"
>
</div>
<h4 class="text-center">
{{ $t('Currently you dont have processes created') }}
</h4>
<p class="text-center">
{{ $t('We encourage you to create new processes using our templates') }}
</p>
<p class="text-center my-4">
<button
type="button"
class="btn btn-primary text-capitalize"
>
{{ $t("Show Me The Templates") }}
</button>
</p>
</div>
</template>
64 changes: 33 additions & 31 deletions resources/js/processes-catalogue/components/ProcessesCatalogue.vue
Original file line number Diff line number Diff line change
@@ -1,53 +1,55 @@
<template>
<div>
<breadcrumbs />
<div class="d-flex w-100">
<div class="w-25">
<b-row>
<b-col cols="2">
<h4> {{ $t('Processes Browser') }} </h4>
</div>
<div class="w-100">
<div v-if="!fields.length" class="d-flex justify-content-center py-5 w-100">
<div>
<div class="d-flex justify-content-center my-5">
<img
class="image d-flex"
src="/img/processes-catalogue-empty.svg"
alt="recent projects"
>
</div>
<h4 class="text-center">
{{ $t('Currently you dont have processes created') }}
</h4>
<p class="text-center">
{{ $t('We encourage you to create new processes using our templates') }}
</p>
<p class="text-center my-4">
<button
type="button"
class="btn btn-primary text-capitalize"
>
{{ $t("Show Me The Templates") }}
</button>
</p>
</div>
<MenuCatologue
:data="listCategories"
:select="selectCategorie"
class="mt-3"
/>
</b-col>
<b-col cols="10">
<div
v-if="!fields.length"
class="d-flex justify-content-center py-5"
>
<CatalogueEmpty />
</div>
</div>
</div>
</b-col>
</b-row>
</div>
</template>

<script>
import MenuCatologue from "./menuCatologue.vue";
import CatalogueEmpty from "./CatalogueEmpty.vue";

import Breadcrumbs from "./Breadcrumbs.vue";

export default {
components: { Breadcrumbs },
components: { MenuCatologue, CatalogueEmpty, Breadcrumbs },
data() {
return {
listCategories: [],
fields: [],
};
},
mounted() {
this.getCategories();
},
methods: {
getCategories() {
ProcessMaker.apiClient
.get("process_categories")
.then((response) => {
this.listCategories = response.data.data;
});
},
selectCategorie(value) {
console.log(value);
},
},
};
</script>
83 changes: 83 additions & 0 deletions resources/js/processes-catalogue/components/menuCatologue.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<template>
<div>
<div
v-b-toggle.collapse-3
block
variant="light"
class="m-1"
>
<div class="d-flex justify-content-between pl-3 pr-3">
<i class="fas fa-play-circle" />
{{ $t("Avaible Processses") }}
<i class="fas fa-sort-down" />
</div>
</div>
<b-collapse
id="collapse-3"
visible
>
<b-list-group>
<b-list-group-item
v-for="item in data"
:key="item.id"
:ref="item.name"
class="list-item"
@click="selectItem(item)"
>
{{ item.name }}
</b-list-group-item>
</b-list-group>
</b-collapse>
</div>
</template>

<script>
export default {
props: ["data", "select"],
methods: {
selectItem(item) {
this.setSelectItem(item.name);
this.select(item);
},
setSelectItem(item) {
for (const item in this.$refs) {
this.$refs[item][0].className = "list-item";
}
this.$refs[item][0].className = "list-item list-item-selected";
},
},
};
</script>

<style scoped>
i {
font-size: 20px;
color: #6A7888;
}
.list-group {
max-height: 40vh;
overflow-y: auto;
}
.list-group-item {
background: #f7f9fb;
border: none;
}
.list-item {
cursor: pointer;
padding-bottom: 0.25rem;
padding-top: 0.25rem;
padding-left: 1rem;
margin-left: 1rem;
margin-bottom: 0.25rem;
color: #4F606D;
font-weight: 400;
}
.list-item:hover {
background: #E5EDF3;
}
.list-item-selected {
background: #E5EDF3;
color: #1572C2;
font-weight: 700;
}
</style>