mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 09:23:13 +01:00
Merge branch 'master' into AD-1315-implement-submission-flow
This commit is contained in:
commit
8188e5ca2f
18
README.md
18
README.md
@ -43,7 +43,25 @@ For this project, we're using:
|
||||
* We don't use ES6's class declaration for React components because it does not support Mixins as well as Autobinding ([Blog post about it](http://facebook.github.io/react/blog/2015/01/27/react-v0.13.0-beta-1.html#autobinding))
|
||||
* We don't use camel case for file naming but in everything Javascript related
|
||||
* We use `let` instead of `var`: [SA Post](http://stackoverflow.com/questions/762011/javascript-let-keyword-vs-var-keyword)
|
||||
* We don't use Javascript's `Date` object, as its interface introduced bugs previously and we're including `momentjs` for other dependencies anyways
|
||||
|
||||
Branch names
|
||||
=====================
|
||||
Since we moved to Github, we cannot create branch names automatically with JIRA anymore.
|
||||
To not lose context, but still be able to switch branches quickly using a ticket's number, we're recommending the following rules when naming our branches in onion.
|
||||
|
||||
```
|
||||
AD-<JIRA-ticket-id>-brief-and-sane-description-of-the-ticket
|
||||
```
|
||||
|
||||
where `brief-and-sane-description-of-the-ticket` does not need to equal to the ticket's title.
|
||||
This allows JIRA to still track branches and pull-requests while allowing us to keep our peace of mind.
|
||||
|
||||
Example
|
||||
-------------
|
||||
**JIRA ticket name:** `AD-1242 - Frontend caching for simple endpoints to measure perceived page load <more useless information>`
|
||||
|
||||
**Github branch name:** `AD-1242-caching-solution-for-stores`
|
||||
|
||||
SCSS Code Conventions
|
||||
=====================
|
||||
|
@ -1,6 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
import React from 'react';
|
||||
import Moment from 'moment';
|
||||
|
||||
import Glyphicon from 'react-bootstrap/lib/Glyphicon';
|
||||
import OverlayTrigger from 'react-bootstrap/lib/OverlayTrigger';
|
||||
@ -129,7 +130,7 @@ let AccordionListItemWallet = React.createClass({
|
||||
piece={this.props.content}
|
||||
subsubheading={
|
||||
<div className="pull-left">
|
||||
<span>{new Date(this.props.content.date_created).getFullYear()}</span>
|
||||
<span>{Moment(this.props.content.date_created, 'YYYY-MM-DD').year()}</span>
|
||||
{this.getLicences()}
|
||||
</div>}
|
||||
buttons={
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
import React from 'react';
|
||||
import { Link, History } from 'react-router';
|
||||
import Moment from 'moment';
|
||||
|
||||
import Row from 'react-bootstrap/lib/Row';
|
||||
import Col from 'react-bootstrap/lib/Col';
|
||||
@ -85,7 +86,7 @@ let Edition = React.createClass({
|
||||
<hr style={{marginTop: 0}}/>
|
||||
<h1 className="ascribe-detail-title">{this.props.edition.title}</h1>
|
||||
<EditionDetailProperty label="BY" value={this.props.edition.artist_name} />
|
||||
<EditionDetailProperty label="DATE" value={ new Date(this.props.edition.date_created).getFullYear() } />
|
||||
<EditionDetailProperty label="DATE" value={Moment(this.props.edition.date_created, 'YYYY-MM-DD').year()} />
|
||||
<hr/>
|
||||
</div>
|
||||
<EditionSummary
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
import React from 'react';
|
||||
import { History } from 'react-router';
|
||||
import Moment from 'moment';
|
||||
|
||||
import PieceActions from '../../actions/piece_actions';
|
||||
import PieceStore from '../../stores/piece_store';
|
||||
@ -236,7 +237,7 @@ let PieceContainer = React.createClass({
|
||||
<hr style={{marginTop: 0}}/>
|
||||
<h1 className="ascribe-detail-title">{this.state.piece.title}</h1>
|
||||
<DetailProperty label="BY" value={this.state.piece.artist_name} />
|
||||
<DetailProperty label="DATE" value={ new Date(this.state.piece.date_created).getFullYear() } />
|
||||
<DetailProperty label="DATE" value={Moment(this.state.piece.date_created, 'YYYY-MM-DD').year() } />
|
||||
{this.state.piece.num_editions > 0 ? <DetailProperty label="EDITIONS" value={ this.state.piece.num_editions } /> : null}
|
||||
<hr/>
|
||||
</div>
|
||||
|
File diff suppressed because one or more lines are too long
@ -3,6 +3,7 @@
|
||||
import React from 'react';
|
||||
import { Link } from 'react-router';
|
||||
import StarRating from 'react-star-rating';
|
||||
import Moment from 'moment';
|
||||
|
||||
import PieceListActions from '../../../../../../actions/piece_list_actions';
|
||||
import PieceListStore from '../../../../../../stores/piece_list_store';
|
||||
@ -182,7 +183,7 @@ let AccordionListItemPrize = React.createClass({
|
||||
artistName={artistName}
|
||||
subsubheading={
|
||||
<div>
|
||||
<span>{new Date(this.props.content.date_created).getFullYear()}</span>
|
||||
<span>{Moment(this.props.content.date_created, 'YYYY-MM-DD').year()}</span>
|
||||
</div>}
|
||||
buttons={this.getPrizeButtons()}
|
||||
badge={this.getPrizeBadge()}>
|
||||
|
@ -150,7 +150,7 @@ let PieceContainer = React.createClass({
|
||||
|
||||
<h1 className="ascribe-detail-title">{this.state.piece.title}</h1>
|
||||
<DetailProperty label={getLangText('BY')} value={artistName} />
|
||||
<DetailProperty label={getLangText('DATE')} value={new Date(this.state.piece.date_created).getFullYear()} />
|
||||
<DetailProperty label={getLangText('DATE')} value={Moment(this.state.piece.date_created, 'YYYY-MM-DD').year()} />
|
||||
{artistEmail}
|
||||
{this.getActions()}
|
||||
<hr/>
|
||||
|
@ -1,6 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
import React from 'react';
|
||||
import Moment from 'moment';
|
||||
|
||||
import Piece from '../../../../../components/ascribe_detail/piece';
|
||||
|
||||
@ -39,7 +40,7 @@ let WalletPieceContainer = React.createClass({
|
||||
<hr style={{marginTop: 0}}/>
|
||||
<h1 className="ascribe-detail-title">{this.props.piece.title}</h1>
|
||||
<DetailProperty label="BY" value={this.props.piece.artist_name} />
|
||||
<DetailProperty label="DATE" value={new Date(this.props.piece.date_created).getFullYear()} />
|
||||
<DetailProperty label="DATE" value={Moment(this.props.piece.date_created, 'YYYY-MM-DD').year()} />
|
||||
<hr/>
|
||||
</div>
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
import React from 'react';
|
||||
import Moment from 'moment';
|
||||
|
||||
import AccordionListItemPiece from '../../../../../ascribe_accordion_list/accordion_list_item_piece';
|
||||
|
||||
@ -100,7 +101,7 @@ let CylandAccordionListItem = React.createClass({
|
||||
piece={this.props.content}
|
||||
subsubheading={
|
||||
<div className="pull-left">
|
||||
<span>{new Date(this.props.content.date_created).getFullYear()}</span>
|
||||
<span>{Moment(this.props.content.date_created, 'YYYY-MM-DD').year()}</span>
|
||||
</div>}
|
||||
buttons={this.getSubmitButtons()}>
|
||||
{this.props.children}
|
||||
|
@ -1,6 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
import React from 'react';
|
||||
import Moment from 'moment';
|
||||
|
||||
import AccordionListItemPiece from '../../../../../ascribe_accordion_list/accordion_list_item_piece';
|
||||
|
||||
@ -106,7 +107,7 @@ let IkonotvAccordionListItem = React.createClass({
|
||||
piece={this.props.content}
|
||||
subsubheading={
|
||||
<div className="pull-left">
|
||||
<span>{new Date(this.props.content.date_created).getFullYear()}</span>
|
||||
<span>{Moment(this.props.content.date_created, 'YYYY-MM-DD').year()}</span>
|
||||
</div>}
|
||||
buttons={this.getSubmitButtons()}>
|
||||
{this.props.children}
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
import Q from 'q';
|
||||
import SparkMD5 from 'spark-md5';
|
||||
import Moment from 'moment';
|
||||
|
||||
import { getLangText } from './lang_utils';
|
||||
|
||||
@ -37,7 +38,7 @@ export function computeHashOfFile(file) {
|
||||
let spark = new SparkMD5.ArrayBuffer();
|
||||
let fileReader = new FileReader();
|
||||
|
||||
let startTime = new Date();
|
||||
let startTime = new Moment();
|
||||
|
||||
// comment: We should convert this to es6 at some point, however if so please consider that
|
||||
// an arrow function will get rid of the function's scope...
|
||||
@ -53,7 +54,7 @@ export function computeHashOfFile(file) {
|
||||
|
||||
console.info('computed hash %s (took %d s)',
|
||||
fileHash,
|
||||
Math.round(((new Date() - startTime) / 1000) % 60)); // Compute hash
|
||||
Math.round(((new Moment() - startTime) / 1000) % 60)); // Compute hash
|
||||
|
||||
let blobTextFile = makeTextFile(fileHash, file);
|
||||
resolve(blobTextFile);
|
||||
|
Loading…
Reference in New Issue
Block a user