In this PR, the frontend was implemented for adminCreateCommonsPage.js. The default values were extracted from the backend in the previous PR, and was fetched in CommonsForm.js. The default values for the create commons page should now be extracted from the backend through an API call. If the API call returns nothing, then just resort to hard-coded default values. README.md is also changed with a link to a description of the environment variables
Before (capacity per person has no hard-coded value, but the rest of the fields are hard-coded)
After (capacity per person has a default value fetched from the api along with the other fields other than the two date fields)
Validation
Download this branch.
Run the project.
Go to this page.
Test this function.
Tests
[x] Backend Unit tests (mvn test) pass
[x] Backend Test coverage (mvn test jacoco:report) 100%
[x] Backend Mutation tests (mvn test pitest:mutationCoverage) 100%
[x] Frontend Unit tests (npm test) pass
[x] Frontend Test coverage (npm run coverage) 100%
Overview
In this PR, the frontend was implemented for adminCreateCommonsPage.js. The default values were extracted from the backend in the previous PR, and was fetched in CommonsForm.js. The default values for the create commons page should now be extracted from the backend through an API call. If the API call returns nothing, then just resort to hard-coded default values. README.md is also changed with a link to a description of the environment variables
Before (capacity per person has no hard-coded value, but the rest of the fields are hard-coded)
After (capacity per person has a default value fetched from the api along with the other fields other than the two date fields)
Validation
Tests
mvn test
) passmvn test jacoco:report
) 100%mvn test pitest:mutationCoverage
) 100%npm test
) passnpm run coverage
) 100%npx stryker run
) 100%npx eslint --fix src
)Linked Issues
Closes #1