-
Notifications
You must be signed in to change notification settings - Fork 110
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
DOCS-2361: Autogenerated Felix docs #1717
Conversation
✅ Deploy Preview for calico-docs-preview-next ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview succeeded!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
13b8786
to
ebd3f82
Compare
</table> | ||
); | ||
|
||
const TableEnv = ({ fieldData }) => ( |
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.
For the sake of neatness, you could extract these components into their own files and import them
/FelixConfig
- index.js
- file.json
- TableEnv.js
- TableConfig.js
- TableCRD.js
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.
Done.
} | ||
|
||
return ( | ||
<div> |
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.
no need for the empty div (unless you actually need it). You can do
return <>{table}</>
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.
Ok, will do.
return <p>No matching group found for '{name}'.</p>; | ||
} | ||
|
||
|
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.
make sure you format all of your files option + shift + f
. You may need to install prettier if it doesn't work
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.
Done, thanks!
</tr> | ||
<tr> | ||
<td>Description</td> | ||
<td dangerouslySetInnerHTML={{ __html: fieldData.DescriptionHTML }} /> |
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.
You should probably sanitize this html to be safe
https://blog.logrocket.com/using-dangerouslysetinnerhtml-react-application/
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.
Done.
fabc45c
to
ba04c2a
Compare
<div> | ||
{matchedGroup.Fields.map((field, index) => ( | ||
<div key={index}> | ||
<Tabs groupId='operating-systems'> |
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 noticed all tabs would change at the same time. Not sure if you intended this, but to stop that behaviour remove groupId='operating-systems'
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 bit was intentional.
<div key={index}> | ||
<Tabs groupId='operating-systems'> | ||
<TabItem | ||
value='apple' |
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.
you should probably replace value='apple/orange'
with something more meaningful like value='configurationFile/environmentVariable'
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.
Yes!
b48d655
to
f730d7f
Compare
6565a82
to
93e925e
Compare
Together with projectcalico/calico#9325, this PR introduces major changes to how our Felix configuration docs are presented.
Major items:
All data comes from the codebase
Diffs between codebase and docs are eliminated (plus cross-version, cross-product diffs)
Process much easier to maintain going forward
Presentation for users is VASTLY improved.
Felix CRD page
Felix config/env page
Product Version(s):
Issue:
Link to docs preview:
SME review:
DOCS review:
Additional information:
Merge checklist: