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

Zoom Rooms Plugin #173

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

Zoom Rooms Plugin #173

wants to merge 4 commits into from

Conversation

pferreir
Copy link
Member

@pferreir pferreir commented Aug 9, 2024

This is the third instalment of indico/indico#6475. See also indico/indico-plugins#236

Changes:

  • RAVEM - move to SUI, in line with changes in core
  • Zoom Rooms - new plugin and tests, as well as some documentation (README)

TODO:

  • Replace https://link/to/docs with the true URL, once there is one. Or even better, add a plugin setting to set the URL.
  • Fix failing unit test and add unit tests to CI
  • Add some more docstrings

@pferreir pferreir force-pushed the zoom-rooms branch 5 times, most recently from 06bce5b to 4bfafe1 Compare August 12, 2024 09:44
- Use hatchling
- Fix distribution name (`indico-plugin-...`)
Copy link
Member

@ThiefMaster ThiefMaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it's still a draft but I had the PR open and couldn't resist having a look 🙈

'<span class="',
states[newState].icon,
'"><strong style="margin-left: 0.4em;">{0}</strong></span>'.format(name),
`<i class="icon ${states[newState].icon}"></i> ${name}`
].join('');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that array join isn't needed anymore now that it's just one string

sa.CheckConstraint('action = 2 OR extra_args IS NULL', name=op.f('ck_queue_move_has_extra_args')),
sa.CheckConstraint('action = 2 OR extra_args IS NULL', name=op.f('ck_queue_other_actions_have_no_extra_args')),
sa.CheckConstraint('action = 3 OR entry_data IS NOT NULL', name=op.f('ck_queue_other_actions_have_args')),
sa.PrimaryKeyConstraint('id', name=op.f('pk_queue')),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

primary_key=True on the column

sa.Column('entry_data', postgresql.JSONB(none_as_null=True, astext_type=sa.Text()), nullable=True),
sa.Column('extra_args', postgresql.JSONB(none_as_null=True, astext_type=sa.Text()), nullable=True),
sa.CheckConstraint(
'action != 3 OR (entry_data IS NULL AND extra_args IS NULL)', name=op.f('ck_queue_delete_has_no_args')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'action != 3 OR (entry_data IS NULL AND extra_args IS NULL)', name=op.f('ck_queue_delete_has_no_args')
'action != 3 OR (entry_data IS NULL AND extra_args IS NULL)', name='delete_has_no_args')

likewise for the others (the naming convention generates the rest)


def __repr__(self):
action = ZoomRoomsAction(self.action).name
return f'<ZoomRoomsQueueEntry({self.id}, {self.entry_id}, {action})>'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's a nice format_repr util for that

Comment on lines +60 to +63
zr_id = get_zoom_room_id(link_obj.room)

# do not bother doing anything if the room is not ZR-enabled
if zr_id:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
zr_id = get_zoom_room_id(link_obj.room)
# do not bother doing anything if the room is not ZR-enabled
if zr_id:
# do not bother doing anything if the room is not ZR-enabled
if zr_id := get_zoom_room_id(link_obj.room):


configurable = True
settings_form = PluginSettingsForm
friendly_name = 'Zoom Rooms'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed, the first docstring line is the default for this

Suggested change
friendly_name = 'Zoom Rooms'

Comment on lines +27 to +35
if (
room
and (attributes := room.attributes)
and (
user_id_attr := attributes.filter(RoomAttribute.name == 'zoom-rooms-calendar-id')
.join(RoomAttribute)
.first()
)
):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really? :D

(not a fan of running queries inside an if unless they all fit in a single line)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants