As announced in SF3, Utopian team will be releasing Utopian v2 on April 2019 just after the planned release of SMTs. This contribution is but a tiny drop in an ocean of contributions.
Repository
https://github.com/utopian-io/v2.utopian.io
Task Request
https://steemit.com/utopian-io/@gregory.latinier/utopian-v2-task-project-module
Pull Request
Add the Allow External Contributions toggle to the project form
Feature Image
Lessons Learned
There were a couple of issues I encountered when I started my development. First, as you may have guessed it, was setting up my development environment. I vented out this frustration to and he was gracious enough to listen and helped me resolve the issues. Eventually, some of the errors I encountered were caused by the values I set in my
.env.
The second was my unfamiliarity with screen layouts. I had three attempts related to this with the last one eventually being accepted.
My first attempt was a combination of a q-field and a q-toggle under it. This worked but Gregory suggested to move the label to the right of the toggle instead of above it. I did this but I didn't like the excess space it created so I went with a q-list which was my second attempt. Gregory didn't like how the q-list looked so we ended up using q-toggle's label property.
I guess what I want to emphasize here is - UI is something that changes often that it's often beautified later. That's the direction Gregory wants and is something I agree to as well.
Technical Explanation of the Contribution
And now the boring stuff...
https://github.com/utopian-io/v2.utopian.io/pull/156/files
These were the main files updated for this contribution.
1) Client Module
/packages/client/src/pages/projects/create-edit/create-edit.vue- the project form; added the
allowExternalsfield, some styling, and some code clean-up for errors spat out by greenkeeper
- the project form; added the
2) API Module
/packages/api/modules/projects/handlers.js- added
allowExternalsto mongooseselectfor it to be included in the response payload
- added
/packages/api/modules/projects/project.model.js- added the
allowExternalsfield to the project model
- added the
/packages/api/modules/projects/validate.js- added validation to require callers to include
allowExternalswhen submitting new projects (createProject) or updating (updateProject) them
- added validation to require callers to include
2.1) Unit Tests
/packages/api/test/fixtures/projects.js/packages/api/test/modules/projects/projects.handlers.spec.js- added two test cases to check for projects that had this flag set to
true(accepts external contributions) orfalse
- added two test cases to check for projects that had this flag set to
3) i18n Module
/packages/i18n/locales_master/de.json/packages/i18n/locales_master/en.json- added the
allowExternals.labelstring
- added the
GitHub Account
This post was made from https://ulogs.org