merge develop
This commit is contained in:
commit
b11a4c71d1
5 changed files with 11 additions and 13 deletions
|
@ -30,6 +30,8 @@ class Mapping < ApplicationRecord
|
||||||
def after_created
|
def after_created
|
||||||
if mappable_type == 'Topic'
|
if mappable_type == 'Topic'
|
||||||
ActionCable.server.broadcast 'map_' + map.id.to_s, type: 'topicAdded', topic: mappable.filtered, mapping_id: id
|
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'
|
elsif mappable_type == 'Synapse'
|
||||||
ActionCable.server.broadcast(
|
ActionCable.server.broadcast(
|
||||||
'map_' + map.id.to_s,
|
'map_' + map.id.to_s,
|
||||||
|
@ -39,17 +41,12 @@ class Mapping < ApplicationRecord
|
||||||
topic2: mappable.topic2.filtered,
|
topic2: mappable.topic2.filtered,
|
||||||
mapping_id: id
|
mapping_id: id
|
||||||
)
|
)
|
||||||
|
Events::SynapseAddedToMap.publish!(mappable, map, user, nil)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def after_created_async
|
def after_created_async
|
||||||
FollowService.follow(map, user, 'contributed')
|
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
|
end
|
||||||
handle_asynchronously :after_created_async
|
handle_asynchronously :after_created_async
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ MAP_INVITE_TO_EDIT = 'INVITE_TO_EDIT'
|
||||||
|
|
||||||
# these ones are new
|
# these ones are new
|
||||||
# this one's a catch all for occurences on the map
|
# this one's a catch all for occurences on the map
|
||||||
MAP_ACTIVITY = 'MAP_ACTIVITY'
|
# MAP_ACTIVITY = 'MAP_ACTIVITY'
|
||||||
# MAP_RECEIVED_TOPIC
|
# MAP_RECEIVED_TOPIC
|
||||||
# MAP_LOST_TOPIC
|
# MAP_LOST_TOPIC
|
||||||
# MAP_TOPIC_MOVED
|
# MAP_TOPIC_MOVED
|
||||||
|
|
|
@ -2,9 +2,6 @@ class CreateFollows < ActiveRecord::Migration[5.0]
|
||||||
def change
|
def change
|
||||||
create_table :follows do |t|
|
create_table :follows do |t|
|
||||||
t.references :user, index: true
|
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.references :followed, polymorphic: true, index: true
|
||||||
t.timestamps
|
t.timestamps
|
||||||
end
|
end
|
||||||
|
|
|
@ -82,9 +82,12 @@ ActiveRecord::Schema.define(version: 20170209215911) do
|
||||||
|
|
||||||
create_table "follows", force: :cascade do |t|
|
create_table "follows", force: :cascade do |t|
|
||||||
t.integer "user_id"
|
t.integer "user_id"
|
||||||
|
<<<<<<< HEAD
|
||||||
t.boolean "email", default: true
|
t.boolean "email", default: true
|
||||||
t.boolean "app", default: true
|
t.boolean "app", default: true
|
||||||
t.boolean "push", default: true
|
t.boolean "push", default: true
|
||||||
|
=======
|
||||||
|
>>>>>>> develop
|
||||||
t.string "followed_type"
|
t.string "followed_type"
|
||||||
t.integer "followed_id"
|
t.integer "followed_id"
|
||||||
t.datetime "created_at", null: false
|
t.datetime "created_at", null: false
|
||||||
|
|
|
@ -82,10 +82,11 @@ class MapCard extends Component {
|
||||||
render = () => {
|
render = () => {
|
||||||
const { map, mobile, juntoState, currentUser, onRequest, onStar } = this.props
|
const { map, mobile, juntoState, currentUser, onRequest, onStar } = this.props
|
||||||
|
|
||||||
const hasMap = juntoState.liveMaps[map.id]
|
const hasMap = (juntoState.liveMaps[map.id] && values(juntoState.liveMaps[map.id]).length) || null
|
||||||
const hasConversation = hasMap && find(values(hasMap), v => v === IN_CONVERSATION)
|
const realtimeMap = juntoState.liveMaps[map.id]
|
||||||
|
const hasConversation = hasMap && find(values(realtimeMap), v => v === IN_CONVERSATION)
|
||||||
const hasMapper = hasMap && !hasConversation
|
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 n = map.get('name')
|
||||||
const d = map.get('desc')
|
const d = map.get('desc')
|
||||||
|
|
Loading…
Add table
Reference in a new issue