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

MAUI-859: Enable Project Creation #4036

Merged
merged 20 commits into from
Sep 16, 2022
Merged

Conversation

chris-pollard
Copy link
Contributor

@chris-pollard chris-pollard commented Jul 21, 2022

Issue MAUI-859:

Changes:

  • Add config in Project Page resource component in admin-panel react app.
  • Add endpoint for getting existing entity data types.
  • Add endpoint for creating a project.
  • Add validation rules for new project record data.

Screenshots:

Screen Shot 2022-07-21 at 11 20 04 am

@chris-pollard
Copy link
Contributor Author

Have also realised that I should write up a unit test, which I have not done yet.

Copy link
Contributor

@IgorNadj IgorNadj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good so far, nice one, just a few qs around entity types and some suggestions

@chris-pollard chris-pollard requested a review from IgorNadj July 28, 2022 01:05
@chris-pollard
Copy link
Contributor Author

@IgorNadj this is ready to review again. Note that there is no specific rollback unit test.


async createProjectEntityRelations(models, code, countries) {
const { id: projectEntityId } = await models.entity.findOne({
'entity.code': code,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: you don't need to prefix things here, you can just do { code: code }, same with others below

});
}

async createProjectEntityRelations(models, code, countries) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest we rename code argument to projectCode? Took me a little bit of time to figure out what this was

const worldCode = 'World';
const { id: worldId } = await models.entity.findOne({ 'entity.code': worldCode });

await models.entity.create({
Copy link
Contributor

@IgorNadj IgorNadj Aug 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: .create() returns the record with an id, so you can return that instead of querying again to get it above on line 42. Same with the others

Copy link
Contributor

@IgorNadj IgorNadj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only minor comments left, nice one 🏌️

@chris-pollard
Copy link
Contributor Author

Thanks for the feedback @IgorNadj

@chris-pollard chris-pollard merged commit 4aacba3 into dev Sep 16, 2022
@chris-pollard chris-pollard deleted the maui-859-enable-project-creation branch September 16, 2022 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants