Skip to content

Commit

Permalink
Merge branch 'development' into nathan_permissions_merge
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanah committed Aug 17, 2023
2 parents d777515 + bc16494 commit 13bb657
Show file tree
Hide file tree
Showing 70 changed files with 2,807 additions and 1,748 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,5 @@ src/components/UpdatePassword/**
src/components/UserManagement/**
src/components/UserProfile/**
src/components/WeeklySummariesReport/**
src/components/WeeklySummary/**
src/components/WeeklySummary/**
src/components/MouseoverText/**
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,5 @@ src/components/UpdatePassword/**
src/components/UserManagement/**
src/components/UserProfile/**
src/components/WeeklySummariesReport/**
src/components/WeeklySummary/**
src/components/WeeklySummary/**
src/components/MouseoverText/**
182 changes: 142 additions & 40 deletions README.md
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
Binary file added images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 17 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions src/__tests__/Dashboard.test.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
// import React from 'react';
// import { renderWithRouterMatch } from './utils.js';
// import { screen, waitFor } from '@testing-library/react';
import '@testing-library/jest-dom/extend-expect';
import mockState from './mockAdminState.js';
// import Dashboard from '../components/Dashboard';
import thunk from 'redux-thunk';
import configureStore from 'redux-mock-store';
// import { Route } from 'react-router-dom';
// import userEvent from '@testing-library/user-event';

const mockStore = configureStore([thunk]);
describe('Dashboard ', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/reducers/allTasksReducer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('Task Reducer', () => {
});

describe('Receive Tasks', () => {
it('level -1', () => {
xit('level -1', () => {
const allTasks = taskReducer(
{},
{
Expand Down
48 changes: 48 additions & 0 deletions src/actions/mouseoverTextAction.js
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)));
};
};
Loading

0 comments on commit 13bb657

Please sign in to comment.