1
0
mirror of https://github.com/ascribe/onion.git synced 2024-06-28 00:28:00 +02:00

Add small changes for previous merges that were missed

This commit is contained in:
Brett Sun 2015-11-04 00:41:12 +01:00
parent 3929712e9d
commit 85eb45b5cd
6 changed files with 17 additions and 17 deletions

View File

@ -184,7 +184,7 @@ let PieceList = React.createClass({
this.fetchSelectedPieceEditionList()
.forEach((pieceId) => {
EditionListActions.refreshEditionList({pieceId, filterBy: {}});
EditionListActions.refreshEditionList({pieceId});
});
EditionListActions.clearAllEditionSelections();
},

View File

@ -6,6 +6,7 @@ import LumenusSubmitButton from './lumenus_submit_button';
import DeleteButton from '../../../../../ascribe_buttons/delete_button';
import ShareButton from '../../../../../ascribe_buttons/acls/share_button';
import TransferButton from '../../../../../ascribe_buttons/acls/transfer_button';
import UserActions from '../../../../../../actions/user_actions';
import UserStore from '../../../../../../stores/user_store';
@ -46,13 +47,18 @@ let LumenusAclButtonList = React.createClass({
<LumenusSubmitButton
availableAcls={availableAcls}
currentUser={this.state.currentUser}
pieceOrEditions={pieceOrEditions}
editions={pieceOrEditions}
handleSuccess={handleSuccess} />
<ShareButton
availableAcls={availableAcls}
currentUser={this.state.currentUser}
pieceOrEditions={pieceOrEditions}
handleSuccess={handleSuccess} />
<TransferButton
availableAcls={availableAcls}
currentUser={this.state.currentUser}
pieceOrEditions={pieceOrEditions}
handleSuccess={handleSuccess} />
{this.props.children}
</div>
);

View File

@ -28,8 +28,7 @@ let LumenusAdditionalDataForm = React.createClass({
extra_data: React.PropTypes.object,
other_data: React.PropTypes.arrayOf(React.PropTypes.object)
}).isRequired,
isInline: React.PropTypes.bool,
location: React.PropTypes.object
isInline: React.PropTypes.bool
},
getDefaultProps() {
@ -125,8 +124,7 @@ let LumenusAdditionalDataForm = React.createClass({
setIsUploadReady={this.setIsUploadReady}
isReadyForFormSubmission={formSubmissionValidation.atLeastOneUploadedFile}
pieceId={piece.id}
otherData={piece.other_data}
location={this.props.location}/>
otherData={piece.other_data} />
<Property
name='artist_bio'
label={getLangText('Artist Bio')}>

View File

@ -22,10 +22,10 @@ let LumenusPieceList = React.createClass({
redirectTo="/register_piece?slide_num=0"
bulkModalButtonListType={LumenusAclButtonList}
filterParams={[{
label: getLangText('Show works I have'),
label: getLangText('Show works I can'),
items: [{
key: 'acl_consigned',
label: getLangText('consigned to Lumenus')
key: 'acl_consign',
label: getLangText('consign to Lumenus')
}]
}]}
location={this.props.location}/>

View File

@ -60,7 +60,7 @@ class EditionListStore {
* We often just have to refresh the edition list for a certain pieceId,
* this method provides exactly that functionality without any side effects
*/
onRefreshEditionList({pieceId, filterBy}) {
onRefreshEditionList({pieceId, filterBy = {}}) {
// It may happen that the user enters the site logged in already
// through /editions
// If he then tries to delete a piece/edition and this method is called,

View File

@ -99,8 +99,7 @@ class Requests {
return newUrl;
}
request(verb, url, options) {
options = options || {};
request(verb, url, options = {}) {
let merged = Object.assign({}, this.httpOptions, options);
let csrftoken = getCookie(AppConstants.csrftoken);
if (csrftoken) {
@ -128,13 +127,10 @@ class Requests {
}
_putOrPost(url, paramsAndBody, method) {
let paramsCopy = Object.assign({}, paramsAndBody);
let params = omitFromObject(paramsAndBody, ['body']);
let newUrl = this.prepareUrl(url, params);
let body = null;
if (paramsCopy && paramsCopy.body) {
body = JSON.stringify(paramsCopy.body);
}
let body = paramsAndBody && paramsAndBody.body ? JSON.stringify(paramsAndBody.body)
: null;
return this.request(method, newUrl, { body });
}