diff --git a/speckle_connector_3/src/actions/base_actions/add_receive_model_card.rb b/speckle_connector_3/src/actions/base_actions/add_receive_model_card.rb index 4cb5e0f9..004cb259 100644 --- a/speckle_connector_3/src/actions/base_actions/add_receive_model_card.rb +++ b/speckle_connector_3/src/actions/base_actions/add_receive_model_card.rb @@ -23,14 +23,19 @@ def self.update_state(state, resolve_id, data) model_name = data['modelName'] expired = data['expired'] selected_version_id = data['selectedVersionId'] + selected_version_source_app = data['selectedVersionSourceApp'] + selected_version_user_id = data['selectedVersionUserId'] latest_version_id = data['latestVersionId'] + latest_version_source_app = data['latestVersionSourceApp'] + latest_version_user_id = data['latestVersionUserId'] has_dismissed_update_warning = data['hasDismissedUpdateWarning'] baked_object_ids = data['bakedObjectIds'].nil? ? nil : data['bakedObjectIds'].values receive_card = Cards::ReceiveCard.new(model_card_id, account_id, project_id, model_id, project_name, model_name, - selected_version_id, latest_version_id, + selected_version_id, selected_version_source_app, selected_version_user_id, + latest_version_id, latest_version_source_app, latest_version_user_id, has_dismissed_update_warning, expired, baked_object_ids) SketchupModel::Dictionary::ModelCardDictionaryHandler .save_receive_card_to_model(receive_card, state.sketchup_state.sketchup_model) diff --git a/speckle_connector_3/src/actions/base_actions/get_document_state.rb b/speckle_connector_3/src/actions/base_actions/get_document_state.rb index 75441e8b..91c12b63 100644 --- a/speckle_connector_3/src/actions/base_actions/get_document_state.rb +++ b/speckle_connector_3/src/actions/base_actions/get_document_state.rb @@ -51,7 +51,9 @@ def self.update_state(state, resolve_id) receive_cards = receive_cards_hash.collect do |id, card| receive_card = Cards::ReceiveCard.new(id, card['account_id'], card['project_id'], card['model_id'], card['project_name'], card['model_name'], card['selected_version_id'], - card['latest_version_id'], card['has_dismissed_update_warning'], + card['selected_version_source_app'], card['selected_version_user_id'], + card['latest_version_id'], card['latest_version_source_app'], + card['latest_version_user_id'], card['has_dismissed_update_warning'], card['expired'], card['baked_object_ids']) new_speckle_state = state.speckle_state.with_receive_card(receive_card) @@ -64,7 +66,11 @@ def self.update_state(state, resolve_id) projectName: receive_card.project_name, modelName: receive_card.model_name, selectedVersionId: receive_card.selected_version_id, + selectedVersionSourceApp: receive_card.selected_version_source_app, + selectedVersionUserId: receive_card.selected_version_user_id, latestVersionId: receive_card.latest_version_id, + latestVersionSourceApp: receive_card.latest_version_source_app, + latestVersionUserId: receive_card.latest_version_user_id, hasDismissedUpdateWarning: receive_card.has_dismissed_update_warning, expired: receive_card.expired, bakedObjectIds: receive_card.baked_object_ids, diff --git a/speckle_connector_3/src/cards/receive_card.rb b/speckle_connector_3/src/cards/receive_card.rb index b705cc0b..cf562459 100644 --- a/speckle_connector_3/src/cards/receive_card.rb +++ b/speckle_connector_3/src/cards/receive_card.rb @@ -14,9 +14,21 @@ class ReceiveCard < Card # @return [String] selected version id to receive attr_reader :selected_version_id + # @return [String] selected version source app + attr_reader :selected_version_source_app + + # @return [String] selected version user id + attr_reader :selected_version_user_id + # @return [String] latest version id to receive attr_reader :latest_version_id + # @return [String] latest version source app + attr_reader :latest_version_source_app + + # @return [String] latest version user id + attr_reader :latest_version_user_id + # @return [Boolean] whether new version notification is dismissed or not attr_reader :has_dismissed_update_warning @@ -41,27 +53,39 @@ def initialize( project_name, model_name, selected_version_id, + selected_version_source_app, + selected_version_user_id, latest_version_id, + latest_version_source_app, + latest_version_user_id, has_dismissed_update_warning, expired, baked_object_ids = nil ) super(model_card_id, account_id, project_id, project_name, model_id, model_name) @selected_version_id = selected_version_id + @selected_version_source_app = selected_version_source_app + @selected_version_user_id = selected_version_user_id @latest_version_id = latest_version_id + @latest_version_source_app = latest_version_source_app + @latest_version_user_id = latest_version_user_id @has_dismissed_update_warning = has_dismissed_update_warning @baked_object_ids = baked_object_ids + @expired = expired + @model_name = model_name + @project_name = project_name + @type_discriminator = 'ReceiverModelCard' self[:selected_version_id] = selected_version_id + self[:selected_version_source_app] = selected_version_source_app + self[:selected_version_user_id] = selected_version_user_id self[:has_dismissed_update_warning] = has_dismissed_update_warning self[:latest_version_id] = latest_version_id + self[:latest_version_source_app] = latest_version_source_app + self[:latest_version_user_id] = latest_version_user_id self[:model_name] = model_name self[:project_name] = project_name self[:expired] = expired self[:baked_object_ids] = @baked_object_ids - @expired = expired - @model_name = model_name - @project_name = project_name - @type_discriminator = 'ReceiverModelCard' self[:type_discriminator] = @type_discriminator end # rubocop:enable Metrics/ParameterLists