From fb23603e0a42dd4a2075d898c6232b076fc4502a Mon Sep 17 00:00:00 2001 From: Jan Sander <63044278+JanhSander@users.noreply.github.com> Date: Mon, 8 Apr 2024 12:41:56 +0200 Subject: [PATCH 1/4] Added readonly property for input --- poetry.lock | 11 ++++++----- pyproject.toml | 2 +- src/datadoc/frontend/components/alerts.py | 2 +- src/datadoc/frontend/fields/display_base.py | 1 + 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/poetry.lock b/poetry.lock index e99b472d..fd43d198 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" @@ -3419,6 +3419,7 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, + {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, @@ -4124,13 +4125,13 @@ sqlcipher = ["sqlcipher3_binary"] [[package]] name = "ssb-dash-components" -version = "0.5.3" +version = "0.5.6" 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.5.6-py3-none-any.whl", hash = "sha256:dcdf6f163eb36069a184b480b8dfbc13f6926b9d19a2a32e08e1fa0051c289f3"}, + {file = "ssb_dash_components-0.5.6.tar.gz", hash = "sha256:3669368f7edbc7ff6e54abcc7a3ba8f7d6a78093d119c797bce274fb38df7e85"}, ] [package.dependencies] @@ -4674,4 +4675,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = ">=3.10,<4.0" -content-hash = "713694ade4a05085744e77aa840336b010bfcc5ad30944fd5474945cd7596ef4" +content-hash = "cc9d04edddba65fb988e218546723166198ad6af04e34bcfcd75502ad7cac0a0" diff --git a/pyproject.toml b/pyproject.toml index 95204112..30466f1e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,7 +40,7 @@ beautifulsoup4 = ">=4.12.3" cloudpathlib = { extras = ["gs"], version = ">=0.17.0" } pyjwt = ">=2.8.0" ssb-klass-python = ">=0.0.9" -ssb-dash-components = ">=0.5.2" +ssb-dash-components = "0.5.6" [tool.poetry.group.dev.dependencies] mypy = ">=0.950" diff --git a/src/datadoc/frontend/components/alerts.py b/src/datadoc/frontend/components/alerts.py index cbd2de2a..ae8b4a4a 100644 --- a/src/datadoc/frontend/components/alerts.py +++ b/src/datadoc/frontend/components/alerts.py @@ -44,7 +44,7 @@ naming_convention_warning = build_ssb_alert( AlertTypes.WARNING, "opened-dataset_warning", - "Filen følger ikke navnestandard. Vennlist se", + "Filen følger ikke navnestandard. Vennligst se", "opened-dataset-warning-explanation", link=get_dapla_manual_naming_standard_url(), ) diff --git a/src/datadoc/frontend/fields/display_base.py b/src/datadoc/frontend/fields/display_base.py index d545b277..73f07bde 100644 --- a/src/datadoc/frontend/fields/display_base.py +++ b/src/datadoc/frontend/fields/display_base.py @@ -151,6 +151,7 @@ def render( id=component_id, debounce=True, type=self.type, + readOnly=not self.editable, disabled=not self.editable, value=value, className="input-component", From 8bd5d792f4ce88b86b620e32b1e5aa2211face28 Mon Sep 17 00:00:00 2001 From: Jan Sander <63044278+JanhSander@users.noreply.github.com> Date: Mon, 8 Apr 2024 12:51:44 +0200 Subject: [PATCH 2/4] Updated to ssb-dash-components 0.6.0 --- poetry.lock | 8 ++++---- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/poetry.lock b/poetry.lock index fd43d198..cb606b1c 100644 --- a/poetry.lock +++ b/poetry.lock @@ -4125,13 +4125,13 @@ sqlcipher = ["sqlcipher3_binary"] [[package]] name = "ssb-dash-components" -version = "0.5.6" +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.6-py3-none-any.whl", hash = "sha256:dcdf6f163eb36069a184b480b8dfbc13f6926b9d19a2a32e08e1fa0051c289f3"}, - {file = "ssb_dash_components-0.5.6.tar.gz", hash = "sha256:3669368f7edbc7ff6e54abcc7a3ba8f7d6a78093d119c797bce274fb38df7e85"}, + {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] @@ -4675,4 +4675,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = ">=3.10,<4.0" -content-hash = "cc9d04edddba65fb988e218546723166198ad6af04e34bcfcd75502ad7cac0a0" +content-hash = "d56e91a3aeb64fc0a38969bbc88c8e532ddca4f6344050f1d13662898456c78c" diff --git a/pyproject.toml b/pyproject.toml index 30466f1e..239d5646 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,7 +40,7 @@ beautifulsoup4 = ">=4.12.3" cloudpathlib = { extras = ["gs"], version = ">=0.17.0" } pyjwt = ">=2.8.0" ssb-klass-python = ">=0.0.9" -ssb-dash-components = "0.5.6" +ssb-dash-components = "0.6.0" [tool.poetry.group.dev.dependencies] mypy = ">=0.950" From ecbbea5c82025d5fcf9676da7ae051eab61aa2c4 Mon Sep 17 00:00:00 2001 From: Jan Sander <63044278+JanhSander@users.noreply.github.com> Date: Mon, 8 Apr 2024 13:16:55 +0200 Subject: [PATCH 3/4] Removed disabled property --- src/datadoc/frontend/fields/display_base.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/datadoc/frontend/fields/display_base.py b/src/datadoc/frontend/fields/display_base.py index 73f07bde..3df51dab 100644 --- a/src/datadoc/frontend/fields/display_base.py +++ b/src/datadoc/frontend/fields/display_base.py @@ -152,7 +152,6 @@ def render( debounce=True, type=self.type, readOnly=not self.editable, - disabled=not self.editable, value=value, className="input-component", ) From bd914c5fd8006ee5482dd435d68e20550e5a2573 Mon Sep 17 00:00:00 2001 From: Jan Sander <63044278+JanhSander@users.noreply.github.com> Date: Tue, 9 Apr 2024 08:45:11 +0200 Subject: [PATCH 4/4] Updated unittest --- tests/frontend/components/test_build_input_section.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/frontend/components/test_build_input_section.py b/tests/frontend/components/test_build_input_section.py index a467e1c0..0d3b922c 100644 --- a/tests/frontend/components/test_build_input_section.py +++ b/tests/frontend/components/test_build_input_section.py @@ -56,7 +56,7 @@ def test_build_input_fields_props_input(input_field_section): assert variable_input_field_for_name.type == "text" assert isinstance(variable_input_field_for_name, ssb.Input) assert variable_input_field_for_name.debounce is True - assert variable_input_field_for_name.disabled is False + assert variable_input_field_for_name.readOnly is False assert variable_input_field_for_name.label == "Navn"