Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(data-templates): filter is empty #2193

Merged
merged 1 commit into from
Jul 6, 2023
Merged

fix(data-templates): filter is empty #2193

merged 1 commit into from
Jul 6, 2023

Conversation

zhangzhonghe
Copy link
Contributor

@zhangzhonghe zhangzhonghe commented Jul 6, 2023

Description (Bug 描述)

Steps to reproduce (复现步骤)

img_v2_0acafe6f-63ae-41db-8cd1-b2cdd884541g

Expected behavior (预期行为)

filter 参数应该有值

Actual behavior (实际行为)

filter 参数为空

Related issues (相关 issue)

#2161

Reason (原因)

#2161field.componentProps?.service?.params?.filter 修改成了 fieldSchema?.['x-component-props']?.service?.params?.filter 以解决变量字符串(包裹在 {{}} 中的字符串)被提前解析的问题。但是这里的 fieldSchema?.['x-component-props']?.service?.params?.filter 的值是一个 {{ getFilter($self.componentProps.service.resource, $self.value) }} 这样的字符串,这个字符串并不是一个变量,进而导致被解析为空。
image

Solution (解决方案)

  1. filter 参数通常是一个对象
  2. 所以当 filter 是一个字符串的时候就可以假设这是类似于 {{ 1 + 1 }} 的字符串
  3. 这个时候需要去 field.componentProps 里面去取值,这里面的值是经过编译之后的值

Testing

建议回归一下 #2161 @hongboji

其它

close T-858

@height
Copy link

height bot commented Jul 6, 2023

This pull request has been linked to and will mark 1 task as "Done" when merged:

💡Tip: You can link multiple Height tasks to a pull request.

@chenos chenos changed the title fix(data-templates): fix filter is empty fix(data-templates): filter is empty Jul 6, 2023
@chenos chenos merged commit f44c5f3 into main Jul 6, 2023
4 checks passed
@chenos chenos deleted the T-858 branch July 6, 2023 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants