Commit cde82730 authored by djeller's avatar djeller 🤖
Browse files

Import of legacy versions in combined repo

parent 017564bf
{
"presets": [
"es2015",
"react",
"survivejs-kanban"
],
"env": {
"start": {
"presets": [
"react-hmre"
]
}
}
}
\ No newline at end of file
### Node template
# Logs
logs
*.log
npm-debug.log*
# Runtime data
pids
*.pid
*.seed
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directory
# https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git
node_modules
### Windows template
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msm
*.msp
# Windows shortcuts
*.lnk
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio
*.iml
## Directory-based project format:
.idea/
# if you remove the above rule, at least ignore the following:
# User-specific stuff:
# .idea/workspace.xml
# .idea/tasks.xml
# .idea/dictionaries
# Sensitive or high-churn files:
# .idea/dataSources.ids
# .idea/dataSources.xml
# .idea/sqlDataSources.xml
# .idea/dynamic.xml
# .idea/uiDesigner.xml
# Gradle:
# .idea/gradle.xml
# .idea/libraries
# Mongo Explorer plugin:
# .idea/mongoSettings.xml
## File-based project format:
*.ipr
*.iws
## Plugin-specific files:
# IntelliJ
/out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
/build/bundle.js
crashlytics-build.properties
\ No newline at end of file
import { fetchAliases } from './charterData/aliases';
import { fetchArchives } from './charterData/archives';
import { fetchCharters } from './charterData/charters';
import { fetchDates } from './charterData/dates';
import { fetchHoldings } from './charterData/holdings';
import { fetchPersons } from './charterData/persons';
import { fetchPlaces } from './charterData/places';
export function fetchCharterData(from, to, holding) {
return dispatch => Promise.all([
dispatch(fetchAliases()),
dispatch(fetchArchives()),
dispatch(fetchCharters(from, to, holding)),
dispatch(fetchDates(holding)),
dispatch(fetchHoldings()),
dispatch(fetchPersons()),
dispatch(fetchPlaces())
]);
}
\ No newline at end of file
import { QUERY_ALIASES } from './../../const';
import { fetchGraph } from './../fetch';
export const REQUEST_ALIASES = "REQUEST_ALIASES";
export function requestAliases() {
return {
type: REQUEST_ALIASES
}
}
export const RECEIVE_ALIASES = "RECEIVE_ALIASES";
export function receiveAliases(json) {
return {
type: RECEIVE_ALIASES,
receivedAt: Date.now(),
items: json.results[0].data.map(data => {
let row = data.row[0];
return {
aliasOf: row.aliasOf,
id: row.id,
name: row.name,
regularName: row.regularName
}
})
}
}
export function fetchAliases() {
return function (dispatch) {
dispatch(requestAliases());
return fetchGraph(QUERY_ALIASES)
.then(response => response.json())
.then(json =>
dispatch(receiveAliases(json))
).catch(function (ex) {
console.log('Fetching aliases failed.', ex)
});
}
}
\ No newline at end of file
import { QUERY_ARCHIVES } from './../../const';
import { fetchGraph } from './../fetch';
export const REQUEST_ARCHIVES = "REQUEST_ARCHIVES";
export function requestArchives() {
return {
type: REQUEST_ARCHIVES
}
}
export const RECEIVE_ARCHIVES = "RECEIVE_ARCHIVES";
export function receiveArchives(json) {
return {
type: RECEIVE_ARCHIVES,
receivedAt: Date.now(),
items: json.results[0].data.map(data => {
let row = data.row[0];
return {
abbreviation: row.abbreviation,
id: row.id,
locatedIn: row.locatedIn,
name: row.name,
stores: row.stores
}
})
}
}
export function fetchArchives() {
return function (dispatch) {
dispatch(requestArchives());
return fetchGraph(QUERY_ARCHIVES)
.then(response => response.json())
.then(json =>
dispatch(receiveArchives(json))
).catch(function (ex) {
console.log('Fetching archives failed.', ex)
});
}
}
\ No newline at end of file
import { QUERY_CHARTERS, QUERY_CHARTERS_HOLDING_FILTER } from './../../const';
import { fetchGraph } from './../fetch';
export const REQUEST_CHARTERS = "REQUEST_CHARTERS";
export function requestCharters() {
return {
type: REQUEST_CHARTERS
}
}
export const RECEIVE_CHARTERS = "RECEIVE_CHARTERS";
export function receiveCharters(json) {
return {
type: RECEIVE_CHARTERS,
receivedAt: Date.now(),
items: json.results[0].data.map(data => {
let row = data.row[0];
return {
abstract: row.abstract,
appearsIn: row.appearsIn,
atomId: row.atomId,
id: row.id,
issuedAt: row.issuedAt,
issuedOn: row.issuedOn,
issuer: row.issuer,
parent: row.parent,
recipient: row.recipient,
relatedTo: row.relatedTo
}
})
}
}
export function fetchCharters(from, to, holding) {
return function (dispatch) {
dispatch(requestCharters());
const holdingFilter = holding == "" ? "" : QUERY_CHARTERS_HOLDING_FILTER.replace("%holding", holding);
const query = QUERY_CHARTERS.replace("%from", from).replace("%to", to).replace("%holdingfilter", holdingFilter);
return fetchGraph(query)
.then(response => response.json())
.then(json =>
dispatch(receiveCharters(json))
).catch(function (ex) {
console.log('Fetching charters failed.', ex)
});
}
}
\ No newline at end of file
import { QUERY_DATES, QUERY_DATES_HOLDING_FILTER } from './../../const';
import { fetchGraph } from './../fetch';
export const REQUEST_DATES = "REQUEST_DATES";
export function requestDates() {
return {
type: REQUEST_DATES
}
}
export const RECEIVE_DATES = "RECEIVE_DATES";
export function receiveDates(json) {
return {
type: RECEIVE_DATES,
receivedAt: Date.now(),
items: json.results[0].data.map(data => {
let row = data.row[0];
return {
day: row.day,
id: row.id,
month: row.month,
year: row.year
}
})
}
}
export function fetchDates(holding) {
return function (dispatch) {
dispatch(requestDates());
const holdingsFilter = holding == "" ? "" : QUERY_DATES_HOLDING_FILTER.replace("%holding", holding);
const query = QUERY_DATES.replace("%holdingfilter", holdingsFilter);
return fetchGraph(query)
.then(response => response.json())
.then(json =>
dispatch(receiveDates(json))
).catch(function (ex) {
console.log('Fetching dates failed.', ex)
});
}
}
\ No newline at end of file
import { QUERY_HOLDINGS } from './../../const';
import { fetchGraph } from './../fetch';
export const REQUEST_HOLDINGS = "REQUEST_HOLDINGS";
export function requestHoldings() {
return {
type: REQUEST_HOLDINGS
}
}
export const RECEIVE_HOLDINGS = "RECEIVE_HOLDINGS";
export function receiveHoldings(json) {
return {
type: RECEIVE_HOLDINGS,
receivedAt: Date.now(),
items: json.results[0].data.map(data => {
let row = data.row[0];
return {
abbreviation: row.abbreviation,
id: row.id,
name: row.name,
parent: row.parent
}
})
}
}
export function fetchHoldings() {
return function (dispatch) {
dispatch(requestHoldings());
return fetchGraph(QUERY_HOLDINGS)
.then(response => response.json())
.then(json =>
dispatch(receiveHoldings(json))
).catch(function (ex) {
console.log('Fetching holdings failed.', ex)
});
}
}
\ No newline at end of file
import { QUERY_PERSONS } from './../../const';
import { fetchGraph } from './../fetch';
export const REQUEST_PERSONS = "REQUEST_PERSONS";
export function requestPersons() {
return {
type: REQUEST_PERSONS
}
}
export const RECEIVE_PERSONS = "RECEIVE_PERSONS";
export function receivePersons(json) {
return {
type: RECEIVE_PERSONS,
receivedAt: Date.now(),
items: json.results[0].data.map(data => {
let row = data.row[0];
return {
id: row.id,
name: row.name,
regularName: row.regularName
}
})
}
}
export function fetchPersons() {
return function (dispatch) {
dispatch(requestPersons());
return fetchGraph(QUERY_PERSONS)
.then(response => response.json())
.then(json =>
dispatch(receivePersons(json))
).catch(function (ex) {
console.log('Fetching persons failed.', ex)
});
}
}
\ No newline at end of file
import { QUERY_PLACES } from './../../const';
import { fetchGraph } from './../fetch';
export const REQUEST_PLACES = "REQUEST_PLACES";
export function requestPlaces() {
return {
type: REQUEST_PLACES
}
}
export const RECEIVE_PLACES = "RECEIVE_PLACES";
export function receivePlaces(json) {
return {
type: RECEIVE_PLACES,
receivedAt: Date.now(),
items: json.results[0].data.map(data => {
let row = data.row[0];
return {
latitude: row.latitude,
longitude: row.longitude,
id: row.id,
name: row.name
};
})
}
}
export function fetchPlaces() {
return function (dispatch) {
dispatch(requestPlaces());
return fetchGraph(QUERY_PLACES)
.then(response => response.json())
.then(json =>
dispatch(receivePlaces(json))
).catch(function (ex) {
console.log('Fetching places failed.', ex)
});
}
}
\ No newline at end of file
import 'babel-polyfill';
import fetch from 'isomorphic-fetch';
export function fetchGraph(query) {
return fetch('http://localhost:7474/db/data/transaction/commit', {
mode: 'cors',
method: 'post',
headers: new Headers({
'Content-Type': 'application/json; charset=UTF-8',
'Accept': 'application/json',
'Authorization': 'Basic bmVvNGo6cGFzc3dvcmQ='
}),
body: JSON.stringify({statements: [{statement: query}]})
});
}
\ No newline at end of file
export const CHANGE_FROM_FILTER = "CHANGE_FROM_FILTER";
export function changeFromFilter(from) {
return {
type: CHANGE_FROM_FILTER,
from: from
}
}
export const CHANGE_TO_FILTER = "CHANGE_TO_FILTER";
export function changeToFilter(to) {
return {
type: CHANGE_TO_FILTER,
to: to
}
}
export const CHANGE_FROM_MIN = "CHANGE_FROM_MIN";
export function changeFromMin(min) {
return {
type: CHANGE_FROM_MIN,
min: min
}
}
export const CHANGE_FROM_MAX = "CHANGE_FROM_MAX";
export function changeFromMax(max) {
return {
type: CHANGE_FROM_MAX,
max: max
}
}
export const CHANGE_SELECTED_HOLDING = "CHANGE_SELECTED_HOLDING";
export function changeSelectedHolding(id) {
return {
type: CHANGE_SELECTED_HOLDING,
id: id
}
}
\ No newline at end of file
export const CHANGE_DISPLAYED_CHARTER = "CHANGE_DISPLAYED_CHARTER";
export function changeDisplayedCharter(id) {
return {
type: CHANGE_DISPLAYED_CHARTER,
id: id
}
}
\ No newline at end of file
import React, {Component} from 'react';
import {Grid, Row, Col} from 'react-bootstrap';
export default class Footer extends Component {
render() {
const {id} = this.props;
return (
<footer id={id}>
<Grid>
<div className="footer-content">Powerd by <a href="http://icar-us.eu">ICARUS</a>,&nbsp;<a
href="http://monasterium.net/">Monasterium.net</a>,&nbsp;<a
href="http://neo4j.com/">Neo4j</a>,&nbsp;<a href="https://facebook.github.io/react/index.html">React.js</a>,&nbsp;
<a href="http://redux.js.org/">Redux</a>,&nbsp;<a
href="http://leafletjs.com/">Leaflet</a>,&nbsp;<a
href="http://www.geonames.org/">Geonames</a>,&nbsp;<a
href="https://www.mapbox.com/">Mapbox</a>&nbsp;
and others.
</div>
</Grid>
</footer>
);
}
}
\ No newline at end of file
import React, {Component} from 'react';
import {Label, Col, Row, Well} from 'react-bootstrap';
require('script!bootstrap-slider/dist/bootstrap-slider');
require("bootstrap-slider/dist/css/bootstrap-slider.css");
export default class RangeSlider extends Component {
componentDidMount() {
const { from, to, min, max, handleRangeChange } = this.props;
var slider = new Slider('#date-filter-slider input', {
min: min,
max: max,
value: [from, to],
step: 1,
handle: "square",
tooltip_split: true
});
slider.on("slideStop", handleRangeChange);
this.setState({
slider: slider
});
}
componentWillReceiveProps(nextProps) {
if (this.state != null) {
const { slider } = this.state;
const { from, to, min, max } = this.props;
if (min != nextProps.min || max != nextProps.max || from != nextProps.from || to != nextProps.to) {
console.log(this.props);
slider.setAttribute("min", nextProps.min);
slider.setAttribute("max", nextProps.max);
slider.setValue([nextProps.from, nextProps.to]);
}
}
}
render() {
const { min, max } = this.props;
return (
<Well id="date-filter-slider" className="slider-wrapper">
<Row>
<Col lg={1}><Label className="slider-label" id="date-filter-min-label">{min}</Label></Col>
<Col lg={10}><input className="slider" type="text"/></Col>
<Col lg={1}><Label className="slider-label" id="date-filter-max-label">{max}</Label></Col>
</Row>
</Well>);
}