Skip to content

Commit

Permalink
Merge pull request #280 from amisha1609/CMGR-54259
Browse files Browse the repository at this point in the history
[CMGR-54259] update permissions doc
  • Loading branch information
bohnertchris authored Mar 19, 2024
2 parents ed41749 + 104f0bb commit 4c8cbb8
Show file tree
Hide file tree
Showing 3 changed files with 140 additions and 83 deletions.
38 changes: 20 additions & 18 deletions src/components/permissions-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,31 +14,33 @@ import React, { Fragment } from 'react'
import data from '../data/permissions.json'

const PermissionsTable = () => {
const createRow = ({ operation, profiles, note, method, path }) => {
return (
<Fragment>
<tr className="spectrum-Table-row">
<td className="spectrum-Table-cell"><code>{operation}</code></td>
<td className="spectrum-Table-cell">
{profiles}
{note && (<Fragment><br/><small>{note}</small></Fragment>)}
</td>
</tr>
<tr className="spectrum-Table-row">
<td colSpan="2" className="spectrum-Table-cell" style={{ fontSize: '75%' }}><code>{method} {path}</code></td>
</tr>
</Fragment>
)
}
const createRow = ({ operation, profiles, note, method, path, permission }) => {
return (
<Fragment>
<tr className="spectrum-Table-row">
<td className="spectrum-Table-cell"><code>{operation}</code></td>
<td className="spectrum-Table-cell">
{profiles}
{note && (<Fragment><br/><small>{note}</small></Fragment>)}
</td>
<td className="spectrum-Table-cell" style={{ verticalAlign: 'top' }}>{permission}</td>
</tr>
<tr className="spectrum-Table-row">
<td colSpan="3" className="spectrum-Table-cell" style={{ fontSize: '75%', verticalAlign: 'top' }}><code>{method} {path}</code></td>
</tr>
</Fragment>
);
};

const sorted = [...data].sort((a, b) => a.path.localeCompare(b.path))

return (
<table className="spectrum-Table" style={{ marginTop: '2em' }}>
<thead className="spectrum-Table-head">
<tr>
<th className="spectrum-Table-headCell">Operation</th>
<th className="spectrum-Table-headCell">Product Profile(s)</th>
<th className="spectrum-Table-headCell" style={{ width: '40%' }}>Operation</th>
<th className="spectrum-Table-headCell" style={{ width: '40%' }}>Product Profile(s)</th>
<th className="spectrum-Table-headCell" style={{ width: '40%' }}>Permission</th>
</tr>
</thead>
<tbody className="spectrum-Table-body">
Expand Down
Loading

0 comments on commit 4c8cbb8

Please sign in to comment.