Skip to content

Commit

Permalink
Merge pull request #1108 from prabhatkumaroc082/stage-attribute
Browse files Browse the repository at this point in the history
Fixed #947
  • Loading branch information
jitendra-webkul authored Sep 16, 2022
2 parents dd69923 + c77fce8 commit 047292b
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 047292b

Please sign in to comment.