ssb-dash-framework 0.2.1__tar.gz → 0.2.2a0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/PKG-INFO +5 -4
  2. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/pyproject.toml +14 -2
  3. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/__init__.py +22 -6
  4. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/assets/stylesheet.css +18 -4
  5. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/control/control_framework_base.py +22 -21
  6. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/modules/__init__.py +22 -6
  7. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/modules/aarsregnskap.py +17 -8
  8. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/modules/agg_dist_plotter.py +3 -3
  9. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/modules/altinn_control_view.py +65 -21
  10. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/modules/altinn_data_capture.py +5 -5
  11. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/modules/altinn_editor/__init__.py +2 -0
  12. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/modules/altinn_editor/altinn_editor_comment.py +2 -2
  13. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/modules/altinn_editor/altinn_editor_contact.py +3 -4
  14. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/modules/altinn_editor/altinn_editor_control.py +3 -4
  15. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/modules/altinn_editor/altinn_editor_history.py +20 -7
  16. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/modules/altinn_editor/altinn_editor_main_view.py +21 -19
  17. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/modules/altinn_editor/altinn_editor_primary_table.py +72 -11
  18. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/modules/altinn_editor/altinn_editor_submitted_forms.py +8 -4
  19. ssb_dash_framework-0.2.2a0/src/ssb_dash_framework/modules/altinn_editor/altinn_editor_supporting_table.py +226 -0
  20. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/modules/altinn_editor/altinn_editor_unit_details.py +4 -5
  21. ssb_dash_framework-0.2.2a0/src/ssb_dash_framework/modules/altinn_editor/altinn_editor_utility.py +17 -0
  22. ssb_dash_framework-0.2.2a0/src/ssb_dash_framework/modules/bedriftstabell.py +310 -0
  23. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/modules/bofregistry.py +41 -17
  24. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/modules/building_blocks/canvas.py +6 -6
  25. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/modules/building_blocks/figuredisplay.py +6 -6
  26. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/modules/building_blocks/map_display.py +27 -27
  27. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/modules/building_blocks/multimodule.py +6 -6
  28. ssb_dash_framework-0.2.2a0/src/ssb_dash_framework/modules/building_blocks/tables.py +411 -0
  29. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/modules/freesearch.py +13 -14
  30. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/modules/hb_method.py +13 -13
  31. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/modules/macro_module.py +30 -11
  32. ssb_dash_framework-0.2.2a0/src/ssb_dash_framework/modules/nspek.py +412 -0
  33. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/modules/parquet_editor.py +40 -22
  34. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/modules/pi_memorizer.py +7 -13
  35. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/modules/skjemapdfviewer.py +10 -15
  36. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/modules/visualizationbuilder.py +12 -16
  37. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/setup/app_setup.py +9 -9
  38. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/setup/main_layout.py +5 -10
  39. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/setup/variableselector.py +13 -14
  40. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/utils/alert_handler.py +22 -22
  41. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/utils/app_logger.py +5 -5
  42. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/utils/core_query_functions.py +11 -3
  43. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/utils/datahelper.py +6 -5
  44. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/utils/debugger_modal.py +3 -3
  45. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/utils/eimerdb_helpers.py +4 -4
  46. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/utils/functions.py +10 -4
  47. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/utils/implementations.py +22 -28
  48. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/utils/module_validation.py +1 -1
  49. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/utils/r_helpers.py +24 -14
  50. ssb_dash_framework-0.2.1/src/ssb_dash_framework/modules/altinn_editor/altinn_editor_supporting_table.py +0 -320
  51. ssb_dash_framework-0.2.1/src/ssb_dash_framework/modules/building_blocks/tables.py +0 -678
  52. ssb_dash_framework-0.2.1/src/ssb_dash_framework/modules/control.py +0 -206
  53. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/LICENSE +0 -0
  54. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/README.md +0 -0
  55. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/__main__.py +0 -0
  56. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/assets/dashAgGridFunctions.js +0 -0
  57. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/control/__init__.py +0 -0
  58. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/modules/building_blocks/__init__.py +0 -0
  59. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/py.typed +0 -0
  60. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/setup/__init__.py +0 -0
  61. {ssb_dash_framework-0.2.1 → ssb_dash_framework-0.2.2a0}/src/ssb_dash_framework/utils/__init__.py +0 -0
