Feature: Support Catalog User Interface#160
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## develop #160 +/- ##
===========================================
- Coverage 93.01% 91.46% -1.56%
===========================================
Files 302 313 +11
Lines 4755 4943 +188
Branches 636 656 +20
===========================================
+ Hits 4423 4521 +98
- Misses 214 302 +88
- Partials 118 120 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
|
|
||
| private getAPIDocUrl(schema: APISchema) { | ||
| const splitUrl = schema.urlPath.split('/'); | ||
| const restructureUrl = splitUrl |
There was a problem hiding this comment.
Suggest adding a comment with an example to explain the purpose.
| .map((brick) => | ||
| brick.startsWith(':') ? `{${brick.replace(':', '')}}` : brick | ||
| ) | ||
| .join('~1'); |
There was a problem hiding this comment.
Not know why need to join '~1', could you explain it?
There was a problem hiding this comment.
That actually the redoc generated url, it will convert the / to ~1
and looked like this one /doc#/paths/~1artist~1%7Bid%7D/get
but I had adjusted the redoc url in 1f05032
now it will more readable: doc#operation/get/artist/:id/works
| const project = this.getProjectOptions(); | ||
| const redoc = project?.['redoc']; | ||
| const docPath = | ||
| redoc?.url?.replace(/\/+$/, '').replace(/^\/+/, '') || 'doc'; |
There was a problem hiding this comment.
Why should need to add + in the first replace and send replace method? seems you would like to remove the first and last / ?
Btw, the same part also appeared in the AuthCredentialsMiddleware and AuthSourceNormalizerMiddleware, but you not add +
There was a problem hiding this comment.
Thanks for finding the difference, I just copied the original code from document router,
It will move to a function and provide the auth refactor function you mention below to use.
| // The endpoint not need contains auth credentials | ||
| const docPrefix = | ||
| this.projectOptions?.['redoc']?.url | ||
| .replace(/\/$/, '') | ||
| .replace(/^\//, '') || 'doc'; | ||
| const pathsWithoutAuth = [ | ||
| '/auth/token', | ||
| '/auth/available-types', | ||
| `/${docPrefix}`, | ||
| `/${docPrefix}/spec`, | ||
| `/${docPrefix}/redoc`, | ||
| ]; | ||
| if (pathsWithoutAuth.includes(context.path)) return next(); |
There was a problem hiding this comment.
Seems the AuthSourceNormalizerMiddleware also has the same code, maybe we could refactor the part to a function and put it in utils.ts under the auth folder, how do you think?
There was a problem hiding this comment.
Agree, the code had been refactored in 1f05032
| }; | ||
|
|
||
| const serveCatalog = async (options: CatalogCommandOptions) => { | ||
| const next = await import(localModulePath('next')); |
There was a problem hiding this comment.
Just a question, where is next module from ? node modules ?
There was a problem hiding this comment.
Yes, it will retrieve next module from the same local root with catalog-server.
103dfc7 to
8211ed3
Compare
f5a250e to
4c3dcd6
Compare
packages/catalog-server/components/catalogDetail/QueryResult.tsx
Outdated
Show resolved
Hide resolved
packages/catalog-server/components/catalogDetail/QueryResult.tsx
Outdated
Show resolved
Hide resolved
fredalai
left a comment
There was a problem hiding this comment.
For catalog-server-e2e part, we might be able to remove this part (https://nx.dev/packages/workspace/generators/remove#@nx/workspace:remove) first since we haven't added tests yet, what do you think?
|
Hi @fredalai |
fredalai
left a comment
There was a problem hiding this comment.
LGTM, except for other comments.
Note: Update your branch based on the latest develop branch finally.
kokokuo
left a comment
There was a problem hiding this comment.
Thanks for fixing the last comments!
Beside some suggestions that need to adjust, others LGTM 👍
2. Set graphql package (@apollo/client , graphql-codegen) 3. Add catalog page
…e, adjust antd version conflict
…talog ux in config missing
…blic paths to a function
770f93c to
eccb2fe
Compare
kokokuo
left a comment
There was a problem hiding this comment.
Thanks for fixing the suggestion, LGTM 👍
Let's please fix the CI test and it could prepare to merge :)
Description
Support the VulcanSQL Catalog user interface for retrieving data in a more efficient and user-friendly manner.
Sample
vulcan.yamlPlease notice
authoptions should be eitherbasicorpassword-fileis setting up or disabled the authCatalog Server
Run Develop Command
open
http://localhost:4200Default catalog option in yaml
UI
Catalog detail & preview dataset result
<img width="1216" alt="image" src="proxy.php?url=https://user-images.githubusercontent.com/9657305/231646109-102dc036-b46e-425c-982c-afc84e530d61.png->
Connect with third-party services tutorial
VulcanSQL Serve
Run Develop Command
In
labs/playground1, runopen
http://localhost:3000/auth/available-typesfor retrieving auth type by APIcatalog-routersfor providing APIs toCatalog Server./catalog/schemas/catalog/schemas/:sourceNameThe schema APIs above will additionally provide
url: string,apiDocUrl: string,shareKey: stringurl: host + urlPath in VulcanSQLapiDocUrl: the API document url in VulcanSQLshareKey: the query string to pass the auth middlewareVulcanSQL CLI
After discussion, the package.json will need to be updated after catalog publishing
You will need to do the actions below if you want to test in local
In
labs/playground1package.json{ "dependencies": { ... "@vulcan-sql/catalog-server": "../../dist/packages/catalog-server" } }Do
yarnto install the dependenciesDo
maketo replace the packages to your local developed packagesYou can use
vulcan catalogcommand line in another terminal after running the VulcanSQL server withvulcan start.VulcanSQL Package
-t --targetfor specific which target need to build and the default isvulcan-serverFor Catalog Server, you can add the command below
Additional Context