Skip to content

Commit

Permalink
Added version history of the website on changelog page
Browse files Browse the repository at this point in the history
  • Loading branch information
bhavberi committed Nov 6, 2024
1 parent 2b65bea commit 273f2eb
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 11 deletions.
91 changes: 83 additions & 8 deletions src/app/changelog/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,20 @@ import { getNginxFile } from "utils/files";

import Link from "next/link";
import { MDXRemote } from "next-mdx-remote/rsc";
import { Container, Box, Typography, Stack, Button } from "@mui/material";
import {
Container,
Box,
Typography,
Stack,
Button,
Accordion,
AccordionSummary,
AccordionDetails,
List,
ListItem,
ListItemText,
} from "@mui/material";
import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown";

import Icon from "components/Icon";
import LocalUsersGrid from "components/users/LocalUsersGrid";
Expand All @@ -13,6 +26,30 @@ import { techTeamWords } from "constants/ccMembersFilterWords";
import Status from "./status.mdx";

const limit = 20;
const releases = [
{
version: "2.2",
date: "November 2024",
description: "Changed from Clubs Council website to Life @ IIIT-H.",
},
{
version: "2.1",
date: "May 2023",
description: "Moved to Next.js server components.",
},
{
version: "2.0",
date: "April 2023",
description:
"Complete UI overhaul with Material Design and Next.js. Complete change of backend to Microservices and GraphQL.",
},
{
version: "1.0",
date: "15 August, 2023",
description:
"The very first version of the website using React and Monolithic backend using Django.",
},
];

export const metadata = {
title: "Changelog | Life @ IIIT-H",
Expand Down Expand Up @@ -57,14 +94,11 @@ export default async function Changelog({ searchParams }) {
},
}}
>
<Status
status={await status.json()}
version={2}
firstRelease={"April 2023"}
/>
<Status status={await status.json()} version={2.2} />
<VersionHistory />
</Box>

<Stack direction="row" pt={2} mb={2} mt={3}>
<Stack direction="row" pt={2} mb={2}>
<Typography variant="h3" mt={3}>
Maintainers
</Typography>
Expand Down Expand Up @@ -140,7 +174,7 @@ const filterRoles = (roles, filterWords) => {
const { name, endYear } = role;
const lowercaseName = name.toLowerCase();
return filterWords.some(
(word) => lowercaseName.includes(word) && endYear === null,
(word) => lowercaseName.includes(word) && endYear === null
);
});
if (filteredRoles?.length > 0)
Expand All @@ -151,3 +185,44 @@ const filterRoles = (roles, filterWords) => {
});
else return filteredRoles;
};

const VersionHistory = () => {
return (
<Accordion>
<AccordionSummary
aria-controls="panel1-content"
id="panel1-header"
style={{ marginLeft: "5px", cursor: "pointer", color: "#444" }}
>
<Box display="flex" alignItems="center">
<Typography>View releases/version history</Typography>
<ArrowDropDownIcon
style={{
marginLeft: "8px",
}}
/>
</Box>
</AccordionSummary>
<AccordionDetails
style={{
marginLeft: "5px",
borderLeft: "2px solid #eaeaea",
}}
>
<List style={{ padding: 0, margin: 0 }}>
{releases.map((release, index) => (
<ListItem
key={index}
style={{ marginBottom: index === releases.length - 1 ? 0 : "8px" }}
>
<ListItemText
primary={<strong>{release.version}</strong>}
secondary={`(${release.date}) - ${release.description}`}
/>
</ListItem>
))}
</List>
</AccordionDetails>
</Accordion>
);
};
9 changes: 6 additions & 3 deletions src/app/changelog/status.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{props.status.environment === "prod" && (<a target="_blank" rel="noreferrer" href="https://clubs_iiith.betteruptime.com/"><img src="https://uptime.betterstack.com/status-badges/v3/monitor/ikqm.svg" alt="Better Uptime Badge"/></a>)}
{props.status.environment === "prod" && (
<a target="_blank" rel="noreferrer" href="https://clubs_iiith.betteruptime.com/">
<img src="https://uptime.betterstack.com/status-badges/v3/monitor/ikqm.svg" alt="Better Uptime Badge"/>
</a>
)}

**Environment:** {props.status.environment === "prod" ? "Production" : props.status.environment}
**Deployed Commit:** Version {props.version} - <a target="\_blank" rel="noreferrer" href={`https://github.com/Clubs-Council-IIITH/services/commit/${props.status.commit}`}>#{props.status.commit}</a>
**First Release:** {props.firstRelease}
**Latest Release:** {new Date(props.status.timestamp).toLocaleString("en-IN", { dateStyle: "full", timeStyle: "medium" })}
**Last Update:** {new Date(props.status.timestamp).toLocaleString("en-IN", { dateStyle: "full", timeStyle: "medium" })}

0 comments on commit 273f2eb

Please sign in to comment.