* reactify rest pages * add space * speed up pages by only sending applicable rest operations * reactify rest operation part 1 * remove restpage * sync translations directory with origin/main * remove translation file * clean up * fix openapi tests * fix tests * remove unused variables * add apps available page component (#25086) * simplify getRest module * add code sample component * revert translation files * revert translation files * update tests * add rest response and notes * refactor and create codeblock and add styling changes from design systems * nested all returned jsx into one single fragment * update style name * remove unnecessary div * update title and add response max height and overflow * refactor entry to RestOperation component * cleanup types and unique keys * update decorated files * Rest page data (#25346) * update endpoints for apps layout * remove null type * Update components/rest/CodeBlock.tsx Co-authored-by: Peter Bengtsson <mail@peterbe.com> * updating renderTableRows * cannot set p tag - should be div * Ashs new feedback on the code blocks * remove rest html pages * Removing and updating decorated files (#25484) * removing and updating decorated files * bring back default tool * fix tests * add types * fix styling in nested tables * semantic changes * adding unique key index * remove unnecessary styling * update styling for categories * place app file in own directory * update types * update function in code samples * fix some bad conflict resolution * add rest banner back to rest pages * Move all rest Markdown to data directory (#25598) * Update components/rest/RestNotes.tsx Co-authored-by: Peter Bengtsson <mail@peterbe.com> * adding translation (#25673) * revert change to Dockerfile * refactor parameter tables * move toc to server side * adding missing files * updating spacing * update body table * Update components/rest/BodyParametersRows.tsx Co-authored-by: Peter Bengtsson <mail@peterbe.com> * adding Fragment * remove key from tr since it is on Fragment * move around imports * Update components/rest/BodyParametersRows.tsx Co-authored-by: Peter Bengtsson <mail@peterbe.com> * Update components/rest/BodyParametersRows.tsx Co-authored-by: Peter Bengtsson <mail@peterbe.com> * Update components/rest/ParameterRows.tsx Co-authored-by: Peter Bengtsson <mail@peterbe.com> * Update components/rest/ParameterRows.tsx Co-authored-by: Peter Bengtsson <mail@peterbe.com> * Update components/rest/BodyParametersRows.tsx Co-authored-by: Peter Bengtsson <mail@peterbe.com> * Update components/rest/BodyParametersRows.tsx Co-authored-by: Peter Bengtsson <mail@peterbe.com> * Update components/rest/BodyParametersRows.tsx Co-authored-by: Peter Bengtsson <mail@peterbe.com> * small changes and adding anchor link to table instead of empty div * adding name type and description to translation * adding more translation * refactor and break out ChildBodyParameterRows * fix table css * check * change the rest parameters table to fixed to show all description * update name to match * run prettier * Update components/rest/RestCodeSamples.tsx Co-authored-by: Peter Bengtsson <mail@peterbe.com> * Update components/rest/ChildBodyParametersRows.tsx Co-authored-by: Peter Bengtsson <mail@peterbe.com> * Update components/rest/ChildBodyParametersRows.tsx Co-authored-by: Peter Bengtsson <mail@peterbe.com> * Update components/rest/BodyParametersRows.tsx Co-authored-by: Peter Bengtsson <mail@peterbe.com> * updating CHildBodyParameterRows * run prettier Co-authored-by: Rachael Sewell <rachmari@github.com> Co-authored-by: Peter Bengtsson <mail@peterbe.com>
49 lines
1.4 KiB
TypeScript
49 lines
1.4 KiB
TypeScript
import cx from 'classnames'
|
|
import { useTranslation } from 'components/hooks/useTranslation'
|
|
import { BodyParameter, Parameter, xGitHub } from './types'
|
|
import styles from './RestParameterTable.module.scss'
|
|
import { PreviewsRow } from './PreviewsRow'
|
|
import { ParameterRows } from './ParameterRows'
|
|
import { BodyParameterRows } from './BodyParametersRows'
|
|
|
|
type Props = {
|
|
slug: string
|
|
hasRequiredPreviews: boolean
|
|
xGitHub: xGitHub
|
|
parameters: Array<Parameter>
|
|
bodyParameters: Array<BodyParameter>
|
|
}
|
|
|
|
export function RestParameterTable({
|
|
slug,
|
|
hasRequiredPreviews,
|
|
xGitHub,
|
|
parameters,
|
|
bodyParameters,
|
|
}: Props) {
|
|
const { t } = useTranslation('products')
|
|
|
|
return (
|
|
<>
|
|
<h4 className="mt-4 mb-3 pt-3" id={`${slug}--parameters`}>
|
|
<a href={`#${slug}--parameters`}>{t('rest.reference.parameters')}</a>
|
|
</h4>
|
|
<table className={cx(styles.parameterTable)}>
|
|
<thead>
|
|
<tr className="text-left">
|
|
<th>{t('rest.reference.name')}</th>
|
|
<th>{t('rest.reference.type')}</th>
|
|
<th>{t('rest.reference.in')}</th>
|
|
<th>{t('rest.reference.description')}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<PreviewsRow slug={slug} hasRequiredPreviews={hasRequiredPreviews} xGitHub={xGitHub} />
|
|
<ParameterRows parameters={parameters} />
|
|
<BodyParameterRows slug={slug} bodyParameters={bodyParameters} />
|
|
</tbody>
|
|
</table>
|
|
</>
|
|
)
|
|
}
|