Skip to content

Commit

Permalink
feat(resource-group-documentation): add list of documentation links
Browse files Browse the repository at this point in the history
  • Loading branch information
yomatters committed Aug 21, 2024
1 parent 28ba672 commit c3069b9
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 1 deletion.
12 changes: 12 additions & 0 deletions public/api/resource-groups/1/documentation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"documentation": [
{
"name": "Bridges-2 Home Page",
"documentationUri": "https://www.psc.edu/resources/bridges-2/"
},
{
"name": "Bridges-2 User Guide",
"documentationUri": "https://www.psc.edu/resources/bridges-2/user-guide/"
}
]
}
7 changes: 6 additions & 1 deletion src/content.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,16 @@ a:hover {
color: var(--teal-600);
text-decoration: none;
}
p {
ol,
p,
ul {
font-size: 1.125rem;
line-height: 1.875rem;
margin: 0 0 1.25rem;
}
li {
margin-bottom: 0.5rem;
}
.btn {
background-color: var(--teal-700);
border: 4px solid var(--teal-700);
Expand Down
2 changes: 2 additions & 0 deletions src/donut-chart.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@
padding: 0;
}
.donut-chart .top-items li {
align-items: center;
display: flex;
flex-direction: row;
font-size: 1rem;
margin-bottom: 5px;
}
.donut-chart .symbol {
Expand Down
5 changes: 5 additions & 0 deletions src/resource-group-detail.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ResourceGroupAffinityGroup from "./resource-group-affinity-group";
import ResourceGroupDescription from "./resource-group-description";
import ResourceGroupDocumentation from "./resource-group-documentation";
import ResourceGroupEvents from "./resource-group-events";
import ResourceGroupProjects from "./resource-group-projects";
import ResourceGroupQueueMetrics from "./resource-group-queue-metrics";
Expand Down Expand Up @@ -39,6 +40,10 @@ export default function ResourceGroupDetail({ baseUri, resourceGroupId }) {
baseUri={baseUri}
resourceGroupId={resourceGroupId}
/>
<ResourceGroupDocumentation
baseUri={baseUri}
resourceGroupId={resourceGroupId}
/>
</div>
);
}
27 changes: 27 additions & 0 deletions src/resource-group-documentation.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { useJSON } from "./utils";

import Section from "./section";

export default function ResourceGroupDocumentation({
baseUri,
resourceGroupId,
}) {
const data = useJSON(
`${baseUri}/api/resource-groups/${resourceGroupId}/documentation.json`,
null
);

if (!data || data.error) return;

return (
<Section title="Documentation" icon="book">
<ul>
{data.documentation.map(({ name, documentationUri }) => (
<li>
<a href={documentationUri}>{name}</a>
</li>
))}
</ul>
</Section>
);
}

0 comments on commit c3069b9

Please sign in to comment.