Merge pull request '4037-fix(multi-check)' (#973) from 4037-multi-check_align into dev
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
Reviewed-on: #973 Reviewed-by: Carlos Jimenez Ruiz <carlosjr@verdnatura.es>
This commit is contained in:
commit
d7c790de4f
|
@ -5,12 +5,14 @@
|
|||
</vn-check>
|
||||
<vn-icon-button
|
||||
class="vn-pl-none"
|
||||
ng-if="$ctrl.checked && $ctrl.checkDummyEnabled"
|
||||
ng-if="$ctrl.isCheckedDummy()"
|
||||
icon="expand_more"
|
||||
vn-popover="menu"
|
||||
ng-click="$ctrl.countRows()">
|
||||
</vn-icon-button>
|
||||
<vn-menu vn-id="menu">
|
||||
<vn-menu
|
||||
vn-id="menu"
|
||||
ng-if="$ctrl.isCheckedDummy()">
|
||||
<vn-list>
|
||||
<span translate>All</span>
|
||||
<span class="bold">
|
||||
|
|
|
@ -172,6 +172,10 @@ export default class MultiCheck extends FormInput {
|
|||
this.checkedDummyCount = this.allRowsCount;
|
||||
}
|
||||
|
||||
isCheckedDummy() {
|
||||
return this.checked && this.checkDummyEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggles checked property on
|
||||
* all instances
|
||||
|
|
|
@ -190,4 +190,30 @@ describe('Component vnMultiCheck', () => {
|
|||
expect(controller.checkedDummyCount).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
describe('isCheckedDummy()', () => {
|
||||
it(`should return true only if is checked and checked dummy is enabled`, () => {
|
||||
controller.checked = true;
|
||||
controller.checkDummyEnabled = true;
|
||||
const isCheckedDummy = controller.isCheckedDummy();
|
||||
|
||||
expect(isCheckedDummy).toEqual(true);
|
||||
});
|
||||
|
||||
it(`should return false if not checked`, () => {
|
||||
controller.checked = false;
|
||||
controller.checkDummyEnabled = true;
|
||||
const isCheckedDummy = controller.isCheckedDummy();
|
||||
|
||||
expect(isCheckedDummy).toEqual(false);
|
||||
});
|
||||
|
||||
it(`should return false if checked dummy is disabled`, () => {
|
||||
controller.checked = true;
|
||||
controller.checkDummyEnabled = false;
|
||||
const isCheckedDummy = controller.isCheckedDummy();
|
||||
|
||||
expect(isCheckedDummy).toEqual(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -3,15 +3,8 @@ vn-multi-check {
|
|||
.vn-check {
|
||||
margin-bottom: 12px
|
||||
}
|
||||
|
||||
vn-list{
|
||||
padding: 50px;
|
||||
}
|
||||
vn-menu{
|
||||
padding: 50px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.bold{
|
||||
font-weight: bold;
|
||||
}
|
Loading…
Reference in New Issue