|
@@ -12,18 +12,27 @@
|
|
import typing as t
|
|
import typing as t
|
|
from datetime import datetime
|
|
from datetime import datetime
|
|
|
|
|
|
|
|
+from taipy.core import Cycle, DataNode, Job, Scenario, Sequence, Task
|
|
from taipy.gui import Gui
|
|
from taipy.gui import Gui
|
|
from taipy.gui.extension import Element, ElementLibrary, ElementProperty, PropertyType
|
|
from taipy.gui.extension import Element, ElementLibrary, ElementProperty, PropertyType
|
|
|
|
|
|
from ..version import _get_version
|
|
from ..version import _get_version
|
|
from ._adapters import (
|
|
from ._adapters import (
|
|
_GuiCoreDatanodeAdapter,
|
|
_GuiCoreDatanodeAdapter,
|
|
|
|
+ _GuiCoreDoNotUpdate,
|
|
_GuiCoreScenarioAdapter,
|
|
_GuiCoreScenarioAdapter,
|
|
_GuiCoreScenarioDagAdapter,
|
|
_GuiCoreScenarioDagAdapter,
|
|
_GuiCoreScenarioProperties,
|
|
_GuiCoreScenarioProperties,
|
|
)
|
|
)
|
|
from ._context import _GuiCoreContext
|
|
from ._context import _GuiCoreContext
|
|
|
|
|
|
|
|
+Scenario.__bases__ += (_GuiCoreDoNotUpdate,)
|
|
|
|
+Sequence.__bases__ += (_GuiCoreDoNotUpdate,)
|
|
|
|
+DataNode.__bases__ += (_GuiCoreDoNotUpdate,)
|
|
|
|
+Cycle.__bases__ += (_GuiCoreDoNotUpdate,)
|
|
|
|
+Job.__bases__ += (_GuiCoreDoNotUpdate,)
|
|
|
|
+Task.__bases__ += (_GuiCoreDoNotUpdate,)
|
|
|
|
+
|
|
|
|
|
|
class _GuiCore(ElementLibrary):
|
|
class _GuiCore(ElementLibrary):
|
|
__LIB_NAME = "taipy_gui_core"
|
|
__LIB_NAME = "taipy_gui_core"
|
|
@@ -64,7 +73,7 @@ class _GuiCore(ElementLibrary):
|
|
"show_dialog": ElementProperty(PropertyType.boolean, True),
|
|
"show_dialog": ElementProperty(PropertyType.boolean, True),
|
|
__SEL_SCENARIOS_PROP: ElementProperty(PropertyType.dynamic_list),
|
|
__SEL_SCENARIOS_PROP: ElementProperty(PropertyType.dynamic_list),
|
|
"multiple": ElementProperty(PropertyType.boolean, False),
|
|
"multiple": ElementProperty(PropertyType.boolean, False),
|
|
- "filter_by": ElementProperty(_GuiCoreScenarioProperties),
|
|
|
|
|
|
+ "filter": ElementProperty(_GuiCoreScenarioProperties, _GuiCoreScenarioProperties.DEFAULT),
|
|
},
|
|
},
|
|
inner_properties={
|
|
inner_properties={
|
|
"inner_scenarios": ElementProperty(
|
|
"inner_scenarios": ElementProperty(
|
|
@@ -75,9 +84,7 @@ class _GuiCore(ElementLibrary):
|
|
"on_scenario_crud": ElementProperty(PropertyType.function, f"{{{__CTX_VAR_NAME}.crud_scenario}}"),
|
|
"on_scenario_crud": ElementProperty(PropertyType.function, f"{{{__CTX_VAR_NAME}.crud_scenario}}"),
|
|
"configs": ElementProperty(PropertyType.react, f"{{{__CTX_VAR_NAME}.get_scenario_configs()}}"),
|
|
"configs": ElementProperty(PropertyType.react, f"{{{__CTX_VAR_NAME}.get_scenario_configs()}}"),
|
|
"core_changed": ElementProperty(PropertyType.broadcast, _GuiCoreContext._CORE_CHANGED_NAME),
|
|
"core_changed": ElementProperty(PropertyType.broadcast, _GuiCoreContext._CORE_CHANGED_NAME),
|
|
- "error": ElementProperty(
|
|
|
|
- PropertyType.react, f"{{{__SCENARIO_SELECTOR_ERROR_VAR}<tp:uniq:sc>}}"
|
|
|
|
- ),
|
|
|
|
|
|
+ "error": ElementProperty(PropertyType.react, f"{{{__SCENARIO_SELECTOR_ERROR_VAR}<tp:uniq:sc>}}"),
|
|
"type": ElementProperty(PropertyType.inner, __SCENARIO_ADAPTER),
|
|
"type": ElementProperty(PropertyType.inner, __SCENARIO_ADAPTER),
|
|
"scenario_edit": ElementProperty(
|
|
"scenario_edit": ElementProperty(
|
|
_GuiCoreScenarioAdapter,
|
|
_GuiCoreScenarioAdapter,
|
|
@@ -116,9 +123,7 @@ class _GuiCore(ElementLibrary):
|
|
"on_submit": ElementProperty(PropertyType.function, f"{{{__CTX_VAR_NAME}.submit_entity}}"),
|
|
"on_submit": ElementProperty(PropertyType.function, f"{{{__CTX_VAR_NAME}.submit_entity}}"),
|
|
"on_delete": ElementProperty(PropertyType.function, f"{{{__CTX_VAR_NAME}.crud_scenario}}"),
|
|
"on_delete": ElementProperty(PropertyType.function, f"{{{__CTX_VAR_NAME}.crud_scenario}}"),
|
|
"core_changed": ElementProperty(PropertyType.broadcast, _GuiCoreContext._CORE_CHANGED_NAME),
|
|
"core_changed": ElementProperty(PropertyType.broadcast, _GuiCoreContext._CORE_CHANGED_NAME),
|
|
- "error": ElementProperty(
|
|
|
|
- PropertyType.react, f"{{{__SCENARIO_VIZ_ERROR_VAR}<tp:uniq:sv>}}"
|
|
|
|
- ),
|
|
|
|
|
|
+ "error": ElementProperty(PropertyType.react, f"{{{__SCENARIO_VIZ_ERROR_VAR}<tp:uniq:sv>}}"),
|
|
"update_sc_vars": ElementProperty(
|
|
"update_sc_vars": ElementProperty(
|
|
PropertyType.string,
|
|
PropertyType.string,
|
|
f"error_id={__SCENARIO_SELECTOR_ERROR_VAR}<tp:uniq:sv>",
|
|
f"error_id={__SCENARIO_SELECTOR_ERROR_VAR}<tp:uniq:sv>",
|
|
@@ -188,9 +193,7 @@ class _GuiCore(ElementLibrary):
|
|
inner_properties={
|
|
inner_properties={
|
|
"on_edit": ElementProperty(PropertyType.function, f"{{{__CTX_VAR_NAME}.edit_data_node}}"),
|
|
"on_edit": ElementProperty(PropertyType.function, f"{{{__CTX_VAR_NAME}.edit_data_node}}"),
|
|
"core_changed": ElementProperty(PropertyType.broadcast, _GuiCoreContext._CORE_CHANGED_NAME),
|
|
"core_changed": ElementProperty(PropertyType.broadcast, _GuiCoreContext._CORE_CHANGED_NAME),
|
|
- "error": ElementProperty(
|
|
|
|
- PropertyType.react, f"{{{__DATANODE_VIZ_ERROR_VAR}<tp:uniq:dn>}}"
|
|
|
|
- ),
|
|
|
|
|
|
+ "error": ElementProperty(PropertyType.react, f"{{{__DATANODE_VIZ_ERROR_VAR}<tp:uniq:dn>}}"),
|
|
"scenarios": ElementProperty(
|
|
"scenarios": ElementProperty(
|
|
PropertyType.lov,
|
|
PropertyType.lov,
|
|
f"{{{__CTX_VAR_NAME}.get_scenarios_for_owner({__DATANODE_VIZ_OWNER_ID_VAR}<tp:uniq:dn>)}}",
|
|
f"{{{__CTX_VAR_NAME}.get_scenarios_for_owner({__DATANODE_VIZ_OWNER_ID_VAR}<tp:uniq:dn>)}}",
|
|
@@ -203,13 +206,11 @@ class _GuiCore(ElementLibrary):
|
|
),
|
|
),
|
|
"history": ElementProperty(
|
|
"history": ElementProperty(
|
|
PropertyType.react,
|
|
PropertyType.react,
|
|
- f"{{{__CTX_VAR_NAME}.get_data_node_history("
|
|
|
|
- + f"{__DATANODE_VIZ_HISTORY_ID_VAR}<tp:uniq:dn>)}}",
|
|
|
|
|
|
+ f"{{{__CTX_VAR_NAME}.get_data_node_history(" + f"{__DATANODE_VIZ_HISTORY_ID_VAR}<tp:uniq:dn>)}}",
|
|
),
|
|
),
|
|
"tabular_data": ElementProperty(
|
|
"tabular_data": ElementProperty(
|
|
PropertyType.data,
|
|
PropertyType.data,
|
|
- f"{{{__CTX_VAR_NAME}.get_data_node_tabular_data("
|
|
|
|
- + f"{__DATANODE_VIZ_DATA_ID_VAR}<tp:uniq:dn>)}}",
|
|
|
|
|
|
+ f"{{{__CTX_VAR_NAME}.get_data_node_tabular_data(" + f"{__DATANODE_VIZ_DATA_ID_VAR}<tp:uniq:dn>)}}",
|
|
),
|
|
),
|
|
"tabular_columns": ElementProperty(
|
|
"tabular_columns": ElementProperty(
|
|
PropertyType.dynamic_string,
|
|
PropertyType.dynamic_string,
|
|
@@ -260,9 +261,7 @@ class _GuiCore(ElementLibrary):
|
|
"core_changed": ElementProperty(PropertyType.broadcast, _GuiCoreContext._CORE_CHANGED_NAME),
|
|
"core_changed": ElementProperty(PropertyType.broadcast, _GuiCoreContext._CORE_CHANGED_NAME),
|
|
"type": ElementProperty(PropertyType.inner, __JOB_ADAPTER),
|
|
"type": ElementProperty(PropertyType.inner, __JOB_ADAPTER),
|
|
"on_job_action": ElementProperty(PropertyType.function, f"{{{__CTX_VAR_NAME}.act_on_jobs}}"),
|
|
"on_job_action": ElementProperty(PropertyType.function, f"{{{__CTX_VAR_NAME}.act_on_jobs}}"),
|
|
- "error": ElementProperty(
|
|
|
|
- PropertyType.dynamic_string, f"{{{__JOB_SELECTOR_ERROR_VAR}<tp:uniq:jb>}}"
|
|
|
|
- ),
|
|
|
|
|
|
+ "error": ElementProperty(PropertyType.dynamic_string, f"{{{__JOB_SELECTOR_ERROR_VAR}<tp:uniq:jb>}}"),
|
|
"update_jb_vars": ElementProperty(
|
|
"update_jb_vars": ElementProperty(
|
|
PropertyType.string, f"error_id={__JOB_SELECTOR_ERROR_VAR}<tp:uniq:jb>"
|
|
PropertyType.string, f"error_id={__JOB_SELECTOR_ERROR_VAR}<tp:uniq:jb>"
|
|
),
|
|
),
|