@@ -1,18 +1,19 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: ssb-dash-framework
3
- Version: 0.2.1
3
+ Version: 0.2.2a0
4
4
  Summary: SSB Dash Framework
5
- License: GPL-3.0
5
+ License-Expression: GPL-3.0
6
+ License-File: LICENSE
6
7
  Author: Magnus Theodor Engh
7
8
  Author-email: dor@ssb.no
8
9
  Requires-Python: >=3.10,<4.0
9
10
  Classifier: Development Status :: 4 - Beta
10
- Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
11
11
  Classifier: Programming Language :: Python :: 3
12
12
  Classifier: Programming Language :: Python :: 3.10
13
13
  Classifier: Programming Language :: Python :: 3.11
14
14
  Classifier: Programming Language :: Python :: 3.12
15
15
  Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Programming Language :: Python :: 3.14
16
17
  Requires-Dist: click (>=8.0.1)
17
18
  Requires-Dist: dapla-toolbelt (>=2.0.8,<5.0.0)
18
19
  Requires-Dist: dash (>=3.3.0,<4.0.0)
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "ssb-dash-framework"
3
- version = "0.2.1"
3
+ version = "0.2.2a0"
4
4
  description = "SSB Dash Framework"
5
5
  authors = [{ name = "Magnus Theodor Engh", email = "dor@ssb.no" }]
6
6
  license = "GPL-3.0"
@@ -46,7 +46,6 @@ requires-poetry = ">=2.0"
46
46
  pygments = ">=2.10.0"
47
47
  black = { extras = ["jupyter"], version = ">=23.1.0" }
48
48
  coverage = { extras = ["toml"], version = ">=6.2" }
49
- darglint = ">=1.8.1"
50
49
  furo = ">=2021.11.12"
51
50
  mypy = ">=0.930"
52
51
  pre-commit = ">=2.16.0"
@@ -61,6 +60,8 @@ typeguard = ">=2.13.3"
61
60
  xdoctest = { extras = ["colors"], version = ">=0.15.10" }
62
61
  myst-parser = { version = ">=0.16.1" }
63
62
  deptry = ">=0.23.0"
63
+ pydoclint = ">=0.8.3"
64
+ pandas-stubs = ">=2.3.1"
64
65
 
65
66
  [tool.poetry.requires-plugins]
66
67
  poetry-plugin-export = ">=1.9"
@@ -92,6 +93,16 @@ show_column_numbers = true
92
93
  show_error_context = true
93
94
  ignore_missing_imports = true
94
95
 
96
+ [tool.pydoclint]
97
+ style = "google"
98
+ exclude = '\.git|\.nox'
99
+ arg-type-hints-in-docstring = false
100
+ check-return-types = false
101
+ check-yield-types = false
102
+ allow-init-docstring = true
103
+ # native-mode-noqa-location = "definition"
104
+ quiet = true
105
+
95
106
  [tool.ruff]
96
107
  force-exclude = true # Apply excludes to pre-commit
97
108
  show-fixes = true
@@ -130,6 +141,7 @@ ignore = [
130
141
  "E501", # Supress line-too-long warnings: trust black's judgement on this one.
131
142
  "PLR2004", # Allow to compare with unnamed numerical constants.
132
143
  ]
144
+ external = ["DOC"] ## Avoiding removing any codes starting with `DOC` from any `# noqa` directives.
133
145
 
134
146
  [tool.ruff.lint.isort]
135
147
  force-single-line = true
@@ -8,20 +8,25 @@ from .modules import AarsregnskapWindow
8
8
  from .modules import AggDistPlotter
9
9
  from .modules import AggDistPlotterTab
10
10
  from .modules import AggDistPlotterWindow
11
- from .modules import AltinnControlView
11
+ from .modules import AltinnControlViewTab
12
12
  from .modules import AltinnControlViewWindow
13
13
  from .modules import AltinnDataCapture
14
14
  from .modules import AltinnDataCaptureTab
15
15
  from .modules import AltinnDataCaptureWindow
16
16
  from .modules import AltinnSkjemadataEditor
17
+ from .modules import AltinnSupportTable
18
+ from .modules import Bedriftstabell
19
+ from .modules import BedriftstabellTab
20
+ from .modules import BedriftstabellWindow
17
21
  from .modules import BofInformation
18
22
  from .modules import BofInformationTab
19
23
  from .modules import BofInformationWindow
20
24
  from .modules import Canvas
