Fixing merge conflicts for docker and master branches
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..6b37aab
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,22 @@
+FROM python:3.4
+
+echo "curl"
+RUN curl -sL https://deb.nodesource.com/setup | bash -
+
+echo "apt-get"
+RUN apt-get -y install nodejs
+
+
+RUN mkdir -p /usr/src/app
+WORKDIR /usr/src/app
+COPY . /usr/src/app
+
+RUN pip install -r requirements.txt
+
+RUN npm install -g gulp
+RUN npm install
+
+RUN python manage.py runserver 0.0.0.0:8000
+RUN gulp dev
+
+EXPOSE 8000
diff --git a/app_mgr/distillviews.py b/app_mgr/distillviews.py
index d85c1ca..0bff3a2 100644
--- a/app_mgr/distillviews.py
+++ b/app_mgr/distillviews.py
@@ -44,8 +44,10 @@
import datetime
import requests
+from tap.settings import DISTILL_URL as distillURL
+
#distillURL = "msbx.draper.com:8091"
-distillURL = "localhost:8090" #move url into settings/config and import
+#distillURL = "localhost:8090" #moved url into tap/settings.py file
def app_results_byname(request, appName, searchType):
completeurl = distillURL+'/search/'+appName+'/'+searchType
diff --git a/app_mgr/views.py b/app_mgr/views.py
index 4d0c464..10bdd27 100644
--- a/app_mgr/views.py
+++ b/app_mgr/views.py
@@ -45,7 +45,7 @@
from app_mgr.serializers import UserProfileSerializer, OrganizationSerializer, ApplicationSerializer
import datetime
-import requests
+import requests
#
# RESTFUL VIEWS
@@ -64,7 +64,7 @@
def get_queryset(self):
# only used for list
- return get_objects_for_user(self.request.user, "view_userprofile",
+ return get_objects_for_user(self.request.user, "view_userprofile",
UserProfile.objects.all())
class OrganizationListView(generics.ListCreateAPIView):
@@ -79,7 +79,7 @@
def get_queryset(self):
# only used for list
- return get_objects_for_user(self.request.user, "view_organization",
+ return get_objects_for_user(self.request.user, "view_organization",
Organization.objects.all())
class ApplicationListView(generics.ListCreateAPIView):
@@ -94,12 +94,12 @@
def get_queryset(self):
# only used for list
- owned = get_objects_for_user(self.request.user, "view_application",
+ owned = get_objects_for_user(self.request.user, "view_application",
Application.objects.all())
public = Application.objects.filter(isPublic=True)
viewable = list(set(list(owned) + list(public)))
-
+
return viewable
# SINGLE RETRIEVE/UPDATE/DESTROY
@@ -176,7 +176,7 @@
# AUTHENTICATION VIEWS
#
-# creates a new user
+# creates a new user
def register(request):
# TODO : add logging back in. Good practice!!
# Like before, get the request's context.
@@ -336,4 +336,4 @@
# return render(request, 'user_profile.html',
# {'user': request.user,
# }
-# )
\ No newline at end of file
+# )
diff --git a/docker-compose.yml b/docker-compose.yml
index f44a98b..5ed59c0 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -79,4 +79,4 @@
depends_on:
- elasticsearch
links:
- - elasticsearch
+ - elasticsearch
\ No newline at end of file
diff --git a/gulpfile.babel.js b/gulpfile.babel.js
index 5240697..2cc122e 100644
--- a/gulpfile.babel.js
+++ b/gulpfile.babel.js
@@ -1,3 +1,18 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
import gulp from 'gulp';
import path from 'path';
import del from 'del';
diff --git a/package.json b/package.json
index 883cac9..df9329d 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "tap",
"description": "Tap, The Software as a Sensor portal and visualization component",
- "version": "0.1.0",
+ "version": "0.2.0",
"private": true,
"license": "Apache-2.0",
"author": "Draper",
@@ -14,53 +14,29 @@
"Michelle Beard <mbeard@draper.com>",
"Arthi Vezhavendan <avezhavendan@draper.com>"
],
- "homepage": "https://github.com/draperlaboratory/tap#readme",
+ "homepage": "https://senssoft.incubator.apache.org",
"repository": {
"type": "git",
- "url": "git+https://github.com/draperlaboratory/tap.git"
+ "url": "https://git-wip-us.apache.org/repos/asf/incubator-senssoft.tap.git"
},
"bugs": {
- "url": "https://github.com/draperlaboratory/tap/issues"
+ "url": "https://issues.apache.org/jira/browse/SENSSOFT"
},
"keywords": [
"Tap"
],
"engines": {
- "node": ">= 4.4.5"
+ "node": "^6.9.1"
},
"dependencies": {
- "better-console": "^0.2.4",
"d3": "^4.1.1",
- "extend": "^3.0.0",
- "gulp-chmod": "^1.3.0",
- "gulp-clone": "^1.0.0",
- "gulp-concat-css": "^2.3.0",
- "gulp-copy": "0.0.2",
- "gulp-dedupe": "0.0.2",
- "gulp-flatten": "^0.3.0",
- "gulp-header": "^1.8.7",
- "gulp-help": "^1.6.1",
- "gulp-if": "^2.0.1",
- "gulp-less": "^3.1.0",
- "gulp-minify-css": "^1.2.4",
- "gulp-notify": "^2.2.0",
- "gulp-plumber": "^1.1.0",
- "gulp-print": "^2.0.1",
- "gulp-rename": "^1.2.2",
- "gulp-replace": "^0.5.4",
- "gulp-rtlcss": "^1.0.0",
- "gulp-watch": "^4.3.8",
- "lodash": "^4.13.1",
- "map-stream": "0.0.6",
+ "isomorphic-fetch": "^2.2.1",
"react": "^15.2.0",
"react-dom": "^15.2.0",
"react-redux": "^4.4.5",
"react-router": "^2.5.2",
"redux": "^3.5.2",
- "redux-thunk": "^2.1.0",
- "require-dot-file": "^0.4.0",
- "semantic-ui": "^2.2.1",
- "yamljs": "^0.2.8"
+ "semantic-ui": "^2.2.6"
},
"devDependencies": {
"babel-core": "^6.10.4",
diff --git a/public/actions/ActionTypes.js b/public/actions/ActionTypes.js
new file mode 100644
index 0000000..f58b9cb
--- /dev/null
+++ b/public/actions/ActionTypes.js
@@ -0,0 +1,30 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+export const LOGIN_REQUEST = 'LOGIN_REQUEST';
+export const LOGIN_SUCCESS = 'LOGIN_SUCCESS';
+export const LOGIN_FAILURE = 'LOGIN_FAILURE';
+export const LOGOUT = 'LOGOUT';
+export const SIGNUP_REQUEST = 'SIGNUP_REQUEST';
+export const SIGNUP_SUCCESS = 'SIGNUP_SUCCESS';
+export const SIGNUP_FAILURE = 'SIGNUP_FAILURE';
+
+export const APP_LIST_REQUEST = 'APP_LIST_REQUEST';
+export const APP_LIST_SUCCESS = 'APP_LIST_SUCCESS';
+export const APP_LIST_FAILURE = 'APP_LIST_FAILURE';
+
+export const APP_DETAILS_REQUEST = 'APP_DETAILS_REQUEST';
+export const APP_DETAILS_SUCCESS = 'APP_DETAILS_SUCCESS';
+export const APP_DETAILS_FAILURE = 'APP_DETAILS_FAILURE';
diff --git a/public/actions/app.js b/public/actions/app.js
deleted file mode 100644
index 3badb05..0000000
--- a/public/actions/app.js
+++ /dev/null
@@ -1,26 +0,0 @@
-import { REQUEST_APP, RECEIVE_APP, REQUEST_APP_UPDATE, CONFIRM_APP_UPDATE, REQUEST_APP_RESULTS, RECEIVE_APP_RESULTS }
- from '../constants/ActionTypes';
-
-export function fetchApp () {
- return { type : REQUEST_APP };
-}
-
-export function receivedApp (app) {
- return { type : RECEIVE_APP, app : app };
-}
-
-export function updateApp (update) {
- return { type : REQUEST_APP_UPDATE, update : update };
-}
-
-export function confirmAppUpdate (success) {
- return { type : CONFIRM_APP_UPDATE, saved : success };
-}
-
-export function fetchAppResults () {
- return { type : REQUEST_APP_RESULTS };
-}
-
-export function receivedAppResults (results) {
- return { type : RECEIVE_APP_RESULTS, results : results };
-}
diff --git a/public/actions/auth.js b/public/actions/auth.js
deleted file mode 100644
index 8dc9ec6..0000000
--- a/public/actions/auth.js
+++ /dev/null
@@ -1,9 +0,0 @@
-import { LOG_IN, LOG_OUT } from '../constants/ActionTypes';
-
-export function logIn () {
- return { type : LOG_IN };
-}
-
-export function logOut () {
- return { type : LOG_OUT };
-}
diff --git a/public/actions/index.js b/public/actions/index.js
index 27914c4..72529b0 100644
--- a/public/actions/index.js
+++ b/public/actions/index.js
@@ -1,4 +1,87 @@
-export * from './auth';
-export * from './user';
-export * from './org';
-export * from './app';
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+import * as ActionTypes from './ActionTypes';
+import { CALL_API } from '../store/api';
+
+export function login(email, password) {
+ return {
+ [CALL_API]: {
+ endpoint: '/app_mgr/login',
+ types: [
+ ActionTypes.LOGIN_REQUEST,
+ ActionTypes.LOGIN_SUCCESS,
+ ActionTypes.LOGIN_FAILURE,
+ ],
+ body: $.param({
+ email,
+ password,
+ }),
+ method: 'POST',
+ successRedirect: '/apps',
+ },
+ email,
+ };
+}
+
+export function logout() {
+ localStorage.removeItem('tapToken');
+}
+
+export function signup(email, password) {
+ return {
+ [CALL_API]: {
+ endpoint: '/app_mgr/register',
+ types: [
+ ActionTypes.SIGNUP_REQUEST,
+ ActionTypes.SIGNUP_SUCCESS,
+ ActionTypes.SIGNUP_FAILURE,
+ ],
+ body: $.param({
+ email,
+ password,
+ }),
+ method: 'POST',
+ successRedirect: '/apps',
+ },
+ };
+}
+
+export function getAppList() {
+ return {
+ [CALL_API]: {
+ endpoint: 'app_mgr/apps',
+ types: [
+ ActionTypes.APP_LIST_REQUEST,
+ ActionTypes.APP_LIST_SUCCESS,
+ ActionTypes.APP_LIST_FAILURE,
+ ],
+ },
+ };
+}
+
+export function getAppDetails(appId) {
+ return {
+ [CALL_API]: {
+ endpoint: `app_mgr/appresults/${appId}/graph`,
+ types: [
+ ActionTypes.APP_DETAILS_REQUEST,
+ ActionTypes.APP_DETAILS_SUCCESS,
+ ActionTypes.APP_DETAILS_FAILURE,
+ ],
+ },
+ appId,
+ };
+}
diff --git a/public/actions/org.js b/public/actions/org.js
deleted file mode 100644
index 95091ae..0000000
--- a/public/actions/org.js
+++ /dev/null
@@ -1,17 +0,0 @@
-import { REQUEST_ORG, RECEIVE_ORG, REQUEST_ORG_UPDATE, CONFIRM_ORG_UPDATE } from '../constants/ActionTypes';
-
-export function fetchOrg () {
- return { type : REQUEST_ORG };
-}
-
-export function receivedOrg (org) {
- return { type : RECEIVE_ORG, org : org };
-}
-
-export function updateOrg (update) {
- return { type : REQUEST_ORG_UPDATE, update : update };
-}
-
-export function confirmOrgUpdate (success) {
- return { type : CONFIRM_ORG_UPDATE, saved : success };
-}
diff --git a/public/actions/user.js b/public/actions/user.js
deleted file mode 100644
index 8bb69a3..0000000
--- a/public/actions/user.js
+++ /dev/null
@@ -1,17 +0,0 @@
-import { REQUEST_USER, RECEIVE_USER, REQUEST_USER_UPDATE, CONFIRM_USER_UPDATE } from '../constants/ActionTypes';
-
-export function fetchUser () {
- return { type : REQUEST_USER };
-}
-
-export function receivedUser (user) {
- return { type : RECEIVE_USER, user : user };
-}
-
-export function updateUser (update) {
- return { type : REQUEST_USER_UPDATE, update : update };
-}
-
-export function confirmUserUpdate (success) {
- return { type : CONFIRM_USER_UPDATE, saved : success };
-}
diff --git a/public/components/AppCard.jsx b/public/components/AppCard.jsx
new file mode 100644
index 0000000..3a167b8
--- /dev/null
+++ b/public/components/AppCard.jsx
@@ -0,0 +1,37 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+import React, { Component, PropTypes } from 'react';
+import { Link } from 'react-router';
+
+class AppCard extends Component {
+ render() {
+ const { app } = this.props;
+
+ return (
+ <div className='ui segment'>
+ <div className='ui tiny header'>
+ {app.name}
+ </div>
+ </div>
+ );
+ }
+}
+
+AppCard.propTypes = {
+ app: PropTypes.object.isRequired,
+};
+
+export default AppCard;
diff --git a/public/components/AppProfile.js b/public/components/AppProfile.js
deleted file mode 100644
index 1615194..0000000
--- a/public/components/AppProfile.js
+++ /dev/null
@@ -1,40 +0,0 @@
-import React, { Component, PropTypes } from 'react';
-import { Link } from 'react-router';
-
-import Profile from './Profile';
-
-class AppProfile extends Component {
- render () {
- const { id, name, users } = this.props;
-
- return (
- <div className='ui text container'>
- <div className='ui vertical basic page segment'>
- <div className='ui large header'>
- {name}
- </div>
- <Link to={`/app/${id}/settings`}>
- <div className='ui brown button'>
- Settings
- </div>
- </Link>
- <Link to={`/app/${id}/results`}>
- <div className='ui brown button'>
- Results
- </div>
- </Link>
- </div>
-
- <Profile feed={['a', 1, 'c']} firstSide={users} firstType={'user'} />
- </div>
- );
- }
-}
-
-AppProfile.propTypes = {
- id : PropTypes.number,
- name : PropTypes.string,
- users : PropTypes.array,
-};
-
-export default AppProfile;
diff --git a/public/components/AppProfile.jsx b/public/components/AppProfile.jsx
index 1615194..bbcff77 100644
--- a/public/components/AppProfile.jsx
+++ b/public/components/AppProfile.jsx
@@ -1,3 +1,18 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
import React, { Component, PropTypes } from 'react';
import { Link } from 'react-router';
diff --git a/public/components/AppResults.jsx b/public/components/AppResults.jsx
index 6e56475..3b0a9af 100644
--- a/public/components/AppResults.jsx
+++ b/public/components/AppResults.jsx
@@ -1,3 +1,18 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
import React, { Component, PropTypes } from 'react';
import Counts from './visualizations/Counts';
@@ -68,10 +83,12 @@
}
render() {
+ const { name, results } = this.props.app;
+
return(
<div className='ui container'>
<div className='ui large header'>
- Log Analysis for {this.props.name}
+ Log Analysis for {name}
</div>
<div className='ui padded grid'>
@@ -257,19 +274,19 @@
case 'graph':
return (
<div>
- <GraphMetrics metric={this.state.metric} element='graph-metrics-viz' data={this.props.results.graph} />
+ <GraphMetrics metric={this.state.metric} element='graph-metrics-viz' data={results.graph} />
{this.state.graphAb ?
<GraphMetrics
metric='betweenness_cent_dir_weighted'
element='graph-metrics-viz-b'
- data={this.props.results.graph}
+ data={results.graph}
/> : null
}
</div>
);
case 'counts':
default:
- return <Counts filters={this.state} data={this.props.results.counts} />;
+ return <Counts filters={this.state} data={results.counts} />;
}
})()}
@@ -282,8 +299,7 @@
}
AppResults.propTypes = {
- name : PropTypes.string,
- results : PropTypes.object,
+ app : PropTypes.object,
};
export default AppResults;
diff --git a/public/components/AppSettings.jsx b/public/components/AppSettings.jsx
index 6eb4432..472b699 100644
--- a/public/components/AppSettings.jsx
+++ b/public/components/AppSettings.jsx
@@ -1,3 +1,18 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
import React, { Component, PropTypes } from 'react';
import Settings from './Settings';
diff --git a/public/components/Feed.jsx b/public/components/Feed.jsx
index f7b15f5..d107eab 100644
--- a/public/components/Feed.jsx
+++ b/public/components/Feed.jsx
@@ -1,3 +1,18 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
import React, { Component, PropTypes } from 'react';
class Feed extends Component {
diff --git a/public/components/Home.jsx b/public/components/Home.jsx
index be8a2c6..08f6a34 100644
--- a/public/components/Home.jsx
+++ b/public/components/Home.jsx
@@ -1,3 +1,18 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
import React, { Component } from 'react';
export default class Home extends Component {
diff --git a/public/components/OrgProfile.jsx b/public/components/OrgProfile.jsx
index 331cb9f..bd33d56 100644
--- a/public/components/OrgProfile.jsx
+++ b/public/components/OrgProfile.jsx
@@ -1,3 +1,18 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
import React, { Component, PropTypes } from 'react';
import { Link } from 'react-router';
diff --git a/public/components/OrgSettings.jsx b/public/components/OrgSettings.jsx
index e5c2b51..86c7d84 100644
--- a/public/components/OrgSettings.jsx
+++ b/public/components/OrgSettings.jsx
@@ -1,3 +1,18 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
import React, { Component, PropTypes } from 'react';
import Settings from './Settings';
diff --git a/public/components/Profile.js b/public/components/Profile.js
deleted file mode 100644
index 528166a..0000000
--- a/public/components/Profile.js
+++ /dev/null
@@ -1,39 +0,0 @@
-import React, { Component, PropTypes } from 'react';
-
-import Feed from './Feed';
-import Sidebox from './Sidebox';
-
-class Profile extends Component {
- render() {
- const { feed, firstSide, secondSide, firstType, secondType } = this.props;
-
- return(
- <div className='ui padded grid'>
- <div className='ten wide column'>
- <Feed feed={feed} />
- </div>
-
- <div className='six wide column'>
- <Sidebox type={firstType} content={firstSide} />
- {(() => {
- if (secondSide) {
- return(
- <Sidebox type={secondType} content={secondSide} />
- );
- }
- })()}
- </div>
- </div>
- );
- }
-}
-
-Profile.propTypes = {
- feed : PropTypes.array,
- firstSide : PropTypes.array,
- firstType : PropTypes.string,
- secondSide : PropTypes.array,
- secondType : PropTypes.string,
-};
-
-export default Profile;
diff --git a/public/components/Profile.jsx b/public/components/Profile.jsx
index 528166a..ce9f883 100644
--- a/public/components/Profile.jsx
+++ b/public/components/Profile.jsx
@@ -1,3 +1,18 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
import React, { Component, PropTypes } from 'react';
import Feed from './Feed';
diff --git a/public/components/Settings.js b/public/components/Settings.js
deleted file mode 100644
index 0194d43..0000000
--- a/public/components/Settings.js
+++ /dev/null
@@ -1,53 +0,0 @@
-import React, { Component, PropTypes } from 'react';
-
-class Settings extends Component {
- componentDidMount() {
- let $settingsControls = $('#settings-menu .item');
- $settingsControls.on('click', (e) => {
- $settingsControls.removeClass('active');
- $(e.target).addClass('active');
- });
- }
-
- render() {
- const { settings } = this.props;
-
- return (
- <div className='ui grid'>
- <div className='four wide column'>
- <div id='settings-menu' className='ui vertical fluid tabular menu'>
- <a className='item active'>
- Account
- </a>
- <a className='item'>
- Notifications
- </a>
- <a className='item'>
- Organizations
- </a>
- </div>
- </div>
-
- <div className='twelve wide stretched column'>
- <div className='ui segment'>
- <ul>
- {Object.keys(settings).map((setting, index) => {
- return (
- <li key={index}>
- {setting}, {settings[setting].toString()}
- </li>
- );
- })}
- </ul>
- </div>
- </div>
- </div>
- );
- }
-}
-
-Settings.propTypes = {
- settings : PropTypes.object,
-};
-
-export default Settings;
diff --git a/public/components/Settings.jsx b/public/components/Settings.jsx
index 0194d43..17024e9 100644
--- a/public/components/Settings.jsx
+++ b/public/components/Settings.jsx
@@ -1,3 +1,18 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
import React, { Component, PropTypes } from 'react';
class Settings extends Component {
diff --git a/public/components/Sidebox.jsx b/public/components/Sidebox.jsx
index db4a5ed..db8659a 100644
--- a/public/components/Sidebox.jsx
+++ b/public/components/Sidebox.jsx
@@ -1,3 +1,18 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
import React, { Component, PropTypes } from 'react';
import { Link } from 'react-router';
diff --git a/public/components/UserProfile.js b/public/components/UserProfile.js
deleted file mode 100644
index 384fe03..0000000
--- a/public/components/UserProfile.js
+++ /dev/null
@@ -1,30 +0,0 @@
-import React, { Component, PropTypes } from 'react';
-import { Link } from 'react-router';
-
-import Profile from './Profile';
-
-class UserProfile extends Component {
- render () {
- const { email, orgs, apps } = this.props;
-
- return (
- <div className='ui text container'>
- <div className='ui vertical basic page segment'>
- <div className='ui large header'>
- {`${email}'s Profile`}
- </div>
- </div>
-
- <Profile feed={['a', 1, 'c']} firstSide={orgs} firstType={'org'} secondSide={apps} secondType={'app'} />
- </div>
- );
- }
-}
-
-UserProfile.propTypes = {
- email : PropTypes.string,
- orgs : PropTypes.array,
- apps : PropTypes.array,
-};
-
-export default UserProfile;
diff --git a/public/components/UserProfile.jsx b/public/components/UserProfile.jsx
index 384fe03..1f110d7 100644
--- a/public/components/UserProfile.jsx
+++ b/public/components/UserProfile.jsx
@@ -1,3 +1,18 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
import React, { Component, PropTypes } from 'react';
import { Link } from 'react-router';
diff --git a/public/components/UserSettings.js b/public/components/UserSettings.js
deleted file mode 100644
index 51dface..0000000
--- a/public/components/UserSettings.js
+++ /dev/null
@@ -1,25 +0,0 @@
-import React, { Component, PropTypes } from 'react';
-
-import Settings from './Settings';
-
-class UserSettings extends Component {
- render () {
- const { email, settings } = this.props;
-
- return (
- <div className='ui text container'>
- <div className='ui large header'>
- Settings for {email}
- </div>
- <Settings settings={settings} />
- </div>
- );
- }
-}
-
-UserSettings.propTypes = {
- email : PropTypes.string,
- settings : PropTypes.object,
-};
-
-export default UserSettings;
diff --git a/public/components/UserSettings.jsx b/public/components/UserSettings.jsx
index 51dface..715656b 100644
--- a/public/components/UserSettings.jsx
+++ b/public/components/UserSettings.jsx
@@ -1,3 +1,18 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
import React, { Component, PropTypes } from 'react';
import Settings from './Settings';
diff --git a/public/components/visualizations/Counts.jsx b/public/components/visualizations/Counts.jsx
index 1540878..c187112 100644
--- a/public/components/visualizations/Counts.jsx
+++ b/public/components/visualizations/Counts.jsx
@@ -1,3 +1,18 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
import React, { Component, PropTypes } from 'react';
import VerticalBar from './VerticalBar';
diff --git a/public/components/visualizations/GraphMetrics.jsx b/public/components/visualizations/GraphMetrics.jsx
index e489313..fcb566f 100644
--- a/public/components/visualizations/GraphMetrics.jsx
+++ b/public/components/visualizations/GraphMetrics.jsx
@@ -1,3 +1,18 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
import React, { Component, PropTypes } from 'react';
import * as d3 from 'd3';
diff --git a/public/components/visualizations/HorizontalBar.jsx b/public/components/visualizations/HorizontalBar.jsx
index d47a186..f362029 100644
--- a/public/components/visualizations/HorizontalBar.jsx
+++ b/public/components/visualizations/HorizontalBar.jsx
@@ -1,3 +1,18 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
import React, { Component, PropTypes } from 'react';
import * as d3 from 'd3';
diff --git a/public/components/visualizations/VerticalBar.jsx b/public/components/visualizations/VerticalBar.jsx
index dc8effd..71613d3 100644
--- a/public/components/visualizations/VerticalBar.jsx
+++ b/public/components/visualizations/VerticalBar.jsx
@@ -1,3 +1,18 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
import React, { Component, PropTypes } from 'react';
import * as d3 from 'd3';
diff --git a/public/constants/ActionTypes.js b/public/constants/ActionTypes.js
deleted file mode 100644
index d7ad8ff..0000000
--- a/public/constants/ActionTypes.js
+++ /dev/null
@@ -1,16 +0,0 @@
-export const LOG_IN = 'LOG_IN';
-export const LOG_OUT = 'LOG_OUT';
-export const REQUEST_USER = 'REQUEST_USER';
-export const RECEIVE_USER = 'RECEIVE_USER';
-export const REQUEST_USER_UPDATE = 'REQUEST_USER_UPDATE';
-export const CONFIRM_USER_UPDATE = 'CONFIRM_USER_UPDATE';
-export const REQUEST_ORG = 'REQUEST_ORG';
-export const RECEIVE_ORG = 'RECEIVE_ORG';
-export const REQUEST_ORG_UPDATE = 'REQUEST_ORG_UPDATE';
-export const CONFIRM_ORG_UPDATE = 'CONFIRM_ORG_UPDATE';
-export const REQUEST_APP = 'REQUEST_APP';
-export const RECEIVE_APP = 'RECEIVE_APP';
-export const REQUEST_APP_UPDATE = 'REQUEST_APP_UPDATE';
-export const CONFIRM_APP_UPDATE = 'CONFIRM_APP_UPDATE';
-export const REQUEST_APP_RESULTS = 'REQUEST_APP_RESULTS';
-export const RECEIVE_APP_RESULTS = 'RECEIVE_APP_RESULTS';
diff --git a/public/containers/App.js b/public/containers/App.js
deleted file mode 100644
index 5110ee0..0000000
--- a/public/containers/App.js
+++ /dev/null
@@ -1,40 +0,0 @@
-import React, { Component, PropTypes } from 'react';
-import { connect } from 'react-redux';
-
-class App extends Component {
- render() {
- const { children, id, name, settings, results, users } = this.props;
-
- return(
- <div>
- {React.cloneElement(children, {
- id,
- name,
- settings,
- results,
- users,
- })}
- </div>
- );
- }
-}
-
-App.propTypes = {
- id : PropTypes.number,
- name : PropTypes.string,
- settings : PropTypes.object,
- results : PropTypes.object,
- users : PropTypes.array,
-};
-
-function mapStateToProps(state, ownProps) {
- return {
- id : state.app.id,
- name : state.app.name,
- settings : state.app.settings,
- results : state.app.results,
- users : state.app.users,
- };
-}
-
-export default connect(mapStateToProps)(App);
diff --git a/public/containers/App.jsx b/public/containers/App.jsx
index 5110ee0..3f69887 100644
--- a/public/containers/App.jsx
+++ b/public/containers/App.jsx
@@ -1,40 +1,66 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.s
+
import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
+import { getAppDetails } from '../actions';
+
class App extends Component {
+ componentDidMount() {
+ this.props.getAppDetails(this.props.params.id);
+ }
+
+ componentDidUpdate(prevProps) {
+ if (this.props.params.id !== prevProps.params.id) {
+ this.props.getAppDetails(this.props.params.id);
+ }
+ }
+
render() {
- const { children, id, name, settings, results, users } = this.props;
+ const { children, params, apps } = this.props;
+
+ const id = params.id;
+ const app = apps[id];
+
+ console.log(id, app);
return(
- <div>
- {React.cloneElement(children, {
- id,
- name,
- settings,
- results,
- users,
- })}
- </div>
+ <div>
+ {React.cloneElement(children, {
+ id,
+ app,
+ })}
+ </div>
);
}
}
App.propTypes = {
- id : PropTypes.number,
- name : PropTypes.string,
- settings : PropTypes.object,
- results : PropTypes.object,
- users : PropTypes.array,
+ children: PropTypes.node.isRequired,
+ params: PropTypes.object.isRequired,
+ apps: PropTypes.object.isRequired,
+ getAppDetails: PropTypes.func.isRequired,
};
-function mapStateToProps(state, ownProps) {
+function mapStateToProps(state) {
return {
- id : state.app.id,
- name : state.app.name,
- settings : state.app.settings,
- results : state.app.results,
- users : state.app.users,
+ apps: state.apps.apps,
};
}
-export default connect(mapStateToProps)(App);
+export default connect(mapStateToProps, {
+ getAppDetails,
+})(App);
diff --git a/public/containers/AppList.jsx b/public/containers/AppList.jsx
new file mode 100644
index 0000000..4f62145
--- /dev/null
+++ b/public/containers/AppList.jsx
@@ -0,0 +1,82 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+import React, { Component, PropTypes } from 'react';
+import { Link } from 'react-router';
+import { connect } from 'react-redux';
+
+import { getAppList } from '../actions';
+import AppCard from '../components/AppCard';
+
+class AppList extends Component {
+ componentDidMount() {
+ this.props.getAppList();
+ }
+
+ render() {
+ const { apps, appIds, isDefault } = this.props;
+
+ const defaultApp = !isDefault ? null : (
+ <div>
+ <div className='ui header'>
+ Example App
+ </div>
+ <div className='ui list'>
+ <div className='item'>
+ <Link to='/app/default'>
+ <AppCard app={apps.default} />
+ </Link>
+ </div>
+ </div>
+ </div>
+ );
+
+ return (
+ <div className='ui container'>
+ {defaultApp}
+ <div className='ui header'>
+ Your Apps
+ </div>
+ <div className='ui list'>
+ {appIds.map((id) => (
+ <div key={id} className='item'>
+ <Link to={`/app/${id}`}>
+ <AppCard app={apps[id]} />
+ </Link>
+ </div>
+ ))}
+ </div>
+ </div>
+ );
+ }
+}
+
+AppList.propTypes = {
+ apps: PropTypes.object.isRequired,
+ appIds: PropTypes.array.isRequired,
+ isDefault: PropTypes.bool.isRequired,
+};
+
+function mapStateToProps(state) {
+ return {
+ apps: state.apps.apps,
+ appIds: state.apps.appIds,
+ isDefault: state.apps.apps.hasOwnProperty('default'),
+ };
+}
+
+export default connect(mapStateToProps, {
+ getAppList
+})(AppList);
diff --git a/public/containers/Login.jsx b/public/containers/Login.jsx
new file mode 100644
index 0000000..0839b0d
--- /dev/null
+++ b/public/containers/Login.jsx
@@ -0,0 +1,70 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+import React, { Component, PropTypes } from 'react';
+import { Link } from 'react-router';
+import { connect } from 'react-redux';
+
+import { login } from '../actions';
+
+class Login extends Component {
+ constructor(props) {
+ super(props);
+ this.handleLogin = this.handleLogin.bind(this);
+ }
+
+ handleLogin() {
+ const email = $('input[name=email]').val();
+ const password = $('input[name=password]').val();
+ this.props.login(email, password);
+ }
+
+ render() {
+ return (
+ <div className='ui text container'>
+ <div className='ui form'>
+ <div className='field'>
+ <input type='text' name='email' placeholder="Email" />
+ </div>
+ <div className='field'>
+ <input type='password' name='password' placeholder="Password" />
+ </div>
+ <button className='ui brown button' onClick={this.handleLogin}>
+ Log In
+ </button>
+ <Link to='/signup'>
+ <button className='ui right floated brown button'>
+ Sign Up
+ </button>
+ </Link>
+ </div>
+ </div>
+ );
+ }
+}
+
+Login.propTypes = {
+ login: PropTypes.func.isRequired,
+};
+
+function mapStateToProps(state) {
+ return {
+
+ };
+}
+
+export default connect(mapStateToProps, {
+ login
+})(Login);
diff --git a/public/containers/Main.jsx b/public/containers/Main.jsx
index e03ecca..22daa70 100644
--- a/public/containers/Main.jsx
+++ b/public/containers/Main.jsx
@@ -1,25 +1,59 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
import React, { Component, PropTypes } from 'react';
import { Link } from 'react-router';
import { connect } from 'react-redux';
-import { logIn, logOut } from '../actions';
+import { login, logout } from '../actions';
class Main extends Component {
- constructor(props) {
- super(props);
- this.handleLogin = this.handleLogin.bind(this);
- this.handleLogout = this.handleLogout.bind(this);
- }
- handleLogin () {
- this.props.logIn();
- }
+ buildAuthHeader() {
+ const { email, logout } = this.props;
- handleLogout () {
- this.props.logOut();
+ if (email) {
+ return (
+ <div className='right menu'>
+ <div className='item'>
+ <Link to='/apps'>
+ {email}
+ </Link>
+ </div>
+ <div className='item' onClick={logout}>
+ Logout
+ </div>
+ </div>
+ );
+ } else {
+ return (
+ <div className='right menu'>
+ <div className='item'>
+ <Link to='/login'>
+ Login
+ </Link>
+ </div>
+ </div>
+ );
+ }
}
render () {
- const { children, isLoggedIn, username } = this.props;
+ const { children } = this.props;
+
+ const authHeader = this.buildAuthHeader();
+
return (
<div id='main-container'>
<div className='site-header'>
@@ -30,23 +64,7 @@
<h3 className='ui inverted header item'>Tap</h3>
</Link>
- <div className='right menu'>
- {
- // <div className='item' onClick={isLoggedIn ? this.handleLogout : this.handleLogin }>
- // {isLoggedIn ? 'Log Out' : 'Log In'}
- // </div>
- }
- <div className='item'>
- <Link to='/user'>
- Profile
- </Link>
- </div>
- <div className='item'>
- <Link to='/user/settings'>
- Settings
- </Link>
- </div>
- </div>
+ {authHeader}
</div>
</div>
@@ -60,7 +78,7 @@
<div className='ui container'>
<div className='ui footer page brown inverted segment'>
<div className='ui center aligned container'>
- <div className='footer-text'>Copyright Tap 2016</div>
+ <div className='footer-text'>Copyright Apache SensSoft 2016</div>
</div>
</div>
</div>
@@ -71,19 +89,17 @@
}
Main.propTypes = {
- children : PropTypes.node,
- isLoggedIn : PropTypes.bool.isRequired,
- username : PropTypes.string,
+ children: PropTypes.node,
+ email: PropTypes.string,
+ logout: PropTypes.func.isRequired,
};
-function mapStateToProps(state, ownProps) {
+function mapStateToProps(state) {
return {
- isLoggedIn : state.auth.isLoggedIn,
- email : state.auth.isLoggedIn ? state.user.email : null,
+ email: state.user.email,
};
}
export default connect(mapStateToProps, {
- logIn,
- logOut,
+ logout,
})(Main);
diff --git a/public/containers/Org.jsx b/public/containers/Org.jsx
index 7c90080..0afa0d4 100644
--- a/public/containers/Org.jsx
+++ b/public/containers/Org.jsx
@@ -1,3 +1,18 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
diff --git a/public/containers/SignUp.jsx b/public/containers/SignUp.jsx
new file mode 100644
index 0000000..6002576
--- /dev/null
+++ b/public/containers/SignUp.jsx
@@ -0,0 +1,70 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+import React, { Component, PropTypes } from 'react';
+import { Link } from 'react-router';
+import { connect } from 'react-redux';
+
+import { signup } from '../actions';
+
+class Signup extends Component {
+ constructor(props) {
+ super(props);
+ this.handleSignup = this.handleSignup.bind(this);
+ }
+
+ handleSignup() {
+ const email = $('input[name=email]').val();
+ const password = $('input[name=password]').val();
+ this.props.signup(email, password);
+ }
+
+ render() {
+ return (
+ <div className='ui text container'>
+ <div className='ui form'>
+ <div className='field'>
+ <input type='text' name='email' placeholder="Email" />
+ </div>
+ <div className='field'>
+ <input type='password' name='password' placeholder="Password" />
+ </div>
+ <button className='ui brown button' onClick={this.handleSignup}>
+ Sign Up
+ </button>
+ <Link to='/login'>
+ <button className='ui right floated brown button'>
+ Log In
+ </button>
+ </Link>
+ </div>
+ </div>
+ );
+ }
+}
+
+Signup.propTypes = {
+ signup: PropTypes.func.isRequired,
+};
+
+function mapStateToProps(state) {
+ return {
+
+ };
+}
+
+export default connect(mapStateToProps, {
+ signup
+})(Signup);
diff --git a/public/containers/User.jsx b/public/containers/User.jsx
index 76bb291..bc01552 100644
--- a/public/containers/User.jsx
+++ b/public/containers/User.jsx
@@ -1,3 +1,18 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
diff --git a/public/index.jsx b/public/index.jsx
index 0a94470..2682265 100644
--- a/public/index.jsx
+++ b/public/index.jsx
@@ -1,3 +1,18 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
import React from 'react';
import { render } from 'react-dom';
import { Router, Route, IndexRoute, Link, browserHistory } from 'react-router';
@@ -7,19 +22,20 @@
import Main from './containers/Main';
import Home from './components/Home';
-// import Login from './containers/Login';
+import Login from './containers/Login';
// import Logout from './containers/Logout';
-// import SignUp from './containers/SignUp';
-import User from './containers/User';
-import UserProfile from './components/UserProfile';
-import UserSettings from './components/UserSettings';
-import Org from './containers/Org';
-import OrgProfile from './components/OrgProfile';
-import OrgSettings from './components/OrgSettings';
+import SignUp from './containers/SignUp';
+// import User from './containers/User';
+// import UserProfile from './components/UserProfile';
+// import UserSettings from './components/UserSettings';
+// import Org from './containers/Org';
+// import OrgProfile from './components/OrgProfile';
+// import OrgSettings from './components/OrgSettings';
// import OrgNew from './containers/OrgNew';
import App from './containers/App';
-import AppProfile from './components/AppProfile';
-import AppSettings from './components/AppSettings';
+import AppList from './containers/AppList';
+// import AppProfile from './components/AppProfile';
+// import AppSettings from './components/AppSettings';
import AppResults from './components/AppResults';
// import AppNew from './containers/AppNew';
@@ -31,29 +47,29 @@
<Route path='/' component={Main}>
<IndexRoute component={Home} />
+ <Route path='login' component={Login} />
+ <Route path='signup' component={SignUp} />
+
+ <Route path='apps' component={AppList} />
+
+ <Route path='app' component={App}>
+ <Route path=':id' component={AppResults} />
+ {
+ // <IndexRoute component={AppProfile} />
+ // <Route path='settings' component={AppSettings} />
+ // <Route path='results' component={AppResults} />
+ }
+ </Route>
+
{
- // <Route path='login' component={Login} />
// <Route path='logout' component={Logout} />
- // <Route path='signup' component={SignUp} />
- }
- <Route path='user' component={User}>
- <IndexRoute component={UserProfile} />
- <Route path='settings' component={UserSettings} />
- </Route>
+ // <Route path='org/:id' component={Org}>
+ // <IndexRoute component={OrgProfile} />
+ // <Route path='settings' component={OrgSettings} />
+ // </Route>
- <Route path='org/:id' component={Org}>
- <IndexRoute component={OrgProfile} />
- <Route path='settings' component={OrgSettings} />
- </Route>
- <Route path='app/:id' component={App}>
- <IndexRoute component={AppProfile} />
- <Route path='settings' component={AppSettings} />
- <Route path='results' component={AppResults} />
- </Route>
-
- {
// <Route path='org/new' component={OrgNew} />
// <Route path='app/new' component={AppNew} />
}
diff --git a/public/reducers/app.js b/public/reducers/app.js
deleted file mode 100644
index 852345a..0000000
--- a/public/reducers/app.js
+++ /dev/null
@@ -1,99 +0,0 @@
-import { REQUEST_APP, RECEIVE_APP, REQUEST_APP_UPDATE, CONFIRM_APP_UPDATE, REQUEST_APP_RESULTS, RECEIVE_APP_RESULTS } from '../constants/ActionTypes';
-import merge from 'lodash/merge';
-
-import graphData from '../neon_graph.js';
-import countsData from '../neon_counts.js';
-
-const initialAppState = {
- id : 7,
- name : 'Ale',
- settings : {
- setting1 : 'a setting',
- },
- users : [
- {
- id : 1,
- email : 'test@test.com'
- },
- {
- id : 2,
- email : 'test2@test.com'
- },
- ],
- results : {
- counts : countsData,
- // counts : [
- // {
- // group : 'map',
- // activities : [
- // {
- // id : 'zoom',
- // count : 100,
- // },
- // {
- // id : 'pan',
- // count : 27,
- // },
- // {
- // id : 'resize',
- // count : 74,
- // },
- // ]
- // },
- // {
- // group : 'linechart',
- // activities : [
- // {
- // id : 'tooltip',
- // count : 51,
- // },
- // {
- // id : 'select',
- // count : 88,
- // },
- // {
- // id : 'resize',
- // count : 12,
- // },
- // ]
- // },
- // {
- // group : 'table',
- // activities : [
- // {
- // id : 'reorder',
- // count : 11,
- // },
- // {
- // id : 'resize',
- // count : 16,
- // },
- // {
- // id : 'filter',
- // count : 67,
- // },
- // ]
- // },
- // ],
- graph : graphData,
- },
-};
-
-export default function app (state = initialAppState, action) {
- switch (action.type) {
- case REQUEST_APP:
- return merge({}, state, {});
- case RECEIVE_APP:
- return merge({}, state, action.app);
- case REQUEST_APP_UPDATE:
- return merge({}, state, action.update);
- case CONFIRM_APP_UPDATE:
- return merge({}, state, action.saved);
- case REQUEST_APP_RESULTS:
- return merge({}, state, {});
- case RECEIVE_APP_RESULTS:
- return merge({}, state, action.results);
- default:
- return state;
- }
-}
diff --git a/public/reducers/apps.js b/public/reducers/apps.js
new file mode 100644
index 0000000..a00525e
--- /dev/null
+++ b/public/reducers/apps.js
@@ -0,0 +1,96 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+import * as ActionTypes from '../actions/ActionTypes';
+
+// If default/example app data is provided, fill in file paths here:
+const defaultAvailable = true;
+const defaultApp = defaultAvailable ? {
+ name: 'Neon',
+ id: 'default',
+ results: {
+ counts: require('../neon_counts.js').default,
+ graph: require('../neon_graph.js').default,
+ },
+} : {};
+
+
+export default function apps (state = {
+ appIds: [],
+ apps: {
+ default: defaultApp,
+ },
+ listPending: false,
+ listSuccess: false,
+ listError: false,
+ detailsPending: false,
+ detailsSuccess: false,
+ detailsError: false,
+}, action) {
+ switch (action.type) {
+ case ActionTypes.APP_LIST_REQUEST:
+ return Object.assign({}, state, {
+ listPending: true,
+ listSuccess: false,
+ });
+ case ActionTypes.APP_LIST_SUCCESS: {
+ const normalizedApps = {};
+ action.response.forEach((a) => {
+ normalizedApps[a.id] = a;
+ });
+
+ return Object.assign({}, state, {
+ apps: Object.assign({}, state.apps, normalizedApps),
+ listPending: false,
+ listSuccess: true,
+ listError: false,
+ });
+ }
+ case ActionTypes.APP_LIST_FAILURE:
+ return Object.assign({}, state, {
+ listPending: false,
+ listSuccess: false,
+ listError: true,
+ });
+ case ActionTypes.APP_DETAILS_REQUEST:
+ return Object.assign({}, state, {
+ detailsPending: true,
+ detailsSuccess: false,
+ });
+ case ActionTypes.APP_DETAILS_SUCCESS: {
+ return Object.assign({}, state, {
+ apps: Object.assign({}, state.apps, {
+ [action.appId]: Object.assign({}, state.apps[action.appId], {
+ results: {
+ counts: [],
+ graph: action.response,
+ },
+ }),
+ }),
+ detailsPending: false,
+ detailsSuccess: true,
+ detailsError: false,
+ });
+ }
+ case ActionTypes.APP_DETAILS_FAILURE:
+ return Object.assign({}, state, {
+ detailsPending: false,
+ detailsSuccess: false,
+ detailsError: true,
+ });
+ default:
+ return state;
+ }
+}
diff --git a/public/reducers/auth.js b/public/reducers/auth.js
deleted file mode 100644
index 935323d..0000000
--- a/public/reducers/auth.js
+++ /dev/null
@@ -1,17 +0,0 @@
-import { LOG_IN, LOG_OUT } from '../constants/ActionTypes';
-import merge from 'lodash/merge';
-
-const initialAuthState = {
- isLoggedIn : false,
-};
-
-export default function auth (state = initialAuthState, action) {
- switch (action.type) {
- case LOG_IN:
- return merge({}, state, { isLoggedIn : true });
- case LOG_OUT:
- return merge({}, state, { isLoggedIn : false });
- default:
- return state;
- }
-}
diff --git a/public/reducers/index.js b/public/reducers/index.js
index 873c783..79aaa78 100644
--- a/public/reducers/index.js
+++ b/public/reducers/index.js
@@ -1,15 +1,28 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
import { combineReducers } from 'redux';
-import auth from './auth';
import user from './user';
-import org from './org';
-import app from './app';
+// import org from './org';
+import apps from './apps';
const rootReducer = combineReducers({
- auth,
user,
- org,
- app
+ // org,
+ apps
});
export default rootReducer;
diff --git a/public/reducers/org.js b/public/reducers/org.js
index 320699d..7fbd8c2 100644
--- a/public/reducers/org.js
+++ b/public/reducers/org.js
@@ -1,3 +1,18 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
import { REQUEST_ORG, RECEIVE_ORG, REQUEST_ORG_UPDATE, CONFIRM_ORG_UPDATE } from '../constants/ActionTypes';
import merge from 'lodash/merge';
diff --git a/public/reducers/user.js b/public/reducers/user.js
index 3900d2f..1f6e293 100644
--- a/public/reducers/user.js
+++ b/public/reducers/user.js
@@ -1,45 +1,70 @@
-import { REQUEST_USER, RECEIVE_USER, REQUEST_USER_UPDATE, CONFIRM_USER_UPDATE } from '../constants/ActionTypes';
-import merge from 'lodash/merge';
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
-const initialUserState = {
- email : 'test@test.com',
- settings : {
- setting1 : true,
- setting2 : 'hello',
- setting3 : 4,
- },
- orgs : [
- {
- id : 3,
- name : 'Tap',
- },
- {
- id : 2,
- name : 'Distill (fake)',
- }
- ],
- apps : [
- {
- id : 7,
- name : 'Ale',
- },
- {
- id : 1,
- name : 'Stout (fake)',
- },
- ]
-};
+import * as ActionTypes from '../actions/ActionTypes';
-export default function user (state = initialUserState, action) {
+export default function user (state = {
+ email: '',
+ loginPending: false,
+ loginSuccess: false,
+ loginError: false,
+ signupPending: false,
+ signupSuccess: false,
+ signupError: false,
+}, action) {
switch (action.type) {
- case REQUEST_USER:
- return merge({}, state, {});
- case RECEIVE_USER:
- return merge({}, state, action.user);
- case REQUEST_USER_UPDATE:
- return merge({}, state, action.update);
- case CONFIRM_USER_UPDATE:
- return merge({}, state, action.saved);
+ case ActionTypes.LOGIN_REQUEST:
+ return Object.assign({}, state, {
+ loginPending: true,
+ loginSuccess: false,
+ });
+ case ActionTypes.LOGIN_SUCCESS:
+ return Object.assign({}, state, {
+ email: action.email,
+ loginPending: false,
+ loginSuccess: true,
+ loginError: false,
+ });
+ case ActionTypes.LOGIN_FAILURE:
+ return Object.assign({}, state, {
+ loginPending: false,
+ loginSuccess: false,
+ loginError: true,
+ });
+ case ActionTypes.LOGOUT:
+ return Object.assign({}, state, {
+ username: '',
+ loginSuccess: false,
+ });
+ case ActionTypes.SIGNUP_REQUEST:
+ return Object.assign({}, state, {
+ signupPending: true,
+ signupSuccess: false,
+ });
+ case ActionTypes.SIGNUP_SUCCESS:
+ return Object.assign({}, state, {
+ signupPending: false,
+ signupSuccess: true,
+ signupError: false,
+ });
+ case ActionTypes.SIGNUP_FAILURE:
+ return Object.assign({}, state, {
+ signupPending: false,
+ signupSuccess: false,
+ signupError: true,
+ });
default:
return state;
}
diff --git a/public/store/api.js b/public/store/api.js
new file mode 100644
index 0000000..2ca8a89
--- /dev/null
+++ b/public/store/api.js
@@ -0,0 +1,95 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+import fetch from 'isomorphic-fetch';
+import { browserHistory } from 'react-router';
+
+const API_ROOT = '';
+
+export const CALL_API = Symbol('CALL_API');
+
+function callApi(apiOpts) {
+ const url = API_ROOT + apiOpts.endpoint;
+ const method = apiOpts.method || 'GET';
+
+ const headers = {};
+ const opts = {
+ method,
+ };
+
+ if (apiOpts.body) {
+ headers['Content-type'] = 'application/x-www-form-urlencoded';
+ opts.body = apiOpts.body;
+ }
+
+ const authToken = localStorage.getItem('tapToken');
+ if (authToken) {
+ headers['Authorization'] = `Token ${authToken}`;
+ }
+
+ opts.headers = new Headers(headers);
+
+ return fetch(url, opts)
+ .then(response =>
+ response.json().then(json => ({ json, response }))
+ ).then(({ json, response }) => {
+ if (!response.ok) {
+ return Promise.reject(json);
+ }
+ return json;
+ });
+}
+
+export default store => next => action => {
+ const opts = action[CALL_API];
+
+ if (typeof opts === 'undefined') {
+ return next(action);
+ }
+
+ function actionWith(data) {
+ const finalAction = Object.assign({}, action, data);
+ delete finalAction[CALL_API];
+ return finalAction;
+ }
+
+ const { types, successRedirect } = opts;
+ const [requestType, successType, failureType] = types;
+ next(actionWith({ type: requestType }));
+
+ return callApi(opts)
+ .then(
+ response => {
+ next(actionWith({
+ type: successType,
+ response,
+ }));
+
+ if (response.token) {
+ localStorage.setItem('tapToken', response.token);
+ }
+
+ if (opts.successRedirect) {
+ browserHistory.push(opts.successRedirect);
+ }
+ },
+ error => {
+ next(actionWith({
+ type: failureType,
+ error,
+ }));
+ }
+ );
+}
diff --git a/public/store/configureStore.js b/public/store/configureStore.js
index 4a3baa5..905949d 100644
--- a/public/store/configureStore.js
+++ b/public/store/configureStore.js
@@ -1,14 +1,29 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
import { createStore, applyMiddleware } from 'redux';
-import thunk from 'redux-thunk';
import logger from 'redux-logger';
+import api from './api';
import rootReducer from '../reducers';
export default function configureStore (preloadedState) {
const store = createStore(
rootReducer,
preloadedState,
- applyMiddleware(thunk, logger())
+ applyMiddleware(api, logger())
);
return store;
diff --git a/stylesheets/main.scss b/stylesheets/main.scss
index 9381e44..b482ee9 100644
--- a/stylesheets/main.scss
+++ b/stylesheets/main.scss
@@ -1,3 +1,18 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
$brown: #A76B00;
$black: #271900;
$background: #FFF5E3;
diff --git a/tap/settings.py b/tap/settings.py
index 8f66901..5c7a213 100644
--- a/tap/settings.py
+++ b/tap/settings.py
@@ -133,3 +133,7 @@
STATICFILES_DIRS = (
os.path.join(BASE_DIR, "static"),
)
+
+# SensSoft Distill URL connection
+# used in app_mgr/distillviews.py
+DISTILL_URL = "localhost:8090"
diff --git a/tasks/build.js b/tasks/build.js
index 5d15922..6de9925 100644
--- a/tasks/build.js
+++ b/tasks/build.js
@@ -1,3 +1,18 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
import gulp from 'gulp';
import gulpLoadPlugins from 'gulp-load-plugins';
diff --git a/tasks/django.js b/tasks/django.js
index 9ef2523..4a7f635 100644
--- a/tasks/django.js
+++ b/tasks/django.js
@@ -1,3 +1,18 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
import gulp from 'gulp';
import { exec } from 'child_process';
diff --git a/tasks/filesystem.js b/tasks/filesystem.js
index 03ee130..fff0551 100644
--- a/tasks/filesystem.js
+++ b/tasks/filesystem.js
@@ -1,3 +1,18 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
import gulp from 'gulp';
import del from 'del';
// import fs from 'fs-extra';
diff --git a/tasks/styles.js b/tasks/styles.js
index bbf432b..083d272 100644
--- a/tasks/styles.js
+++ b/tasks/styles.js
@@ -1,3 +1,18 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
import gulp from 'gulp';
import runSequence from 'run-sequence';
import gulpLoadPlugins from 'gulp-load-plugins';
diff --git a/tasks/test.js b/tasks/test.js
index 11472e5..3874ae6 100644
--- a/tasks/test.js
+++ b/tasks/test.js
@@ -1,3 +1,18 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
import gulp from 'gulp';
import runSequence from 'run-sequence';
import gulpLoadPlugins from 'gulp-load-plugins';
diff --git a/templates/main.html b/templates/main.html
index fc706b4..a3b64eb 100644
--- a/templates/main.html
+++ b/templates/main.html
@@ -1,3 +1,20 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
<!DOCTYPE html>
<html lang="en">
<head>