Skip to content

Commit 0c9dd87

Browse files
committed
Fixed Data Grid components labels being rewriten to false
1 parent e4b37bc commit 0c9dd87

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

src/components/base/Base.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1090,7 +1090,7 @@ export default class BaseComponent {
10901090
}
10911091

10921092
labelIsHidden() {
1093-
return !this.component.label || this.component.hideLabel || this.options.inputsOnly;
1093+
return !this.component.label || this.component.hideLabel || this.options.inputsOnly || (this.component.inDataGrid && !this.component.dataGridLabel);
10941094
}
10951095

10961096
/**

src/components/button/Button.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ export default class ButtonComponent extends BaseComponent {
1515
action: 'submit',
1616
persistent: false,
1717
disableOnInvalid: false,
18-
theme: 'default'
18+
theme: 'default',
19+
dataGridLabel: true
1920
}, ...extend);
2021
}
2122

@@ -120,7 +121,7 @@ export default class ButtonComponent extends BaseComponent {
120121
this.buttonElement.appendChild(this.text(' '));
121122
}
122123

123-
if (this.component.label) {
124+
if (!this.labelIsHidden()) {
124125
this.labelElement = this.text(this.addShortcutToLabel());
125126
this.buttonElement.appendChild(this.labelElement);
126127
this.createTooltip(this.buttonElement, null, this.iconClass('question-sign'));

src/components/checkbox/Checkbox.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default class CheckBoxComponent extends BaseComponent {
88
inputType: 'checkbox',
99
label: 'Checkbox',
1010
key: 'checkbox',
11-
datagridLabel: true,
11+
dataGridLabel: true,
1212
labelPosition: 'right',
1313
value: '',
1414
name: ''
@@ -75,7 +75,7 @@ export default class CheckBoxComponent extends BaseComponent {
7575

7676
createElement() {
7777
let className = `form-check ${this.className}`;
78-
if (this.component.label) {
78+
if (!this.labelIsHidden()) {
7979
className += ' checkbox';
8080
}
8181
this.element = this.ce('div', {
@@ -135,7 +135,7 @@ export default class CheckBoxComponent extends BaseComponent {
135135
}
136136

137137
createLabel(container, input) {
138-
if (!this.component.label) {
138+
if (this.labelIsHidden()) {
139139
return null;
140140
}
141141

src/components/checkbox/editForm/Checkbox.edit.display.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export default [
7575
input: true,
7676
weight: 440,
7777
label: 'Datagrid Label',
78-
key: 'datagridLabel',
78+
key: 'dataGridLabel',
7979
tooltip: 'Show the label when in a datagrid.'
8080
}
8181
];

src/components/checkbox/fixtures/comp1.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default {
1515
'protected': false,
1616
'defaultValue': false,
1717
'key': 'checkme',
18-
'datagridLabel': true,
18+
'dataGridLabel': true,
1919
'label': 'Check me',
2020
'hideLabel': false,
2121
'tableView': true,

src/components/datagrid/DataGrid.js

-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ export default class DataGridComponent extends NestedComponent {
229229
options.name += `[${rowIndex}]`;
230230
options.row = `${rowIndex}-${colIndex}`;
231231
const comp = this.createComponent(_.assign({}, column, {
232-
label: column.dataGridLabel ? column.label : false,
233232
row: options.row
234233
}), options, row);
235234
comp.rowIndex = rowIndex;

0 commit comments

Comments
 (0)