Skip to content

Commit

Permalink
Merge pull request #321 from dzcode-io/fix/jully_monthly_fixes
Browse files Browse the repository at this point in the history
Fixes: July monthly fixes
  • Loading branch information
ZibanPirate authored Jul 3, 2021
2 parents 896f182 + 97aa3f8 commit 8517059
Show file tree
Hide file tree
Showing 28 changed files with 2,241 additions and 2,219 deletions.
4 changes: 2 additions & 2 deletions api/src/fetch/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { Service } from "typedi";
@Service()
export class FetchService {
constructor(private readonly configService: ConfigService) {
this.fetch = defaults(({
this.fetch = defaults({
cachePath: this.configService.env().FETCH_CACHE_PATH,
} as unknown) as FetchOptions);
} as unknown as FetchOptions);
}

public get = async <T = unknown>(
Expand Down
8 changes: 1 addition & 7 deletions data/models/articles/ssr.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
{
"items": [
"Send_Emails_With_Django_and_Gmail_A_Better_Way",
"Use_Conventional_Commits_To_Contribute_To_DZCode",
"Open_source",
"A_Python_Website_No_Framework_Needed",
"A_Python_Website_No_Framework_Needed_PART_2"
],
"items": "all",
"include": ["title", "description", "image"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,4 @@ To add new article, named for example: "**My Awesome Article**", simply do the f
}
```

**Notes**

- to make your article indexed by Google search, repeat the 4th step for `data/articles/ssr.json`.

5. Finally, commit and push the modifications you did to the repository and create a [pull request](/learn/git_basics/pull_merge_request). the maintainers will happily review, approve, merge and [deploy](https://github.com/dzcode-io/dzcode.io/releases) your changes!
5. Finally run `yarn` then `yarn lint:fix`, commit and push the modifications you did to the repository and create a [pull request](/learn/git_basics/pull_merge_request). the maintainers will happily review, approve, merge and [deploy](https://github.com/dzcode-io/dzcode.io/releases) your changes!
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ To add new project, named for example: "**My Awesome Project**", simply do the f
- Please use **Capital Cased** words for the name, as shown in the above example.
- if your projects has mutiple repositories, just add them in the `repositories` array, and they will automatically be shown in the website.

4. Finally, commit and push the modifications you did to the repository and create a [pull request](/learn/git_basics/pull_merge_request). the maintainers will happily review, approve, merge and [deploy](https://github.com/dzcode-io/dzcode.io/releases) your changes!
4. Finally run `yarn` then `yarn lint:fix`, commit and push the modifications you did to the repository and create a [pull request](/learn/git_basics/pull_merge_request). the maintainers will happily review, approve, merge and [deploy](https://github.com/dzcode-io/dzcode.io/releases) your changes!

This file was deleted.

This file was deleted.

6 changes: 5 additions & 1 deletion data/models/documentation/About_dzcode_io/content.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
Content coming soon...
Find guides, tutorials, learning videos and all things related to contributing the dzcode.io website.

check out dzcode YouTube channel for video tutorials:

https://www.youtube.com/channel/UC_tLjuQaYotzERtaAo8Y4SQ
Original file line number Diff line number Diff line change
@@ -1 +1,19 @@
Content coming soon...
# Pull Request vs Merge Request

Well, they are the exact same thing, just different names.

# What?

Pull requests let you tell others about changes you've pushed to a branch in a repository. Once a pull request is opened, you can discuss and review the potential changes with collaborators and add follow-up commits before your changes are merged into the base branch.

# Why?

pull requests is a mechanism for a developer to notify team members that a feature or fix, developed on a separate branch, is ready. This lets everybody involved know that they can review the code, providing a forum discussing the implementation of the proposed feature.

# How?

it's simple, it's just that each provider has its own GUI steps to do it:

- [Github](https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests)
- [Gitlab](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
- [BitBucket](https://www.atlassian.com/git/tutorials/making-a-pull-request)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "What is a Pull/Merge Request",
"description": "Description coming soon",
"image": "https://images.unsplash.com/photo-1481487196290-c152efe083f5?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=800&q=100",
"description": "What is a Pull Request? And what is a Merge Request? they are the same right???",
"image": "https://images.unsplash.com/photo-1452802447250-470a88ac82bc?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=100",
"authors": ["ZibanPirate"]
}
22 changes: 21 additions & 1 deletion data/models/documentation/Git_Basics/What_The_Fork/content.md
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
Content coming soon...
# What?

Creating a “fork” is producing a personal copy of someone else’s project. Forks act as a sort of bridge between the original repository and your personal copy

# Why?

It's needed mainly for two reasons:

## Propose changes to someone else's project

You want to contribute to a project, but you don't have **Write** access to it, the only way you can make changes in this case, is by forking this project into your account, make the changes there, then create a [Pull-Request](/Learn/Git_Basics/Pull_Merge_Request) but make sure this PR is targeting the original repository aka upstream, this PR will show up on the original project, and it's up to the maintainers to accept or request more changes before merging it.

## Use someone else's project as a starting point for your own idea

Open source software is based on the idea that by sharing code, we can make better, more reliable software.

When creating your public repository from a fork of someone's project, make sure to include a license file that determines how you want your project to be shared with others.

# How?

the best up-to-date place to learn how to fork, is in [Github docs](https://docs.github.com/en/get-started/quickstart/fork-a-repo)
4 changes: 2 additions & 2 deletions data/models/documentation/Git_Basics/What_The_Fork/info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "What The Fork!",
"description": "Description coming soon",
"image": "https://images.unsplash.com/photo-1481487196290-c152efe083f5?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=800&q=100",
"description": "What does it mean to fork on GitHub?",
"image": "https://images.unsplash.com/photo-1619367300934-373d9adf7dfb?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=100",
"authors": ["ZibanPirate"]
}
2 changes: 1 addition & 1 deletion data/models/documentation/Git_Basics/content.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Content coming soon...
Learn the basic of GIT version control, just the things you need daily in work, such as PRs, Forks ...etc.
2 changes: 1 addition & 1 deletion data/models/documentation/Git_Basics/info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "Git Basics",
"description": "Learn the basic of GIT version control, just the things you need daily in work.",
"image": "https://images.unsplash.com/photo-1481487196290-c152efe083f5?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=800&q=100",
"image": "https://images.unsplash.com/photo-1556075798-4825dfaaf498?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=100",
"authors": ["ZibanPirate"]
}
3 changes: 0 additions & 3 deletions data/models/documentation/list.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
{
"items": [
"Getting_Started",

"Git_Basics",
"Git_Basics/What_The_Fork",
"Git_Basics/Syncing_An_Old_Forked_Repository_With_Upstream",
"Git_Basics/Pull_Merge_Request",

"About_dzcode_io",
"About_dzcode_io/What_Is_dzcode_io_Built_With",
"About_dzcode_io/Add_Your_Article_To_dzcode_io",
"About_dzcode_io/Add_Your_Project_To_dzcode_io"
],
Expand Down
14 changes: 1 addition & 13 deletions data/models/documentation/ssr.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
{
"items": [
"Getting_Started",

"Git_Basics",
"Git_Basics/What_The_Fork",
"Git_Basics/Syncing_An_Old_Forked_Repository_With_Upstream",
"Git_Basics/Pull_Merge_Request",

"About_dzcode_io",
"About_dzcode_io/What_Is_dzcode_io_Built_With",
"About_dzcode_io/Add_Your_Article_To_dzcode_io",
"About_dzcode_io/Add_Your_Project_To_dzcode_io"
],
"items": "all",
"include": ["title", "description", "image"]
}
2 changes: 1 addition & 1 deletion data/models/projects-v2/Dzair_Data_Usage/info.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "My Awesome Project",
"name": "Dzair Data Usage",
"repositories": [
{
"provider": "github",
Expand Down
6 changes: 6 additions & 0 deletions data/models/projects/Dzair_Data_Usage/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"title": "Dzair Data Usage",
"description": "dzair_data_usage is a dart/flutter package for dealing with algerian cities data such as dairas,communes and more.",
"image": "https://images.unsplash.com/photo-1451187580459-43490279c0fa?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=512&q=80",
"githubURI": "dfourcfive/dzair_data_usage"
}
13 changes: 0 additions & 13 deletions data/models/projects/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,6 @@ To add new project simply do the following:
}
```

- Also Make your project **server side rendered** by adding the name of the project folder into the `"items": [] array` on `ssr.json` under `data/projects`.

```json
{
"items": [
"DzCode",
"React_Project_Builder",
"My_New_Project" 👈 here is my new project
],
"include": ["title", "description", "image"]
}
```

- Finally, Commit and push the modifications you did to the repository and create a `pull request`.

### 🎉 Congratulations 🎉 Your project is listed on dzCode
Expand Down
3 changes: 2 additions & 1 deletion data/models/projects/list.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"Voice_Translator_React_Native",
"React_Native_Help_Create",
"Melyon_Theme",
"AiPalettes"
"AiPalettes",
"Dzair_Data_Usage"
],
"include": ["title", "description", "image", "githubURI"]
}
18 changes: 1 addition & 17 deletions data/models/projects/ssr.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,4 @@
{
"items": [
"Leblad",
"Leblad_Py",
"Mishkal",
"React_Project_Builder",
"Kuliya",
"DzCode",
"Algerian_Administrative_Division",
"Flutter_Reaction_Button",
"Algeria_Covid19_Tracker",
"React_Native_Currency_Converter",
"Python_Complex",
"List_to_Tree_aka_l2t",
"Voice_Translator_React_Native",
"React_Native_Help_Create",
"Melyon_Theme"
],
"items": "all",
"include": ["title", "description", "image"]
}
2 changes: 1 addition & 1 deletion data/src/config/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { Environment } from "@dzcode.io/common/dist/types";
import { fsConfig } from "@dzcode.io/common/dist/config";
export const fullstackConfig = fsConfig((process.env as unknown) as Environment);
export const fullstackConfig = fsConfig(process.env as unknown as Environment);
12 changes: 8 additions & 4 deletions web/src/apps/main/components/speed-dial/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ import PropTypes from "prop-types";
import SpeedDialAction from "@material-ui/lab/SpeedDialAction";
import SpeedDialIcon from "@material-ui/lab/SpeedDialIcon";

export interface SpeedDialAction {
icon: ReactNode;
name: string;
link?: string;
}

interface SpeedDialProps extends SpeedDialPropsMUI {
actions: Array<{
icon: ReactNode;
name: string;
}>;
actions: SpeedDialAction[];
open: boolean;
}
export const SpeedDial: FC<SpeedDialProps> = (props) => {
Expand All @@ -31,6 +34,7 @@ export const SpeedDial: FC<SpeedDialProps> = (props) => {
icon={action.icon}
tooltipTitle={action.name}
onClick={handleClose}
FabProps={{ href: action.link }}
/>
))}
</SpeedDialMUI>
Expand Down
14 changes: 9 additions & 5 deletions web/src/apps/main/pages/articles/content/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import "./style.scss";

