Created
August 26, 2015 09:56
-
-
Save zindel/6424deaa6a814bf0b303 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from rex.core import OMapVal | |
from rex.action import Wizard, Action, Page | |
from rex.action.typing import ValueType | |
from rex.widget import Widget, WidgetComposition, Field, WidgetVal | |
OMap = OMapVal() | |
TableType = ValueType('table') | |
class InitialTableList(Action): | |
name = 'initial-table-list' | |
js_type = 'props-idea/lib/Placeholder.js' | |
output = Field(TableType) | |
def context(self): | |
input = self.domain.record() | |
output = self.domain.record(table=TableType) | |
return input, self.output | |
class TableInfo(Action): | |
name = 'table-info' | |
js_type = 'props-idea/lib/Placeholder.js' | |
def context(self): | |
input = self.domain.record(table=TableType) | |
output = self.domain.record(table=TableType) | |
return input, output | |
class TableList(Action): | |
name = 'table-list' | |
js_type = 'props-idea/lib/Placeholder.js' | |
def context(self): | |
input = self.domain.record(table=TableType) | |
output = self.domain.record(table=TableType) | |
return input, output | |
class TableColumns(Action): | |
name = 'table-columns' | |
js_type = 'props-idea/lib/Placeholder.js' | |
def context(self): | |
input = self.domain.record(table=TableType) | |
output = self.domain.record(table=TableType) | |
return input, output | |
class IdeaDeployEditorWidgetImpl(Widget): | |
name = 'IdeaDeployEditorWidgetImpl' | |
js_type = 'props-idea/lib/IdeaDeployEditor' | |
wizard = Field(WidgetVal(), default=None) | |
class IdeaDeployEditorWidget(WidgetComposition): | |
name = 'IdeaDeployEditorWidget' | |
def render(self): | |
return IdeaDeployEditorWidgetImpl( | |
wizard=Wizard( | |
actions={ | |
'root': InitialTableList( | |
id='root', | |
title='Tables', | |
output=OMap([('table1', 'table')]) | |
) | |
}, | |
path=OMap([('root', None)]), | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment