Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore(dui3): add workspace id to model card #391

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
Binary file added speckle_connector_3/.DS_Store
Binary file not shown.
Binary file added speckle_connector_3/src/.DS_Store
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@ class AddReceiveModelCard < Action
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 @@ def self.update_state(state, resolve_id, data)
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,
Original file line number Diff line number Diff line change
@@ -22,6 +22,7 @@ def self.update_state(state, resolve_id, data)
send_card = Cards::SendCard.new(
data['modelCardId'],
data['accountId'],
data['workspaceId'],
data['projectId'],
data['projectName'],
data['modelId'],
Original file line number Diff line number Diff line change
@@ -21,6 +21,7 @@ def self.update_state(state, resolve_id)
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 @@ def self.update_state(state, resolve_id)
{
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 @@ def self.update_state(state, resolve_id)

# 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 @@ def self.update_state(state, resolve_id)
{
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,
7 changes: 6 additions & 1 deletion speckle_connector_3/src/cards/card.rb
Original file line number Diff line number Diff line change
@@ -24,21 +24,26 @@ class Card < Hash
# @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
@model_name = model_name
@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
3 changes: 2 additions & 1 deletion speckle_connector_3/src/cards/receive_card.rb
Original file line number Diff line number Diff line change
@@ -48,6 +48,7 @@ class ReceiveCard < Card
def initialize(
model_card_id,
account_id,
workspace_id,
project_id,
model_id,
project_name,
@@ -62,7 +63,7 @@ def initialize(
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
3 changes: 2 additions & 1 deletion speckle_connector_3/src/cards/send_card.rb
Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@ class SendCard < Card
def initialize(
model_card_id,
account_id,
workspace_id,
project_id,
project_name,
model_id,
@@ -34,7 +35,7 @@ def initialize(
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
4 changes: 2 additions & 2 deletions speckle_connector_3/src/ui/dui3_dialog.rb
Original file line number Diff line number Diff line change
@@ -84,8 +84,8 @@ def init_dialog
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
Loading