-
Notifications
You must be signed in to change notification settings - Fork 22
Conversation
|
Did Travis fail because it's using old flags ie. no-nat-pnp? |
|
@science-girl quite possibly. I will get reviewing this now |
Connoropolous
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall sweetness. The pattern used with this.props.children on the modal is especially good because it sets up something that's easily extendable.
A couple of overall suggestions:
- Best practice would be to make sure that the UI handles more errors as well, and displays error messages.
- When submitting pull requests, its useful to separate stylistic pull requests, (all the linting you did, which is great!) from functionality pull requests, so that code reviewers can focus on function, and the real changed files.
- In the case of the 'profile photo' addition, it's also good to submit code in pull requests as more complete features. Introducing partial code for features gets unwieldy fast. Easy to lose track of what's actually working from what's not yet working.
dna/clutter/clutter.js
Outdated
| if (name == "App_DNA_Hash") {return App.DNA.Hash;} | ||
| return "Error: No App Property with name: " + name; | ||
| } catch (exception) { | ||
| debug(exception); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Best practice would be to return an error if an error occurs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| } catch (exception) { | ||
| debug(exception); | ||
| } | ||
| return data; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the function comments, it says it will return the hash, but it returns the raw input instead. Best to reconcile them, one way or another.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
dna/clutter/clutter.js
Outdated
| * @param none | ||
| * @return firstName associated with this user | ||
| **/ | ||
| function getFirstName(then) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused param in the input here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
ui-src/src/EditProfile.js
Outdated
| e.preventDefault(); | ||
|
|
||
| if (!newNameText) return; | ||
| setFirstName(newNameText); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once the action/request completes, the user expects some feedback.
This could be done with some kind of transient user feedback message like 'Name was saved' that comes into the page, then out. Could also be done with a redirect away from the profile page.
I will review how to go about treating an action as a Promise so that you can perform some code once the action completes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done - goes back to meow container. also added first name set to handle as a default.
ui-src/src/EditProfile.js
Outdated
| } | ||
| componentDidMount() { | ||
| const { firstName } = this.props; | ||
| this.setState({ newNameText: firstName }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice pattern to use
| <div className="panel panel-default"> | ||
| <div className="panel-body"> | ||
| <div style={{ paddingLeft: 30, paddingBottom: 10 }}> | ||
| <p |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another way to toggle visibility of elements based on boolean, as an option
{this.state.newHandleText.length === 0 && this.props.handleTaken === false && <p>...</p>}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaving it as is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
ui-src/src/actions/index.js
Outdated
| export const GET_AGENT = "getAgent"; | ||
| export const NEW_HANDLE = "newHandle"; | ||
| export const UNFOLLOW = "unfollow"; | ||
| export const TOGGLE_MODAL = "toggleModal"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TOGGLE_MODAL could be separated out from the "Holochain actions", since it's a UI only action, and has no backend implications. Just by putting it above the "Holochain actions" comment above, and giving it a "UI actions" comment or something
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
ui-src/src/components/Modal.js
Outdated
| render() { | ||
| // Render nothing if the "show" prop is false | ||
| if (!this.props.show) { | ||
| console.log(this.props); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to remove debugging console.log statements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
ui-src/src/reducers/index.js
Outdated
| appProperties: {}, | ||
| // posts with 'stamp' as their key | ||
| posts: {}, | ||
| isOpen: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using a slightly more descriptive var name is a bit better. What isOpen? modalIsOpen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
Got the command line flags passing... |
|
@science-girl have you used docker? If so, I can clarify how to use docker to run the ui-automation tests. Or even if you haven't used it, but are interested I can show you. It is pretty neat (and useful) to see the Cypress tests that Philip wrote running (because you can actually visually see it testing the app). |
|
I have not used docker and am interested! |
dna/dna.json
Outdated
| }, | ||
| "BasedOn": { | ||
| "H": null | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the latest head in https://github.com/holochain/holochain-proto develop branch, this
"BasedOn": { "H": null }
makes it fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you be able to provide more background on this? I don't know what purpose "BasedOn" serves, which I think would help with fixing it.
lucksus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work in general! :)
I've tried setting the name in your new EditProfile component. The name gets stored in the front-ends state but does not seem to be written to holochain - at least it is gone when I reload the page.
ui-src/src/App.js
Outdated
| componentWillUnmount () { | ||
| if (this.interval) clearInterval(this.interval) | ||
| componentWillUnmount() { | ||
| if (this.interval) clearInterval(this.interval); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if you set a styleguide that requires semicolons, but JS does not (any more).
(And I personally would prefer not having them but ok :D)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer semi-colons, but I can omit them for consistency. Is there a style guide I should follow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you're right about the refresh - it's set, but I need to call getFirstName to ensure I retrieve the firstName from the chain rather than just from the redux store. I'll look into that.
|
Based on is a tag that we added to allow you to indicate which DNA this DNA
came from. The format of the storing of hashes changed from an object to a
string, so you can fix this by simply removing the whole based on key when
null, it's not necessary.
…On Fri, May 18, 2018, 12:34 AM Lindsey Woo ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In dna/dna.json
<#76 (comment)>:
> + "Version": 0,
+ "UUID": "00000000-0000-0000-0000-000000000000",
+ "Name": "clutter",
+ "RequiresVersion": 21,
+ "Properties": {
+ "description": "distributed micro-blogging (Twitter clone)",
+ "language": "en",
+ "enableDirectoryAccess": "true"
+ },
+ "PropertiesSchemaFile": "properties_schema.json",
+ "DHTConfig": {
+ "HashType": "sha2-256"
+ },
+ "BasedOn": {
+ "H": null
+ },
Can you provide more background on this? I don't know what purpose
"BasedOn" serves and how I can fix this.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#76 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAAN60BaqU_ehvqxplDg8b89Wvm1agFMks5tzk9PgaJpZM4UAdPi>
.
|
|
Awesome! Thanks. |
|
@science-girl maybe leave the 'profile photo' field in the code, but comment it out so its not in the UI yet while its an incomplete feature? |
|
@philipbeadle is much stronger with docker than me but to run the cypress tests in a docker way |
|
@science-girl first name thing wasn't working because you were using the It's necessary to use the conditional like this, otherwise you end up in infinitely recurring loops caused by updating the component, and then updating the component when the component updates. Gotta be real careful with these ones. |
|
@science-girl and the pre-requisite that I forgot to mention for using docker is of course installing it :p that's pretty straightforward |
|
Thanks @Connoropolous! I rarely use componentDidUpdate - is this preferred to async/awaiting? |
|
Not better or worse, just different. I think I may still have a small issue with my async (then) pattern with hc-redux-middleware so that's why I went this way. |
…e firstName is replacement
|
@Connoropolous I ran the docker tests. 2 tests fail - there's a test for changing the handle, which no longer applies. I'll connect with @philipbeadle about fixing this. |
|
Ok, now the name gets persisted across reloads :) But, I saw something else: on first use (first time loading the UI) I saw form widgets for adding a user image. After reload those elements were gone. |
lucksus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge at will :)
Added pop up modal box when user first starts clutter.

Added profile page where users can edit their first name.