21
25
  from .modules import CanvasTab
22
26
  from .modules import CanvasWindow
23
- from .modules import Control
24
- from .modules import ControlWindow
27
+ from .modules import ControlView
28
+ from .modules import ControlViewTab
29
+ from .modules import ControlViewWindow
25
30
  from .modules import EditingTable
26
31
  from .modules import EditingTableTab
27
32
  from .modules import EditingTableWindow
@@ -42,6 +47,9 @@ from .modules import MapDisplayWindow
42
47
  from .modules import MultiModule
43
48
  from .modules import MultiModuleTab
44
49
  from .modules import MultiModuleWindow
50
+ from .modules import Naeringsspesifikasjon
51
+ from .modules import NaeringsspesifikasjonTab
52
+ from .modules import NaeringsspesifikasjonWindow
45
53
  from .modules import ParquetEditor
46
54
  from .modules import ParquetEditorChangelog
47
55
  from .modules import PimemorizerTab
@@ -85,21 +93,26 @@ __all__ = [
85
93
  "AggDistPlotterTab",
86
94
  "AggDistPlotterWindow",
87
95
  "AlertHandler",
88
- "AltinnControlView",
96
+ "AltinnControlViewTab",
89
97
  "AltinnControlViewWindow",
90
98
  "AltinnDataCapture",
91
99
  "AltinnDataCaptureTab",
92
100
  "AltinnDataCaptureWindow",
93
101
  "AltinnSkjemadataEditor",
102
+ "AltinnSupportTable",
103
+ "Bedriftstabell",
104
+ "BedriftstabellTab",
105
+ "BedriftstabellWindow",
94
106
  "BofInformation",
95
107
  "BofInformationTab",
96
108
  "BofInformationWindow",
97
109
  "Canvas",
98
110
  "CanvasTab",
99
111
  "CanvasWindow",
100
- "Control",
101
112
  "ControlFrameworkBase",
102
- "ControlWindow",
113
+ "ControlView",
114
+ "ControlViewTab",
115
+ "ControlViewWindow",
103
116
  "DatabaseBuilderAltinnEimerdb",
104
117
  "DebugInspector",
105
118
  "DemoDataCreator",
@@ -127,6 +140,9 @@ __all__ = [
127
140
  "MultiModuleWindow",
128
141
  "MultiModuleWindow",
129
142
  "MultiModuleWindow",
143
+ "Naeringsspesifikasjon",
144
+ "NaeringsspesifikasjonTab",
145
+ "NaeringsspesifikasjonWindow",
130
146
  "ParquetEditor",
131
147
  "ParquetEditorChangelog",
132
148
  "PimemorizerTab",
@@ -131,12 +131,13 @@ Aarsregnskap
131
131
  }
132
132
 
133
133
  .aarsregnskap-pdf-col {
134
+ padding: 15px;
134
135
  flex: 1;
135
136
  min-height: 0;
136
137
  }
137
138
 
138
139
  .aarsregnskap-pdf-iframe {
139
- width: 100%;
140
+ width: 120vh;
140
141
  height: 100%;
141
142
  border: none;
142
143
  }
@@ -155,7 +156,7 @@ AggDistPlotter
155
156
  }
156
157
 
157
158
  /*
158
- AltinnControlView
159
+ ControlView
159
160
  */
160
161
 
161
162
 
@@ -200,7 +201,7 @@ Bofregistry
200
201
 
201
202
  .bofregistry-table-bedrift-aggrid {
202
203
  width: 100%;
203
- height: 45vh;
204
+ height: 55vh !important;
204
205
  }
205
206
 
