Skip to content

Implement UI for Displaying Wizard Templates #5709

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 24 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
1b3408d
Adding Open Launchpad to Process ellipsis
CarliPinell Nov 13, 2023
8c1bfbf
Merge pull request #5617 from ProcessMaker/feature/FOUR-11542
pmPaulis Nov 14, 2023
484fed2
feature/FOUR-12396
luNunezProcessmaker Nov 15, 2023
8bd9350
feature/FOUR-12396
luNunezProcessmaker Nov 15, 2023
1edcb9a
feature/FOUR-12396
luNunezProcessmaker Nov 16, 2023
26c9591
Merge branch 'feature/FOUR-12396' of https://github.com/ProcessMaker/…
luNunezProcessmaker Nov 16, 2023
37c49ab
Merge remote-tracking branch 'origin/next' into feature/FOUR-11531
pmPaulis Nov 16, 2023
d009ce8
feature/FOUR-12396
luNunezProcessmaker Nov 15, 2023
362e065
feature/FOUR-12396
luNunezProcessmaker Nov 15, 2023
e6c607a
feature/FOUR-12396
luNunezProcessmaker Nov 16, 2023
6e58fef
feature/FOUR-12396
luNunezProcessmaker Nov 21, 2023
ac37194
Merge branch 'feature/FOUR-12396' of https://github.com/ProcessMaker/…
luNunezProcessmaker Nov 21, 2023
4439449
feature/FOUR-12396
luNunezProcessmaker Nov 21, 2023
e229ebd
feature/FOUR-12396
luNunezProcessmaker Nov 21, 2023
87fd46e
feature/FOUR-12318
luNunezProcessmaker Nov 21, 2023
56784b0
Merge pull request #5634 from ProcessMaker/feature/FOUR-12396
pmPaulis Nov 21, 2023
602dbc8
Merge pull request #5677 from ProcessMaker/feature/FOUR-12318
pmPaulis Nov 21, 2023
a6a6119
FOUR-12581:Process Launchpad: Create the initial mockup
fagubla Nov 27, 2023
ded7370
Merge pull request #5703 from ProcessMaker/feature/FOUR-12581
pmPaulis Nov 27, 2023
9361ebc
Initial Wizard Template Setup
sanjacornelius Nov 28, 2023
81ba6ef
Update wizard template card styling
sanjacornelius Nov 28, 2023
54839e0
Implement template mixin; Resolve issue when selecting template card
sanjacornelius Nov 28, 2023
727e665
Implement UI listing for wizard templates
sanjacornelius Nov 28, 2023
41b294e
Generate link to display Wizard Templates
sanjacornelius Nov 28, 2023
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
29 changes: 29 additions & 0 deletions ProcessMaker/Http/Controllers/ProcessesCatalogueController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace ProcessMaker\Http\Controllers;

use Illuminate\Http\Request;
use ProcessMaker\Http\Controllers\Controller;
use ProcessMaker\Models\Process;
use ProcessMaker\Models\ProcessCategory;

