Skip to content
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

Org Filter by Skill #12

Merged
merged 17 commits into from
Jan 29, 2024
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,47 @@ Additionally, a subset of **Sphinx Tribes** is the Bounties Platform - a global
The **sphinx-tribes-frontend** also contains the frontend for the bounties platform website. In order to run the website locally on your computer, you'll need to run sphinx-tribes-frontend as a whole. You can find the backend repo at [sphinx-tribes](https://github.com/stakwork/sphinx-tribes).


## Authentication 🔒

The authentication process is seamlessly handled by [sphinx-auth](https://github.com/stakwork/sphinx-auth).

## Running Against Sphinx-Stack 🏃

To run the **tribes** frontend locally, utilize the following ports:

- Tribes: `yarn start:tribes:docker` (localhost:23000)
- People: `yarn start:people:docker` (localhost:23007)

## Running Frontend Against people.sphinx.chat Locally 🌐

If you wish to run only the frontend, follow these steps:

1. Modify line 10 in `src/config/ModeDispatcher.tsx`:
- Change `'localhost:3000': AppMode.TRIBES` to `'localhost:3000': AppMode.COMMUNITY`

2. Modify line 27 in `src/config/ModeDispatcher.tsx`:
- Change `return hosts[host] || AppMode.TRIBES;` to `return hosts[host] || AppMode.COMMUNITY;`

3. Modify line 6 in `src/config/host.ts`:
- Change `return host;` to `return 'people-test.sphinx.chat';`

4. Open the terminal. Locate your folder and then run:

- `yarn install` to install the dependencies
- `yarn start` to run the frontend locally

## Contributing Guidelines 🤝

All code contributions, including those of people having commit access, must go through a pull request and be approved by a core developer before being merged. This is to ensure a proper review of all the code.

We truly ❤️ pull requests! If you wish to help, you can learn more about how you can contribute to this project in the [contribution guide](CONTRIBUTING.md).
## Community and Support 💬

Join our community on [Forum/Chat](https://people.sphinx.chat) to connect with other users and get support.

Feel free to explore the potential of **sphinx-tribes** and contribute to its vibrant ecosystem! 🌟
=======

## Authentication 🔒

The authentication process is seamlessly handled by [sphinx-auth](https://github.com/stakwork/sphinx-auth).
Expand Down
28 changes: 19 additions & 9 deletions src/pages/tickets/org/OrgTickets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ function OrgBodyComponent() {
const [scrollValue, setScrollValue] = useState<boolean>(false);
const [checkboxIdToSelectedMap, setCheckboxIdToSelectedMap] = useState(defaultOrgBountyStatus);
const [checkboxIdToSelectedMapLanguage, setCheckboxIdToSelectedMapLanguage] = useState({});
const [languageString, setLanguageString] = useState('');
const { uuid } = useParams<{ uuid: string; bountyId: string }>();
const [languageString, setLanguageString] = useState('');
const [organizationUrls, setOrganizationUrls] = useState({});

const color = colors['light'];
Expand All @@ -37,13 +37,17 @@ function OrgBodyComponent() {
await main.getBadgeList();
await main.getPeople();
if (uuid) {
await main.getSpecificOrganizationBounties(uuid, { page: 1, resetPage: true });
await main.getSpecificOrganizationBounties(uuid, {
page: 1,
resetPage: true,
languages: languageString
});
const orgUrls = await api.get(`organizations/${uuid}`);
setOrganizationUrls(orgUrls);
}
setLoading(false);
})();
}, [main, uuid]);
}, [main, uuid, checkboxIdToSelectedMap, languageString]);

useEffect(() => {
setCheckboxIdToSelectedMap({
Expand All @@ -70,14 +74,17 @@ function OrgBodyComponent() {
setCheckboxIdToSelectedMap(newCheckboxIdToSelectedMap);
};

const onChangeLanguage = (optionId: any) => {
const onChangeLanguage = (optionId: number) => {
const newCheckboxIdToSelectedMapLanguage = {
...checkboxIdToSelectedMapLanguage,
...{
[optionId]: !checkboxIdToSelectedMapLanguage[optionId]
}
[optionId]: !checkboxIdToSelectedMapLanguage[optionId]
};
setCheckboxIdToSelectedMapLanguage(newCheckboxIdToSelectedMapLanguage);
const languageString = Object.keys(newCheckboxIdToSelectedMapLanguage)
.filter((key: string) => newCheckboxIdToSelectedMapLanguage[key])
.join(',');
setLanguageString(languageString);
main.setBountyLanguages(languageString);
};

const onPanelClick = (person: any, item: any) => {
Expand Down Expand Up @@ -159,11 +166,13 @@ function OrgBodyComponent() {
}}
>
<OrgHeader
organizationUrls={organizationUrls}
onChangeStatus={onChangeStatus}
onChangeLanguage={onChangeLanguage}
checkboxIdToSelectedMap={checkboxIdToSelectedMap}
org_uuid={uuid}
checkboxIdToSelectedMapLanguage={checkboxIdToSelectedMapLanguage}
languageString={languageString}
organizationUrls={organizationUrls}
org_uuid={uuid}
/>
<>
<div
Expand Down Expand Up @@ -193,6 +202,7 @@ function OrgBodyComponent() {
fromBountyPage={true}
selectedWidget={selectedWidget}
loading={loading}
uuid={uuid}
org_uuid={uuid}
/>
</div>
Expand Down
8 changes: 8 additions & 0 deletions src/pages/tickets/org/orgHeader/Icons/dropDownIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading