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

[WIP] feat: publishing of completed documents #11

Merged
merged 28 commits into from
Jul 6, 2020
Merged

Conversation

yehjxraymond
Copy link
Contributor

@yehjxraymond yehjxraymond commented Jun 12, 2020

Publishing of documents on the blockchain

Done

  • Network config
  • Multiple documents to form a single batch (if and only if they are verifiable documents on the same document store)
  • Grouping of transactions that can be batch together and creating a queue

Not Done

  • Progress bar to show the tasks that are completed and those that are not
  • Support for token registry
  • Creation of title escrow prior to token registry

Changes to core

@yehjxraymond yehjxraymond changed the title feat: multiform support in the background [WIP] feat: multiform support in the background Jun 12, 2020
@yehjxraymond yehjxraymond changed the title [WIP] feat: multiform support in the background [WIP] feat: publishing of completed documents Jun 23, 2020
@isaackps isaackps force-pushed the feat/publishDocument branch from 4baf4ad to 6c15aa0 Compare June 30, 2020 03:26
@yehjxraymond yehjxraymond force-pushed the feat/publishDocument branch from 3e0edea to 0692f02 Compare July 1, 2020 07:32
@yehjxraymond yehjxraymond force-pushed the feat/publishDocument branch from cf08adf to d01fccb Compare July 2, 2020 10:04

return (
<>
{show && (
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Don't have to pass a show props in if it's handled by the parent

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can remove the fragment while at it

Copy link
Contributor

Choose a reason for hiding this comment

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

ok

return (
<>
{show && (
<ModalDialog show={show} close={closeDeleteModal}>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can remove show props. See comments below on the ModalDialog.

Copy link
Contributor

@isaackps isaackps Jul 3, 2020

Choose a reason for hiding this comment

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

ok

Comment on lines +6 to +10
it("should not display anything on initial", () => {
render(<DeleteModal deleteForm={() => {}} show={false} closeDeleteModal={() => {}} />);

expect(screen.queryAllByText("Delete Form")).toHaveLength(0);
});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can remove when we remove show

Copy link
Contributor

@isaackps isaackps Jul 3, 2020

Choose a reason for hiding this comment

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

still needs it for the part to show the component or not.

}) => {
return (
<>
{show && (
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same thing, can remove show here as well. Managed by whoever calls the dialog

Copy link
Contributor

Choose a reason for hiding this comment

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

erm because we using the useLockBodyScroll, if the component is being rendered but not shown on screen, the body will be locked, so still need the show props in here, but can remove in the modalDialog.

onFormSubmit,
}) => {
return (
<>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can rm

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You also like to put fragments everywhere lol

Copy link
Contributor

Choose a reason for hiding this comment

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

hahah ok

return (hasError = true);
}
setFormError(ajv.errors);
return (hasError = false);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Consider a loop that runs twice.
The first run, return errors
The second run, returns no errors
Should the final hasError be true or false?
In this case it seeemed like if the last loop has no error, then it will return no error.

Copy link
Contributor

Choose a reason for hiding this comment

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

hmmm ok will edit it to cater to the error in any run of the loop

const validateCurrentForm = (): boolean => {
const ajv = new Ajv();
let hasError = false;
forms.forEach((form) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why not just run for the current form?

Copy link
Contributor

Choose a reason for hiding this comment

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

hmm ok will change to just the current form

Comment on lines 60 to 62
const onBackToFormSelection = (): void => {
removeCurrentForm();
};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

can remove, it does nothing more than just removeCurrentForm

Copy link
Contributor

Choose a reason for hiding this comment

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

ok

<SvgIconXCircle />
</SvgIcon>
<div className="text-red text-xl text-center">
This form has errors. Please fix the errors and submit again.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Don't you want to spell the errors out?

Copy link
Contributor

Choose a reason for hiding this comment

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

yup, will display a list of errors upon validation

Comment on lines 24 to 25
<>
{show && (
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can rm show

Copy link
Contributor

Choose a reason for hiding this comment

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

ok

Copy link
Contributor Author

@yehjxraymond yehjxraymond left a comment

Choose a reason for hiding this comment

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

LGTM

@isaackps isaackps merged commit 5985135 into master Jul 6, 2020
@isaackps isaackps deleted the feat/publishDocument branch July 6, 2020 02:49
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.

2 participants