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

Milestone Screen - Complete Management #68

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
641c7df
Milestones Page - UI/Fetching data
SiddharthBhansali13 Jan 27, 2022
32bf1b8
ReadMe Changes to include updated installation instructions.
SiddharthBhansali13 Jan 27, 2022
d750aa9
Milestone UI & Fetch Rework.
SiddharthBhansali13 Jan 28, 2022
0e65883
Milestone - Formatting Data on Submit.
SiddharthBhansali13 Jan 31, 2022
b493d9f
Milestone - Saga Connection - Fetch Repositories & Milestones.
SiddharthBhansali13 Feb 1, 2022
f631e45
Milestone - Saga Connection - Add & Delete Milestones.
SiddharthBhansali13 Feb 1, 2022
763d136
Milestone - Saga Connection - Edit Milestone.
SiddharthBhansali13 Feb 2, 2022
30ee9fc
Milestone - Actions Test.
SiddharthBhansali13 Feb 2, 2022
f10ee86
Milestone - Reducer Test.
SiddharthBhansali13 Feb 2, 2022
d32d3ba
Merge branch 'master' of https://github.com/buildly-release-managemen…
SiddharthBhansali13 Feb 2, 2022
3eccc48
Milestone - Adding comments.
SiddharthBhansali13 Feb 2, 2022
54dcf60
Milestone - Fixing Problems.
SiddharthBhansali13 Feb 3, 2022
556fe8c
Milestone - Adding GitHub Owner To env.
SiddharthBhansali13 Feb 10, 2022
6193c35
Adding 'Select All' & Milestone Title Edit.
SiddharthBhansali13 Feb 14, 2022
52a44d6
Resolved conflicts with master
Feb 15, 2022
c471730
Resolved conflicts
Feb 15, 2022
9bfc87e
Resolved conflicts
Feb 15, 2022
967d813
Fixing Bug With Filtering Of Data After Edit/Delete.
SiddharthBhansali13 Mar 1, 2022
a19c221
Adding Checkbox To Select Menus.
SiddharthBhansali13 Mar 22, 2022
b91304c
Fixing Checkbox Issue On Individual Selects.
SiddharthBhansali13 Mar 23, 2022
216c13d
Closing Milestones In Bulk.
SiddharthBhansali13 Mar 23, 2022
b58feb0
Changing Owner On UI.
SiddharthBhansali13 Mar 23, 2022
a18c1a1
Refreshing Milestones on Creation & Removing Select After Closing.
SiddharthBhansali13 Apr 1, 2022
ed2a2d1
Fixing Overflow Issue.
SiddharthBhansali13 Apr 1, 2022
664505c
Fixing Overflow Issue.
SiddharthBhansali13 Apr 1, 2022
8087da9
resolve conflicts default to master
Sep 30, 2022
b372f1c
fix more merge conflicts
Sep 30, 2022
3277e21
fix more merge conflicts
Sep 30, 2022
3dc4838
fix more merge conflicts
Sep 30, 2022
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
41 changes: 24 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Buildly React Template

