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

feat: support protobuf on Web #2320

Merged
merged 14 commits into from
Mar 6, 2022
Merged

Conversation

oil-oil
Copy link
Contributor

@oil-oil oil-oil commented Feb 16, 2022

Please answer these questions before submitting a pull request, or your PR will get closed.

Why submit this pull request?

  • Bugfix
  • New feature provided
  • Improve performance
  • Backport patches

What changes will this PR take into?

I added a page to manage protos for the apisix dashboard. In order to support the monaco editor to prompt the proto file code, I upgraded its version .

List page:
image

Edit page:
image

Related issues

resolve #2189

Checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

@codecov-commenter
Copy link

codecov-commenter commented Feb 16, 2022

Codecov Report

Merging #2320 (0b962e6) into master (2aadeff) will increase coverage by 0.45%.
The diff coverage is 93.44%.

❗ Current head 0b962e6 differs from pull request most recent head 11e2808. Consider uploading reports for the commit 11e2808 to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2320      +/-   ##
==========================================
+ Coverage   68.07%   68.52%   +0.45%     
==========================================
  Files         128      131       +3     
  Lines        3358     3419      +61     
  Branches      822      826       +4     
==========================================
+ Hits         2286     2343      +57     
- Misses       1072     1076       +4     
Flag Coverage Δ
frontend-e2e-test 68.52% <93.44%> (+0.45%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
web/src/helpers.tsx 73.77% <ø> (ø)
...b/src/pages/Proto/components/ProtoDrawer/index.tsx 88.46% <88.46%> (ø)
web/src/pages/Proto/List.tsx 96.15% <96.15%> (ø)
web/src/pages/Proto/service.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2aadeff...11e2808. Read the comment docs.

@juzhiyuan
Copy link
Member

cc @Baoyuantop @guoqqqi to have a review

@oil-oil
Copy link
Contributor Author

oil-oil commented Mar 1, 2022

@guoqqqi @Baoyuantop Please help me review.😃

@Baoyuantop
Copy link
Contributor

also cc @bzp2010 @LiteSun

@oil-oil
Copy link
Contributor Author

oil-oil commented Mar 2, 2022

@LiteSun Please help me re execute CI. I can pass it in the development environment.

Copy link
Member

@guoqqqi guoqqqi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM


useEffect(() => {
const { page = 1, pageSize = 10 } = querystring.parse(window.location.search);
setPaginationConfig({ pageSize: Number(pageSize), current: Number(page) });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about using your usepagination? (we could merge that one first)

@oil-oil
Copy link
Contributor Author

oil-oil commented Mar 4, 2022

@juzhiyuan @bzp2010 Please help me re execute CI. I can pass it in the development environment.

@membphis membphis requested a review from nic-chen March 4, 2022 06:47
@nic-chen
Copy link
Member

nic-chen commented Mar 4, 2022

LGTM with the screenshots and test cases.

BTW, do we have a plan to support selecting proto on the UI of the plugin grpc-transcode? Thanks!

export default {
'page.proto.list': 'Proto List',
'page.proto.list.description':
"Protocol buffers are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data.You define how you want your data to be structured once, then you can use special generated source code to easily write and read your structured data to and from a variety of data streams and using a variety of languages.",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The relationship between the proto and the grpc-transcode plugin needs to be explained.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @oil-oil , we must explain that the proto resources here are used in the grpc-transcode plugin and that the proto resources created here can be accessed by selecting the corresponding IDs when the grpc-transcode plugin is opened. There is no need to explain what Protocol buffers are.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oil-oil I see your update. LGTM, but should be better to keep the previous introduction.

@oil-oil
Copy link
Contributor Author

oil-oil commented Mar 4, 2022

LGTM with the screenshots and test cases.

BTW, do we have a plan to support selecting proto on the UI of the plugin grpc-transcode? Thanks!

You can create a new issue after the current PR is merged, Maybe I'll try to develop it. 😀

@nic-chen
Copy link
Member

nic-chen commented Mar 4, 2022

@Baoyuantop please have a look again.

export default {
'page.proto.list': 'Proto 列表',
'page.proto.list.description':
'Protocol Buffers 是 Google 用于序列化结构化数据的框架,它具有语言中立、平台中立、可扩展机制的特性,您只需定义一次数据的结构化方式,然后就可以使用各种语言通过特殊生成的源代码轻松地将结构化数据写入和读取各种数据流。',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@bzp2010 bzp2010 requested a review from juzhiyuan March 4, 2022 12:12
@juzhiyuan juzhiyuan merged commit 6367ffd into apache:master Mar 6, 2022
@oil-oil oil-oil deleted the support-protobuf-on-web branch March 6, 2022 07:44
hongbinhsu pushed a commit to fitphp/apix-dashboard that referenced this pull request Mar 13, 2022
* origin:
  feat: release 2.11.0 (apache#2361)
  feat: add data loader framework (apache#2371)
  feat: improve Consumer module (apache#2327)
  fix: ! (reverse) operator not handled correctly (apache#2364)
  chore: modify the select upstream field to upstream (apache#2344)
  feat: support protobuf on Web (apache#2320)
  chore: Extract paging related functions into standalone hook (apache#2334)
  feat: basic support Apache APISIX 2.12.1 (apache#2315)

# Conflicts:
#	web/src/helpers.tsx
#	web/yarn.lock
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.

support protobuf on Web
8 participants