diff --git a/README.md b/README.md index a8cad30..9aa74eb 100644 --- a/README.md +++ b/README.md @@ -71,20 +71,20 @@ These are the basic steps to get up and running: #### 1. IPFS -Run a local IPFS deamon in offline mode. +Run a local IPFS deamon. * Make sure CORS headers are configured. See [IPFS](#ipfs) for more info. - * `ipfs daemon --offline` + * `ipfs daemon` #### 2. kredits-contracts -Get your local Ethereum development node running. (See [kredits-contracts README](https://github.com/67P/kredits-contracts) +Get your local Ethereum development node running. (See [kredits-contracts README](https://github.com/67P/kredits-contracts) for details. * Clone [kredits-contracts](https://github.com/67P/kredits-contracts) * `npm install` * `npm run devchain` - runs a local development chain - * `npm run bootstrap` - bootstrap runs deploys all the contracts + * `npm run bootstrap` - bootstrap runs deploys all the contracts * `npm link` - make the `kredits-contracts` module linkable as `kredits-contracts` on your machine (currently broken :( ) #### 3. kredits-web @@ -94,10 +94,15 @@ With IPFS and Ethereum/ganache running, you can now start this Ember app. * `npm link kredits-contracts` - link the local `kredits-contracts` package * `npm run start:local` - WEB3_PROVIDER_URL=http://localhost:7545 must be set for local settings -If you restart the devchain your network ID changes. So kredits-contracts does not find the correct DAO Kernel address. -If that is the case the DAO address must be provided as `KREDITS_KERNEL_ADDRESS` environment variable. +If you restart the devchain your network ID changes. So kredits-contracts does not find the correct DAO address. +If that is the case the DAO address must be provided as `KREDITS_DAO_ADDRESS` environment variable. - * `KREDITS_KERNEL_ADDRESS=<0xYOURADDRESS> npm run start:local` - find your address with the `npm run dao:address` command in the kredits-contracts repo. + * `npm run dao:address` in the kredits-contracts repo to find your address + * `KREDITS_DAO_ADDRESS=<0xYOURADDRESS> npm run start:local` + +#### 4. Metamask network + +Switch the network in Metamask to "Custom RPC" with the RPC URL `http://localhost:7545`. #### IPFS @@ -107,6 +112,7 @@ Install IPFS with your favorite package manager and run ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["localhost:4200"]' ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "GET", "POST"]' ipfs config --json API.HTTPHeaders.Access-Control-Allow-Credentials '["true"]' + ipfs config Addresses.Gateway /ip4/127.0.0.1/tcp/8080 ## Further Reading / Useful Links diff --git a/app/components/add-contribution/component.js b/app/components/add-contribution/component.js index 4b16e65..0c25c85 100644 --- a/app/components/add-contribution/component.js +++ b/app/components/add-contribution/component.js @@ -1,6 +1,7 @@ import Component from '@ember/component'; import { computed } from '@ember/object'; import { and, notEmpty } from '@ember/object/computed'; +import moment from 'moment'; export default Component.extend({ @@ -21,13 +22,13 @@ export default Component.extend({ init () { this._super(...arguments); - this.set('defaultDate', new Date()); + this.set('defaultDate', moment().startOf('hour').toDate()); // Default attributes used by reset this.set('attributes', { contributorId: null, kind: null, - date: [new Date()], + date: this.defaultDate, amount: null, description: null, url: null, @@ -49,8 +50,12 @@ export default Component.extend({ } const attributes = this.getProperties(Object.keys(this.attributes)); - const [ date/* , time */ ] = attributes.date[0].toISOString().split('T'); - attributes.date = date; + + let dateInput = (attributes.date instanceof Array) ? + attributes.date[0] : attributes.date; + + const [ date, time ] = dateInput.toISOString().split('T'); + [ attributes.date, attributes.time ] = [ date, time ]; this.set('inProgress', true); diff --git a/app/components/add-contribution/template.hbs b/app/components/add-contribution/template.hbs index 8126463..2d2751f 100644 --- a/app/components/add-contribution/template.hbs +++ b/app/components/add-contribution/template.hbs @@ -1,54 +1,68 @@