Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
fdf7686
chore: harmonize create/update area params
mickaelpham Sep 20, 2025
92e36b1
chore: harmonize create/update arrow params
mickaelpham Sep 20, 2025
8f6615d
chore: harmonize create/update comment params
mickaelpham Sep 20, 2025
a3064b1
chore: harmonize create/update file params + add tests
mickaelpham Sep 20, 2025
a16da24
chore: harmonize create/update image params
mickaelpham Sep 20, 2025
ce6a5f1
chore: harmonize create/update shape params
mickaelpham Sep 20, 2025
606fd0a
chore: harmonize create/update sticky note params
mickaelpham Sep 20, 2025
543d515
chore: harmonize create table/table cell params
mickaelpham Sep 20, 2025
26956b5
chore: harmonize create/update text box params
mickaelpham Sep 20, 2025
e851ab5
chore: harmonize create/update title params
mickaelpham Sep 20, 2025
6c61c37
fix: (area) widget common attributes should be parsed
mickaelpham Sep 20, 2025
a42183b
fix: (arrow) widget common attributes should be decoded
mickaelpham Sep 20, 2025
0dc656e
fix: (comment) widget common attributes should be decoded
mickaelpham Sep 20, 2025
89fc148
fix: (file) widget common attributes should be decoded
mickaelpham Sep 20, 2025
cd47e8d
fix: (image) widget common attributes should be decoded
mickaelpham Sep 20, 2025
a9f276a
fix: (shape) widget common attributes should be decoded
mickaelpham Sep 20, 2025
98fb173
fix: (sticky note) widget common attributes should be decoded
mickaelpham Sep 20, 2025
c1bfa26
fix: (text box) widget common attributes should be decoded
mickaelpham Sep 20, 2025
c22186d
fix: (title) widget common attributes should be decoded
mickaelpham Sep 20, 2025
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
4 changes: 2 additions & 2 deletions lib/mural/client/mural_content/areas.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def create_area(mural_id, create_area_params)
create_area_params.encode
)

Mural::Widget::Area.decode(json['value'])
Mural::Widget.decode(json['value'])
end

# https://developers.mural.co/public/reference/updatearea
Expand All @@ -21,7 +21,7 @@ def update_area(mural_id, area_id, update_area_params)
update_area_params.encode
)

Mural::Widget::Area.decode(json['value'])
Mural::Widget.decode(json['value'])
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/mural/client/mural_content/arrows.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def create_arrow(mural_id, create_arrow_params)
create_arrow_params.encode
)

Mural::Widget::Arrow.decode(json['value'])
Mural::Widget.decode(json['value'])
end

# https://developers.mural.co/public/reference/updatearrow
Expand All @@ -21,7 +21,7 @@ def update_arrow(mural_id, arrow_id, update_arrow_params)
update_arrow_params.encode
)

Mural::Widget::Arrow.decode(json['value'])
Mural::Widget.decode(json['value'])
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/mural/client/mural_content/comments.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def create_comment(mural_id, create_comment_params)
create_comment_params.encode
)

Mural::Widget::Comment.decode(json['value'])
Mural::Widget.decode(json['value'])
end

# Update a comment widget on a mural.
Expand All @@ -29,7 +29,7 @@ def update_comment(mural_id, comment_id, update_comment_params)
update_comment_params.encode
)

Mural::Widget::Comment.decode(json['value'])
Mural::Widget.decode(json['value'])
end
end
end
Expand Down
6 changes: 3 additions & 3 deletions lib/mural/client/mural_content/files.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def create_file(mural_id, params)
params.encode
)

Mural::Widget::File.decode(json['value'])
Mural::Widget.decode(json['value'])
end

# https://developers.mural.co/public/reference/getmuralfilewidgets
Expand All @@ -21,7 +21,7 @@ def list_files(mural_id, next_page: nil)
{ next: next_page }
)

files = json['value'].map { |f| Mural::Widget::File.decode(f) }
files = json['value'].map { |f| Mural::Widget.decode(f) }
[files, json['next']]
end

Expand All @@ -32,7 +32,7 @@ def update_file(mural_id, widget_id:, update_file_params:)
update_file_params.encode
)

Mural::Widget::File.decode(json['value'])
Mural::Widget.decode(json['value'])
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/mural/client/mural_content/images.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def create_image(mural_id, create_image_params)
create_image_params.encode
)

Mural::Widget::Image.decode(json['value'])
Mural::Widget.decode(json['value'])
end

# https://developers.mural.co/public/reference/createimage
Expand All @@ -21,7 +21,7 @@ def update_image(mural_id, image_id, update_image_params)
update_image_params.encode
)

Mural::Widget::Image.decode(json['value'])
Mural::Widget.decode(json['value'])
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/mural/client/mural_content/shapes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def create_shapes(mural_id, create_shape_params)
[*create_shape_params].map(&:encode)
)
json['value'].map do |json_shape|
Mural::Widget::Shape.decode(json_shape)
Mural::Widget.decode(json_shape)
end
end

Expand All @@ -30,7 +30,7 @@ def update_shape(mural_id, shape_id, update_shape_params)
update_shape_params.encode
)

Mural::Widget::Shape.decode(json['value'])
Mural::Widget.decode(json['value'])
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/mural/client/mural_content/sticky_notes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def create_sticky_notes(mural_id, create_sticky_note_params)
[*create_sticky_note_params].map(&:encode)
)

