From 357f63fa2b7429d398b95c5ef685b7ccc3e50d8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Mon, 16 Nov 2015 11:45:56 +0100 Subject: [PATCH 1/2] Add contract link to loan history --- .../ascribe_detail/history_iterator.js | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/js/components/ascribe_detail/history_iterator.js b/js/components/ascribe_detail/history_iterator.js index 54d11a5b..413aeb21 100644 --- a/js/components/ascribe_detail/history_iterator.js +++ b/js/components/ascribe_detail/history_iterator.js @@ -5,11 +5,33 @@ import React from 'react'; import Form from '../ascribe_forms/form'; import Property from '../ascribe_forms/property'; +import { replaceSubstringAtIndex } from '../../utils/general_utils'; + + let HistoryIterator = React.createClass({ propTypes: { history: React.PropTypes.array }, + composeHistoryDescription(historicalEvent) { + if(historicalEvent.length === 3) { + // We want to get the capturing group without the quotes, + // which is why we access the match list at index 1 and not 0 + const contractName = historicalEvent[1].match(/\"(.*)\"/)[1]; + const historicalEventDescription = replaceSubstringAtIndex(historicalEvent[1], `"${contractName}"`, ''); + return ( + + {historicalEventDescription} + {contractName} + + ); + } else if(historicalEvent.length === 2) { + return historicalEvent[1]; + } else { + throw new Error('Expected an historical event list with either 3 or 2 items. Got less or more.'); + } + }, + render() { return (
@@ -20,7 +42,7 @@ let HistoryIterator = React.createClass({ key={i} label={ historicalEvent[0] } editable={false}> -
{ historicalEvent[1] }
+
{this.composeHistoryDescription(historicalEvent)}
); })} From c1f1573f27bc0d619f9a8a773211a9dd6ddbb848 Mon Sep 17 00:00:00 2001 From: diminator Date: Thu, 19 Nov 2015 17:35:25 +0100 Subject: [PATCH 2/2] change impressum to imprint --- js/components/footer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/components/footer.js b/js/components/footer.js index 2a71f7d0..65088ee2 100644 --- a/js/components/footer.js +++ b/js/components/footer.js @@ -11,7 +11,7 @@ let Footer = React.createClass({


api | - impressum | + {getLangText('imprint')} | {getLangText('terms of service')} | {getLangText('privacy')}