From cfde8751429058663d2c8850d25024b4fb8aadaf Mon Sep 17 00:00:00 2001 From: Hans Kallekleiv <16436291+HansKallekleiv@users.noreply.github.com> Date: Thu, 24 Feb 2022 22:43:19 +0100 Subject: [PATCH] Replace modals with `wcc.Dialog` in `StructuralUncertainty` (#970) --- CHANGELOG.md | 4 ++ .../test_structural_uncertainty.py | 6 +- .../_assets/css/structural_uncertainty.css | 12 +--- .../controllers/__init__.py | 2 +- .../controllers/dialog_controller.py | 29 ++++++++ .../controllers/modal_controller.py | 29 -------- .../realization_filter_controller.py | 20 +++--- .../uncertainty_table_controller.py | 28 -------- .../structural_uncertainty.py | 48 +++++++------ .../_structural_uncertainty/views/__init__.py | 4 +- .../_structural_uncertainty/views/dialog.py | 61 ++++++++++++++++ .../views/intersection_and_map.py | 12 ---- .../views/intersection_data.py | 33 +++++---- .../_structural_uncertainty/views/map_data.py | 9 ++- .../_structural_uncertainty/views/modal.py | 71 ------------------- ...ization_modal.py => realization_filter.py} | 2 +- .../views/uncertainty_table.py | 14 +--- 17 files changed, 162 insertions(+), 222 deletions(-) create mode 100644 webviz_subsurface/plugins/_structural_uncertainty/controllers/dialog_controller.py delete mode 100644 webviz_subsurface/plugins/_structural_uncertainty/controllers/modal_controller.py create mode 100644 webviz_subsurface/plugins/_structural_uncertainty/views/dialog.py delete mode 100644 webviz_subsurface/plugins/_structural_uncertainty/views/modal.py rename webviz_subsurface/plugins/_structural_uncertainty/views/{realization_modal.py => realization_filter.py} (93%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6fc98a183..ed673e6a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [#940](https://github.com/equinor/webviz-subsurface/pull/940) - `SimulationTimeSeries` - Changed vector annotation from "AVG_" with suffix "R" and "INTVL_" to "PER_DAY_" and "PER_INTVL_". Retrieve `VectorDefinitions` via Python-API for `webviz-subsurface-components`. - [#956](https://github.com/equinor/webviz-subsurface/pull/956) - `SimulationTimeSeries` - Deprecate usage of user input options {vector1, vector2, vector3}. Add list of vectors as user input options for initially selected vectors. - [#961](https://github.com/equinor/webviz-subsurface/pull/961) - Improved error message when there are none valid realizations in an ensemble. +- [#970](https://github.com/equinor/webviz-subsurface/pull/970) - Replaced modals with new Dialog component in `StructuralUncertainty`. Changed display of uncertainty table to be a Dialog. + +### Fixed +- [#965](https://github.com/equinor/webviz-subsurface/pull/965) - Allow a filtered subset of surface names for multiple attributes in `StructuralUncertainty`. ### Fixed - [#965](https://github.com/equinor/webviz-subsurface/pull/965) - Allow a filtered subset of surface names for multiple attributes in `StructuralUncertainty`. diff --git a/tests/integration_tests/plugin_tests/test_structural_uncertainty.py b/tests/integration_tests/plugin_tests/test_structural_uncertainty.py index 7d1e759b9..95d979657 100644 --- a/tests/integration_tests/plugin_tests/test_structural_uncertainty.py +++ b/tests/integration_tests/plugin_tests/test_structural_uncertainty.py @@ -59,7 +59,7 @@ def test_default_configuration(dash_duo, app, testdata_folder) -> None: dash_duo.start_server(app) intersection_data_id = plugin.uuid("intersection-data") - modal_id = plugin.uuid("modal") + dialog_id = plugin.uuid("dialog") # Check some initialization # Check dropdowns for element, return_val in zip( @@ -102,8 +102,8 @@ def test_default_configuration(dash_duo, app, testdata_folder) -> None: # Check realizations real_filter_btn_uuid = stringify_object_id( { - "id": modal_id, - "modal_id": "realization-filter", + "id": dialog_id, + "dialog_id": "realization-filter", "element": "button-open", } ) diff --git a/webviz_subsurface/_assets/css/structural_uncertainty.css b/webviz_subsurface/_assets/css/structural_uncertainty.css index 7f1df1095..cac2fd6f4 100644 --- a/webviz_subsurface/_assets/css/structural_uncertainty.css +++ b/webviz_subsurface/_assets/css/structural_uncertainty.css @@ -48,13 +48,7 @@ margin-right: 10; } -.webviz-structunc-open-modal-btn { - margin-left: auto; - margin-right: auto; - display: block; - width: 100%; - background-color: #E8E8E8; -} + .webviz-structunc-details-main { cursor: pointer; @@ -77,9 +71,7 @@ box-shadow: 0px 0px 3px 0.5px lightgrey; } -.webviz-structunc-open-modal-btn:hover { - box-shadow: 0px 0px 3px 0.5px lightgrey; -} + .webviz-structunc-blue-apply-btn:hover { box-shadow: 0px 0px 3px 0.5px lightgrey; diff --git a/webviz_subsurface/plugins/_structural_uncertainty/controllers/__init__.py b/webviz_subsurface/plugins/_structural_uncertainty/controllers/__init__.py index 83b73e3a4..25a9e8421 100644 --- a/webviz_subsurface/plugins/_structural_uncertainty/controllers/__init__.py +++ b/webviz_subsurface/plugins/_structural_uncertainty/controllers/__init__.py @@ -1,6 +1,6 @@ +from .dialog_controller import open_dialogs from .intersection_controller import update_intersection from .intersection_source_controller import update_intersection_source from .map_controller import update_maps -from .modal_controller import open_modals from .realization_filter_controller import update_realizations from .uncertainty_table_controller import update_uncertainty_table diff --git a/webviz_subsurface/plugins/_structural_uncertainty/controllers/dialog_controller.py b/webviz_subsurface/plugins/_structural_uncertainty/controllers/dialog_controller.py new file mode 100644 index 000000000..73aa27f80 --- /dev/null +++ b/webviz_subsurface/plugins/_structural_uncertainty/controllers/dialog_controller.py @@ -0,0 +1,29 @@ +from typing import Callable, Optional + +from dash import MATCH, Dash, Input, Output, State +from dash.exceptions import PreventUpdate + + +def open_dialogs( + app: Dash, + get_uuid: Callable, +) -> None: + @app.callback( + Output( + {"id": get_uuid("dialog"), "dialog_id": MATCH, "element": "wrapper"}, + "open", + ), + Input( + {"id": get_uuid("dialog"), "dialog_id": MATCH, "element": "button-open"}, + "n_clicks", + ), + State( + {"id": get_uuid("dialog"), "dialog_id": MATCH, "element": "wrapper"}, + "open", + ), + ) + def _toggle_dialog_graph_settings(n_open: int, is_open: bool) -> Optional[bool]: + """Open or close graph settings dialog button""" + if n_open: + return not is_open + raise PreventUpdate diff --git a/webviz_subsurface/plugins/_structural_uncertainty/controllers/modal_controller.py b/webviz_subsurface/plugins/_structural_uncertainty/controllers/modal_controller.py deleted file mode 100644 index cf8d6932a..000000000 --- a/webviz_subsurface/plugins/_structural_uncertainty/controllers/modal_controller.py +++ /dev/null @@ -1,29 +0,0 @@ -from typing import Callable, Optional - -from dash import MATCH, Dash, Input, Output, State -from dash.exceptions import PreventUpdate - - -def open_modals( - app: Dash, - get_uuid: Callable, -) -> None: - @app.callback( - Output( - {"id": get_uuid("modal"), "modal_id": MATCH, "element": "wrapper"}, - "is_open", - ), - Input( - {"id": get_uuid("modal"), "modal_id": MATCH, "element": "button-open"}, - "n_clicks", - ), - State( - {"id": get_uuid("modal"), "modal_id": MATCH, "element": "wrapper"}, - "is_open", - ), - ) - def _toggle_modal_graph_settings(n_open: int, is_open: bool) -> Optional[bool]: - """Open or close graph settings modal button""" - if n_open: - return not is_open - raise PreventUpdate diff --git a/webviz_subsurface/plugins/_structural_uncertainty/controllers/realization_filter_controller.py b/webviz_subsurface/plugins/_structural_uncertainty/controllers/realization_filter_controller.py index e697c7bb5..ad8fc80f2 100644 --- a/webviz_subsurface/plugins/_structural_uncertainty/controllers/realization_filter_controller.py +++ b/webviz_subsurface/plugins/_structural_uncertainty/controllers/realization_filter_controller.py @@ -8,16 +8,16 @@ def update_realizations(app: Dash, get_uuid: Callable) -> None: @app.callback( Output( { - "id": get_uuid("modal"), - "modal_id": "realization-filter", + "id": get_uuid("dialog"), + "dialog_id": "realization-filter", "element": "apply", }, "disabled", ), Output( { - "id": get_uuid("modal"), - "modal_id": "realization-filter", + "id": get_uuid("dialog"), + "dialog_id": "realization-filter", "element": "apply", }, "style", @@ -47,8 +47,8 @@ def _activate_realization_apply_btn( ), Input( { - "id": get_uuid("modal"), - "modal_id": "realization-filter", + "id": get_uuid("dialog"), + "dialog_id": "realization-filter", "element": "apply", }, "n_clicks", @@ -70,16 +70,16 @@ def _store_realizations(btn_click: Optional[int], selected_reals: List) -> List: ), Input( { - "id": get_uuid("modal"), - "modal_id": "realization-filter", + "id": get_uuid("dialog"), + "dialog_id": "realization-filter", "element": "clear", }, "n_clicks", ), Input( { - "id": get_uuid("modal"), - "modal_id": "realization-filter", + "id": get_uuid("dialog"), + "dialog_id": "realization-filter", "element": "all", }, "n_clicks", diff --git a/webviz_subsurface/plugins/_structural_uncertainty/controllers/uncertainty_table_controller.py b/webviz_subsurface/plugins/_structural_uncertainty/controllers/uncertainty_table_controller.py index 9fce0fd81..22a3c870a 100644 --- a/webviz_subsurface/plugins/_structural_uncertainty/controllers/uncertainty_table_controller.py +++ b/webviz_subsurface/plugins/_structural_uncertainty/controllers/uncertainty_table_controller.py @@ -14,34 +14,6 @@ def update_uncertainty_table( surface_set_models: Dict[str, SurfaceSetModel], well_set_model: WellSetModel, ) -> None: - @app.callback( - Output({"id": get_uuid("uncertainty-table"), "element": "wrapper"}, "style"), - Output(get_uuid("all-maps-wrapper"), "style"), - Output( - get_uuid("uncertainty-table-display-button"), - "children", - ), - Input( - get_uuid("uncertainty-table-display-button"), - "n_clicks", - ), - ) - def _display_uncertainty_table(n_clicks: Optional[int]) -> Tuple[Dict, Dict, str]: - if not n_clicks: - raise PreventUpdate - if n_clicks % 2 == 0: - - return ( - {"height": "40vh", "display": "none"}, - {"height": "40vh", "display": "flex"}, - "Show uncertainty table", - ) - return ( - {"height": "40vh", "display": "block"}, - {"height": "40vh", "display": "none"}, - "Hide uncertainty table", - ) - @app.callback( Output({"id": get_uuid("uncertainty-table"), "element": "table"}, "data"), Output({"id": get_uuid("uncertainty-table"), "element": "label"}, "children"), diff --git a/webviz_subsurface/plugins/_structural_uncertainty/structural_uncertainty.py b/webviz_subsurface/plugins/_structural_uncertainty/structural_uncertainty.py index 39482218e..eabc1449b 100644 --- a/webviz_subsurface/plugins/_structural_uncertainty/structural_uncertainty.py +++ b/webviz_subsurface/plugins/_structural_uncertainty/structural_uncertainty.py @@ -16,7 +16,7 @@ from ._tour_steps import generate_tour_steps from .controllers import ( - open_modals, + open_dialogs, update_intersection, update_intersection_source, update_maps, @@ -25,11 +25,12 @@ ) from .views import ( clientside_stores, + dialog, intersection_and_map_layout, intersection_data_layout, map_data_layout, - modal, realization_layout, + uncertainty_table_layout, ) @@ -151,9 +152,6 @@ def __init__( / "css" / "structural_uncertainty.css" ) - WEBVIZ_ASSETS.add( - Path(webviz_subsurface.__file__).parent / "_assets" / "css" / "modal.css" - ) WEBVIZ_ASSETS.add( Path(webviz_subsurface.__file__).parent / "_assets" @@ -316,9 +314,9 @@ def layout(self) -> wcc.FlexBox: wcc.Selectors( label="Filters", children=[ - modal.open_modal_layout( - uuid=self.uuid("modal"), - modal_id="realization-filter", + dialog.open_dialog_layout( + uuid=self.uuid("dialog"), + dialog_id="realization-filter", title="Realization filter", ), ], @@ -334,22 +332,22 @@ def layout(self) -> wcc.FlexBox: ), ] ), - modal.modal_layout( - uuid=self.uuid("modal"), - modal_id="color", + dialog.dialog_layout( + uuid=self.uuid("dialog"), + dialog_id="color", title="Color settings", size="lg", - body_children=[ + children=[ html.Div( children=[self._color_picker.layout], ), ], ), - modal.modal_layout( - uuid=self.uuid("modal"), - modal_id="realization-filter", + dialog.dialog_layout( + uuid=self.uuid("dialog"), + dialog_id="realization-filter", title="Filter realizations", - body_children=[ + children=[ realization_layout( uuid=self.uuid("intersection-data"), realizations=self._realizations, @@ -357,16 +355,26 @@ def layout(self) -> wcc.FlexBox: "intersection_data", {} ).get("realizations", self._realizations), ), + dialog.clear_all_apply_dialog_buttons( + uuid=self.uuid("dialog"), dialog_id="realization-filter" + ), + ], + ), + dialog.dialog_layout( + uuid=self.uuid("dialog"), + dialog_id="uncertainty-table", + title="Uncertainty table", + children=[ + uncertainty_table_layout( + uuid=self.uuid("uncertainty-table"), + ) ], - footer=modal.clear_all_apply_modal_buttons( - uuid=self.uuid("modal"), modal_id="realization-filter" - ), ), ], ) def set_callbacks(self, app: Dash) -> None: - open_modals(app=app, get_uuid=self.uuid) + open_dialogs(app=app, get_uuid=self.uuid) update_realizations(app=app, get_uuid=self.uuid) update_intersection( app=app, diff --git a/webviz_subsurface/plugins/_structural_uncertainty/views/__init__.py b/webviz_subsurface/plugins/_structural_uncertainty/views/__init__.py index 08bbd60e7..d5f1052c3 100644 --- a/webviz_subsurface/plugins/_structural_uncertainty/views/__init__.py +++ b/webviz_subsurface/plugins/_structural_uncertainty/views/__init__.py @@ -2,5 +2,5 @@ from .intersection_and_map import intersection_and_map_layout from .intersection_data import intersection_data_layout from .map_data import map_data_layout -from .realization_modal import realization_layout -from .uncertainty_table import uncertainty_table_btn, uncertainty_table_layout +from .realization_filter import realization_layout +from .uncertainty_table import uncertainty_table_layout diff --git a/webviz_subsurface/plugins/_structural_uncertainty/views/dialog.py b/webviz_subsurface/plugins/_structural_uncertainty/views/dialog.py new file mode 100644 index 000000000..718b0102c --- /dev/null +++ b/webviz_subsurface/plugins/_structural_uncertainty/views/dialog.py @@ -0,0 +1,61 @@ +from typing import List + +import dash_bootstrap_components as dbc +import webviz_core_components as wcc +from dash import html + + +def dialog_layout( + uuid: str, + dialog_id: str, + title: str, + children: List, + size: str = "sm", +) -> wcc.Dialog: + + return wcc.Dialog( + # style={"marginTop": "20vh"}, + children=children, + id={"id": uuid, "dialog_id": dialog_id, "element": "wrapper"}, + max_width=size, + title=title, + draggable=True, + ) + + +def open_dialog_layout(uuid: str, dialog_id: str, title: str) -> dbc.Button: + return html.Div( + children=html.Button( + title, + id={"id": uuid, "dialog_id": dialog_id, "element": "button-open"}, + ), + ) + + +def clear_all_apply_dialog_buttons( + uuid: str, dialog_id: str, apply_disabled: bool = True +) -> html.Div: + return html.Div( + children=[ + dbc.Button( + "Clear", + style={"padding": "0 20px"}, + className="mr-1", + id={"id": uuid, "dialog_id": dialog_id, "element": "clear"}, + ), + dbc.Button( + "All", + style={"padding": "0 20px"}, + className="mr-1", + id={"id": uuid, "dialog_id": dialog_id, "element": "all"}, + ), + dbc.Button( + "Apply", + style={"padding": "0 20px", "visibility": "hidden"} + if apply_disabled + else {"padding": "0 20px"}, + className="mr-1", + id={"id": uuid, "dialog_id": dialog_id, "element": "apply"}, + ), + ] + ) diff --git a/webviz_subsurface/plugins/_structural_uncertainty/views/intersection_and_map.py b/webviz_subsurface/plugins/_structural_uncertainty/views/intersection_and_map.py index ccc172e38..e44abb5b5 100644 --- a/webviz_subsurface/plugins/_structural_uncertainty/views/intersection_and_map.py +++ b/webviz_subsurface/plugins/_structural_uncertainty/views/intersection_and_map.py @@ -4,8 +4,6 @@ from dash import html from webviz_subsurface_components import LeafletMap -from .uncertainty_table import uncertainty_table_layout - def intersection_and_map_layout(get_uuid: Callable) -> html.Div: """Layout for the intersection graph and maps""" @@ -67,16 +65,6 @@ def intersection_and_map_layout(get_uuid: Callable) -> html.Div: ), ], ), - wcc.Frame( - id={ - "id": get_uuid("uncertainty-table"), - "element": "wrapper", - }, - style={"height": "40vh", "display": "none"}, - children=uncertainty_table_layout( - uuid=get_uuid("uncertainty-table"), - ), - ), ], ), ], diff --git a/webviz_subsurface/plugins/_structural_uncertainty/views/intersection_data.py b/webviz_subsurface/plugins/_structural_uncertainty/views/intersection_data.py index f8051913f..550b3ba3b 100644 --- a/webviz_subsurface/plugins/_structural_uncertainty/views/intersection_data.py +++ b/webviz_subsurface/plugins/_structural_uncertainty/views/intersection_data.py @@ -1,11 +1,9 @@ from typing import Callable, Dict, List, Optional -import dash_bootstrap_components as dbc import webviz_core_components as wcc from dash import dcc, html -from .modal import open_modal_layout -from .uncertainty_table import uncertainty_table_btn +from .dialog import open_dialog_layout def intersection_data_layout( @@ -79,9 +77,10 @@ def intersection_data_layout( uuid=get_uuid("apply-intersection-data-selections"), title="Update intersection", ), - uncertainty_table_btn( - uuid=get_uuid("uncertainty-table-display-button"), - disabled=not use_wells, + open_dialog_layout( + dialog_id="uncertainty-table", + uuid=get_uuid("dialog"), + title="Uncertainty table", ), settings_layout(get_uuid, initial_settings=initial_settings), ], @@ -136,7 +135,7 @@ def xline_layout(uuid: str, surface_geometry: Dict) -> html.Div: wcc.FlexBox( style={"fontSize": "0.8em"}, children=[ - dbc.Input( + dcc.Input( id={"id": uuid, "cross-section": "xline", "element": "value"}, style={"flex": 3, "minWidth": "100px"}, type="number", @@ -147,11 +146,11 @@ def xline_layout(uuid: str, surface_geometry: Dict) -> html.Div: persistence=True, persistence_type="session", ), - dbc.Label( + wcc.Label( style={"flex": 1, "marginLeft": "10px", "minWidth": "20px"}, children="Step:", ), - dbc.Input( + dcc.Input( id={"id": uuid, "cross-section": "xline", "element": "step"}, style={"flex": 2, "minWidth": "20px"}, value=500, @@ -179,7 +178,7 @@ def yline_layout(uuid: str, surface_geometry: Dict) -> html.Div: wcc.FlexBox( style={"fontSize": "0.8em"}, children=[ - dbc.Input( + dcc.Input( id={"id": uuid, "cross-section": "yline", "element": "value"}, style={"flex": 3, "minWidth": "100px"}, type="number", @@ -190,11 +189,11 @@ def yline_layout(uuid: str, surface_geometry: Dict) -> html.Div: persistence=True, persistence_type="session", ), - dbc.Label( + wcc.Label( style={"flex": 1, "marginLeft": "10px", "minWidth": "20px"}, children="Step:", ), - dbc.Input( + dcc.Input( id={"id": uuid, "cross-section": "yline", "element": "step"}, style={"flex": 2, "minWidth": "20px"}, value=50, @@ -333,7 +332,7 @@ def options_layout( wcc.FlexBox( style={"display": "flex"}, children=[ - dbc.Input( + dcc.Input( id={ "id": uuid, "settings": "zrange_min", @@ -346,7 +345,7 @@ def options_layout( persistence=True, persistence_type="session", ), - dbc.Input( + dcc.Input( id={ "id": uuid, "settings": "zrange_max", @@ -406,9 +405,9 @@ def settings_layout(get_uuid: Callable, initial_settings: Dict) -> html.Div: extension=initial_settings.get("extension", 500), initial_layout=initial_settings.get("intersection_layout", {}), ), - open_modal_layout( - modal_id="color", - uuid=get_uuid("modal"), + open_dialog_layout( + dialog_id="color", + uuid=get_uuid("dialog"), title="Intersection colors", ), ], diff --git a/webviz_subsurface/plugins/_structural_uncertainty/views/map_data.py b/webviz_subsurface/plugins/_structural_uncertainty/views/map_data.py index 37ef8e7db..93ffca1ac 100644 --- a/webviz_subsurface/plugins/_structural_uncertainty/views/map_data.py +++ b/webviz_subsurface/plugins/_structural_uncertainty/views/map_data.py @@ -1,8 +1,7 @@ from typing import List -import dash_bootstrap_components as dbc import webviz_core_components as wcc -from dash import html +from dash import dcc, html def map_data_layout( @@ -13,7 +12,7 @@ def map_data_layout( realizations: List[int], use_wells: bool, ) -> html.Div: - """Layout for the map data modal""" + """Layout for the map data dialog""" return html.Div( children=[ wcc.Selectors( @@ -153,7 +152,7 @@ def color_range_layout(uuid: str, map_id: str) -> wcc.FlexBox: "Surface A" if map_id == "map1" else "Surface B", style={"flex": 1, "minWidth": "40px"}, ), - dbc.Input( + dcc.Input( id={ "id": uuid, "colors": f"{map_id}_clip_min", @@ -166,7 +165,7 @@ def color_range_layout(uuid: str, map_id: str) -> wcc.FlexBox: persistence=True, persistence_type="session", ), - dbc.Input( + dcc.Input( id={ "id": uuid, "colors": f"{map_id}_clip_max", diff --git a/webviz_subsurface/plugins/_structural_uncertainty/views/modal.py b/webviz_subsurface/plugins/_structural_uncertainty/views/modal.py deleted file mode 100644 index 1485de120..000000000 --- a/webviz_subsurface/plugins/_structural_uncertainty/views/modal.py +++ /dev/null @@ -1,71 +0,0 @@ -from typing import List, Optional - -import dash_bootstrap_components as dbc -from dash import html - - -def modal_layout( - uuid: str, - modal_id: str, - title: str, - body_children: List, - footer: Optional[dbc.ModalFooter] = None, - size: str = "sm", -) -> dbc.Modal: - modalchildren = [ - dbc.ModalHeader(title), - dbc.ModalBody( - children=[*body_children], - ), - ] - if footer: - modalchildren.append(footer) - return dbc.Modal( - style={"marginTop": "20vh"}, - children=modalchildren, - id={"id": uuid, "modal_id": modal_id, "element": "wrapper"}, - size=size, - ) - - -def open_modal_layout(uuid: str, modal_id: str, title: str) -> dbc.Button: - return html.Div( - children=html.Button( - title, - className="webviz-structunc-open-modal-btn", - id={"id": uuid, "modal_id": modal_id, "element": "button-open"}, - ), - ) - - -def clear_all_apply_modal_buttons( - uuid: str, modal_id: str, apply_disabled: bool = True -) -> dbc.ModalFooter: - return dbc.ModalFooter( - children=[ - html.Div( - children=[ - dbc.Button( - "Clear", - style={"padding": "0 20px"}, - className="mr-1", - id={"id": uuid, "modal_id": modal_id, "element": "clear"}, - ), - dbc.Button( - "All", - style={"padding": "0 20px"}, - className="mr-1", - id={"id": uuid, "modal_id": modal_id, "element": "all"}, - ), - dbc.Button( - "Apply", - style={"padding": "0 20px", "visibility": "hidden"} - if apply_disabled - else {"padding": "0 20px"}, - className="mr-1", - id={"id": uuid, "modal_id": modal_id, "element": "apply"}, - ), - ] - ), - ] - ) diff --git a/webviz_subsurface/plugins/_structural_uncertainty/views/realization_modal.py b/webviz_subsurface/plugins/_structural_uncertainty/views/realization_filter.py similarity index 93% rename from webviz_subsurface/plugins/_structural_uncertainty/views/realization_modal.py rename to webviz_subsurface/plugins/_structural_uncertainty/views/realization_filter.py index 5cf67944b..3d8f4cf4f 100644 --- a/webviz_subsurface/plugins/_structural_uncertainty/views/realization_modal.py +++ b/webviz_subsurface/plugins/_structural_uncertainty/views/realization_filter.py @@ -7,7 +7,7 @@ def realization_layout( uuid: str, realizations: List[int], value: List[int] ) -> html.Div: - """Layout for the realization filter modal""" + """Layout for the realization filter dialog""" return html.Div( style={"marginTop": "10px"}, children=html.Label( diff --git a/webviz_subsurface/plugins/_structural_uncertainty/views/uncertainty_table.py b/webviz_subsurface/plugins/_structural_uncertainty/views/uncertainty_table.py index dab922c23..25e2d9f1c 100644 --- a/webviz_subsurface/plugins/_structural_uncertainty/views/uncertainty_table.py +++ b/webviz_subsurface/plugins/_structural_uncertainty/views/uncertainty_table.py @@ -5,9 +5,8 @@ def uncertainty_table_layout( uuid: str, ) -> html.Div: - """Layout for the uncertainty table modal""" + """Layout for the uncertainty table dialog""" return html.Div( - className="webviz-structunc-uncertainty-table-wrapper", children=[ wcc.FlexBox( children=[ @@ -73,14 +72,3 @@ def uncertainty_table_layout( ), ], ) - - -def uncertainty_table_btn(uuid: str, disabled: bool = False) -> html.Button: - return html.Div( - children=html.Button( - "Show uncertainty table", - className="webviz-structunc-open-modal-btn", - id=uuid, - disabled=disabled, - ), - )