json['value'].map { |s| Mural::Widget::StickyNote.decode(s) }
json['value'].map { |s| Mural::Widget.decode(s) }
end

# Update a sticky note widget on a mural.
Expand All @@ -32,7 +32,7 @@ def update_sticky_note(
update_sticky_note_params.encode
)

Mural::Widget::StickyNote.decode(json['value'])
Mural::Widget.decode(json['value'])
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/mural/client/mural_content/text_boxes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def create_text_boxes(mural_id, create_text_box_params)
[*create_text_box_params].map(&:encode)
)

json['value'].map { |text_box| Mural::Widget::Text.decode(text_box) }
json['value'].map { |text_box| Mural::Widget.decode(text_box) }
end

# Update a textbox on a mural
Expand All @@ -29,7 +29,7 @@ def update_text_box(mural_id, text_box_id, update_text_box_params)
update_text_box_params.encode
)

Mural::Widget::Text.decode(json['value'])
Mural::Widget.decode(json['value'])
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/mural/client/mural_content/titles.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def create_titles(mural_id, create_title_params)
[*create_title_params].map(&:encode)
)

json['value'].map { |title| Mural::Widget::Text.decode(title) }
json['value'].map { |title| Mural::Widget.decode(title) }
end

# Update a title on a mural
Expand All @@ -29,7 +29,7 @@ def update_title(mural_id, title_id, update_title_params)
update_title_params.encode
)

Mural::Widget::Text.decode(json['value'])
Mural::Widget.decode(json['value'])
end
end
end
Expand Down
30 changes: 15 additions & 15 deletions lib/mural/widget/create_area_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ class Widget
class CreateAreaParams
include Mural::Codec

# https://developers.mural.co/public/reference/createarea
define_attributes(
**Mural::Widget::Area.attrs.reject do |attr|
**Mural::Widget::Area.attrs.filter do |attr|
%i[
content_edited_by
content_edited_on
created_by
created_on
hide_editor
hide_owner
id
invisible
locked
locked_by_facilitator
rotation
type
updated_by
updated_on
height
hidden
instruction
layout
parent_id
presentation_index
show_title
stacking_order
style
title
width
x
y
].include? attr
end
)
Expand Down
42 changes: 23 additions & 19 deletions lib/mural/widget/create_arrow_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,41 @@ class CreateArrowParams

# https://developers.mural.co/public/reference/createarrow
define_attributes(
**Mural::Widget::Arrow.attrs.reject do |attr|
**Mural::Widget::Arrow.attrs.filter do |attr|
%i[
content_edited_by
content_edited_on
created_by
created_on
hidden
hide_editor
hide_owner
id
invisible
locked
locked_by_facilitator
type
updated_by
updated_on
arrow_type
end_ref_id
height
instruction
label
parent_id
points
presentation_index
rotation
stackable
stacking_order
start_ref_id
style
tip
title
width
x
y
].include? attr
end
)

Style = Mural::Widget::Arrow::Style
Label = Mural::Widget::Arrow::Label
Point = Mural::Widget::Arrow::Point

def encode
super.tap do |json|
json['points']&.map!(&:encode)
json['label'] = json['label']&.encode
json['style'] = json['style']&.encode
end
end

Style = Mural::Widget::Arrow::Style
Label = Mural::Widget::Arrow::Label
Point = Mural::Widget::Arrow::Point
end
end
end
4 changes: 3 additions & 1 deletion lib/mural/widget/create_comment_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,19 @@ class Widget
class CreateCommentParams
include Mural::Codec

# https://developers.mural.co/public/reference/createcomment
define_attributes(
**Mural::Widget::Comment.attrs.filter do |attr|
%i[
reference_widget_id
message
reference_widget_id
stacking_order
x
y
].include? attr
end,

# If true, the comment is marked as resolved.
resolved: 'resolved'
)
end
Expand Down
57 changes: 16 additions & 41 deletions lib/mural/widget/create_file_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,49 +7,24 @@ class CreateFileParams

# https://developers.mural.co/public/reference/createfile
define_attributes(
# The height of the widget in px. This value will be overwritten if the
# file has a preview from which the final value will be extracted.
height: 'height',

# If true, the widget is hidden from non-facilitators. Applies only when
# the widget is in the outline.
hidden: 'hidden',

# The instructions for a section of the outline. This text can only be
# added and modified by a facilitator.
instruction: 'instruction',
**Mural::Widget::File.attrs.filter do |attr|
%i[
height
hidden
instruction
parent_id
presentation_index
rotation
stacking_order
title
width
x
y
].include? attr
end,

# The name of the file.
name: 'name',

# The ID of the area widget that contains the widget.
parent_id: 'parentId',

# The list order of the widget in the outline.
presentation_index: 'presentationIndex',

# The angle of widget rotation in degrees.
rotation: 'rotation',

# The z-index stacking order of the widget.
stacking_order: 'stackingOrder',

# The title in the file widget and in the outline.
title: 'title',

# The width of the widget in px. This value will be overwritten if the
# file has a preview from which the final value will be extracted.
width: 'width',

# The horizontal position of the widget in px. This is the distance from
# the left of the parent widget, such as an area. If the widget has no
# parent widget, this is the distance from the left of the mural.
x: 'x',

# The vertical position of the widget in px. This is the distance from
# the top of the parent widget, such as an area. If the widget has no
# parent widget, this is the distance from the top of the mural.
y: 'y'
name: 'name'
)
end
end
Expand Down
Loading