From 5e7f7983e18cf1a665e6de580cb7ac26d98e0df7 Mon Sep 17 00:00:00 2001 From: ddejongh Date: Thu, 11 Jun 2015 15:57:19 +0200 Subject: [PATCH] application constants --- js/components/header.js | 4 +-- js/constants/api_urls.js | 42 +++++++++++++-------------- js/constants/application_constants.js | 4 +-- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/js/components/header.js b/js/components/header.js index 8954104c..6c8145e6 100644 --- a/js/components/header.js +++ b/js/components/header.js @@ -1,7 +1,7 @@ 'use strict'; import React from 'react'; -//import Router from 'react-router'; +import Router from 'react-router'; import UserActions from '../actions/user_actions'; import UserStore from '../stores/user_store'; @@ -16,7 +16,7 @@ import LoginForm from '../components/ascribe_forms/form_login'; import { getLangText } from '../utils/lang_utils'; -//let Link = Router.Link; +let Link = Router.Link; let Header = React.createClass({ diff --git a/js/constants/api_urls.js b/js/constants/api_urls.js index cbde0f81..1bc835cd 100644 --- a/js/constants/api_urls.js +++ b/js/constants/api_urls.js @@ -3,27 +3,27 @@ import AppConstants from './application_constants'; let apiUrls = { - 'piece': AppConstants.baseUrl + 'pieces/${piece_id}', - 'pieces_list': AppConstants.baseUrl + 'pieces/', - 'piece_extradata': AppConstants.baseUrl + 'pieces/${piece_id}/extradata/', - 'edition': AppConstants.baseUrl + 'editions/${bitcoin_id}/', - 'editions_list': AppConstants.baseUrl + 'pieces/${piece_id}/editions/', - 'edition_delete': AppConstants.baseUrl + 'editions/${edition_id}/', - 'edition_remove_from_collection': AppConstants.baseUrl + 'ownership/shares/${edition_id}/', - 'ownership_shares_mail': AppConstants.baseUrl + 'ownership/shares/mail/', - 'ownership_transfers': AppConstants.baseUrl + 'ownership/transfers/', - 'ownership_consigns': AppConstants.baseUrl + 'ownership/consigns/', - 'ownership_consigns_confirm': AppConstants.baseUrl + 'ownership/consigns/confirm/', - 'ownership_consigns_deny': AppConstants.baseUrl + 'ownership/consigns/deny/', - 'ownership_unconsigns': AppConstants.baseUrl + 'ownership/unconsigns/', - 'ownership_unconsigns_request': AppConstants.baseUrl + 'ownership/unconsigns/request/', - 'ownership_unconsigns_deny': AppConstants.baseUrl + 'ownership/unconsigns/deny/', - 'ownership_loans': AppConstants.baseUrl + 'ownership/loans/', - 'ownership_loans_confirm': AppConstants.baseUrl + 'ownership/loans/confirm/', - 'ownership_loans_deny': AppConstants.baseUrl + 'ownership/loans/deny/', - 'note_notes': AppConstants.baseUrl + 'note/notes/', - 'user': AppConstants.baseUrl + 'users/', - 'users_login': AppConstants.baseUrl + 'users/login/' + 'piece': AppConstants.apiEndpoint + 'pieces/${piece_id}', + 'pieces_list': AppConstants.apiEndpoint + 'pieces/', + 'piece_extradata': AppConstants.apiEndpoint + 'pieces/${piece_id}/extradata/', + 'edition': AppConstants.apiEndpoint + 'editions/${bitcoin_id}/', + 'editions_list': AppConstants.apiEndpoint + 'pieces/${piece_id}/editions/', + 'edition_delete': AppConstants.apiEndpoint + 'editions/${edition_id}/', + 'edition_remove_from_collection': AppConstants.apiEndpoint + 'ownership/shares/${edition_id}/', + 'ownership_shares_mail': AppConstants.apiEndpoint + 'ownership/shares/mail/', + 'ownership_transfers': AppConstants.apiEndpoint + 'ownership/transfers/', + 'ownership_consigns': AppConstants.apiEndpoint + 'ownership/consigns/', + 'ownership_consigns_confirm': AppConstants.apiEndpoint + 'ownership/consigns/confirm/', + 'ownership_consigns_deny': AppConstants.apiEndpoint + 'ownership/consigns/deny/', + 'ownership_unconsigns': AppConstants.apiEndpoint + 'ownership/unconsigns/', + 'ownership_unconsigns_request': AppConstants.apiEndpoint + 'ownership/unconsigns/request/', + 'ownership_unconsigns_deny': AppConstants.apiEndpoint + 'ownership/unconsigns/deny/', + 'ownership_loans': AppConstants.apiEndpoint + 'ownership/loans/', + 'ownership_loans_confirm': AppConstants.apiEndpoint + 'ownership/loans/confirm/', + 'ownership_loans_deny': AppConstants.apiEndpoint + 'ownership/loans/deny/', + 'note_notes': AppConstants.apiEndpoint + 'note/notes/', + 'user': AppConstants.apiEndpoint + 'users/', + 'users_login': AppConstants.apiEndpoint + 'users/login/' }; export default apiUrls; diff --git a/js/constants/application_constants.js b/js/constants/application_constants.js index 3f2ca621..508eebda 100644 --- a/js/constants/application_constants.js +++ b/js/constants/application_constants.js @@ -5,9 +5,9 @@ let constants = { //FIXME: referring to a global variable in `window` is not // super pro. What if we render stuff on the server? - 'baseUrl': window.BASE_URL, + //'baseUrl': window.BASE_URL, 'apiEndpoint': window.API_ENDPOINT, - //'baseUrl': 'http://staging.ascribe.io/api/', + 'baseUrl': 'http://staging.ascribe.io/api/', 'debugCredentialBase64': 'ZGltaUBtYWlsaW5hdG9yLmNvbTowMDAwMDAwMDAw', // dimi@mailinator:0000000000 'aclList': ['edit', 'consign', 'consign_request', 'unconsign', 'unconsign_request', 'transfer', 'loan', 'loan_request', 'share', 'download', 'view', 'delete', 'del_from_collection', 'add_to_collection']