Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Jan 17, 2025
1 parent bcd6b86 commit b53234f
Show file tree
Hide file tree
Showing 7 changed files with 386 additions and 14 deletions.
7 changes: 7 additions & 0 deletions config/navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ const navbar = {
label: 'Processes',
docsPluginId: 'general',
},
{
type: 'docSidebar',
position: 'left',
sidebarId: 'projects',
label: 'Projects',
docsPluginId: 'general',
},
{
type: 'docSidebar',
position: 'left',
Expand Down
23 changes: 22 additions & 1 deletion data/projects.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,30 @@
{
"$schema": "../static/schema/projects.json",
"projects": {
"directoryrestructure/index": {
"title": "Directory Restructure",
"status": "In Progress",
"owners": [
{
"name": "Andrew Lyons",
"githubUsername": "andrewnicols"
}
],
"discussionLinks": [],
"issueLinks": [
{
"link": "https://tracker.moodle.org/browse/MDL-83424",
"title": "MDL-83424"
},
{
"link": "https://tracker.moodle.org/browse/IDEA-75",
"title": "Roadmap Proposal"
}
]
},
"docs/migration": {
"title": "Dev Docs Migration",
"status": "In Progress",
"status": "Complete",
"owners": [
{
"name": "Andrew Lyons",
Expand Down
317 changes: 317 additions & 0 deletions general/projects/directoryrestructure/index.md

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions project-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ Josep
JMeter
JWKS
Kanban
Laravel
MAINNODE
MDK
MDL
MDLQA
MDLSITE
Expand All @@ -49,6 +51,7 @@ Moodleisms
Moodlelib
Moodlenet
Moodlers
Moosh
Multilang
MyISAM
MySQLi
Expand All @@ -73,6 +76,7 @@ SIGINT
SIGTERM
Soulier
Stene
Symfony
TCPDF
TODO
ToBic
Expand Down
4 changes: 3 additions & 1 deletion src/components/Project/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ export declare interface Link {
link: string,
}

declare interface IssueLinks extends Array<Link> {}

export declare interface ProjectSummaryData {
projectName: string,
title: string,
owners: Array<PersonProps>,
status: string,
issueLinks?: Array<Link>,
issueLinks?: IssueLinks,
discussionLinks?: Array<Link>,
}

Expand Down
44 changes: 33 additions & 11 deletions src/components/ProjectSummary/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,38 @@ export default function ProjectSummary(props: ProjectSummaryProps): ReactNode {
);
}

function getIssueLinks({ issueLinks }: ProjectSummaryData): ReactNode {
if (issueLinks.length === 1) {
return (
<>
{issueLinks.map(({ link, title }) => (
<div key={title}>
<Link
to={link}
>
{title}
</Link>
</div>
))}
</>
);
}

return (
<ul>
{issueLinks.map(({ link, title }) => (
<li key={title}>
<Link
to={link}
>
{title}
</Link>
</li>
))}
</ul>
);
}

function GetProjectSummary(projectData: ProjectSummaryData): ReactNode {
return (
<div className={styles.projectsummary}>
Expand Down Expand Up @@ -82,17 +114,7 @@ export default function ProjectSummary(props: ProjectSummaryProps): ReactNode {
&& (
<tr>
<th>Issues</th>
<td>
{projectData.issueLinks.map(({ link, title }) => (
<div key={title}>
<Link
to={link}
>
{title}
</Link>
</div>
))}
</td>
<td>{getIssueLinks(projectData)}</td>
</tr>
)}
</tbody>
Expand Down
1 change: 0 additions & 1 deletion src/components/ProjectSummary/styles.module.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.projectsummary {
float: right;
clear: both;
font-family: monospace;
padding-left: 1rem;
}

0 comments on commit b53234f

Please sign in to comment.