Skip to content

Commit 90fdb04

Browse files
authored
Merge pull request #1000 from navikt/bugfix/hide-label-fix
Ignore dataGridLabel for ReactComponents, just use hideLabel instead.
2 parents bb72d95 + ca956eb commit 90fdb04

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

packages/shared-components/src/formio/components/base/BaseComponent.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ class BaseComponent extends FormioReactComponent {
2323
static schema(values) {
2424
return Field.schema({
2525
fieldSize: 'input--xxl',
26-
dataGridLabel: true,
2726
validateOn: 'blur',
2827
...values,
2928
});
@@ -50,7 +49,7 @@ class BaseComponent extends FormioReactComponent {
5049
}
5150

5251
getHideLabel() {
53-
return this.labelIsHidden();
52+
return this.component?.hideLabel ?? false;
5453
}
5554

5655
/**

packages/shared-components/src/formio/components/base/editForm/shared/editFormValuesGrid.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const editFormValuesGrid = (): Component => ({
1212
key: 'label',
1313
input: true,
1414
type: 'textfield',
15-
dataGridLabel: false,
15+
hideLabel: true,
1616
validate: {
1717
required: true,
1818
},
@@ -22,7 +22,7 @@ const editFormValuesGrid = (): Component => ({
2222
key: 'value',
2323
input: true,
2424
type: 'textfield',
25-
dataGridLabel: false,
25+
hideLabel: true,
2626
allowCalculateOverride: true,
2727
calculateValue: 'value = _.camelCase(row.label);',
2828
},

packages/shared-components/src/formio/template/templates/navdesign/datagrid/form.ejs

+1-3
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@
44
{{ ctx.component.hover ? 'table-hover' : ''}}
55
{{ ctx.component.condensed ? 'table-sm' : ''}}
66
" {% if (ctx.component.layoutFixed) { %}style="table-layout: fixed;"{% } %}>
7-
{% if (ctx.hasHeader) { %}
87
<thead>
98
<tr>
109
{% if (ctx.component.reorder) { %}<th></th>{% } %}
1110
{% ctx.columns.forEach(function(col) { %}
1211
<th class="{{col.validate && col.validate.required ? 'field-required' : ''}}">
13-
{{ col.hideLabel ? '' : ctx.t(col.label || col.title, { _userInput: true }) }}
12+
{{ ctx.t(col.label || col.title, { _userInput: true }) }}
1413
{% if (col.tooltip) { %} <i ref="tooltip" data-title="{{col.tooltip}}" class="{{ctx.iconClass('question-sign')}} text-muted" data-tooltip="{{col.tooltip}}"></i>{% } %}
1514
</th>
1615
{% }) %}
@@ -33,7 +32,6 @@
3332
{% } %}
3433
</tr>
3534
</thead>
36-
{% } %}
3735
<tbody ref="{{ctx.datagridKey}}-tbody" data-key="{{ctx.datagridKey}}">
3836
{% ctx.rows.forEach(function(row, index) { %}
3937
{% if (ctx.hasGroups && ctx.groups[index]) { %}

0 commit comments

Comments
 (0)