-
Notifications
You must be signed in to change notification settings - Fork 539
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 data loader in frontend #2480
Conversation
f7e93ca
to
09b5350
Compare
Codecov Report
@@ Coverage Diff @@
## master #2480 +/- ##
==========================================
- Coverage 71.55% 67.51% -4.05%
==========================================
Files 60 133 +73
Lines 3966 3469 -497
Branches 0 846 +846
==========================================
- Hits 2838 2342 -496
- Misses 838 1127 +289
+ Partials 290 0 -290
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
web/src/pages/Route/locales/zh-CN.ts
Outdated
'page.route.data_loader.tips.input_task_name': '请输入导入任务名称', | ||
'page.route.data_loader.tips.click_upload': '点击上传', | ||
'page.route.data_loader.tips.openapi3_merge_method': | ||
'是否将 OpenAPI 路径中的多个 HTTP 方法合并为单一路由。当你的路径中多个HTTP方法有不同的细节配置(如securitySchema),你可以关闭这个选项,将为不同的 HTTP 方法生成单独的路由。', |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
About testImport using the new For routes a pre-check is performed before writing the data to make sure there are no duplicate routes with the same effect; for upstream, the detection is performed only at the time of writing. Therefore, if the route is duplicated, none of it will be written; if the upstream is duplicated, the route will be written and the upstream will fail to write. |
|
||
'page.route.fields.vars.invalid': 'Lütfen gelişmiş eşleşme koşulu yapılandırmasını kontrol edin', | ||
'page.route.fields.vars.in.invalid': | ||
'IN operatörünü kullanırken parametre değerlerini dizi formatında girin.', | ||
|
||
'page.route.data_loader.import': 'Import', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why use English here, will it update in the future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know any Turkish and I can only translate using a translation tool that may not convey the meaning correctly (I had a lot of problems with the English=>Turkish=>English back-and-forth translation) and I think it's better to use English for now and wait for a later translator to do the translation.
BTW, later I will try to import these into crowdin to simplify the internationalization process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @anldrms, Can you help review these translations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Baoyuantop @anldrms If it would help to add a translation of this section, a new PR could be created to do this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for late but I'll glad to help for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// remove route | ||
/**/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section seems to be able to be deleted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
cy.get(selector.drawer).contains('Import Failed').should('be.visible'); | ||
cy.get(selector.drawer).contains('Total 5 route imported, 1 failed').click(); | ||
cy.get(selector.drawer).contains('is duplicated with route api101_nmm_').should('be.visible'); | ||
cy.get(selector.drawer).contains('Close').click(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is best to add assertions to confirm that the drawer has disappeared
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
}); | ||
setState('result'); | ||
}) | ||
.catch(console.error); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we disable console.error
in production environment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That probably means we don't need to catch and just keep an empty catch function. 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't actually need to use it to handle errors either, just to prevent JS errors where exceptions are not caught.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That probably means we don't need to catch and just keep an empty catch function. 🤔
I think console.error
can somehow be removed at compile time for the production environment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can try https://stackoverflow.com/a/41041580 (Not Now)
* upstream/master: (23 commits) feat: Add config struct of OpenID-Connect Login (apache#2597) feat: set serverUrlMap with env, update cypress, update stylelint (apache#2583) chore: fix function name typo (apache#2599) fix: page refresh causes deletion exception (apache#2593) feat: support show all enable plugin list tab (apache#2585) fix: drawer components delete plugin not working (apache#2573) feat: add batch delete function for route (apache#2502) test: reduce fe ci time (apache#2557) doc(csp): add correct csp rule (apache#2548) doc: add a notice about the compatibility of Ingress and Dashboard (apache#2552) fix: add judgement for last_report_time (apache#2551) fix: cli test invalid etcd (apache#2544) feat: fix actions version to root version (apache#2521) fix: duplicate ID (apache#2501) fix: block arbitrary file index (apache#2497) docs: update deploy-with-docker.md (apache#2472) feat: translating Turkish for new features (apache#2487) docs: add new import and export docs to sidebar (apache#2485) docs: add data loader and new OpenAPI 3 loader (apache#2484) feat: support data loader in frontend (apache#2480) ... # Conflicts: # api/internal/route.go # web/config/defaultSettings.ts # web/yarn.lock
Please answer these questions before submitting a pull request, or your PR will get closed.
Why submit this pull request?
What changes will this PR take into?
Improved OpenAPI import form for a new import experience.
In the current design, he will provide such an import form that can support multiple import data sources with their responsive import options.
Related issues
a part of #2465
Checklist: