Merge pull request #1729 from prashant-webkul/bugs_patch_1

Fixed issue #1728
This commit is contained in:
Jitendra Singh 2019-11-05 12:02:49 +05:30 committed by GitHub
commit 00b40689f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 81 additions and 69 deletions

View File

@ -8,6 +8,8 @@ class FixedAmount extends Action
{
public function __construct($rule)
{
parent::__construct();
/**
* Setting the rule getting applied
*/

View File

@ -8,6 +8,8 @@ class PercentOfProduct extends Action
{
public function __construct($rule)
{
parent::__construct();
/**
* Setting the rule getting applied
*/

View File

@ -15,7 +15,7 @@ class WholeCartToFixed
*/
public function calculate($rule)
{
$actualInstance = new FixedAmount();
$actualInstance = new FixedAmount($rule);
$result = $actualInstance->calculate($rule);

View File

@ -15,7 +15,7 @@ class WholeCartToPercent
*/
public function calculate($rule)
{
$actualInstance = new PercentOfProduct();
$actualInstance = new PercentOfProduct($rule);
$result = $actualInstance->calculate($rule);

View File

@ -0,0 +1,33 @@
<thead v-if="massActionsToggle == false">
<tr style="height: 65px;">
@if (count($results['records']) && $results['enableMassActions'])
<th class="grid_head" id="mastercheckbox" style="width: 50px;">
<span class="checkbox">
<input type="checkbox" v-model="allSelected" v-on:change="selectAll">
<label class="checkbox-view" for="checkbox"></label>
</span>
</th>
@endif
@foreach($results['columns'] as $key => $column)
<th class="grid_head"
@if(isset($column['width']))
style="width: {{ $column['width'] }}"
@endif
@if(isset($column['sortable']) && $column['sortable'])
v-on:click="sortCollection('{{ $column['index'] }}')"
@endif
>
{{ $column['label'] }}
</th>
@endforeach
@if ($results['enableActions'])
<th>
{{ __('ui::app.datagrid.actions') }}
</th>
@endif
</tr>
</thead>

View File

@ -0,0 +1,34 @@
<thead v-if="massActionsToggle">
@if (isset($results['massactions']))
<tr class="mass-action" v-if="massActionsToggle" style="height: 65px;">
<th colspan="100%">
<div class="mass-action-wrapper" style="display: flex; flex-direction: row; align-items: center; justify-content: flex-start;">
<span class="massaction-remove" v-on:click="removeMassActions" style="margin-right: 10px; margin-top: 3px;">
<span class="icon checkbox-dash-icon"></span>
</span>
<form method="POST" id="mass-action-form" style="display: inline-flex;" action="" onsubmit="return confirm('{{ __('ui::app.datagrid.click_on_action') }}')">
@csrf()
<input type="hidden" id="indexes" name="indexes" v-model="dataIds">
<div class="control-group">
<select class="control" v-model="massActionType" @change="changeMassActionTarget" name="massaction-type" required>
<option v-for="(massAction, index) in massActions" :key="index" :value="massAction.type">@{{ massAction.label }}</option>
</select>
</div>
<div class="control-group" style="margin-left: 10px;" v-if="massActionType == 'update'">
<select class="control" v-model="massActionUpdateValue" name="update-options" required>
<option v-for="(massActionValue, id) in massActionValues" :value="massActionValue">@{{ id }}</option>
</select>
</div>
<input type="submit" class="btn btn-sm btn-primary" style="margin-left: 10px;">
</form>
</div>
</th>
</tr>
@endif
</thead>

View File

@ -146,74 +146,9 @@
</div>
<table class="table">
<thead v-if="massActionsToggle">
@if (isset($results['massactions']))
<tr class="mass-action" v-if="massActionsToggle" style="height: 65px;">
<th colspan="100%">
<div class="mass-action-wrapper" style="display: flex; flex-direction: row; align-items: center; justify-content: flex-start;">
@include('ui::datagrid.partials.mass-action-header')
<span class="massaction-remove" v-on:click="removeMassActions" style="margin-right: 10px; margin-top: 3px;">
<span class="icon checkbox-dash-icon"></span>
</span>
<form method="POST" id="mass-action-form" style="display: inline-flex;" action="" onsubmit="return confirm('{{ __('ui::app.datagrid.click_on_action') }}')">
@csrf()
<input type="hidden" id="indexes" name="indexes" v-model="dataIds">
<div class="control-group">
<select class="control" v-model="massActionType" @change="changeMassActionTarget" name="massaction-type" required>
<option v-for="(massAction, index) in massActions" :key="index" :value="massAction.type">@{{ massAction.label }}</option>
</select>
</div>
<div class="control-group" style="margin-left: 10px;" v-if="massActionType == 'update'">
<select class="control" v-model="massActionUpdateValue" name="update-options" required>
<option v-for="(massActionValue, id) in massActionValues" :value="massActionValue">@{{ id }}</option>
</select>
</div>
<input type="submit" class="btn btn-sm btn-primary" style="margin-left: 10px;">
</form>
</div>
</th>
</tr>
@endif
</thead>
<thead v-if="massActionsToggle == false">
<tr style="height: 65px;">
@if (count($results['records']) && $results['enableMassActions'])
<th class="grid_head" id="mastercheckbox" style="width: 50px;">
<span class="checkbox">
<input type="checkbox" v-model="allSelected" v-on:change="selectAll">
<label class="checkbox-view" for="checkbox"></label>
</span>
</th>
@endif
@foreach($results['columns'] as $key => $column)
<th class="grid_head"
@if(isset($column['width']))
style="width: {{ $column['width'] }}"
@endif
@if(isset($column['sortable']) && $column['sortable'])
v-on:click="sortCollection('{{ $column['index'] }}')"
@endif
>
{{ $column['label'] }}
</th>
@endforeach
@if ($results['enableActions'])
<th>
{{ __('ui::app.datagrid.actions') }}
</th>
@endif
</tr>
</thead>
@include('ui::datagrid.partials.default-header')
@include('ui::datagrid.body', ['records' => $results['records'], 'actions' => $results['actions'], 'index' => $results['index'], 'columns' => $results['columns'],'enableMassActions' => $results['enableMassActions'], 'enableActions' => $results['enableActions'], 'norecords' => $results['norecords']])
</table>
@ -725,6 +660,12 @@
}
},
captureColumn: function(id) {
element = document.getElementById(id);
console.log(element.innerHTML);
},
removeMassActions: function() {
this.dataIds = [];