class ProcessesCatalogueController extends Controller
{
public function index(Request $request)
{
return view('processes-catalogue.index');
}
/**
* @param Process $process
* @param string $id
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function open(Process $process, $id)
{
return view('processes-catalogue.open', [
'process' => $process,
'processId' => $id
]);
}
}
9 changes: 9 additions & 0 deletions ProcessMaker/Http/Middleware/GenerateMenus.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ public function handle(Request $request, Closure $next)
['route' => 'requests.index', 'id' => 'requests']
)->active('requests/*');
});
$menu->group(['prefix' => 'processes'], function ($request_items) {
$request_items->add(
__('Processes'),
['route' => 'processes.catalogue.index', 'id' => 'processes-catalogue']
)->active('processes-catalogue/*');
});
//@TODO change the index to the correct blade
$menu->group(['prefix' => 'tasks'], function ($request_items) {
$request_items->add(
Expand Down Expand Up @@ -127,6 +133,9 @@ public function handle(Request $request, Closure $next)
'id' => 'homeid',
]);
});
Menu::make('sidebar_processes_catalogue', function ($menu) {
$submenu = $menu->add(__('Processes'));
});
Menu::make('sidebar_request', function ($menu) {
$submenu = $menu->add(__('Request'));
$submenu->add(__('My Requests'), [
Expand Down
20 changes: 20 additions & 0 deletions resources/img/processes-catalogue-empty.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions resources/img/wizard-template-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions resources/js/components/shared/ellipsisMenuActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ export default {
icon: "fas fa-pause",
conditional: "if(has_timer_start_events and not(pause_timer_start), true, false)",
},
{
value: "open-launchpad",
content: "Open Launchpad",
link: true,
href: "/processes-catalogue/{{id}}",
permission: ["edit-processes", "create-projects", "view-projects"],
icon: "fas fa-file-export",
},
{
value: "edit-designer",
content: "Edit Process",
Expand Down
99 changes: 99 additions & 0 deletions resources/js/components/templates/DefaultTemplateCard.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
<template>
<div>
<b-card
no-body
class="template-select-card"
@click="showDetails()"
@mouseenter="addHoverClass"
@mouseleave="removeHoverClass"
>
<b-card-body :title="template.name | str_limit(30)" class="card-body">
<b-card-text class="mb-2">
{{ template.description | str_limit(150) }}
</b-card-text>
<b-badge v-for="category in categories" :key="category.id" pill class="category-badge mb-3 mr-1">
{{ category.name }}
</b-badge>
<small v-if="template.categories.length > 3" class="text-muted">+{{ catCount }}</small>
</b-card-body>
</b-card>
</div>
</template>

<script>
import templateMixin from './mixins/template.js';

export default {
mixins: [templateMixin],
props: ['template'],
data() {
return {
thumbnail: null,
catLimit: 3,
};
},
computed: {
categories() {
return this.catLimit ? this.template.categories.slice(0, this.catLimit) : this.template.categories;
},
catCount() {
const { length } = this.template.categories;
return length - this.catLimit;
},
},
methods: {
}
}
</script>

</script>

<style lang="scss" scoped>
.template-select-card {
height: 172px;
border-radius: 4px;
padding: 10px 8px 10px 8px;
overflow: hidden;
border: 2px solid rgba(0, 0, 0, 0.125);

&.hover {
border-color: #1572C2;
cursor: pointer;
}
.card-title {
font-weight: 600;
font-size: 14px;
}

.card-img {
background: #80808017;
height: 112px;
display: flex;
align-items: center;
}

.card-body {
padding: 2px!important;
}

.card-text {
font-size: 12px;
color: #6C757D;
}

.category-badge {
background-color: #DEEBFF;
color: #104A75;
font-size: 12px;
}

}

@media (min-width: 576px) {
.card-deck .card {
margin-left: 9px;
margin-right: 9px;
}
}

</style>
84 changes: 71 additions & 13 deletions resources/js/components/templates/TemplateSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,31 @@
<b-form-input v-model="filter" id="search-box" class="pl-0" :placeholder="$t('Search Templates')"></b-form-input>
</b-input-group>
</div>

<div class="cards-container">
<b-card-group id="template-options" deck class="d-flex small-deck-margin">
<div class="cards-container" :class="type !== 'wizard' ? 'fixed-height' : '' ">
<b-card-group v-if="showTemplateOptionsActionBar && component === 'template-select-card' " id="template-options" deck class="d-flex small-deck-margin">
<button-card
class="col-4 p-0"
v-show="component === 'template-select-card'"
:button="blankProcessButton"
@show-details="showDetails($event)"
@card-button-clicked="$emit('blank-process-button-clicked')"
/>

<div v-if="packageAi" class="col-8 p-0">
<button-card
v-if="component === 'template-select-card'"
:button="aiProcessButton"
@show-details="showDetails($event)"
@card-button-clicked="$emit('ai-process-button-clicked')"
/>
</div>
<div v-if="component === 'template-select-card'" class="d-flex w-100 align-items-center my-3 card-separator">
<small class="mr-2 text-secondary">Templates</small>
<div class="d-flex w-100 align-items-center my-3 card-separator">
<small class="mr-2 text-secondary">{{ $t('Templates') }}</small>
<div class="flex-grow-1 border-bottom"></div>
</div>

</b-card-group>

<div class="pb-2 template-container">
<template v-if="noResults === true">
<template v-if="noResults">
<div class="no-data-icon d-flex d-block justify-content-center pb-2">
<i class="fas fa-umbrella-beach mt-5" />
</div>
Expand All @@ -50,6 +47,7 @@
<template-select-card
v-show="component === 'template-select-card'"
v-for="(template, index) in templates"
:type="type"
:key="index"
:template="template"
@show-details="showDetails($event)"
Expand All @@ -74,7 +72,7 @@
last-number
first-number
></b-pagination>
<div>
<div v-if="showTemplateGalleryLink">
<a href="https://www.processmaker.com/resources/customer-success/templates/"
class="text-muted"
target="_blank">
Expand All @@ -97,7 +95,7 @@ import dataLoadingMixin from "../../components/common/mixins/apiDataLoading";
export default {
components: { ButtonCard, TemplateSelectCard, TemplateDetails },
mixins: [datatableMixin, dataLoadingMixin],
props: ["type", "component", "packageAi"],
props: ["type", "component", "packageAi", 'showTemplateGalleryLink', 'showTemplateOptionsActionBar'],
data() {
return {
filter: "",
Expand Down Expand Up @@ -154,6 +152,63 @@ export default {
? "templates/" + this.type.toLowerCase() +"?"
: "templates/" + this.type.toLowerCase() + "?status=" + this.status + "&";

// TODO: Remove this temporary code to populate the wizard templates
if (this.type === 'wizard') {
this.templates = [
{
id: 1,
name: 'New Hire Onboarding',
shortDescription: 'Keep a constant pulse on employee engagement',
headline: 'Gather real-time Data about how your people feel about work',
description: 'Drive action and measure your impact with a continuous, real-time understanding of employee engagement.',
icon: 'https://cdn-icons-png.flaticon.com/512/1160/1160358.png',
backgroundImage: 'https://images.pexels.com/photos/255379/pexels-photo-255379.jpeg?cs=srgb&dl=pexels-miguel-%C3%A1-padri%C3%B1%C3%A1n-255379.jpg&fm=jpg',
sliderImages: ['https://www.smartinsights.com/wp-content/uploads/2023/11/RACE-Digital-Marketing-Plan-Funnel-2023.png', 'https://blog.hootsuite.com/wp-content/uploads/2021/10/How-to-Create-a-Social-Media-Marketing-Strategy-in-9-Easy-Steps-Free-Template.png'],
helperProcessId: 1,
categories:'1',
},
{
id: 1,
name: 'New Hire Onboarding',
shortDescription: 'Keep a constant pulse on employee engagement',
headline: 'Gather real-time Data about how your people feel about work',
description: 'Drive action and measure your impact with a continuous, real-time understanding of employee engagement.',
icon: 'https://cdn-icons-png.flaticon.com/512/1160/1160358.png',
backgroundImage: 'https://images.pexels.com/photos/255379/pexels-photo-255379.jpeg?cs=srgb&dl=pexels-miguel-%C3%A1-padri%C3%B1%C3%A1n-255379.jpg&fm=jpg',
sliderImages: ['https://www.smartinsights.com/wp-content/uploads/2023/11/RACE-Digital-Marketing-Plan-Funnel-2023.png', 'https://blog.hootsuite.com/wp-content/uploads/2021/10/How-to-Create-a-Social-Media-Marketing-Strategy-in-9-Easy-Steps-Free-Template.png'],
helperProcessId: 1,
categories:'1',
},
{
id: 1,
name: 'New Hire Onboarding',
shortDescription: 'Keep a constant pulse on employee engagement',
headline: 'Gather real-time Data about how your people feel about work',
description: 'Drive action and measure your impact with a continuous, real-time understanding of employee engagement.',
icon: 'https://cdn-icons-png.flaticon.com/512/1160/1160358.png',
backgroundImage: 'https://images.pexels.com/photos/255379/pexels-photo-255379.jpeg?cs=srgb&dl=pexels-miguel-%C3%A1-padri%C3%B1%C3%A1n-255379.jpg&fm=jpg',
sliderImages: ['https://www.smartinsights.com/wp-content/uploads/2023/11/RACE-Digital-Marketing-Plan-Funnel-2023.png', 'https://blog.hootsuite.com/wp-content/uploads/2021/10/How-to-Create-a-Social-Media-Marketing-Strategy-in-9-Easy-Steps-Free-Template.png'],
helperProcessId: 1,
categories:'1',
},
{
id: 1,
name: 'New Hire Onboarding',
shortDescription: 'Keep a constant pulse on employee engagement',
headline: 'Gather real-time Data about how your people feel about work',
description: 'Drive action and measure your impact with a continuous, real-time understanding of employee engagement.',
icon: 'https://cdn-icons-png.flaticon.com/512/1160/1160358.png',
backgroundImage: 'https://images.pexels.com/photos/255379/pexels-photo-255379.jpeg?cs=srgb&dl=pexels-miguel-%C3%A1-padri%C3%B1%C3%A1n-255379.jpg&fm=jpg',
sliderImages: ['https://www.smartinsights.com/wp-content/uploads/2023/11/RACE-Digital-Marketing-Plan-Funnel-2023.png', 'https://blog.hootsuite.com/wp-content/uploads/2021/10/How-to-Create-a-Social-Media-Marketing-Strategy-in-9-Easy-Steps-Free-Template.png'],
helperProcessId: 1,
categories:'1',
},
];
this.totalRow = 1;
this.apiDataLoading = false;
this.apiNoResults = false;
this.noResults = false;
} else {
// Load from our api client
ProcessMaker.apiClient
.get(
Expand Down Expand Up @@ -184,6 +239,7 @@ export default {
.finally(() => {
this.loading = false;
});
}
},
},
mounted() {
Expand Down Expand Up @@ -228,9 +284,11 @@ export default {
margin-right: 0.7rem;
}
.cards-container {
overflow-y: auto;
overflow-x: hidden;
height: 415px;
&.fixed-height {
overflow-y: auto;
overflow-x: hidden;
height: 415px;
}
}
.template-options {
display: flex;
Expand Down
Loading