Skip to content

Feature/four 12645: Update Breadcrumbs with Categories and process #5745

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 6 commits into from
Dec 4, 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
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ public function index(Request $request)
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function open(Process $process)
public function open(Process $process, Request $request)
{
return view('processes-catalogue.open', compact('process'));
$category = $request->input('category') ?? 0;
return view('processes-catalogue.open', compact('process', 'category'));
}
}
19 changes: 16 additions & 3 deletions resources/js/processes-catalogue/components/Breadcrumbs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
</li>

<li v-if="category" class="breadcrumb-item">
<a :href="categoryRoute" :aria-label="category">
{{ category }}
<a :aria-label="categoryName">
{{ categoryName }}
</a>
</li>

Expand All @@ -29,14 +29,27 @@
<script>
export default {
router: window.ProcessMaker.Router,
props: ["process", "categoryRoute", "category"],
props: ["process", "category"],
data() {
return {
categoryName: "",
};
},
mounted() {
this.getCategory();
},
methods: {
getCategory(value = "") {
if (value) {
this.categoryName = value;
} else if (this.category) {
ProcessMaker.apiClient
.get(`process_categories/${this.category}`)
.then((response) => {
this.categoryName = response.data.name;
});
}
},
},
};
</script>
46 changes: 39 additions & 7 deletions resources/js/processes-catalogue/components/ProcessInfo.vue
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
<template>
<div>
<breadcrumbs />
<breadcrumbs
ref="breadcrumb"
:category="selectCategory"
:process="process.name"
/>
<b-row>
<b-col cols="2">
<h4>{{ $t("Processes Browser") }}</h4>
<!--
Menu Catalogue FOUR-12111
<MenuCatologue
:data="listCategories"
:select="selectCategorie"
class="mt-3"
/>
-->
</b-col>
<b-col cols="10">
<div class="d-flex">
Expand All @@ -37,18 +38,49 @@
</template>

<script>
import MenuCatologue from "./menuCatologue.vue";
import ProcessesCarousel from "../components/ProcessesCarousel.vue";
import ProcessMap from "./ProcessMap.vue";
import ProcessOptions from "./ProcessOptions.vue";
import Breadcrumbs from "./Breadcrumbs.vue";

export default {
components: { ProcessOptions, Breadcrumbs, ProcessMap, ProcessesCarousel },
props: ["process", "permission", "isDocumenterInstalled", "currentUserId"],
components: {
ProcessOptions,
Breadcrumbs,
ProcessMap,
MenuCatologue,
ProcessesCarousel,
},
props: ["process", "permission", "isDocumenterInstalled", "currentUserId", "category"],
data() {
return {
fields: [],
listCategories: [],
selectCategory: 0,
};
},
created() {
this.selectCategory = this.selectedCategory();
this.getCategories();
},
methods: {
selectedCategory() {
if (this.category) {
return this.category;
}
const categories = this.process.process_category_id;
return typeof categories === "string" ? categories.split(",")[0] : categories;
},
getCategories() {
ProcessMaker.apiClient
.get("process_categories")
.then((response) => {
this.listCategories = response.data.data;
});
},
selectCategorie(value) {
// TODO Flow from processInfo to ProcessesCtalogue
},
},
};
</script>
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<template>
<div>
<breadcrumbs />
<breadcrumbs
ref="breadcrumb"
:category="category ? category.id : ''"
/>
<b-row>
<b-col cols="2">
<h4> {{ $t('Processes Browser') }} </h4>
Expand Down Expand Up @@ -74,6 +77,7 @@ export default {
},
selectCategorie(value) {
this.category = value;
this.$refs.breadcrumb.getCategory(value.name);
this.showCardProcesses = true;
this.showWizardTemplates = false;
},
Expand Down
1 change: 1 addition & 0 deletions resources/views/processes-catalogue/open.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<div id="open-process" class="px-3 page-content mb-0">
<process-info
:process="{{$process}}"
:category="{{$category}}"
:current-user-id="{{ \Auth::user()->id }}"
:permission="{{ \Auth::user()->hasPermissionsFor('processes', 'process-templates', 'pm-blocks') }}"
is-documenter-installed="{{\ProcessMaker\PackageHelper::isPmPackageProcessDocumenterInstalled()}}"
Expand Down