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

Help wanted to allow ballot-ui make use of participate.js #250

Merged
merged 6 commits into from
Jul 26, 2021

Conversation

David405
Copy link
Collaborator

No description provided.

@@ -0,0 +1,11 @@

import { getEthProvider } from 'rchain-api';
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems tricky... browsers don't grok bare-names like 'rchain-api'. Did you see errors in your browser console?

Or did you run this thru webpack somehow? How did you run this code?

Copy link
Collaborator Author

@David405 David405 Jul 16, 2021

Choose a reason for hiding this comment

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

Yea, it couldn't find 'rchain-api' so I commented it out but it also couldn't find ./participate.js. I added ballot.html as an HTMLplugin in webpack

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm confused... Are you saying you ran it with webpack or without? Or both?

If you saw browser console errors, what were they, exactly?

If you used webpack, exactly how did you start the code running? What characters did you type, exactly?

Copy link
Collaborator Author

@David405 David405 Jul 16, 2021

Choose a reason for hiding this comment

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

As regarding webpack, I added ballot.html as an HTMLplugin. I ran the code using the normal npm run start

The error in the browser console is "cannot find http://localhost:8080/participate", I can't figure why it is looking for participate.js as a route rather than a js file

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, now you have given me enough info that I could test it on my end.

I just haven't managed to find time.

And it's not clear when I will. Such is life :-/

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

How about over the weekend? Can you kindly make out time so we could go over this?

@dckc
Copy link
Contributor

dckc commented Jul 24, 2021 via email

@David405
Copy link
Collaborator Author

David405 commented Jul 24, 2021

The main problem I am facing is that I don't understand how participate.js interact with participate.html, I mean, when you do mount('#xxxx', xxxx) inside participate.js, how does participate.js know it has to search participate.html for #xxxxx?

If you can get me up to speed by explaining this, I think I can figure out a solution from there.

@David405
Copy link
Collaborator Author

David405 commented Jul 24, 2021

@dckc I was able to figure out a fix, Idk if it's the best way to approach this but it works correctly and isn't causing any obvious problems.

What I did was, since I don't know how to make another HTML file use participate.js, I divided participate.html into two main divs (one div controls the developer interface, the other controls the voting interface) and created a navbar, the navbar buttons control which area of the DOM is shown or hidden, this way, I can use participate.html to render the voting interface.

@David405 David405 mentioned this pull request Jul 26, 2021
}

{"localhostNETWORK": { "MasterURI":
"`rho:id:nqdwznnpibxq1e3uaqdf473bfspsq7tueo5j34ncmb4g57o8z34ym4`"
Copy link
Contributor

Choose a reason for hiding this comment

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

src/MasterURI.localhost.json should not be committed

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have fixed that, thanks for the catch.

@jimscarver jimscarver merged commit 01dd879 into master Jul 26, 2021
@jimscarver jimscarver deleted the voting-interface branch July 26, 2021 19:26
@jimscarver jimscarver restored the voting-interface branch July 26, 2021 20:19
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.

None yet

3 participants