Skip to content

Commit c0ed3d3

Browse files
authored
Merge pull request #636 from dzcode-io/chore/remove-milestones
2 parents b1c8acc + efe9a0c commit c0ed3d3

File tree

13 files changed

+1
-264
lines changed

13 files changed

+1
-264
lines changed

api/src/app/endpoints.ts

-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
GetContributorsForSitemapResponse,
1111
GetContributorsResponse,
1212
} from "src/contributor/types";
13-
import { GetMilestonesResponse } from "src/milestone/types";
1413
import {
1514
GetProjectNameResponse,
1615
GetProjectResponse,
@@ -63,9 +62,6 @@ export interface Endpoints {
6362
response: GetContributorNameResponse;
6463
params: { id: string };
6564
};
66-
"api:milestones/dzcode": {
67-
response: GetMilestonesResponse;
68-
};
6965
"api:search": {
7066
response: SearchResponse;
7167
query: [["query", string], ["limit", number]];

api/src/app/index.ts

-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import { DigestCron } from "src/digest/cron";
1414
import { GithubController } from "src/github/controller";
1515
import { LoggerMiddleware } from "./middlewares/logger";
1616
import { LoggerService } from "src/logger/service";
17-
import { MilestoneController } from "src/milestone/controller";
1817
import { PostgresService } from "src/postgres/service";
1918
import { ProjectController } from "src/project/controller";
2019
import { RobotsController } from "./middlewares/robots";
@@ -46,7 +45,6 @@ useContainer(Container); // eslint-disable-line react-hooks/rules-of-hooks
4645
controllers: [
4746
ContributionController,
4847
GithubController,
49-
MilestoneController,
5048
ProjectController,
5149
ContributorController,
5250
RobotsController,

api/src/github/service.ts

-16
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ import {
88
GetRepositoryIssuesResponse,
99
GetRepositoryResponse,
1010
GetUserInput,
11-
GitHubListRepositoryMilestonesInput,
12-
GithubMilestone,
1311
GitHubRateLimitApiResponse,
1412
GitHubUserApiResponse,
1513
ListRepositoryContributorsResponse,
@@ -88,20 +86,6 @@ export class GithubService {
8886
};
8987
};
9088

91-
public listRepositoryMilestones = async ({
92-
owner,
93-
repository,
94-
}: GitHubListRepositoryMilestonesInput): Promise<GithubMilestone[]> => {
95-
const milestones = await this.fetchService.get<GithubMilestone[]>(
96-
`${this.apiURL}/repos/${owner}/${repository}/milestones`,
97-
{
98-
headers: this.githubToken ? { Authorization: `Token ${this.githubToken}` } : {},
99-
params: { state: "all", per_page: 100 },
100-
},
101-
);
102-
return milestones;
103-
};
104-
10589
private githubToken = this.configService.env().GITHUB_TOKEN;
10690
private apiURL = "https://api.github.com";
10791
}

api/src/github/types.ts

-22
Original file line numberDiff line numberDiff line change
@@ -30,28 +30,6 @@ export interface GetRepositoryInput {
3030
owner: string;
3131
repo: string;
3232
}
33-
34-
interface GitHubListRepositoryIssuesInput {
35-
owner: string;
36-
repository: string;
37-
}
38-
39-
export type GitHubListRepositoryMilestonesInput = GitHubListRepositoryIssuesInput;
40-
41-
export interface GithubMilestone {
42-
html_url: string;
43-
number: number;
44-
title: string;
45-
description: string;
46-
state: "closed" | "open";
47-
open_issues: number;
48-
closed_issues: number;
49-
created_at: string;
50-
updated_at: string;
51-
closed_at: string | null;
52-
due_on: string | null;
53-
}
54-
5533
export interface GitHubRateLimitApiResponse {
5634
resources: {
5735
core: {

api/src/milestone/controller.ts

-60
This file was deleted.

api/src/milestone/types.ts

-6
This file was deleted.

packages/models/src/milestone/index.ts

-13
This file was deleted.

web/src/components/locale/dictionary.ts

-8
Original file line numberDiff line numberDiff line change
@@ -175,14 +175,6 @@ Besides the open tasks on [/contribute](/contribute) page, you can also contribu
175175
en: "Make a Contribution",
176176
ar: "قدم مساهمة",
177177
},
178-
"landing-milestones-title": {
179-
en: "Project roadmap",
180-
ar: "خارطة طريق المشروع",
181-
},
182-
"landing-milestones-subtitle": {
183-
en: "See how and when new features are released and share your ideas and feedback to help us better shape dzcode roadmap",
184-
ar: "تعرف على كيفية ووقت إصدار الميزات الجديدة وشارك بأفكارك وملاحظاتك لمساعدتنا في تشكيل خارطة طريق dzcode بشكل أفضل",
185-
},
186178
"team-title": {
187179
en: "Meet the team! | DzCode i/o",
188180
ar: "تعرّف على الفريق! | DzCode i / o",

web/src/components/top-bar.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ export function TopBar({ version, links }: TopBarProps): JSX.Element {
152152
href={href}
153153
key={index}
154154
role="tab"
155-
className={`tab ${activeIndex === index ? "tab-active" : ""}`}
155+
className={`whitespace-nowrap tab ${activeIndex === index ? "tab-active" : ""}`}
156156
data-testid={`top-bar-to:${href}`}
157157
>
158158
<Locale {...{ localeKey }} />

web/src/pages/landing/index.tsx

-91
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,11 @@
1-
import { useEffect } from "react";
21
import { Helmet } from "react-helmet-async";
32
import { Link } from "src/components/link";
4-
import { Loading } from "src/components/loading";
53
import { Locale, useLocale } from "src/components/locale";
6-
import { Markdown } from "src/components/markdown";
7-
import { TryAgain } from "src/components/try-again";
8-
import { fetchMilestonesListAction } from "src/redux/actions/milestones";
9-
import { useAppDispatch, useAppSelector } from "src/redux/store";
104
import React from "react";
115

126
// ts-prune-ignore-next
137
export default function Page(): JSX.Element {
148
const { localize } = useLocale();
15-
const { milestones } = useAppSelector((state) => state.landingPage);
16-
const dispatch = useAppDispatch();
17-
18-
useEffect(() => {
19-
dispatch(fetchMilestonesListAction());
20-
}, [dispatch]);
219

2210
return (
2311
<main className="flex flex-col self-center">
@@ -45,85 +33,6 @@ export default function Page(): JSX.Element {
4533
</div>
4634
</div>
4735
</div>
48-
49-
<div className="m-4">
50-
<h1 className="text-4xl font-bold text-center max-w-xl m-auto">
51-
<Locale landing-milestones-title />
52-
</h1>
53-
<p className="py-6 max-w-xl m-auto">
54-
<Locale landing-milestones-subtitle />
55-
</p>
56-
57-
<div className="flex justify-center">
58-
{milestones === "ERROR" ? (
59-
<TryAgain
60-
error={localize("global-generic-error")}
61-
action={localize("global-try-again")}
62-
onClick={() => {
63-
dispatch(fetchMilestonesListAction());
64-
}}
65-
/>
66-
) : milestones === null ? (
67-
<Loading />
68-
) : (
69-
<div>
70-
<ul className="timeline max-md:timeline-compact timeline-vertical mt-4 mb-4">
71-
{milestones.map((milestone, milestoneIndex) => {
72-
const isEven = milestoneIndex % 2 === 0;
73-
74-
return (
75-
<li dir="ltr" key={milestoneIndex}>
76-
<hr />
77-
<div
78-
className={`${
79-
isEven ? "timeline-start" : "timeline-end"
80-
} w-full md:w-auto timeline-box ${
81-
isEven ? "md:text-end" : "md:text-start"
82-
}`}
83-
>
84-
<h2 className="text-xl font-bold">{milestone.title}</h2>
85-
<p>
86-
<Markdown content={milestone.description} />
87-
</p>
88-
</div>
89-
<div className="md:timeline-middle">
90-
{milestone.closedAt ? (
91-
<svg
92-
xmlns="http://www.w3.org/2000/svg"
93-
viewBox="0 0 20 20"
94-
fill="currentColor"
95-
className="text-primary h-5 w-5"
96-
>
97-
<path
98-
fillRule="evenodd"
99-
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"
100-
clipRule="evenodd"
101-
/>
102-
</svg>
103-
) : (
104-
<svg
105-
xmlns="http://www.w3.org/2000/svg"
106-
viewBox="0 0 20 20"
107-
fill="currentColor"
108-
className="h-5 w-5"
109-
>
110-
<path
111-
fillRule="evenodd"
112-
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"
113-
clipRule="evenodd"
114-
/>
115-
</svg>
116-
)}
117-
</div>
118-
<hr />
119-
</li>
120-
);
121-
})}
122-
</ul>
123-
</div>
124-
)}
125-
</div>
126-
</div>
12736
</main>
12837
);
12938
}

web/src/redux/actions/milestones.ts

-18
This file was deleted.

web/src/redux/slices/landing-page.ts

-21
This file was deleted.

web/src/redux/store.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { Provider as ReduxProvider, useDispatch, useSelector } from "react-redux
66
import { contributionsPageSlice } from "./slices/contributions-page";
77
import { contributionPageSlice } from "./slices/contribution-page";
88
import { contributorsPageSlice } from "./slices/contributors-page";
9-
import { landingPageSlice } from "./slices/landing-page";
109
import { projectsPageSlice } from "./slices/projects-page";
1110
import { settingsSlice } from "./slices/settings";
1211
import { projectPageSlice } from "./slices/project-page";
@@ -22,7 +21,6 @@ const makeAppStore = () => {
2221
contributorPage: contributorPageSlice.reducer,
2322
contributionsPage: contributionsPageSlice.reducer,
2423
contributionPage: contributionPageSlice.reducer,
25-
landingPage: landingPageSlice.reducer,
2624
},
2725
});
2826
};

0 commit comments

Comments
 (0)