Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

Generate Errors as Objects #86

Closed
jolanglinais opened this issue Sep 9, 2019 · 6 comments
Closed

Generate Errors as Objects #86

jolanglinais opened this issue Sep 9, 2019 · 6 comments
Assignees
Labels
Difficulty: Challenging Hacktoberfest by DigitalOcean and DEV Type: Enhancement ✨ Improvement to process or efficiency

Comments

@jolanglinais
Copy link
Member

jolanglinais commented Sep 9, 2019

Is your feature request related to a problem? Please describe.
Revisit contractReducer logic and how we generate errors. Right now, the errors get added to an array every time a clause is parsed. This means if multiple changes cause a clause to be parsed multiple times, the same error will be added to the array multiple times and we end up with multiple of the same error.

Describe the solution you'd like
It makes more sense to use an object instead of an array, where the clauseId are keys and we update the error by clauseId, so we only ever have one error per clause.

Describe alternatives you've considered
Any alternatives are welcome.

Additional context
Related issue in Cicero UI

@jolanglinais jolanglinais added Good First Issue :octocat: Good for newcomers Difficulty: Starter Type: Enhancement ✨ Improvement to process or efficiency labels Sep 9, 2019
@jolanglinais jolanglinais added this to the Replace Template Studio milestone Sep 9, 2019
@jolanglinais jolanglinais added the Hacktoberfest by DigitalOcean and DEV label Sep 14, 2019
@christyjacob4
Copy link

Can I work on this @irmerk

@christyjacob4
Copy link

Hey @irmerk are the changes you requested to be in
src/reducers/contractReducer.js

@Ph0tonic
Copy link
Contributor

Ph0tonic commented Oct 9, 2019

Hello,

I had a look at the code:

But it seems to me that clauses are already stored inside an object. What else has to be done ?
Thanks

@jolanglinais
Copy link
Member Author

@Ph0tonic yes the clauses are in an object, but the way in which we shape the errors to pass down to cicero-ui to be displayed in the ErrorLogger is here: https://github.com/accordproject/template-studio-v2/blob/master/src/containers/Error/errorReducer.js

@Ph0tonic
Copy link
Contributor

Ph0tonic commented Oct 9, 2019

Thanks @irmerk, so the errorReducer should return an object instead of an Array.
Can I work on this ?

@jolanglinais
Copy link
Member Author

This specific issue is closed, but testing continues in Cicero UI #167

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Difficulty: Challenging Hacktoberfest by DigitalOcean and DEV Type: Enhancement ✨ Improvement to process or efficiency
Projects
None yet
Development

No branches or pull requests

3 participants