mirror of
https://github.com/enso-org/enso.git
synced 2024-12-24 05:22:10 +03:00
Text Editor shows up for Text only parameters. (#9014)
- Fix type name so that Text Editor shows for parameters. - Following on from #9010, now show the default text values. ![image](https://github.com/enso-org/enso/assets/4699705/da68fec4-25b9-4e04-ba13-a2d112cf67c9)
This commit is contained in:
parent
9339672e0e
commit
aed59d316d
@ -187,7 +187,7 @@ test('Managing aggregates in `aggregate` node', async ({ page }) => {
|
|||||||
'.',
|
'.',
|
||||||
'Count_Distinct',
|
'Count_Distinct',
|
||||||
])
|
])
|
||||||
await expect(columnsArg.locator('.EnsoTextInputWidget > input')).toHaveValue('"column 1"')
|
await expect(columnsArg.locator('.EnsoTextInputWidget > input').first()).toHaveValue('"column 1"')
|
||||||
|
|
||||||
// Add another aggregate
|
// Add another aggregate
|
||||||
await columnsArg.locator('.add-item').click()
|
await columnsArg.locator('.add-item').click()
|
||||||
@ -222,7 +222,7 @@ test('Managing aggregates in `aggregate` node', async ({ page }) => {
|
|||||||
await dropDown.expectVisibleWithOptions(page, ['column 1', 'column 2'])
|
await dropDown.expectVisibleWithOptions(page, ['column 1', 'column 2'])
|
||||||
await dropDown.clickOption(page, 'column 2')
|
await dropDown.clickOption(page, 'column 2')
|
||||||
await expect(secondItem.locator('.WidgetToken')).toHaveText(['Aggregate_Column', '.', 'Group_By'])
|
await expect(secondItem.locator('.WidgetToken')).toHaveText(['Aggregate_Column', '.', 'Group_By'])
|
||||||
await expect(secondItem.locator('.EnsoTextInputWidget > input')).toHaveValue('"column 2"')
|
await expect(secondItem.locator('.EnsoTextInputWidget > input').first()).toHaveValue('"column 2"')
|
||||||
|
|
||||||
// Switch aggregates
|
// Switch aggregates
|
||||||
//TODO[ao] I have no idea how to emulate drag. Simple dragTo does not work (some element seem to capture event).
|
//TODO[ao] I have no idea how to emulate drag. Simple dragTo does not work (some element seem to capture event).
|
||||||
|
@ -10,7 +10,9 @@ const props = defineProps(widgetProps(widgetDefinition))
|
|||||||
const value = computed({
|
const value = computed({
|
||||||
get() {
|
get() {
|
||||||
const valueStr = WidgetInput.valueRepr(props.input)
|
const valueStr = WidgetInput.valueRepr(props.input)
|
||||||
return valueStr ?? ''
|
return typeof valueStr === 'string' && Ast.parse(valueStr) instanceof Ast.TextLiteral
|
||||||
|
? valueStr
|
||||||
|
: ''
|
||||||
},
|
},
|
||||||
set(value) {
|
set(value) {
|
||||||
props.onUpdate({
|
props.onUpdate({
|
||||||
@ -27,7 +29,7 @@ export const widgetDefinition = defineWidget(WidgetInput.isAstOrPlaceholder, {
|
|||||||
if (props.input.value instanceof Ast.TextLiteral) return Score.Perfect
|
if (props.input.value instanceof Ast.TextLiteral) return Score.Perfect
|
||||||
if (props.input.dynamicConfig?.kind === 'Text_Input') return Score.Perfect
|
if (props.input.dynamicConfig?.kind === 'Text_Input') return Score.Perfect
|
||||||
const type = props.input.expectedType
|
const type = props.input.expectedType
|
||||||
if (type === 'Standard.Base.Data.Text') return Score.Good
|
if (type === 'Standard.Base.Data.Text.Text') return Score.Good
|
||||||
return Score.Mismatch
|
return Score.Mismatch
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user