diff --git a/poetry.lock b/poetry.lock index e99b472d..772e51bc 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. [[package]] name = "aiohttp" @@ -4124,13 +4124,13 @@ sqlcipher = ["sqlcipher3_binary"] [[package]] name = "ssb-dash-components" -version = "0.5.3" +version = "0.6.0" description = "Dash Component library for SSB" optional = false python-versions = "<4.0,>=3.9" files = [ - {file = "ssb_dash_components-0.5.3-py3-none-any.whl", hash = "sha256:25249cf04e8c10509bb08a6e6a0e5b6ba5030187000d2d5a1e8420625122a0ca"}, - {file = "ssb_dash_components-0.5.3.tar.gz", hash = "sha256:dc4efef0a74a4de967b605518d39d32c017b17320d208f101b38030cd509b00f"}, + {file = "ssb_dash_components-0.6.0-py3-none-any.whl", hash = "sha256:b924f20679f185147b105ff84bfdec8f15dd5691d49ddf087885179e661a6810"}, + {file = "ssb_dash_components-0.6.0.tar.gz", hash = "sha256:0963136b92b4e556a596852f04b757216caf183998c4f4ddde812221a23cec0d"}, ] [package.dependencies] diff --git a/src/datadoc/assets/workspace_style.css b/src/datadoc/assets/workspace_style.css index 1142bb12..26edfeaf 100644 --- a/src/datadoc/assets/workspace_style.css +++ b/src/datadoc/assets/workspace_style.css @@ -81,3 +81,7 @@ .form-check{ padding-left: 0; } + +label.form-check-label{ + padding-left: 0.5rem; +} diff --git a/src/datadoc/frontend/fields/display_base.py b/src/datadoc/frontend/fields/display_base.py index d545b277..693df847 100644 --- a/src/datadoc/frontend/fields/display_base.py +++ b/src/datadoc/frontend/fields/display_base.py @@ -10,7 +10,6 @@ from typing import TYPE_CHECKING from typing import Any -import dash_bootstrap_components as dbc import ssb_dash_components as ssb from dash import dcc @@ -228,16 +227,16 @@ def render( variable_id: dict, language: str, # noqa: ARG002 Required by Dash variable: model.Variable, - ) -> dbc.Checkbox: + ) -> ssb.Checkbox: """Build Checkbox component.""" value = self.value_getter(variable, self.identifier) - return dbc.Checkbox( + return ssb.Checkbox( label=self.display_name, id=variable_id, disabled=not self.editable, - label_class_name="ssb-checkbox checkbox-label", - class_name="ssb-checkbox", value=value, + showDescription=True, + description=self.description, ) diff --git a/src/datadoc/frontend/fields/display_variables.py b/src/datadoc/frontend/fields/display_variables.py index 16470218..270f3823 100644 --- a/src/datadoc/frontend/fields/display_variables.py +++ b/src/datadoc/frontend/fields/display_variables.py @@ -89,7 +89,7 @@ class VariableIdentifiers(str, Enum): VariableIdentifiers.DIRECT_PERSON_IDENTIFYING: MetadataCheckboxField( identifier=VariableIdentifiers.DIRECT_PERSON_IDENTIFYING.value, display_name="Direkte personidentifiserende informasjon", - description="Direkte personidentifiserende informasjon (DPI)", + description="Velges hvis variabelen inneholder informasjon som innebærer at enkeltpersoner kan identifiseres. Gjelder ikke hvis kolonnen er pseudonymisert eller anonymisert.", obligatory=True, ), VariableIdentifiers.DATA_SOURCE: MetadataInputField( diff --git a/tests/frontend/components/test_build_input_section.py b/tests/frontend/components/test_build_input_section.py index 62f3b375..6c8fbaa3 100644 --- a/tests/frontend/components/test_build_input_section.py +++ b/tests/frontend/components/test_build_input_section.py @@ -93,7 +93,7 @@ def test_build_input_fields_input_components(field_list, variable, language): def test_build_input_fields_checkbox_components(field_list, variable, language): """Test checkbox fields for variabel identifiers.""" input_section = build_input_field_section(field_list, variable, language) - type_checkbox = dbc.Checkbox + type_checkbox = ssb.Checkbox elements_of_checkbox = [ element for element in input_section.children