[![Build Status](https://travis-ci.org/buildlyio/buildly-react-template.svg?branch=master)](https://travis-ci.org/buildlyio/buildly-react-template) [![Documentation Status](https://readthedocs.org/projects/buildly-react-template/badge/?version=latest)](https://buildly-react-template.readthedocs.io/en/latest/?badge=latest) [![Gitter](https://badges.gitter.im/Buildlyio/community.svg)](https://gitter.im/Buildlyio/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

Buildly React Template is a [React](https://reactjs.org/) web application that implements the core features of the UI core, pre-configure to connect to [Buildly Core](https://github.com/buildlyio/buildly-core).
Expand All @@ -11,30 +12,36 @@ These instructions will get you a copy of the project up and running on your loc

The web application was tested and built with the following versions:

- node v16.13.0
- yarn v1.17.3
- node v16.13.0
- yarn v1.17.3

### Installing

First of all, you need to have a Buildly Core instance up and running locally.
Further detail about how to deploy Buildly Core locally, check its [documentation](https://buildly-core.readthedocs.io/en/latest/).

To install the application you need to download and install its dependencies, so you have to navigate to the project folder and run the following command:
Create a `.env.development.local` file in the root, and add the following lines with working credentials:

```
$ yarn install
```
window.env = {
API_URL: "https://rm-dev-api.buildly.io/",
OAUTH_CLIENT_ID: "xxxxx",
OAUTH_TOKEN_URL: "https://rm-dev-api.buildly.io/oauth/token/",
GITHUB_CLIENT_ID: "xxxxx",
TRELLO_API_KEY: "xxxxx",
FEEDBACK_SHEET: "https://sheet.best/api/sheets/xxxxx",
production: false
};

Now, initialize and build the project
To install the application you need to download and install its dependencies, so you have to navigate to the project folder and run the following command:

```
$ yarn run build
$ yarn install
```

To run the web app:

```
$ yarn run start
$ yarn start:local
```

Your Buildly React Template will be running locally and listening to the port 3000, so you can access it via your browser typing this address: 127.0.0.1:3000
Expand Down Expand Up @@ -64,14 +71,14 @@ Now, you just need to build a Docker image and host it somewhere. Further info a

### Configuration

The following table lists the configurable parameters of Buildly React Template and their default values. They can be updated in the
The following table lists the configurable parameters of Buildly React Template and their default values. They can be updated in the
Docker container via flags as below or configured as environment variables in Travis.

| Parameter | Description | Default |
|-------------------------------------|------------------------------------|-------------------------------------------|
| `API_URL` | Buildly Core URL | `` |
| `OAUTH_CLIENT_ID` | The client identifier issued to the client during Buildly Core deployment | `` |
| `OAUTH_TOKEN_URL` | Buildly Core URL used to authenticate users | `` |
| Parameter | Description | Default |
| ----------------- | ------------------------------------------------------------------------- | ------- |
| `API_URL` | Buildly Core URL | `` |
| `OAUTH_CLIENT_ID` | The client identifier issued to the client during Buildly Core deployment | `` |
| `OAUTH_TOKEN_URL` | Buildly Core URL used to authenticate users | `` |

Specify each parameter using `-e`, `--env`, and `--env-file` flags to set simple (non-array) environment variables to `docker run`. For example,

Expand All @@ -83,7 +90,7 @@ $ docker run -e MYVAR1 --env MYVAR2=foo \

## Built With

* [Travis CI](https://travis-ci.org/) - Recommended CI/CD
- [Travis CI](https://travis-ci.org/) - Recommended CI/CD

## Contributing

Expand All @@ -95,7 +102,7 @@ We use [SemVer](http://semver.org/) for versioning. For the versions available,

## Authors

* **Buildly** - *Initial work*
- **Buildly** - _Initial work_

See also the list of [contributors](https://github.com/buildlyio/buildly-react-template/graphs/contributors) who participated in this project.

Expand Down
30 changes: 26 additions & 4 deletions src/components/DataTableWrapper/DataTableWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
Add as AddIcon,
Edit as EditIcon,
Delete as DeleteIcon,
Close as CloseIcon,
} from '@mui/icons-material';
import Loader from '@components/Loader/Loader';
import ConfirmModal from '@components/Modal/ConfirmModal';
Expand Down Expand Up @@ -52,6 +53,8 @@ const DataTableWrapper = ({
filename,
addButtonHeading,
onAddButtonClick,
additionalButtonHeading,
onAdditionalButtonClick,
children,
editAction,
deleteAction,
Expand All @@ -62,12 +65,14 @@ const DataTableWrapper = ({
tableHeight,
tableHeader,
hideAddButton,
hideAdditionalButton,
selectable,
selected,
customSort,
noCustomTheme,
noSpace,
noOptionsIcon,
onRowSelectChange
}) => {
const classes = useStyles();

Expand Down Expand Up @@ -130,6 +135,9 @@ const DataTableWrapper = ({
selectableRows: selectable && selectable.rows
? selectable.rows
: 'none',
onRowSelectionChange: (currentRowsExpanded, allRowsExpanded, rowsExpanded) => {
onRowSelectChange(rowsExpanded);
},
selectToolbarPlacement: 'none',
selectableRowsHeader: selectable && selectable.rowsHeader
? selectable.rowsHeader
Expand Down Expand Up @@ -163,19 +171,33 @@ const DataTableWrapper = ({
<Box mt={noSpace ? 0 : 5} mb={noSpace ? 0 : 5}>
{loading && <Loader open={loading} />}
<div>
{!hideAddButton && (
<Box mb={3} mt={2}>
<Box mb={3} mt={2}>
{!hideAddButton && (
<Button
type="button"
variant="contained"
color="primary"
onClick={onAddButtonClick}
sx={{
marginRight: '16px',
}}
>
<AddIcon />
{` ${addButtonHeading}`}
</Button>
</Box>
)}
)}
{!hideAdditionalButton && (
<Button
type="button"
variant="outlined"
color="error"
onClick={onAdditionalButtonClick}
>
<CloseIcon />
{` ${additionalButtonHeading}`}
</Button>
)}
</Box>
{tableHeader && (
<Typography
className={classes.dashboardHeading}
Expand Down
1 change: 0 additions & 1 deletion src/hooks/useInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export const useInput = (initialValue = '', validators = {}) => {
},
clear: () => setValue(''),
reset: () => setValue(initialValue),
setNewValue: (newValue) => setValue(newValue),
hasChanged: () => {
let newValue = value;
if (typeof (initialValue) === 'number') {
Expand Down
2 changes: 2 additions & 0 deletions src/layout/Container/Container.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { routes } from '@routes/routesConstants';
import NewProduct from '@pages/NewProduct/NewProduct';
import Release from '@pages/Release/Release';
import ViewRelease from '@pages/Release/components/ViewRelease';
import Milestone from '@pages/Milestone/Milestone';
import DeveloperForm from '@pages/DeveloperForm/DeveloperForm';

const useStyles = makeStyles((theme) => ({
Expand Down Expand Up @@ -65,6 +66,7 @@ const ContainerDashboard = ({ location, history }) => {
<Route path={routes.DEVELOPER_FORM} component={DeveloperForm} />
<Route exact path={`${routes.RELEASE}/view/:releaseID`} component={ViewRelease} />
<Route path={routes.RELEASE} component={Release} />
<Route path={routes.MILESTONE} component={Milestone} />
</Switch>
</Container>
</UserContext.Provider>
Expand Down
10 changes: 10 additions & 0 deletions src/layout/NavBar/NavBarConstants.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,19 @@ export const NAVIGATION_ITEMS = [
name: 'Dashboard',
link: routes.DASHBOARD,
},
{
id: 'products',
name: 'Products',
link: routes.NEW_PRODUCT,
},
{
id: 'releases',
name: 'Releases',
link: routes.RELEASE,
},
{
id: 'milestones',
name: 'Milestones',
link: routes.MILESTONE,
},
];
13 changes: 9 additions & 4 deletions src/modules/http/http.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ export const httpService = {
* @param {boolean} useJwt - boolean to check if we want to use JWT or not
* @param {string} contentType - type of content to be requested
* @param {string} responseType - the expected response type from the server
* @param customHeaders - custom headers to be sent with the request
* @returns {Observable} - response of the request or error
*/
function makeRequest(method, url, body, useJwt, contentType, responseType) {
function makeRequest(method, url, body, useJwt, contentType, responseType, customHeaders) {
let token;
let tokenType;
if (useJwt) {
Expand All @@ -25,13 +26,17 @@ function makeRequest(method, url, body, useJwt, contentType, responseType) {
tokenType = 'Bearer';
token = oauthService.getAccessToken();
}
const headers = {
let headers;

headers = {
Authorization: `${tokenType} ${token}`,
// 'Content-Type': contentType || 'application/json', // Commenting to make it work for GCP
};
if (method === 'POST' || method === 'post') {
headers['Content-Type'] = 'application/json';

if (customHeaders) {
headers = customHeaders;
}

const options = {
method,
data: body,
Expand Down
25 changes: 14 additions & 11 deletions src/pages/Dashboard/components/UserDashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ import {
getAllFeatures,
getAllIssues,
getAllStatuses,
deleteFeature,
deleteIssue,
} from '@redux/decision/actions/decision.actions';
import List from '../components/List';
import Kanban from '../components/Kanban';
import AddFeatures from '../forms/AddFeatures';
import AddIssues from '../forms/AddIssues';
import FeatureToIssue from '../forms/FeatureToIssue';
import ConfirmModal from '@components/Modal/ConfirmModal';

const useStyles = makeStyles((theme) => ({
Expand Down Expand Up @@ -159,16 +158,18 @@ const UserDashboard = (props) => {
const editItem = (item, type) => {
let path;
if (type === 'feat') {
path = `${editFeatPath}/:${item.feature_uuid}`;
path = `${editFeatPath}/:${item.id}`;
} else if (type === 'issue') {
path = `${editIssuePath}/:${item.issue_uuid}`;
path = `${editIssuePath}/:${item.id}`;
} else if (type === 'convert') {
path = `${featureToIssuePath}/:${item.id}`;
}

history.push(path, {
type: 'edit',
from: redirectTo || location.pathname,
data: item,
product_uuid: product,
productID: product,
});
};

Expand All @@ -178,11 +179,13 @@ const UserDashboard = (props) => {
path = addFeatPath;
} else if (type === 'issue') {
path = addIssuePath;
} else if (type === 'convert') {
path = featureToIssuePath;
}

history.push(path, {
from: redirectTo || location.pathname,
product_uuid: product,
productID: product,
});
};

Expand All @@ -193,9 +196,9 @@ const UserDashboard = (props) => {
}

history.push(path, {
type: 'convert',
type: 'edit',
from: redirectTo || location.pathname,
product_uuid: product,
productID: product,
data: item,
});
};
Expand All @@ -213,9 +216,9 @@ const UserDashboard = (props) => {
const { id, type } = toDeleteItem;
setDeleteModal(false);
if (type === 'feat') {
dispatch(deleteFeature(id));
console.log('Dispatch delete feature action here');
} else if (type === 'issue') {
dispatch(deleteIssue(id));
console.log('Dispatch delete issue action here');
}
};

Expand Down Expand Up @@ -319,7 +322,7 @@ const UserDashboard = (props) => {
<Route path={editFeatPath} component={AddFeatures} />
<Route path={addIssuePath} component={AddIssues} />
<Route path={editIssuePath} component={AddIssues} />
<Route path={featureToIssuePath} component={AddIssues} />
<Route path={featureToIssuePath} component={FeatureToIssue} />
</div>
);
};
Expand Down
Loading