merge develop

This commit is contained in:
Connor Turland 2017-02-11 13:59:08 +00:00
commit b11a4c71d1
5 changed files with 11 additions and 13 deletions

View file

@ -30,6 +30,8 @@ class Mapping < ApplicationRecord
def after_created
if mappable_type == 'Topic'
ActionCable.server.broadcast 'map_' + map.id.to_s, type: 'topicAdded', topic: mappable.filtered, mapping_id: id
meta = { 'x': xloc, 'y': yloc, 'mapping_id': id }
Events::TopicAddedToMap.publish!(mappable, map, user, meta)
elsif mappable_type == 'Synapse'
ActionCable.server.broadcast(
'map_' + map.id.to_s,
@ -39,17 +41,12 @@ class Mapping < ApplicationRecord
topic2: mappable.topic2.filtered,
mapping_id: id
)
Events::SynapseAddedToMap.publish!(mappable, map, user, nil)
end
end
def after_created_async
FollowService.follow(map, user, 'contributed')
if mappable_type == 'Topic'
meta = { 'x': xloc, 'y': yloc, 'mapping_id': id }
Events::TopicAddedToMap.publish!(mappable, map, user, meta)
elsif mappable_type == 'Synapse'
Events::SynapseAddedToMap.publish!(mappable, map, user, nil)
end
end
handle_asynchronously :after_created_async

View file

@ -16,7 +16,7 @@ MAP_INVITE_TO_EDIT = 'INVITE_TO_EDIT'
# these ones are new
# this one's a catch all for occurences on the map
MAP_ACTIVITY = 'MAP_ACTIVITY'
# MAP_ACTIVITY = 'MAP_ACTIVITY'
# MAP_RECEIVED_TOPIC
# MAP_LOST_TOPIC
# MAP_TOPIC_MOVED

View file

@ -2,9 +2,6 @@ class CreateFollows < ActiveRecord::Migration[5.0]
def change
create_table :follows do |t|
t.references :user, index: true
t.boolean :email, default: true
t.boolean :app, default: true
t.boolean :push, default: true
t.references :followed, polymorphic: true, index: true
t.timestamps
end

View file

@ -82,9 +82,12 @@ ActiveRecord::Schema.define(version: 20170209215911) do
create_table "follows", force: :cascade do |t|
t.integer "user_id"
<<<<<<< HEAD
t.boolean "email", default: true
t.boolean "app", default: true
t.boolean "push", default: true
=======
>>>>>>> develop
t.string "followed_type"
t.integer "followed_id"
t.datetime "created_at", null: false

View file

@ -82,10 +82,11 @@ class MapCard extends Component {
render = () => {
const { map, mobile, juntoState, currentUser, onRequest, onStar } = this.props
const hasMap = juntoState.liveMaps[map.id]
const hasConversation = hasMap && find(values(hasMap), v => v === IN_CONVERSATION)
const hasMap = (juntoState.liveMaps[map.id] && values(juntoState.liveMaps[map.id]).length) || null
const realtimeMap = juntoState.liveMaps[map.id]
const hasConversation = hasMap && find(values(realtimeMap), v => v === IN_CONVERSATION)
const hasMapper = hasMap && !hasConversation
const mapperList = hasMap && Object.keys(hasMap).map(id => juntoState.connectedPeople[id])
const mapperList = hasMap && Object.keys(realtimeMap).map(id => juntoState.connectedPeople[id])
const n = map.get('name')
const d = map.get('desc')