multi check now behaves properly
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Carlos Jimenez Ruiz 2021-11-11 16:38:41 +01:00
parent 6baa9935de
commit d2dc0bd147
5 changed files with 9 additions and 10 deletions

View File

@ -8,6 +8,6 @@ comment 'The default configuration of columns for views';
INSERT INTO `salix`.`defaultViewConfig` (tableCode, columns) INSERT INTO `salix`.`defaultViewConfig` (tableCode, columns)
VALUES VALUES
('itemsIndex', '{"intrastat":false,"stemMultiplier":false}'), ('itemsIndex', '{"intrastat":false,"stemMultiplier":false}'),
('latestBuys', '{"intrastat":false,"description":false,"density":false,"isActive":false,"freightValue":false,"packageValue":false,"isIgnored":false,"price2":false,"minPrice":false,"ektFk":false,"weight":false}'); ('latestBuys', '{"intrastat":false,"description":false,"density":false,"isActive":false,"freightValue":false,"packageValue":false,"isIgnored":false,"price2":false,"minPrice":true,"ektFk":false,"weight":false,"id":true,"packing":true,"grouping":true,"quantity":true,"size":false,"name":true,"code":true,"origin":true,"family":true,"entryFk":true,"buyingValue":true,"comissionValue":false,"price3":true,"packageFk":true,"packingOut":true}');

View File

@ -145,9 +145,8 @@ export default class MultiCheck extends FormInput {
toggle() { toggle() {
const data = this.model.data; const data = this.model.data;
if (!data) return; if (!data) return;
data.forEach(el => { for (let el of data)
el[this.checkField] = this.checkAll; el[this.checkField] = this.checkAll;
});
} }
} }
@ -158,6 +157,7 @@ ngModule.vnComponent('vnMultiCheck', {
model: '<', model: '<',
checkField: '@?', checkField: '@?',
checkAll: '=?', checkAll: '=?',
checked: '=?',
disabled: '<?' disabled: '<?'
} }
}); });

View File

@ -128,7 +128,8 @@ async function launchBackTest(done) {
if (err) if (err)
throw err; throw err;
} }
launchBackTest.description = `Runs the backend tests once using a random container, can receive --ci arg to save reports on a xml file`; launchBackTest.description = `
Runs the backend tests once using a random container, can receive --ci arg to save reports on a xml file`;
// Backend tests // Backend tests

View File

@ -28,6 +28,7 @@
<tr> <tr>
<th shrink> <th shrink>
<vn-multi-check <vn-multi-check
checked="$ctrl.checkAll"
model="model" model="model"
check-field="$checked"> <!-- Change $checked as default prop --> check-field="$checked"> <!-- Change $checked as default prop -->
</vn-multi-check> </vn-multi-check>

View File

@ -6,6 +6,7 @@ export default class Controller extends Section {
constructor($element, $) { constructor($element, $) {
super($element, $); super($element, $);
this.editedColumn; this.editedColumn;
this.$checkAll = false;
this.smartTableOptions = { this.smartTableOptions = {
activeButtons: { activeButtons: {
@ -130,11 +131,7 @@ export default class Controller extends Section {
} }
uncheck() { uncheck() {
const lines = this.checked; this.checkAll = false;
for (let line of lines) {
if (line.checked)
line.checked = false;
}
} }
get totalChecked() { get totalChecked() {