Skip to content

Commit

Permalink
added stage attribute in lead and autocomplete list in select actions
Browse files Browse the repository at this point in the history
  • Loading branch information
prabhat-webkul committed Sep 15, 2022
1 parent dd69923 commit c77fce8
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,17 @@ class="control"
</div>

<div class="form-group" v-if="matchedAttribute.type == 'select' || matchedAttribute.type == 'radio' || matchedAttribute.type == 'lookup'">
<select :name="['actions[' + index + '][value]']" class="control" v-model="action.value">
<select :name="['actions[' + index + '][value]']" class="control" v-model="action.value" v-if="! matchedAttribute.lookup_type">
<option v-for='option in matchedAttribute.options' :value="option.id">
@{{ option.name }}
</option>
</select>

<lookup-component
:attribute="{'code': 'actions[' + index + '][value]', 'name': matchedAttribute.name, 'lookup_type': matchedAttribute.lookup_type}"
validations="required"
v-else
></lookup-component>
</div>

<div class="form-group" v-if="matchedAttribute.type == 'multiselect' || matchedAttribute.type == 'checkbox'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,11 +328,18 @@
</div>

<div class="form-group" v-if="matchedAttribute.type == 'select' || matchedAttribute.type == 'radio' || matchedAttribute.type == 'lookup'">
<select :name="['actions[' + index + '][value]']" class="control" v-model="action.value">
<select :name="['actions[' + index + '][value]']" class="control" v-model="action.value" v-if="! matchedAttribute.lookup_type">
<option v-for='option in matchedAttribute.options' :value="option.id">
@{{ option.name }}
</option>
</select>

<lookup-component
:attribute="{'code': 'actions[' + index + '][value]', 'name': matchedAttribute.name, 'lookup_type': matchedAttribute.lookup_type}"
validations="required"
:data="action.value"
v-else
></lookup-component>
</div>

<div class="form-group" v-if="matchedAttribute.type == 'multiselect' || matchedAttribute.type == 'checkbox'">
Expand Down
23 changes: 23 additions & 0 deletions packages/Webkul/Workflow/src/Helpers/Entity/Lead.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,29 @@ public function getEntity($entity)
return $entity;
}

/**
* Returns attributes
*
* @param string $entityType
* @param array $skipAttributes
* @return array
*/
public function getAttributes($entityType, $skipAttributes = ['textarea', 'image', 'file', 'address'])
{
$attributes[] = [
'id' => 'lead_pipeline_stage_id',
'type' => 'select',
'name' => 'Stage',
'lookup_type' => 'lead_pipeline_stages',
'options' => collect([]),
];

return array_merge(
parent::getAttributes($entityType, $skipAttributes),
$attributes
);
}

/**
* Returns workflow actions
*
Expand Down

0 comments on commit c77fce8

Please sign in to comment.