diff --git a/.buildpacks b/.buildpacks
index 9fb12425..96d0a9dd 100644
--- a/.buildpacks
+++ b/.buildpacks
@@ -1,2 +1 @@
https://github.com/heroku/heroku-buildpack-nodejs.git
-https://github.com/heroku/heroku-buildpack-ruby.git
diff --git a/.codeclimate.yml b/.codeclimate.yml
index a187069d..4aeeffb8 100644
--- a/.codeclimate.yml
+++ b/.codeclimate.yml
@@ -1,16 +1,10 @@
---
engines:
- brakeman:
- enabled: true
- bundler-audit:
- enabled: true
duplication:
enabled: true
config:
languages:
count_threshold: 3 # rule of three
- ruby:
- mass_threshold: 36 # default: 18
javascript:
mass_threshold: 80 # default: 40
eslint:
@@ -18,21 +12,11 @@ engines:
channel: "eslint-3"
fixme:
enabled: true
- rubocop:
- enabled: true
- exclude_fingerprints:
- - 74f18007b920e8d81148d2f6a2756534
ratings:
paths:
- - 'Gemfile.lock'
- - '**.erb'
- - '**.rb'
- '**.js'
- '**.jsx'
exclude_paths:
-- app/assets/images/
-- app/assets/javascripts/lib/
-- frontend/src/patched/
-- db/
-- script/
-- spec/
+- public/images
+- public/lib
+- src/patched/
diff --git a/.nvmrc b/.nvmrc
index ca063943..e3f76f34 100644
--- a/.nvmrc
+++ b/.nvmrc
@@ -1 +1 @@
-6.2.2
+8.9.4
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 00000000..8ccb5030
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,4 @@
+language: node_js
+addons:
+ code_climate:
+ repo_token: 479d3bf56798fbc7fff3fc8151a5ed09e8ac368fd5af332c437b9e07dbebb44e
\ No newline at end of file
diff --git a/README.md b/README.md
index 27235033..4b9ae84f 100644
--- a/README.md
+++ b/README.md
@@ -1,25 +1,28 @@
-Make sure you have `nodemon` and `node-sass` installed
-`$ npm install -g nodemon node-sass`
+Make sure you're running a good up to date LTS version of `node`, like 8.9.4
+Make sure you have `node-sass` installed
+`$ npm install -g node-sass`
-Run the following at the same time, in two terminals
-
+Run the following at the same time, in TWO SEPARATE terminals. We tell the server where the backend process is running with the API environment variable
+JS files, and CSS will rebuild automatically, just refresh the page
+If coding the server itself, you will have to use nodemon, or kill and restart the server process manually
```
-$ API=http://localhost:3001 nodemon server.js
+$ API=http://localhost:3001 node server.js
$ node-sass -w sass/application.scss public/css/application.css
```
-To run the server as a daemon that will be re-run if it crashes, you can
-use the forever node package.
+To make sure the css files get built, use the following in another terminal
```
-$ npm install -g forever
-$ forever start server.js
+touch sass/application.scss
```
-Run the metamaps api in another terminal using
+Run the metamaps api in another terminal using (on port 3001, so the UI can talk to it)
+For now, make sure you are running on the `add-user-route` branch of Metamaps, and that it's up to date with the latest on that branch
`$ rails s -p 3001`
+open up http://localhost:3000 and start coding!
+
Checklist
- [x] Get the Import lightbox working, and not conflicting on screen
- [x] Handling CSRF
@@ -27,32 +30,52 @@ Checklist
- [x] Figure out how authentication of requests from the frontend to the API works
- [x] Figure out how to combine the nodejs realtime server into server.js
- [x] Notifications: make sure loading states are working for popup and page
+- [x] Request unreadNotificationCount
+- [x] Request invite code
+- [x] Request user object itself
+- [x] Load the metacodes
+- [x] move ImportDialog lightbox into main app
+- [x] create topic form
+- [x] Fork map lightbox / component
+
+- [ ] fix other places where metacode sets are used
+- [ ] make newtopic form load metacodes from users selected ones
+- [ ] create synapse form
+- [ ] replace old loader with react loader
+- [ ] ensure exports of maps work
- [ ] Notifications: make sure notifications either look nice, or redirect
- [ ] Notifications: pagination
- [ ] Notifications: Request unreadNotificationCount
- [ ] Notifications: CSS fixes related to 'controller-x' in body classes
- [ ] Make sure loading state for explore maps pages work
- [ ] Get actioncable working
-- [ ] Request invite code
-- [x] Request user object itself
+- [ ] lightboxes
+- [ ] About lightbox
+- [ ] Switch Metacodes lightbox / component
+- [ ] break up index.html into parts
- [ ] Handle CSS metacode colors
- [ ] Fix Request An Invite page
- [ ] Make 'new map' action work
- [ ] Modify the remaining rails templates into JSX templates
- [x] notifications list
- [x] notification page
- - [ ] list metacodes
- - [ ] new metacode
- - [ ] edit metacode
- - [ ] list metacode_sets
- - [ ] new metacode set
- - [ ] edit metacode set
+ - [x] list metacodes
+ - [x] new metacode
+ - [x] edit metacode
+ - [x] list metacode_sets
+ - [x] new metacode set
+ - [x] edit metacode set
- [ ] authorized apps
- [ ] registered apps
- [ ] authorize
- [ ] user passwords
- [ ] Modify the RubyOnRails app to only serve JSON responses, no HTML pages anymore
-- [ ] Modify the RubyOnRails app to include an endpoint that responds with basic data the front end needs to display (such as the invite code for the user, and the current metamaps build) (a bunch of the data found here: https://github.com/metamaps/metamaps/blob/frontendonly/Metamaps.ServerData.js.erb)
- [ ] Modify the frontend to request that data from the API which is necessary at first to load the page
-- [x] Load the metacodes
-- [ ] Load the metacode sets
+ - [x] Load the metacode sets
+
+To run the server as a daemon that will be re-run if it crashes, you can
+use the forever node package.
+```
+$ npm install -g forever
+$ forever start server.js
+```
\ No newline at end of file
diff --git a/apiProxyMiddleware.js b/apiProxyMiddleware.js
index 47c5752a..bd380368 100644
--- a/apiProxyMiddleware.js
+++ b/apiProxyMiddleware.js
@@ -1,7 +1,8 @@
const request = require('request')
function apiProxyMiddleware (req, res, next) {
- if (!(req.xhr || req.originalUrl.indexOf('.json') > -1 || req.method !== 'GET')) {
+ // TODO: tidy this up!
+ if (!(req.xhr || req.headers['content-type'] === 'application/json' || req.originalUrl.indexOf('.json') > -1 || req.method !== 'GET')) {
return next()
}
const method = req.method.toLowerCase()
diff --git a/package.json b/package.json
index 2606b210..5f87ace8 100644
--- a/package.json
+++ b/package.json
@@ -7,9 +7,9 @@
"server": "node server.js",
"build": "webpack",
"build:watch": "webpack --watch",
- "test": "mocha-webpack --webpack-config webpack.test.config.js --require frontend/test_support/dom.js --recursive frontend/test",
- "eslint": "eslint frontend",
- "eslint:fix": "eslint --fix frontend"
+ "test": "mocha-webpack --webpack-config webpack.test.config.js --require test_support/dom.js --recursive test",
+ "eslint": "eslint src",
+ "eslint:fix": "eslint --fix src"
},
"repository": {
"type": "git",
diff --git a/public/index.html b/public/index.html
index a0b79386..f7496952 100644
--- a/public/index.html
+++ b/public/index.html
@@ -11,17 +11,18 @@
+
Metamaps.cc is a free and open source web platform that supports real-time sense-making and distributed collaboration between individuals, communities and organizations.
-
-
Using an intuitive graph-based interface, Metamaps.cc helps map out networks of people, ideas, resources, stories, experiences, conversations and much more. The platform is evolving for a range of applications amidst a growing network of designers, developers, facilitators, practitioners, entrepreneurs, and artists.
-
-
Metamaps.cc is created and maintained by a distributed community of contributors passionate about the evolution of collaboration, alternative forms of value creation and increase of collective intelligence through the lens of the open culture and the peer-to-peer revolution.
The Metamaps platform is currently in an invite-only beta with the express purpose of creating a high value knowledge ecosystem, a diverse community of contributors and a culture of collaboration and curiosity.
-
As a valued beta tester, you have the ability to invite your peers, colleagues and collaborators onto the platform.
-
Below is a personal invite link containing your unique access code, which can be used multiple times.
Your browser doesn't support copying, please copy manually.
`)
- window.setTimeout(() => $('#joinCodesBox .popup').remove(), 1500)
- })
}
}
diff --git a/src/Metamaps/Map/CheatSheet.js b/src/Metamaps/Map/CheatSheet.js
deleted file mode 100644
index 0d968b63..00000000
--- a/src/Metamaps/Map/CheatSheet.js
+++ /dev/null
@@ -1,12 +0,0 @@
-/* global $ */
-
-const CheatSheet = {
- init: function() {
- // tab the cheatsheet
- $('#cheatSheet').tabs()
- $('#quickReference').tabs().addClass('ui-tabs-vertical ui-helper-clearfix')
- $('#quickReference .ui-tabs-nav li').removeClass('ui-corner-top').addClass('ui-corner-left')
- }
-}
-
-export default CheatSheet
diff --git a/src/Metamaps/Map/index.js b/src/Metamaps/Map/index.js
index f337d1d0..7c176c7a 100644
--- a/src/Metamaps/Map/index.js
+++ b/src/Metamaps/Map/index.js
@@ -20,7 +20,6 @@ import ContextMenu from '../Views/ContextMenu'
import TopicCard from '../Views/TopicCard'
import Visualize from '../Visualize'
-import CheatSheet from './CheatSheet'
import InfoBox from './InfoBox'
const Map = {
@@ -45,7 +44,6 @@ const Map = {
InfoBox.init(serverData, function updateThumbnail() {
self.uploadMapScreenshot()
})
- CheatSheet.init(serverData)
$(document).on(Map.events.editedByActiveMapper, self.editedByActiveMapper)
},
setHasLearnedTopicCreation: function(value) {
@@ -130,6 +128,14 @@ const Map = {
DataModel.attachCollectionEvents()
self.requests = data.requests
isLoaded()
+ },
+ error: function(res) {
+ // forbidden
+ if (res.status === 403) {
+ browserHistory.push(`/maps/${id}/request_access`)
+ } else {
+ GlobalUI.notifyUser('There was an error fetching the map')
+ }
}
})
}
@@ -383,5 +389,5 @@ const Map = {
}
}
-export { CheatSheet, InfoBox }
+export { InfoBox }
export default Map
diff --git a/src/Metamaps/index.js b/src/Metamaps/index.js
index 5b0c3b02..0770b30f 100644
--- a/src/Metamaps/index.js
+++ b/src/Metamaps/index.js
@@ -1,5 +1,4 @@
import Active from './Active'
-import Admin from './Admin'
import AutoLayout from './AutoLayout'
import Cable from './Cable'
import Control from './Control'
@@ -15,7 +14,7 @@ import Import from './Import'
import JIT from './JIT'
import Listeners from './Listeners'
import Loading from './Loading'
-import Map, { CheatSheet, InfoBox } from './Map'
+import Map, { InfoBox } from './Map'
import Mapper from './Mapper'
import Mouse from './Mouse'
import Organize from './Organize'
@@ -32,7 +31,6 @@ import Visualize from './Visualize'
const Metamaps = window.Metamaps || {}
Metamaps.Active = Active
-Metamaps.Admin = Admin
Metamaps.AutoLayout = AutoLayout
Metamaps.Cable = Cable
Metamaps.Control = Control
@@ -52,7 +50,6 @@ Metamaps.JIT = JIT
Metamaps.Listeners = Listeners
Metamaps.Loading = Loading
Metamaps.Map = Map
-Metamaps.Map.CheatSheet = CheatSheet
Metamaps.Map.InfoBox = InfoBox
Metamaps.Maps = {}
Metamaps.Mapper = Mapper
@@ -87,9 +84,13 @@ function runInitFunctions(serverData) {
document.addEventListener('DOMContentLoaded', async function() {
Metamaps.ServerData = Metamaps.ServerData || {}
try {
+ // TODO: do these in parallel (Promise.all)
const metacodes = await DataFetcher.getMetacodes()
Metamaps.ServerData.Metacodes = metacodes
+ const metacodeSets = await DataFetcher.getMetacodeSets()
+ Metamaps.ServerData.metacodeSets = metacodeSets
+
const activeMapper = await DataFetcher.getCurrentUser()
if (activeMapper) {
Metamaps.ServerData.ActiveMapper = activeMapper
diff --git a/src/components/LightBoxes/About.js b/src/components/LightBoxes/About.js
new file mode 100644
index 00000000..633fbac2
--- /dev/null
+++ b/src/components/LightBoxes/About.js
@@ -0,0 +1,64 @@
+import React, { Component } from 'react'
+
+class About extends Component {
+ render = () => {
+ return (
+
+
About Metamaps.cc
+
+
+
STATUS:
+
VERSION:
+
BUILD:
+
LAST UPDATE:
+
+
+
PRIVATE BETA
+
+
+
+
+
+
+
Metamaps.cc is a free and open source web platform that supports real-time sense-making and distributed collaboration between individuals, communities and organizations.
+
Using an intuitive graph-based interface, Metamaps.cc helps map out networks of people, ideas, resources, stories, experiences, conversations and much more. The platform is evolving for a range of applications amidst a growing network of designers, developers, facilitators, practitioners, entrepreneurs, and artists.
+
Metamaps.cc is created and maintained by a distributed community of contributors passionate about the evolution of collaboration, alternative forms of value creation and increase of collective intelligence through the lens of the open culture and the peer-to-peer revolution.
The Metamaps platform is currently in an invite-only beta with the express purpose of creating a high value knowledge ecosystem, a diverse community of contributors and a culture of collaboration and curiosity.
+
As a valued beta tester, you have the ability to invite your peers, colleagues and collaborators onto the platform.
+
Below is a personal invite link containing your unique access code, which can be used multiple times.
{request.approved && You already responded to this access request, and allowed access.}
{!request.approved && You already responded to this access request, and declined access. If you changed your mind, you can still grant
them access by going to the map and adding them as a collaborator.}
- }
- {!request.answered &&
+
)
}
}
-export default RequestAccess
-
-/*
-
-*/
\ No newline at end of file
+export default RequestAccess
\ No newline at end of file
diff --git a/src/routes/makeRoutes.js b/src/routes/makeRoutes.js
index 428da21d..4466a950 100644
--- a/src/routes/makeRoutes.js
+++ b/src/routes/makeRoutes.js
@@ -1,10 +1,15 @@
import React from 'react'
-import { Route, IndexRoute } from 'react-router'
-import Admin from './Admin'
+import { Route, IndexRoute, Redirect } from 'react-router'
import App from './App'
import Apps from './Apps'
import Maps from './Maps'
import MapView from './MapView'
+import Metacodes from './Admin/Metacodes'
+import NewMetacode from './Admin/NewMetacode'
+import EditMetacode from './Admin/EditMetacode'
+import MetacodeSets from './Admin/MetacodeSets'
+import NewMetacodeSet from './Admin/NewMetacodeSet'
+import EditMetacodeSet from './Admin/EditMetacodeSet'
import Notifications from './Notifications/Notifications'
import NotificationPage from './Notifications/NotificationPage'
import TopicView from './TopicView'
@@ -36,9 +41,12 @@ export default function makeRoutes (currentUser) {
-
-
-
+ {!currentUser && }
+ {!currentUser && }
+ {!currentUser && }
+ {currentUser && }
+ {currentUser && }
+ {currentUser && }
@@ -50,14 +58,14 @@ export default function makeRoutes (currentUser) {
-
-
-
+
+
+
-
-
-
+
+
+
diff --git a/test/routes/MapView/ImportDialogBox.spec.js b/test/components/LightBoxes/ImportDialogBox.spec.js
similarity index 95%
rename from test/routes/MapView/ImportDialogBox.spec.js
rename to test/components/LightBoxes/ImportDialogBox.spec.js
index 20ac5542..4f5e4e02 100644
--- a/test/routes/MapView/ImportDialogBox.spec.js
+++ b/test/components/LightBoxes/ImportDialogBox.spec.js
@@ -1,6 +1,6 @@
/* global describe, it */
import React from 'react'
-import ImportDialogBox from '../../../src/routes/MapView/ImportDialogBox.js'
+import ImportDialogBox from '../../../src/components/LightBoxes/ImportDialogBox.js'
import Dropzone from 'react-dropzone'
import { expect } from 'chai'
import { shallow } from 'enzyme'
diff --git a/views/js/approve_access_post.js b/views/js/approve_access_post.js
deleted file mode 100644
index 24db9b80..00000000
--- a/views/js/approve_access_post.js
+++ /dev/null
@@ -1 +0,0 @@
-$('.main-text').text($('.requesterName').text() + ' has been shared on the map and notified.')
\ No newline at end of file
diff --git a/views/js/deny_access_post.js b/views/js/deny_access_post.js
deleted file mode 100644
index 64b89256..00000000
--- a/views/js/deny_access_post.js
+++ /dev/null
@@ -1 +0,0 @@
-$('.main-text').text('Fair enough.')
\ No newline at end of file
diff --git a/views/js/mark_read.js b/views/js/mark_read.js
deleted file mode 100644
index fdd11b8a..00000000
--- a/views/js/mark_read.js
+++ /dev/null
@@ -1,7 +0,0 @@
-$('#notification-{ @notification.id } .notification-read-unread > a')
- .text('mark as unread')
- .attr('href', '{ mark_unread_notification_path(@notification.id) }')
-$('#notification-{ @notification.id }')
- .removeClass('unread')
- .addClass('read')
-Metamaps.GlobalUI.Notifications.decrementUnread(Metamaps.GlobalUI.ReactApp.render)
diff --git a/views/js/mark_unread.js b/views/js/mark_unread.js
deleted file mode 100644
index ba128688..00000000
--- a/views/js/mark_unread.js
+++ /dev/null
@@ -1,7 +0,0 @@
-$('#notification-{ @notification.id } .notification-read-unread > a')
- .text('mark as read')
- .attr('href', '{ mark_read_notification_path(@notification.id) }')
-$('#notification-{ @notification.id }')
- .removeClass('read')
- .addClass('unread')
-Metamaps.GlobalUI.Notifications.incrementUnread(Metamaps.GlobalUI.ReactApp.render)
diff --git a/views/layouts/_lightboxes.js b/views/layouts/_lightboxes.js
deleted file mode 100644
index 7c823778..00000000
--- a/views/layouts/_lightboxes.js
+++ /dev/null
@@ -1,113 +0,0 @@
-
-
-
-
-
-
-
-
About Metamaps.cc
-
-
-
STATUS:
-
VERSION:
-
BUILD:
-
LAST UPDATE:
-
-
-
-
PRIVATE BETA
-
{ METAMAPS_VERSION }
-
{ METAMAPS_BUILD }
-
{ METAMAPS_LAST_UPDATED }
-
-
-
-
-
Metamaps.cc is a free and open source web platform that supports real-time sense-making and distributed collaboration between individuals, communities and organizations.
-
-
Using an intuitive graph-based interface, Metamaps.cc helps map out networks of people, ideas, resources, stories, experiences, conversations and much more. The platform is evolving for a range of applications amidst a growing network of designers, developers, facilitators, practitioners, entrepreneurs, and artists.
-
-
Metamaps.cc is created and maintained by a distributed community of contributors passionate about the evolution of collaboration, alternative forms of value creation and increase of collective intelligence through the lens of the open culture and the peer-to-peer revolution.
The Metamaps platform is currently in an invite-only beta with the express purpose of creating a high value knowledge ecosystem, a diverse community of contributors and a culture of collaboration and curiosity.
-
As a valued beta tester, you have the ability to invite your peers, colleagues and collaborators onto the platform.
-
Below is a personal invite link containing your unique access code, which can be used multiple times.