Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new checkbox with glossary #273

Merged
merged 3 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/datadoc/assets/workspace_style.css
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,7 @@
.form-check{
padding-left: 0;
}

label.form-check-label{
padding-left: 0.5rem;
}
9 changes: 4 additions & 5 deletions src/datadoc/frontend/fields/display_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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,
)


Expand Down
2 changes: 1 addition & 1 deletion src/datadoc/frontend/fields/display_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion tests/frontend/components/test_build_input_section.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down