Skip to content

chore: remove milestone-related code #636

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions api/src/app/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
GetContributorsForSitemapResponse,
GetContributorsResponse,
} from "src/contributor/types";
import { GetMilestonesResponse } from "src/milestone/types";
import {
GetProjectNameResponse,
GetProjectResponse,
Expand Down Expand Up @@ -63,9 +62,6 @@ export interface Endpoints {
response: GetContributorNameResponse;
params: { id: string };
};
"api:milestones/dzcode": {
response: GetMilestonesResponse;
};
"api:search": {
response: SearchResponse;
query: [["query", string], ["limit", number]];
Expand Down
2 changes: 0 additions & 2 deletions api/src/app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { DigestCron } from "src/digest/cron";
import { GithubController } from "src/github/controller";
import { LoggerMiddleware } from "./middlewares/logger";
import { LoggerService } from "src/logger/service";
import { MilestoneController } from "src/milestone/controller";
import { PostgresService } from "src/postgres/service";
import { ProjectController } from "src/project/controller";
import { RobotsController } from "./middlewares/robots";
Expand Down Expand Up @@ -46,7 +45,6 @@ useContainer(Container); // eslint-disable-line react-hooks/rules-of-hooks
controllers: [
ContributionController,
GithubController,
MilestoneController,
ProjectController,
ContributorController,
RobotsController,
Expand Down
16 changes: 0 additions & 16 deletions api/src/github/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import {
GetRepositoryIssuesResponse,
GetRepositoryResponse,
GetUserInput,
GitHubListRepositoryMilestonesInput,
GithubMilestone,
GitHubRateLimitApiResponse,
GitHubUserApiResponse,
ListRepositoryContributorsResponse,
Expand Down Expand Up @@ -88,20 +86,6 @@ export class GithubService {
};
};

public listRepositoryMilestones = async ({
owner,
repository,
}: GitHubListRepositoryMilestonesInput): Promise<GithubMilestone[]> => {
const milestones = await this.fetchService.get<GithubMilestone[]>(
`${this.apiURL}/repos/${owner}/${repository}/milestones`,
{
headers: this.githubToken ? { Authorization: `Token ${this.githubToken}` } : {},
params: { state: "all", per_page: 100 },
},
);
return milestones;
};

private githubToken = this.configService.env().GITHUB_TOKEN;
private apiURL = "https://api.github.com";
}
22 changes: 0 additions & 22 deletions api/src/github/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,6 @@ export interface GetRepositoryInput {
owner: string;
repo: string;
}

interface GitHubListRepositoryIssuesInput {
owner: string;
repository: string;
}

export type GitHubListRepositoryMilestonesInput = GitHubListRepositoryIssuesInput;

export interface GithubMilestone {
html_url: string;
number: number;
title: string;
description: string;
state: "closed" | "open";
open_issues: number;
closed_issues: number;
created_at: string;
updated_at: string;
closed_at: string | null;
due_on: string | null;
}

export interface GitHubRateLimitApiResponse {
resources: {
core: {
Expand Down
60 changes: 0 additions & 60 deletions api/src/milestone/controller.ts

This file was deleted.

6 changes: 0 additions & 6 deletions api/src/milestone/types.ts

This file was deleted.

13 changes: 0 additions & 13 deletions packages/models/src/milestone/index.ts

This file was deleted.

8 changes: 0 additions & 8 deletions web/src/components/locale/dictionary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,6 @@ Besides the open tasks on [/contribute](/contribute) page, you can also contribu
en: "Make a Contribution",
ar: "قدم مساهمة",
},
"landing-milestones-title": {
en: "Project roadmap",
ar: "خارطة طريق المشروع",
},
"landing-milestones-subtitle": {
en: "See how and when new features are released and share your ideas and feedback to help us better shape dzcode roadmap",
ar: "تعرف على كيفية ووقت إصدار الميزات الجديدة وشارك بأفكارك وملاحظاتك لمساعدتنا في تشكيل خارطة طريق dzcode بشكل أفضل",
},
"team-title": {
en: "Meet the team! | DzCode i/o",
ar: "تعرّف على الفريق! | DzCode i / o",
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/top-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export function TopBar({ version, links }: TopBarProps): JSX.Element {
href={href}
key={index}
role="tab"
className={`tab ${activeIndex === index ? "tab-active" : ""}`}
className={`whitespace-nowrap tab ${activeIndex === index ? "tab-active" : ""}`}
data-testid={`top-bar-to:${href}`}
>
<Locale {...{ localeKey }} />
Expand Down
91 changes: 0 additions & 91 deletions web/src/pages/landing/index.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,11 @@
import { useEffect } from "react";
import { Helmet } from "react-helmet-async";
import { Link } from "src/components/link";
import { Loading } from "src/components/loading";
import { Locale, useLocale } from "src/components/locale";
import { Markdown } from "src/components/markdown";
import { TryAgain } from "src/components/try-again";
import { fetchMilestonesListAction } from "src/redux/actions/milestones";
import { useAppDispatch, useAppSelector } from "src/redux/store";
import React from "react";

// ts-prune-ignore-next
export default function Page(): JSX.Element {
const { localize } = useLocale();
const { milestones } = useAppSelector((state) => state.landingPage);
const dispatch = useAppDispatch();

useEffect(() => {
dispatch(fetchMilestonesListAction());
}, [dispatch]);

return (
<main className="flex flex-col self-center">
Expand Down Expand Up @@ -45,85 +33,6 @@ export default function Page(): JSX.Element {
</div>
</div>
</div>

<div className="m-4">
<h1 className="text-4xl font-bold text-center max-w-xl m-auto">
<Locale landing-milestones-title />
</h1>
<p className="py-6 max-w-xl m-auto">
<Locale landing-milestones-subtitle />
</p>

<div className="flex justify-center">
{milestones === "ERROR" ? (
<TryAgain
error={localize("global-generic-error")}
action={localize("global-try-again")}
onClick={() => {
dispatch(fetchMilestonesListAction());
}}
/>
) : milestones === null ? (
<Loading />
) : (
<div>
<ul className="timeline max-md:timeline-compact timeline-vertical mt-4 mb-4">
{milestones.map((milestone, milestoneIndex) => {
const isEven = milestoneIndex % 2 === 0;

return (
<li dir="ltr" key={milestoneIndex}>
<hr />
<div
className={`${
isEven ? "timeline-start" : "timeline-end"
} w-full md:w-auto timeline-box ${
isEven ? "md:text-end" : "md:text-start"
}`}
>
<h2 className="text-xl font-bold">{milestone.title}</h2>
<p>
<Markdown content={milestone.description} />
</p>
</div>
<div className="md:timeline-middle">
{milestone.closedAt ? (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
fill="currentColor"
className="text-primary h-5 w-5"
>
<path
fillRule="evenodd"
d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z"
clipRule="evenodd"
/>
</svg>
) : (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
fill="currentColor"
className="h-5 w-5"
>
<path
fillRule="evenodd"
d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z"
clipRule="evenodd"
/>
</svg>
)}
</div>
<hr />
</li>
);
})}
</ul>
</div>
)}
</div>
</div>
</main>
);
}
18 changes: 0 additions & 18 deletions web/src/redux/actions/milestones.ts

This file was deleted.

21 changes: 0 additions & 21 deletions web/src/redux/slices/landing-page.ts

This file was deleted.

2 changes: 0 additions & 2 deletions web/src/redux/store.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { Provider as ReduxProvider, useDispatch, useSelector } from "react-redux
import { contributionsPageSlice } from "./slices/contributions-page";
import { contributionPageSlice } from "./slices/contribution-page";
import { contributorsPageSlice } from "./slices/contributors-page";
import { landingPageSlice } from "./slices/landing-page";
import { projectsPageSlice } from "./slices/projects-page";
import { settingsSlice } from "./slices/settings";
import { projectPageSlice } from "./slices/project-page";
Expand All @@ -22,7 +21,6 @@ const makeAppStore = () => {
contributorPage: contributorPageSlice.reducer,
contributionsPage: contributionsPageSlice.reducer,
contributionPage: contributionPageSlice.reducer,
landingPage: landingPageSlice.reducer,
},
});
};
Expand Down
Loading