-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'development' into nathan_permissions_merge
- Loading branch information
Showing
70 changed files
with
2,807 additions
and
1,748 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,165 @@ | ||
# HGN TIME Tracking Application in React | ||
|
||
### Installation | ||
<a name="readme-top"></a> | ||
|
||
<!-- PROJECT SHIELDS --> | ||
|
||
[![Contributors][contributors-shield]][contributors-url] | ||
[![Forks][forks-shield]][forks-url] | ||
[![Stargazers][stars-shield]][stars-url] | ||
[![Issues][issues-shield]][issues-url] | ||
[![LinkedIn][linkedin-shield]][linkedin-url] | ||
|
||
<!-- PROJECT LOGO --> | ||
<br /> | ||
<div align="center"> | ||
<a href="https://github.com/OneCommunityGlobal/HighestGoodNetworkApp"> | ||
<img src="images/logo.png" alt="Logo" width="80" height="80"> | ||
</a> | ||
|
||
<h3 align="center">Highest Good Network(HGN) Software</h3> | ||
|
||
<p align="center"> | ||
Phase I - Labor tracking | ||
<br /> | ||
<a href="https://github.com/OneCommunityGlobal/HighestGoodNetworkApp"><strong>Explore the docs »</strong></a> | ||
<br /> | ||
<br /> | ||
<a href="https://github.com/OneCommunityGlobal/HighestGoodNetworkApp">View Demo</a> | ||
· | ||
<a href="https://github.com/OneCommunityGlobal/HighestGoodNetworkApp/issues">Report Bug</a> | ||
· | ||
<a href="https://github.com/OneCommunityGlobal/HighestGoodNetworkApp/issues">Request Feature</a> | ||
</p> | ||
</div> | ||
|
||
<!-- TABLE OF CONTENTS --> | ||
<details> | ||
<summary>Table of Contents</summary> | ||
<ol> | ||
<li> | ||
<a href="#about-the-project">About The Project</a> | ||
<ul> | ||
<li><a href="#built-with">Built With</a></li> | ||
</ul> | ||
</li> | ||
<li> | ||
<a href="#getting-started">Getting Started</a> | ||
<ul> | ||
<li><a href="#prerequisites">Prerequisites</a></li> | ||
<li><a href="#installation">Installation</a></li> | ||
</ul> | ||
</li> | ||
<li><a href="#usage">Usage</a></li> | ||
<li><a href="#roadmap">Roadmap</a></li> | ||
<li><a href="#contributing">Contributing</a></li> | ||
<li><a href="#license">License</a></li> | ||
<li><a href="#contact">Contact</a></li> | ||
<li><a href="#acknowledgments">Acknowledgments</a></li> | ||
</ol> | ||
</details> | ||
|
||
<!-- ABOUT THE PROJECT --> | ||
|
||
## About The Project | ||
|
||
[![Product Name Screen Shot][product-screenshot]](https://hgnapplication_react_beta.surge.sh/) | ||
|
||
<p align="right">(<a href="#readme-top">back to top</a>)</p> | ||
|
||
### Built With | ||
|
||
- [![React][react.js]][react-url] | ||
- [![MongoDB][MongoDB]][MongoDB-url] | ||
- [![Express][express.js]][express-url] | ||
- [![Node][node.js]][node-url] | ||
|
||
<p align="right">(<a href="#readme-top">back to top</a>)</p> | ||
|
||
<!-- GETTING STARTED --> | ||
|
||
## Getting Started | ||
|
||
For setting up your project locally, please get a local copy up and running follow these simple example steps. | ||
|
||
### Prerequisites | ||
|
||
1. Node v12.5 or higher installed on your machine. | ||
2. A decent code editor like VS Code or Atom. | ||
3. Git | ||
4. NPM | ||
|
||
If using NPM(Preffered): | ||
### Installation | ||
|
||
1. Clone the repo | ||
```sh | ||
git clone https://github.com/OneCommunityGlobal/HighestGoodNetworkApp.git | ||
``` | ||
2. Install NPM packages | ||
```sh | ||
npm install | ||
``` | ||
3. Get your `.env` file ready and start the app | ||
```sh | ||
npm run start:local | ||
``` | ||
|
||
<p align="right">(<a href="#readme-top">back to top</a>)</p> | ||
|
||
<!-- USAGE EXAMPLES --> | ||
|
||
```sh | ||
$ npm install | ||
$ npm run start:local | ||
``` | ||
## Usage | ||
|
||
'npm install' to install the dependencies. | ||
'npm run start:local' to run the application | ||
Use this space to show useful examples of how a project can be used. Additional screenshots, code examples and demos work well in this space. You may also link to more resources. | ||
|
||
To get started, make sure you have: | ||
_For more examples, please refer to the [Documentation](https://example.com)_ | ||
|
||
Step1: Clone the App | ||
To clone the code, navigate to the source directory where you want to maintain the code and via terminal or GUI of your choice, run : git clone https://github.com/OneCommunityGlobal/HighestGoodNetworkApp.git . You can also setup SSH and then use that for working with remote. | ||
<p align="right">(<a href="#readme-top">back to top</a>)</p> | ||
|
||
Step2: Run npm install root directory. | ||
<!-- CONTRIBUTING --> | ||
|
||
Step3: Start the app: | ||
## Contributing | ||
|
||
Option 1: | ||
To start the app, you need to set up the api endpoint as a process.env variable. Setup tokenKey as same as in HGNRest server. RestApi needs to be followed by '/api'. For example if HGNRest server is hosted at http://localhost:4500, the RestApi is http://localhost:4500/api . You can just run | ||
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**. | ||
|
||
``` | ||
REACT_APP_APIENDPOINT=<put apiendpoint here> npm start | ||
``` | ||
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". | ||
Don't forget to give the project a star! Thanks again! | ||
For a windows user, you can run | ||
1. Join One Community as a member | ||
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`) | ||
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`) | ||
4. Push to the Branch (`git push origin feature/AmazingFeature`) | ||
5. Open a Pull Request | ||
``` | ||
set REACT_APP_APIENDPOINT=<put apiendpoint here> && npm start | ||
``` | ||
<p align="right">(<a href="#readme-top">back to top</a>)</p> | ||
Option 2 (Preferred): | ||
You can also create a .env file in the base directory with the following or ask a team member on slack to recieve a copy of this file for both the frontend and backend: | ||
REACT_APP_APIENDPOINT="<put apiendpoint here>" | ||
SKIP_PREFLIGHT_CHECK=true | ||
<!-- CONTACT --> | ||
``` | ||
npm run start:local | ||
``` | ||
## Contact | ||
You may have to run it as super user (i.e. sudo) depending upon the permission setup on your machine. | ||
The application, by default, starts on port 3000. If 3000 is busy, then the start process will suggest another port and you can choose that. The url, by default, will be http://localhost:3000. You will need to login and those credentials will be provided to you as a part of your user setup process. | ||
One Community - [@onecommunityorg](https://twitter.com/onecommunityorg) - onecommunityglobal@gmail.com | ||
Note: | ||
Once you check in the code in github and get it reviewed, the application will be published to the following: | ||
Project Link: [https://github.com/OneCommunityGlobal/HighestGoodNetworkApp](https://github.com/OneCommunityGlobal/HighestGoodNetworkApp) | ||
- Development : https://hgnapplication_react_dev.surge.sh | ||
- Master: https://hgnapplicationv2.surge.sh | ||
<p align="right">(<a href="#readme-top">back to top</a>)</p> | ||
Other key touchpoints: | ||
<!-- MARKDOWN LINKS & IMAGES --> | ||
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links --> | ||
1. Build: CircleCI | ||
2. Monitoring and logging: Sentry.io | ||
[contributors-shield]: https://img.shields.io/github/contributors/OneCommunityGlobal/HighestGoodNetworkApp.svg?style=for-the-badge | ||
[contributors-url]: https://github.com/OneCommunityGlobal/HighestGoodNetworkApp/graphs/contributors | ||
[forks-shield]: https://img.shields.io/github/forks/OneCommunityGlobal/HighestGoodNetworkApp.svg?style=for-the-badge | ||
[forks-url]: https://github.com/OneCommunityGlobal/HighestGoodNetworkApp/network/members | ||
[stars-shield]: https://img.shields.io/github/stars/OneCommunityGlobal/HighestGoodNetworkApp.svg?style=for-the-badge | ||
[stars-url]: https://github.com/OneCommunityGlobal/HighestGoodNetworkApp/stargazers | ||
[issues-shield]: https://img.shields.io/github/issues/OneCommunityGlobal/HighestGoodNetworkApp.svg?style=for-the-badge | ||
[issues-url]: https://github.com/OneCommunityGlobal/HighestGoodNetworkApp/issues | ||
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555 | ||
[linkedin-url]: https://www.linkedin.com/company/one-community-global/ | ||
[product-screenshot]: images/screenshot.png | ||
[react.js]: https://img.shields.io/badge/React-20232A?style=for-the-badge&logo=react&logoColor=61DAFB | ||
[react-url]: https://reactjs.org/ | ||
[MongoDB]: https://img.shields.io/badge/MongoDB-4EA94B?style=for-the-badge&logo=mongodb&logoColor=white | ||
[MongoDB-url]: https://www.mongodb.com/ | ||
[express.js]: https://img.shields.io/badge/Express.js-404D59?style=for-the-badge | ||
[express-url]: https://expressjs.com/ | ||
[node.js]: https://img.shields.io/badge/Node.js-43853D?style=for-the-badge&logo=node.js&logoColor=white | ||
[node-url]: https://nodejs.org/en |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import axios from 'axios'; | ||
import { ENDPOINTS } from '../utils/URL'; | ||
|
||
import * as types from './../constants/mouseoverTextConstants'; | ||
|
||
export const getMouseoverTextAction = payload => { | ||
return { | ||
type: types.GET_MOUSEOVER_TEXT, | ||
payload, | ||
}; | ||
}; | ||
|
||
export const getMouseoverText = () => async dispatch => { | ||
try { | ||
const { data } = await axios.get(ENDPOINTS.MOUSEOVERTEXT()); | ||
// console.log('Fetched mouseoverText data:', data); // Verify the fetched data | ||
return dispatch(getMouseoverTextAction(data)); | ||
} catch (error) { | ||
console.log('Error fetching mouseoverText:', error); | ||
} | ||
}; | ||
|
||
export const createMouseoverTextAction = payload => { | ||
return { | ||
type: types.CREATE_MOUSEOVER_TEXT, | ||
payload, | ||
}; | ||
}; | ||
|
||
export const createMouseoverText = mouseoverText => async dispatch => { | ||
await axios.post(ENDPOINTS.MOUSEOVERTEXT(), mouseoverText); | ||
return dispatch(createMouseoverTextAction(mouseoverText)); | ||
}; | ||
|
||
export const updateMouseoverTextAction = payload => { | ||
return { | ||
type: types.UPDATE_MOUSEOVER_TEXT, | ||
payload, | ||
}; | ||
}; | ||
|
||
export const updateMouseoverText = (mouseoverTextId, mouseoverText) => { | ||
return async dispatch => { | ||
await axios | ||
.put(ENDPOINTS.MOUSEOVERTEXT_BY_ID(mouseoverTextId), mouseoverText) | ||
.then(dispatch(updateMouseoverTextAction(mouseoverText))); | ||
}; | ||
}; |
Oops, something went wrong.