Add workspace id to model cards (#391)
Co-authored-by: Oguzhan Koral <oguzhankoral@192.168.1.104>
This commit is contained in:
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
@@ -17,6 +17,7 @@ module SpeckleConnector3
|
||||
def self.update_state(state, resolve_id, data)
|
||||
model_card_id = data['modelCardId']
|
||||
account_id = data['accountId']
|
||||
workspace_id = data['workspaceId']
|
||||
project_id = data['projectId']
|
||||
model_id = data['modelId']
|
||||
project_name = data['projectName']
|
||||
@@ -31,7 +32,7 @@ module SpeckleConnector3
|
||||
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,
|
||||
receive_card = Cards::ReceiveCard.new(model_card_id, account_id, workspace_id,
|
||||
project_id, model_id,
|
||||
project_name, model_name,
|
||||
selected_version_id, selected_version_source_app, selected_version_user_id,
|
||||
|
||||
@@ -22,6 +22,7 @@ module SpeckleConnector3
|
||||
send_card = Cards::SendCard.new(
|
||||
data['modelCardId'],
|
||||
data['accountId'],
|
||||
data['workspaceId'],
|
||||
data['projectId'],
|
||||
data['projectName'],
|
||||
data['modelId'],
|
||||
|
||||
@@ -21,6 +21,7 @@ module SpeckleConnector3
|
||||
send_card = Cards::SendCard.new(
|
||||
id,
|
||||
card['account_id'],
|
||||
card['workspace_id'],
|
||||
card['project_id'],
|
||||
card['project_name'],
|
||||
card['model_id'],
|
||||
@@ -35,6 +36,7 @@ module SpeckleConnector3
|
||||
{
|
||||
modelCardId: send_card.model_card_id,
|
||||
accountId: send_card.account_id,
|
||||
workspaceId: send_card.workspace_id,
|
||||
projectId: send_card.project_id,
|
||||
modelId: send_card.model_id,
|
||||
sendFilter: send_card.send_filter,
|
||||
@@ -49,7 +51,7 @@ module SpeckleConnector3
|
||||
|
||||
# TODO: CONVERTER_V2: Extract into new actions
|
||||
receive_cards = receive_cards_hash.collect do |id, card|
|
||||
receive_card = Cards::ReceiveCard.new(id, card['account_id'], card['project_id'], card['model_id'],
|
||||
receive_card = Cards::ReceiveCard.new(id, card['account_id'], card['workspace_id'], card['project_id'], card['model_id'],
|
||||
card['project_name'], card['model_name'], card['selected_version_id'],
|
||||
card['selected_version_source_app'], card['selected_version_user_id'],
|
||||
card['latest_version_id'], card['latest_version_source_app'],
|
||||
@@ -61,6 +63,7 @@ module SpeckleConnector3
|
||||
{
|
||||
modelCardId: receive_card.model_card_id,
|
||||
accountId: receive_card.account_id,
|
||||
workspaceId: receive_card.workspace_id,
|
||||
projectId: receive_card.project_id,
|
||||
modelId: receive_card.model_id,
|
||||
projectName: receive_card.project_name,
|
||||
|
||||
@@ -24,14 +24,18 @@ module SpeckleConnector3
|
||||
# @return [String] model name of the card.
|
||||
attr_reader :model_name
|
||||
|
||||
# @return [String] workspace id of the card.
|
||||
attr_reader :workspace_id
|
||||
|
||||
# @return [Boolean] card is valid or not.
|
||||
attr_reader :valid
|
||||
|
||||
# rubocop:disable Metrics/ParameterLists
|
||||
def initialize(model_card_id, account_id, project_id, project_name, model_id, model_name)
|
||||
def initialize(model_card_id, account_id, workspace_id, project_id, project_name, model_id, model_name)
|
||||
super()
|
||||
@model_card_id = model_card_id
|
||||
@account_id = account_id
|
||||
@workspace_id = workspace_id
|
||||
@project_id = project_id
|
||||
@project_name = project_name
|
||||
@model_id = model_id
|
||||
@@ -39,6 +43,7 @@ module SpeckleConnector3
|
||||
@valid = true
|
||||
self[:model_card_id] = model_card_id
|
||||
self[:account_id] = account_id
|
||||
self[:workspace_id] = workspace_id
|
||||
self[:project_id] = project_id
|
||||
self[:project_name] = project_name
|
||||
self[:model_id] = model_id
|
||||
|
||||
@@ -48,6 +48,7 @@ module SpeckleConnector3
|
||||
def initialize(
|
||||
model_card_id,
|
||||
account_id,
|
||||
workspace_id,
|
||||
project_id,
|
||||
model_id,
|
||||
project_name,
|
||||
@@ -62,7 +63,7 @@ module SpeckleConnector3
|
||||
expired,
|
||||
baked_object_ids = nil
|
||||
)
|
||||
super(model_card_id, account_id, project_id, project_name, model_id, model_name)
|
||||
super(model_card_id, account_id, workspace_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
|
||||
|
||||
@@ -26,6 +26,7 @@ module SpeckleConnector3
|
||||
def initialize(
|
||||
model_card_id,
|
||||
account_id,
|
||||
workspace_id,
|
||||
project_id,
|
||||
project_name,
|
||||
model_id,
|
||||
@@ -34,7 +35,7 @@ module SpeckleConnector3
|
||||
send_filter,
|
||||
send_settings
|
||||
)
|
||||
super(model_card_id, account_id, project_id, project_name, model_id, model_name)
|
||||
super(model_card_id, account_id, workspace_id, project_id, project_name, model_id, model_name)
|
||||
@send_filter = send_filter
|
||||
@send_settings = send_settings
|
||||
@latest_created_version_id = latest_created_version_id
|
||||
|
||||
@@ -84,8 +84,8 @@ module SpeckleConnector3
|
||||
true
|
||||
end
|
||||
# File.exist?(@htm_file) ? dialog.set_file(@htm_file) : dialog.set_url('http://localhost:9091')
|
||||
# dialog.set_url('http://localhost:8082') # uncomment this line if you want to use your local version of ui
|
||||
dialog.set_url('https://boisterous-douhua-e3cefb.netlify.app/') # uncomment this line if you want to use deployed ui on netlify
|
||||
dialog.set_url('http://localhost:8082') # uncomment this line if you want to use your local version of ui
|
||||
# dialog.set_url('https://boisterous-douhua-e3cefb.netlify.app/') # uncomment this line if you want to use deployed ui on netlify
|
||||
add_exec_callback(dialog)
|
||||
dialog
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user