module IHP.IDE.SchemaDesigner.View.EnumValues.New where import IHP.ViewPrelude import IHP.IDE.SchemaDesigner.Types import IHP.IDE.ToolServer.Types import IHP.IDE.SchemaDesigner.View.Layout data NewEnumValueView = NewEnumValueView { statements :: [Statement] , enumName :: Text } instance View NewEnumValueView where html NewEnumValueView { .. } = [hsx|
{renderObjectSelector (zip [0..] statements) (Just enumName)} {renderEnumSelector enumName (zip [0..] values)}
{migrationStatus} {renderModal modal} |] where table = findStatementByName enumName statements values = maybe [] (.values) table modalContent = [hsx|
It's highly recommended to use snake case / underscores for naming your enum values
Use underscores instead of camel case. E.g.: public_user, in_progress, currency_eur
|] modalFooter = mempty modalCloseUrl = pathTo ShowEnumAction { enumName } modalTitle = "New Enum Value" modal = Modal { modalContent, modalFooter, modalCloseUrl, modalTitle }