import { Dispatch, StateInterface } from "src/apps/main/redux";
import { FC, useEffect } from "react";
import { SpeedDial, SpeedDialAction } from "src/apps/main/components/speed-dial";
import { createStyles, makeStyles } from "@material-ui/core/styles";
import { useDispatch, useSelector } from "react-redux";

import { Article } from "@dzcode.io/common/dist/types";
import { ArticlesPageState } from "src/apps/main/redux/reducers/articles-page";
import { Authors } from "src/apps/main/components/authors";
import { Contributors } from "src/apps/main/components/contributors";
Expand All @@ -16,13 +17,16 @@ import InstagramIcon from "@material-ui/icons/Instagram";
import LinkedInIcon from "@material-ui/icons/LinkedIn";
import { Markdown } from "src/apps/main/components/markdown";
import Skeleton from "@material-ui/lab/Skeleton";
import { SpeedDial } from "src/apps/main/components/speed-dial";
import TwitterIcon from "@material-ui/icons/Twitter";
import Typography from "@material-ui/core/Typography";
import { fetchCurrentArticle } from "src/apps/main/redux/actions/articles-page";

const actions = [
{ icon: <EditIcon />, name: "Edit This Article" },
const actions = ({ slug }: Article): SpeedDialAction[] => [
{
icon: <EditIcon />,
name: "Edit This Article",
link: `https://github.com/dzcode-io/dzcode.io/blob/main/data/models/articles/${slug}/content.md`,
},
{ icon: <FileCopyIcon />, name: "Copy URL" },
{ icon: <FacebookIcon />, name: "Share to Facebook" },
{ icon: <TwitterIcon />, name: "Share to Twitter" },
Expand Down Expand Up @@ -115,7 +119,7 @@ export const Content: FC = () => {
<SpeedDial
className={classes.speedDial}
ariaLabel="Actions SpeedDial"
actions={actions}
actions={actions(currentArticle)}
open
/>
<Divider className={classes.spacing} />
Expand Down
14 changes: 9 additions & 5 deletions web/src/apps/main/pages/learn/content/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ import "./style.scss";

import { Dispatch, StateInterface } from "src/apps/main/redux";
import { FC, useEffect } from "react";
import { SpeedDial, SpeedDialAction } from "src/apps/main/components/speed-dial";
import { createStyles, makeStyles } from "@material-ui/core/styles";
import { useDispatch, useSelector } from "react-redux";

import { Authors } from "src/apps/main/components/authors";
import { Contributors } from "src/apps/main/components/contributors";
import { Divider } from "@material-ui/core";
import { Document } from "@dzcode.io/common/dist/types";
import EditIcon from "@material-ui/icons/Edit";
import FacebookIcon from "@material-ui/icons/Facebook";
import FileCopyIcon from "@material-ui/icons/FileCopyOutlined";
Expand All @@ -16,13 +17,16 @@ import { LearnPageState } from "src/apps/main/redux/reducers/learn-page";
import LinkedInIcon from "@material-ui/icons/LinkedIn";
import { Markdown } from "src/apps/main/components/markdown";
import Skeleton from "@material-ui/lab/Skeleton";
import { SpeedDial } from "src/apps/main/components/speed-dial";
import TwitterIcon from "@material-ui/icons/Twitter";
import Typography from "@material-ui/core/Typography";
import { fetchCurrentDocument } from "src/apps/main/redux/actions/documentation-page";

const actions = [
{ icon: <EditIcon />, name: "Edit This Document" },
const actions = ({ slug }: Document): SpeedDialAction[] => [
{
icon: <EditIcon />,
name: "Edit This Document",
link: `https://github.com/dzcode-io/dzcode.io/blob/main/data/models/documentation/${slug}/content.md`,
},
{ icon: <FileCopyIcon />, name: "Copy URL" },
{ icon: <FacebookIcon />, name: "Share to Facebook" },
{ icon: <TwitterIcon />, name: "Share to Twitter" },
Expand Down Expand Up @@ -114,7 +118,7 @@ export const Content: FC = () => {
<SpeedDial
className={classes.speedDial}
ariaLabel="Actions SpeedDial"
actions={actions}
actions={actions(currentDocument)}
open
/>

Expand Down
Loading

0 comments on commit 8517059

Please sign in to comment.