206
207
  .bofregistry-modal {
@@ -213,9 +214,22 @@ Bofregistry
213
214
 
214
215
  .bofregistry-modal-aggrid {
215
216
  height: 100% !important;
216
- width: 100% !important;
217
+ width: 60vh !important;
218
+ }
219
+
220
+ /*
221
+ Altinn Editor History
222
+ */
223
+ .history-modal .modal-dialog {
224
+ max-width: 70vw !important;
225
+ width: 80vw !important;
226
+ }
227
+
228
+ .history-modal .modal-content {
229
+ height: 60vh !important;
217
230
  }
218
231
 
232
+
219
233
  /*
220
234
  MacroModule
221
235
  */
@@ -29,22 +29,22 @@ def register_control(
29
29
  It is recommended to have the name of your control method / function start with the prefix 'control_'.
30
30
 
31
31
  Args:
32
- kontrollid (str): The id of the control, preferably a code or shortened name. Must be unique. Note that in the control module controls are sorted alphabetically based on kontrollid, meaning you can add numbers as prefix to control the sorting order in the app.
33
- kontrolltype (str): The type of control. Must be 'H' (Hard control), 'S' (Soft control) or 'I' (Informative)
34
- beskrivelse (str): A description of the control.
35
- kontrollerte_variabler (list[str]): A list of variables that are covered / relevant to the control.
36
- sorteringsvariabel (str | None): Variable to sort the values on.
37
- sortering (str | None): Controls if the sorting is ascending (ASC) or descending (DESC). Defaults to DESC
38
- kwargs (Any): These will be added to the _control_meta dict attached to the method as additional key and value pairs.
32
+ kontrollid: The id of the control, preferably a code or shortened name. Must be unique. Note that in the control module controls are sorted alphabetically based on kontrollid, meaning you can add numbers as prefix to control the sorting order in the app.
33
+ kontrolltype: The type of control. Must be 'H' (Hard control), 'S' (Soft control) or 'I' (Informative)
34
+ beskrivelse: A description of the control.
35
+ kontrollerte_variabler: A list of variables that are covered / relevant to the control.
36
+ sorteringsvariabel: Variable to sort the values on.
37
+ sortering: Controls if the sorting is ascending (ASC) or descending (DESC). Defaults to DESC
38
+ **kwargs: These will be added to the `_control_meta` dict attached to the method as additional key and value pairs.
39
39
 
40
40
  Raises:
41
41
  TypeError: If `kontrollerte_variabler` is not a list of strings.
42
- ValueError: If `kontrolltype` is not one of 'H', 'S', or 'I'.
43
- ValueError: If `sortering` is not one of 'ASC' or 'DESC'.
44
- ValueError: If required keys are missing from the metadata dictionary.
42
+ ValueError: If `kontrolltype` is not one of 'H', 'S', or 'I'. Or
43
+ if `sortering` is not one of 'ASC' or 'DESC'. Or
44
+ if required keys are missing from the metadata dictionary.
45
45
 
46
46
  Returns:
47
- Callable[..., Any]: The decorated function with added attribute '_control_meta' containing a dictionary with metadata.
47
+ The decorated function with added attribute '_control_meta' containing a dictionary with metadata.
48
48
 
49
49
  Example:
50
50
  @register_control(
@@ -313,14 +313,14 @@ class ControlFrameworkBase: # TODO: Add some common control methods here for ea
313
313
 
314
314
  Raises:
315
315
  TypeError: If the control method does not return a `pd.DataFrame`.
316
- ValueError: If a required column from `_required_kontrollutslag_columns` is missing.
317
- ValueError: If the result contains extra columns that are not allowed.
318
- ValueError: If the control is not registered in `self.controls`.
319
- ValueError: If any key in `applies_to_subset` has too many unique values.
320
- ValueError: If any value in `applies_to_subset` does not match the expected period.
321
- ValueError: If the results contain more than one unique `kontrollid`.
322
- ValueError: If the `kontrollid` in the results does not match the registered `_control_meta`.
323
- ValueError: If there are duplicated rows in the results based on `time_units`, `ident`, and `refnr`.
316
+ ValueError: If a required column from `_required_kontrollutslag_columns` is missing. Or
317
+ if the result contains extra columns that are not allowed. Or
318
+ if the control is not registered in `self.controls`. Or
319
+ if any key in `applies_to_subset` has too many unique values. Or
320
+ if any value in `applies_to_subset` does not match the expected period. Or
321
+ if the results contain more than one unique `kontrollid`. Or
322
+ if the `kontrollid` in the results does not match the registered `_control_meta`. Or
323
+ if there are duplicated rows in the results based on `time_units`, `ident`, and `refnr`.
324
324
  """
325
325
  logger.info(f"Running control: {control}")
326
326
  results = getattr(self, control)()
@@ -392,6 +392,7 @@ class ControlFrameworkBase: # TODO: Add some common control methods here for ea
392
392
 
393
393
  Raises:
394
394
  NotImplementedError: If connection is not EimerDBInstance or Ibis connection.
395
+ ValueError: If the query fails for reasons other than an empty 'kontrollutslag' table.
395
396
  """
396
397
  logger.info("Getting current kontrollutslag.")
397
398
  if isinstance(self.conn, EimerDBInstance):
@@ -533,10 +534,10 @@ class ControlFrameworkBase: # TODO: Add some common control methods here for ea
533
534
  """Generates a SQL UPDATE query for updating rows in 'kontrollutslag'.
534
535
 
535
536
  Args:
536
- df_updates (pd.DataFrame): DataFrame with updates to apply.
537
+ df_updates: DataFrame with updates to apply.
537
538
 
538
539
  Returns:
539
- str: SQL query string.
540
+ SQL query string.
540
541
  """
541
542
  update_query = "UPDATE kontrollutslag SET utslag = CASE"
542
543
 
@@ -6,12 +6,19 @@ from .aarsregnskap import AarsregnskapWindow
6
6
  from .agg_dist_plotter import AggDistPlotter
7
7
  from .agg_dist_plotter import AggDistPlotterTab
8
8
  from .agg_dist_plotter import AggDistPlotterWindow
9
- from .altinn_control_view import AltinnControlView
9
+ from .altinn_control_view import AltinnControlViewTab
10
10
  from .altinn_control_view import AltinnControlViewWindow
11
+ from .altinn_control_view import ControlView
12
+ from .altinn_control_view import ControlViewTab
13
+ from .altinn_control_view import ControlViewWindow
11
14
  from .altinn_data_capture import AltinnDataCapture
12
15
  from .altinn_data_capture import AltinnDataCaptureTab
13
16
  from .altinn_data_capture import AltinnDataCaptureWindow
14
17
  from .altinn_editor import AltinnSkjemadataEditor
18
+ from .altinn_editor import AltinnSupportTable
19
+ from .bedriftstabell import Bedriftstabell
20
+ from .bedriftstabell import BedriftstabellTab
21
+ from .bedriftstabell import BedriftstabellWindow
15
22
  from .bofregistry import BofInformation
16
23
  from .bofregistry import BofInformationTab
17
24
  from .bofregistry import BofInformationWindow
@@ -30,8 +37,6 @@ from .building_blocks import MapDisplayWindow
30
37
  from .building_blocks import MultiModule
31
38
  from .building_blocks import MultiModuleTab
32
39
  from .building_blocks import MultiModuleWindow
33
- from .control import Control
34
- from .control import ControlWindow
35
40
  from .freesearch import FreeSearch
36
41
  from .freesearch import FreeSearchTab
37
42
  from .freesearch import FreeSearchWindow
@@ -40,6 +45,9 @@ from .hb_method import HBMethodWindow
40
45
  from .macro_module import MacroModule
41
46
  from .macro_module import MacroModuleTab
42
47
  from .macro_module import MacroModuleWindow
48
+ from .nspek import Naeringsspesifikasjon
49
+ from .nspek import NaeringsspesifikasjonTab
50
+ from .nspek import NaeringsspesifikasjonWindow
43
51
  from .parquet_editor import ParquetEditor
44
52
  from .parquet_editor import ParquetEditorChangelog
45
53
  from .parquet_editor import apply_edits
@@ -59,20 +67,25 @@ __all__ = [
59
67
  "AggDistPlotter",
60
68
  "AggDistPlotterTab",
61
69
  "AggDistPlotterWindow",
62
- "AltinnControlView",
70
+ "AltinnControlViewTab",
63
71
  "AltinnControlViewWindow",
64
72
  "AltinnDataCapture",
65
73
  "AltinnDataCaptureTab",
66
74
  "AltinnDataCaptureWindow",
67
75
  "AltinnSkjemadataEditor",
76
+ "AltinnSupportTable",
77
+ "Bedriftstabell",
78
+ "BedriftstabellTab",
79
+ "BedriftstabellWindow",
68
80
  "BofInformation",
69
81
  "BofInformationTab",
70
82
  "BofInformationWindow",
71
83
  "Canvas",
72
84
  "CanvasTab",
73
85
  "CanvasWindow",
74
- "Control",
75
- "ControlWindow",
86
+ "ControlView",
87
+ "ControlViewTab",
88
+ "ControlViewWindow",
76
89
  "EditingTable",
77
90
  "EditingTableTab",
78
91
  "EditingTableWindow",
@@ -93,6 +106,9 @@ __all__ = [
93
106
  "MultiModule",
94
107
  "MultiModuleTab",
95
108
  "MultiModuleWindow",
109
+ "Naeringsspesifikasjon",
110
+ "NaeringsspesifikasjonTab",
111
+ "NaeringsspesifikasjonWindow",
96
112
  "ParquetEditor",
97
113
  "ParquetEditorChangelog",
98
114
  "PimemorizerTab",
@@ -24,10 +24,19 @@ class Aarsregnskap(ABC):
24
24
  """Module for displaying annual financial statements (Årsregnskap).
25
25
 
26
26
  Attributes:
27
- label (str): Label for the module when initialized, displayed as "Årsregnskap".
27
+ module_number: Sequential ID of the module instance.
28
+ module_name: Name of the module class.
29
+ label: User-visible label of the module, shown as "Årsregnskap".
30
+ icon: Emoji icon representing the module.
31
+ module_layout: The UI layout object returned by ``_create_layout()``.
28
32
  """
29
33
 
30
34
  _id_number: ClassVar[int] = 0
35
+ module_number: int
36
+ module_name: str
37
+ label: str
38
+ icon: str
39
+ module_layout: html.Div
31
40
 
32
41
  def __init__(
33
42
  self,
@@ -147,10 +156,10 @@ class Aarsregnskap(ABC):
147
156
  """Update the year input field based on the selected year.
148
157
 
149
158
  Args:
150
- aar (int): The selected year.
159
+ aar: The selected year.
151
160
 
152
161
  Returns:
153
- int: The updated year value.
162
+ The updated year value.
154
163
  """
155
164
  logger.debug(f"Args:\naar: {aar}\n")
156
165
  return aar
@@ -163,10 +172,10 @@ class Aarsregnskap(ABC):
163
172
  """Update the organization number input field.
164
173
 
165
174
  Args:
166
- orgnr (str): The selected organization number.
175
+ orgnr: The selected organization number.
167
176
 
168
177
  Returns:
169
- str: The updated organization number value.
178
+ The updated organization number value.
170
179
  """
171
180
  logger.debug(f"Args:\norgnr: {orgnr}\n")
172
181
  return orgnr
@@ -180,11 +189,11 @@ class Aarsregnskap(ABC):
180
189
  """Fetch and encode the PDF source based on the year and organization number.
181
190
 
182
191
  Args:
183
- aar (int): The year input value.
184
- orgnr (str): The organization number input value.
192
+ aar: The year input value.
193
+ orgnr: The organization number input value.
185
194
 
186
195
  Returns:
187
- str: A data URI for the PDF file, encoded in base64.
196
+ A data URI for the PDF file, encoded in base64.
188
197
 
189
198
  Raises:
190
199
  PreventUpdate: If the year or organization number is not provided.
@@ -66,8 +66,8 @@ class AggDistPlotter(ABC):
66
66
  """Initializes the AggDistPlotter.
67
67
 
68
68
  Args:
69
- time_units (list[str]): Your time variables used in the variable selector. Example year, quarter, month, etc.
70
- conn (object): A connection object to a database. It must have a .query method that can handle SQL queries.
69
+ time_units: Your time variables used in the variable selector. Example year, quarter, month, etc.
70
+ conn: A connection object to a database. It must have a .query method that can handle SQL queries.
71
71
  Currently designed with eimerdb in mind.
72
72
  """
73
73
  logger.warning(
@@ -235,7 +235,7 @@ class AggDistPlotter(ABC):
235
235
  This is an abstract method that must be implemented by subclasses to define the module's layout.
236
236
 
237
237
  Returns:
238
- html.Div: A Dash HTML Div component representing the layout of the module.
238
+ A Dash HTML Div component representing the layout of the module.
239
239
  """
240
240
  pass
241
241
 
@@ -1,6 +1,5 @@
1
- # TODO: Rewrite to window/tab implementation model
2
-
3
1
  import logging
2
+ import warnings
4
3
  from abc import ABC
5
4
  from abc import abstractmethod
6
5
  from typing import Any
@@ -36,7 +35,7 @@ default_col_def = {
36
35
  }
37
36
 
38
37
 
39
- class AltinnControlView(ABC):
38
+ class ControlView(ABC):
40
39
  """Provides a layout and functionality for a modal that offers a tabular view of the controls."""
41
40
 
42
41
  _id_number: int = 0
@@ -48,13 +47,13 @@ class AltinnControlView(ABC):
48
47
  conn: object,
49
48
  outputs: list[str] | None = None,
50
49
  ) -> None: # TODO add proper annotation for control_dict value
51
- """Initializes the AltinnControlView with time units, control dictionary, and database connection.
50
+ """Initializes the ControlView with time units, control dictionary, and database connection.
52
51
 
53
52
  Args:
54
- time_units (list): A list of the time units used.
55
- control_dict (dict): A dictionary with one control class per skjema.
56
- conn (object): The eimerdb connection.
57
- outputs (list[str] | None): Variable selector fields to output to. Defaults to ['ident']
53
+ time_units: A list of the time units used.
54
+ control_dict: A dictionary with one control class per skjema.
55
+ conn: The eimerdb connection.
56
+ outputs: Variable selector fields to output to. Defaults to ['ident']
58
57
  """
59
58
  logger.warning(
60
59
  f"{self.__class__.__name__} is under development and may change in future releases."
@@ -64,9 +63,9 @@ class AltinnControlView(ABC):
64
63
  assert hasattr(
65
64
  conn, "query"
66
65
  ), "The database connection object must have a 'query' method."
67
- self.module_number = AltinnControlView._id_number
66
+ self.module_number = ControlView._id_number
68
67
  self.module_name = self.__class__.__name__
69
- AltinnControlView._id_number += 1
68
+ ControlView._id_number += 1
70
69
 
71
70
  self.icon = "⚠️"
72
71
  self.label = "Kontroll"
@@ -91,7 +90,7 @@ class AltinnControlView(ABC):
91
90
  VariableSelector([], []).get_option("var-ident", search_target="id")
92
91
 
93
92
  def create_layout(self) -> html.Div:
94
- """Generates the layout for the AltinnControlView module.
93
+ """Generates the layout for the ControlView module.
95
94
 
96
95
  Returns:
97
96
  layout: A Div element containing two tables, kontroller and kontrollutslag.
@@ -156,7 +155,7 @@ class AltinnControlView(ABC):
156
155
 
157
156
  @abstractmethod
158
157
  def layout(self) -> html.Div:
159
- """Defines the layout for the AltinnControlView module.
158
+ """Defines the layout for the ControlView module.
160
159
 
161
160
  This is an abstract method that must be implemented by subclasses to define the module's layout.
162
161
 
@@ -166,7 +165,7 @@ class AltinnControlView(ABC):
166
165
  pass
167
166
 
168
167
  def module_callbacks(self) -> None:
169
- """Registers Dash callbacks for the AltinnControlView module."""
168
+ """Registers Dash callbacks for the ControlView module."""
170
169
 
171
170
  @callback(
172
171
  Output(f"{self.module_number}-kontroll-var", "children"),
@@ -474,14 +473,14 @@ class AltinnControlView(ABC):
474
473
  )
475
474
 
476
475
 
477
- class AltinnControlViewTab(TabImplementation, AltinnControlView):
478
- """AltinnControlView implemented as a tab."""
476
+ class ControlViewTab(TabImplementation, ControlView):
477
+ """ControlView implemented as a tab."""
479
478
 
480
479
  def __init__(
481
480
  self, time_units: list[str], control_dict: dict[str, Any], conn: object
482
481
  ) -> None:
483
- """Initializes the AltinnControlViewTab module."""
484
- AltinnControlView.__init__(
482
+ """Initializes the ControlViewTab module."""
483
+ ControlView.__init__(
485
484
  self,
486
485
  time_units=time_units,
487
486
  control_dict=control_dict,
@@ -490,14 +489,59 @@ class AltinnControlViewTab(TabImplementation, AltinnControlView):
490
489
  TabImplementation.__init__(self)
491
490
 
492
491
 
493
- class AltinnControlViewWindow(WindowImplementation, AltinnControlView):
494
- """AltinnControlView implemented as a window."""
492
+ class ControlViewWindow(WindowImplementation, ControlView):
493
+ """ControlView implemented as a window."""
494
+
495
+ def __init__(
496
+ self, time_units: list[str], control_dict: dict[str, Any], conn: object
497
+ ) -> None:
498
+ """Initializes the ControlViewWindow module."""
499
+ ControlView.__init__(
500
+ self,
501
+ time_units=time_units,
502
+ control_dict=control_dict,
503
+ conn=conn,
504
+ )
505
+ WindowImplementation.__init__(self)
506
+
507
+
508
+ # Temporary
509
+ class AltinnControlViewTab(TabImplementation, ControlView):
510
+ """ControlView implemented as a tab."""
495
511
 
496
512
  def __init__(
497
513
  self, time_units: list[str], control_dict: dict[str, Any], conn: object
498
514
  ) -> None:
499
- """Initializes the AltinnControlViewWindow module."""
500
- AltinnControlView.__init__(
515
+ """Initializes the ControlViewTab module."""
516
+ warnings.warn(
517
+ "AltinnControlViewTab is deprecated and will be removed in a future version. "
518
+ "Use ControlViewTab instead.",
519
+ FutureWarning,
520
+ stacklevel=2,
521
+ )
522
+ ControlView.__init__(
523
+ self,
524
+ time_units=time_units,
525
+ control_dict=control_dict,
526
+ conn=conn,
527
+ )
528
+ TabImplementation.__init__(self)
529
+
530
+
531
+ class AltinnControlViewWindow(WindowImplementation, ControlView):
532
+ """ControlView implemented as a window."""
533
+
534
+ def __init__(
535
+ self, time_units: list[str], control_dict: dict[str, Any], conn: object
536
+ ) -> None:
537
+ """Initializes the ControlViewWindow module."""
538
+ warnings.warn(
539
+ "AltinnControlViewWindow is deprecated and will be removed in a future version. "
540
+ "Use ControlViewWindow instead.",
541
+ FutureWarning,
542
+ stacklevel=2,
543
+ )
544
+ ControlView.__init__(
501
545
  self,
502
546
  time_units=time_units,
503
547
  control_dict=control_dict,
@@ -46,13 +46,13 @@ class AltinnDataCapture(ABC):
46
46
  """Initializes the AntinnDataCapture module.
47
47
 
48
48
  Args:
49
- time_units (list): A list of the time units used.
50
- label (str): The label for the module.
51
- database_type (str | None): The selected method / set of database connections. Defaults to None.
52
- database (object): The database connection.
49
+ time_units: A list of the time units used.
50
+ label: The label for the module.
51
+ database_type: The selected method / set of database connections. Defaults to None.
52
+ database: The database connection.
53
53
 
54
54
  Raises:
55
- TypeError if database is invalid connection type.
55
+ TypeError: If database is invalid connection type.
56
56
  """
57
57
  if not isinstance(database, EimerDBInstance) and not conn_is_ibis(database):
58
58
  raise TypeError(
@@ -4,7 +4,9 @@ It has a main view that acts as an organizer for several submodules with specifi
4
4
  """
5
5
 
6
6
  from .altinn_editor_main_view import AltinnSkjemadataEditor
7
+ from .altinn_editor_supporting_table import AltinnSupportTable
7
8
 
8
9
  __all__ = [
9
10
  "AltinnSkjemadataEditor",
11
+ "AltinnSupportTable",
10
12
  ]
@@ -32,10 +32,10 @@ class AltinnEditorComment:
32
32
  """Initializes the Altinn Editor Comment module.
33
33
 
34
34
  Args:
35
- conn (object): Database connection object that must have a 'query' method.
35
+ conn: Database connection object that must have a 'query' method.
36
36
 
37
37
  Raises:
38
- AssertionError: If the connection object does not have a 'query' method.
38
+ TypeError: If the connection object is not 'EimerDBInstance' or ibis connection.
39
39
  """
40
40
  if not isinstance(conn, EimerDBInstance) and not conn_is_ibis(conn):
41
41
  raise TypeError(
@@ -33,13 +33,12 @@ class AltinnEditorContact:
33
33
  """Initializes the Altinn Editor Contact module.
34
34
 
35
35
  Args:
36
- time_units (list[str]): List of time units to be used in the module.
37
- conn (object): Database connection object that must have a 'query' method.
38
- variable_selector_instance (VariableSelector): An instance of VariableSelector for variable selection.
36
+ time_units: List of time units to be used in the module.
37
+ conn: Database connection object that must have a 'query' method.
38
+ variable_selector_instance: An instance of VariableSelector for variable selection.
39
39
 
40
40
  Raises:
41
41
  TypeError: If variable_selector_instance is not an instance of VariableSelector.
42
- AssertionError: If the connection object does not have a 'query' method.
43
42
  """
44
43
  if not isinstance(conn, EimerDBInstance) and not conn_is_ibis(conn):
45
44
  raise TypeError(