Skip to content
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
1 change: 0 additions & 1 deletion .gitlab/CODEOWNERS

This file was deleted.

41 changes: 0 additions & 41 deletions .gitlab/issue_templates/Bug.md

This file was deleted.

26 changes: 0 additions & 26 deletions .gitlab/issue_templates/Feature_request.md

This file was deleted.

28 changes: 0 additions & 28 deletions .gitlab/merge_request_templates/Default.md

This file was deleted.

43 changes: 23 additions & 20 deletions CONTRIBUTE.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,22 @@ This project and everyone participating in it is governed by our [Code of Conduc

### Your First Code Contribution

Unsure where to begin contributing? You can start by looking through `good-first-issue` labeled [issues](https://gitlab.com/need4deed/website/-/issues/?label_name%5B%5D=good-first-issue)
Unsure where to begin contributing? You can start by looking through `good-first-issue` labeled [issues](https://github.com/need4deed-org/website/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22good%20first%20issue%22)

### First Merge Request

Step 1: Fork the Repository

1. Go to the our repository: [https://gitlab.com/need4deed/website](https://gitlab.com/need4deed/website).
1. Go to the our repository: [https://github.com/need4deed-org/website](https://github.com/need4deed-org/website).
1. Click the **Fork** button in the top-right corner.
1. Choose where to fork the repository (usually your own GitLab account).
1. Choose where to fork the repository (usually your own GitHub account).

Step 2: Clone Your Forked Repository

1. Go to your forked repository (e.g., `https://gitlab.com/your-username/website`).
1. Go to your forked repository (e.g., `https://github.com/your-username/website`).
1. Click the **Clone** button and copy it e.g. with HTTPS URL.
```bash
git clone https://gitlab.com/your-username/website.git
git clone git@github.com:need4deed-org/website.git
```
1. Navigate into the cloned repository:

Expand All @@ -53,7 +53,7 @@ Step 3: Add the Original Repository as a Remote

1. Add the original repository as a remote called `upstream`:
```bash
git remote add upstream https://gitlab.com/need4deed/website.git
git remote add upstream https://github.com/need4deed-org/website.git
```
1. Verify the remotes:

Expand All @@ -70,7 +70,7 @@ Step 3: Add the Original Repository as a Remote
```bash
git checkout -b your-branch-name
```
The branch should titled be your_nick-feature-title
The branch should titled be issue#-your_nick-feature-title, like `123-johndoe-update-readme`

Step 4: Commit and Push Your Changes

Expand All @@ -87,31 +87,32 @@ Step 4: Commit and Push Your Changes
git push origin your-branch-name
```

Step 5: Create a merge request
Step 5: Create a pull request (PR)

1. Go to your forked repository on GitLab: `https://gitlab.com/your-username/website`.
1. Click on **Merge Requests** in the left sidebar.
1. Click **New Merge Request**.
1. Select your branch (`your-branch-name`) as the **Source Branch** and `main` as the **Target Branch**.
1. Fill in the Merge Request template
1. Click **Create Merge Request**.
1. Let us know about the awaiting review!
1. Go to your forked repository on GitHub: `https://github.com/your-username/website`.
2. Click on **Pull requests** in the left sidebar.
3. Click **New pull request**.
4. Select your branch (`your-branch-name`) on the right and make sure `develop` is on the left.
5. Click **Create pull request**.
6. Fill in the Pull Request template
7. Click **Create pull request**.
8. Let us know about the awaiting review!

### Reporting Bugs

Before creating bug reports, please check [this list](#before-submitting-a-bug-report) as you might find out that you don't need to create one. When you are creating a bug report, please [include as many details as possible](#how-do-i-submit-a-good-bug-report).

#### Before Submitting A Bug Report

- Please check [check](https://gitlab.com/need4deed/website/-/issues/?sort=created_date&state=opened&label_name%5B%5D=Any&first_page_size=20) if the problem has already been reported.
- Please check [already reported bugs](https://github.com/need4deed-org/website/issues?q=is%3Aissue%20state%3Aopen%20type%3ABug) if the problem has already been reported.

#### How Do I Submit A Bug Report?

Bugs are tracked as [GitLab issues](https://gitlab.com/need4deed/website/-/issues). Create a bug issue. All the necesary info should be in the bug template.
Bugs are tracked as [GitHub issues](https://github.com/need4deed-org/website/issues). Create a bug issue. All the necessary info should be in the bug template.

### Suggesting features

Feature suggestions are also tracked as [GitLab issues](https://gitlab.com/need4deed/website/-/issues). Please refer to the feature template.
Feature suggestions are also tracked as [GitHub issues](https://github.com/need4deed-org/website/issues). Please refer to the feature template.

## Styleguides

Expand All @@ -128,6 +129,8 @@ Feature suggestions are also tracked as [GitLab issues](https://gitlab.com/need4
- 🐛 `:bug:` when fixing a bug
- 🔥 `:fire:` when removing code or files

Please keep commits reasonably scoped, e.g. a single commit containing all the diffs is hard to comprehend.

### JavaScript Styleguide

Please refer to the linter.
Expand All @@ -141,7 +144,7 @@ By contributing, you agree that your contributions will be licensed under its [C
Don't hesitate to reach out if you have any questions! You can:

- Open an issue
- Reach out to [@maintainer](https://gitlab.com/szymon.skorupinski.need4deed])
- Join our Slack (please request an access h4ck@need4deed.org)
- Reach out to [@need4deed](https://github.com/need4deed)
- Join our Slack (please request an access dev@need4deed.org)

Any contributions are welcome! 🙏
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The number of people fleeing conflict zones, persecution and human rights violat

## Equal opportunities

People living under destitute life conditions should be given equal opportunities. The latter includes underserved individuals and groups affected by forced migration.
People living under destitute life conditions should be given equal opportunities. The latter includes undeserved individuals and groups affected by forced migration.

## Responsibility

Expand All @@ -33,17 +33,17 @@ Applying technology in the effort to support underserved communities is a key va
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.

## Background

We use simple react/vite app for landing page, aka [website], which is being served from files on S3 using Amplify
we're also developing a PWA on nextjs for automation of need4deed business processes, this is fe repo. also we use separate repo sdk mostly for sharing of types between fron and backend.
also we plan merging our landing page into the app so in the end there should be frontend, backend, and sdk.
so the website is now kind of frozen in terms of development. it still operates along with legacy backend before we launch the app with the new backend.


## Step 1: Fork the Repository

1. Go to the our repository: [https://github.com/need4deed-org/website](https://github.com/need4deed-org/website).
1. Click the **Fork** button in the top-right corner.
1. Choose where to fork the repository (usually your own GitLab account).
1. Choose where to fork the repository (usually your own GitHub account).

See [CONTRIBUTE.md](CONTRIBUTE.md) for the next steps and detailed contribution guidelines.

Expand All @@ -65,7 +65,7 @@ See [CONTRIBUTE.md](CONTRIBUTE.md) for the next steps and detailed contribution
1. Clone the repository

```bash
git clone git@gitlab.com:need4deed/website.git
git clone git@github.com:need4deed-org/website.git
```

2. Install dependencies
Expand Down Expand Up @@ -115,6 +115,6 @@ This project is licensed under the Common Clause and the MIT License - see the [

## Support 💬

- Create an [Issue](https://gitlab.com/need4deed/website/-/issues)
- Create an [Issue](https://github.com/need4deed-org/website/issues)
- Join our Slack - ask as for an inivatation
- Email: h4ck@need4deed.org
8 changes: 8 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ function App() {
path={`/${Subpages.OPPORTUNITY_FORM}`}
element={<OpportunityForm />}
/>
<Route
path={`/${Subpages.OPPORTUNITY_FORM}/:lng`}
element={<OpportunityForm />}
/>
<Route
path={`/${Subpages.OPPORTUNITY_FORM_LEGACY}`}
element={<OpportunityForm />}
Expand All @@ -177,6 +181,10 @@ function App() {
path={`/${Subpages.VOLUNTEER_FORM}`}
element={<VolunteerForm />}
/>
<Route
path={`/${Subpages.VOLUNTEER_FORM}/:lng`}
element={<VolunteerForm />}
/>
<Route
path={`/${Subpages.RAC_GUIDELINES}`}
element={<GuidelinesPage />}
Expand Down
14 changes: 7 additions & 7 deletions src/components/OpportunityCards/Cards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,27 @@ import { useTranslation } from "react-i18next";
import styled from "styled-components";
import { OpportunityParams, ScreenTypes } from "../../config/types";
import useOpportunities from "../../hooks/api/useOpportunities";
import useScreenType from "../../hooks/useScreenType";
import Announcement from "../Announcement";
import PaginatedGrid from "../core/paginatedGrid/PaginatedGrid";
import OpportunityCard from "../VolunteeringOpportunities/OpportunityCard";
import OpportunityCardPopup from "../VolunteeringOpportunities/OpportunityCardPopup";
import {
Opportunity,
OpportunityApi,
} from "../VolunteeringOpportunities/types";
import {
CategoryTitle,
getIconName,
getMappedOpportunities,
} from "../VolunteeringOpportunities/utils";
import {
Opportunity,
OpportunityApi,
} from "../VolunteeringOpportunities/types";
import OpportunityCard from "../VolunteeringOpportunities/OpportunityCard";
import {
extractCardsFilter,
filterOpportunity,
isObjectEmpty,
reduceFilter,
} from "./helpers";
import { CardsFilter, SetFilter } from "./types";
import PaginatedGrid from "../core/paginatedGrid/PaginatedGrid";
import useScreenType from "../../hooks/useScreenType";

interface Props extends React.HTMLAttributes<HTMLDivElement> {
url: string;
Expand Down
16 changes: 8 additions & 8 deletions src/components/OpportunityCards/OpportunityCards.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { useLocation, useSearchParams } from "react-router-dom";
import styled from "styled-components";
import { Lang, OpportunityType } from "need4deed-sdk";
import { useTranslation } from "react-i18next";
import { useState } from "react";
import Cards from "./Cards";
import { useTranslation } from "react-i18next";
import { useLocation, useSearchParams } from "react-router-dom";
import styled from "styled-components";
import { urlApiOpportunity } from "../../config/constants";
import OpportunityCardsHeader from "./OpportunityCardsHeader";
import MapView from "./MapView";
import Cards from "./Cards";
import Filters from "./Filters/Filters";
import { defaultFilter, FILTER_KEY_LIST } from "./Filters/constants";
import { CardsFilter } from "./types";
import MapView from "./MapView";
import OpportunityCardsHeader from "./OpportunityCardsHeader";
import { deserializeFilters, openFilters, serializeFilters } from "./helpers";
import { CardsFilter } from "./types";

const OpportunitiesContainer = styled.div`
display: flex;
Expand Down Expand Up @@ -90,7 +90,7 @@ export function OpportunityCards() {

{selectedTabIndex === 0 ? (
<Cards
url={urlApiOpportunity}
url={`${urlApiOpportunity}/legacy`}
opportunityParams={{
search: {
status: ["Volunteers Needed", "Search in process"],
Expand Down
8 changes: 4 additions & 4 deletions src/components/OpportunityCards/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/* eslint-disable no-restricted-syntax */
import { Lang, OpportunityType } from "need4deed-sdk";
import { TFunction } from "i18next";
import { Opportunity } from "../VolunteeringOpportunities/types";
import { CardsFilter, Day, DayKeys, Days, DaysKeys } from "./types";
import { Lang, OpportunityType } from "need4deed-sdk";
import { TimeSlot, Weekday } from "../forms/types";
import { Opportunity } from "../VolunteeringOpportunities/types";
import { CategoryTitle } from "../VolunteeringOpportunities/utils";
import {
DASH,
Expand All @@ -12,6 +11,7 @@ import {
FilterKey,
langQueryParamKey,
} from "./Filters/constants";
import { CardsFilter, Day, DayKeys, Days, DaysKeys } from "./types";

const dayEnumMap: Record<string, DaysKeys> = {
1: "monday",
Expand Down Expand Up @@ -236,7 +236,7 @@ export const extractCardsFilter = (
if (opp.categoryId !== CategoryTitle.ACCOMPANYING)
categoriesSet.add(opp.category);

opp.locations.forEach((l) => districtSet.add(l));
opp.locations?.forEach((l) => districtSet.add(l));
}

putItemToEnd(
Expand Down
3 changes: 2 additions & 1 deletion src/components/VolunteeringOpportunities/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ export const getMappedOpportunities = (
opps: OpportunityApi[],
t: TFunction,
) => {
return opps.map((opp) => mapOpportunity(opp, t));
const oppArray = Array.isArray(opps) ? opps : [];
return oppArray.map((opp) => mapOpportunity(opp, t));
};

export function getIconName(category: CategoryTitle) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/AddOpportunity/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default function AddOpportunity() {
const { postRequest } = usePostRequest<
OpportunityParsedData,
Record<string, string | string[]>
>({ url: `${urlApi}/opportunity/` });
>({ url: `${urlApi}/api/opportunity/legacy` });

const formOpportunity = useForm<OpportunityData>({
defaultValues: {
Expand Down
Loading
Loading