Skip to content

Commit 047292b

Browse files
Merge pull request #1108 from prabhatkumaroc082/stage-attribute
Fixed #947
2 parents dd69923 + c77fce8 commit 047292b

File tree

3 files changed

+38
-2
lines changed

3 files changed

+38
-2
lines changed

packages/Webkul/Admin/src/Resources/views/settings/workflows/create.blade.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -329,11 +329,17 @@ class="control"
329329
</div>
330330

331331
<div class="form-group" v-if="matchedAttribute.type == 'select' || matchedAttribute.type == 'radio' || matchedAttribute.type == 'lookup'">
332-
<select :name="['actions[' + index + '][value]']" class="control" v-model="action.value">
332+
<select :name="['actions[' + index + '][value]']" class="control" v-model="action.value" v-if="! matchedAttribute.lookup_type">
333333
<option v-for='option in matchedAttribute.options' :value="option.id">
334334
@{{ option.name }}
335335
</option>
336336
</select>
337+
338+
<lookup-component
339+
:attribute="{'code': 'actions[' + index + '][value]', 'name': matchedAttribute.name, 'lookup_type': matchedAttribute.lookup_type}"
340+
validations="required"
341+
v-else
342+
></lookup-component>
337343
</div>
338344

339345
<div class="form-group" v-if="matchedAttribute.type == 'multiselect' || matchedAttribute.type == 'checkbox'">

packages/Webkul/Admin/src/Resources/views/settings/workflows/edit.blade.php

+8-1
Original file line numberDiff line numberDiff line change
@@ -328,11 +328,18 @@
328328
</div>
329329

330330
<div class="form-group" v-if="matchedAttribute.type == 'select' || matchedAttribute.type == 'radio' || matchedAttribute.type == 'lookup'">
331-
<select :name="['actions[' + index + '][value]']" class="control" v-model="action.value">
331+
<select :name="['actions[' + index + '][value]']" class="control" v-model="action.value" v-if="! matchedAttribute.lookup_type">
332332
<option v-for='option in matchedAttribute.options' :value="option.id">
333333
@{{ option.name }}
334334
</option>
335335
</select>
336+
337+
<lookup-component
338+
:attribute="{'code': 'actions[' + index + '][value]', 'name': matchedAttribute.name, 'lookup_type': matchedAttribute.lookup_type}"
339+
validations="required"
340+
:data="action.value"
341+
v-else
342+
></lookup-component>
336343
</div>
337344

338345
<div class="form-group" v-if="matchedAttribute.type == 'multiselect' || matchedAttribute.type == 'checkbox'">

packages/Webkul/Workflow/src/Helpers/Entity/Lead.php

+23
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,29 @@ public function getEntity($entity)
108108
return $entity;
109109
}
110110

111+
/**
112+
* Returns attributes
113+
*
114+
* @param string $entityType
115+
* @param array $skipAttributes
116+
* @return array
117+
*/
118+
public function getAttributes($entityType, $skipAttributes = ['textarea', 'image', 'file', 'address'])
119+
{
120+
$attributes[] = [
121+
'id' => 'lead_pipeline_stage_id',
122+
'type' => 'select',
123+
'name' => 'Stage',
124+
'lookup_type' => 'lead_pipeline_stages',
125+
'options' => collect([]),
126+
];
127+
128+
return array_merge(
129+
parent::getAttributes($entityType, $skipAttributes),
130+
$attributes
131+
);
132+
}
133+
111134
/**
112135
* Returns workflow actions
113136
*

0 commit comments

Comments
 (0)