-
Notifications
You must be signed in to change notification settings - Fork 25
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
base: master
Are you sure you want to change the base?
Zoom Rooms Plugin #173
Conversation
06bce5b
to
4bfafe1
Compare
4bfafe1
to
3489324
Compare
- Use hatchling - Fix distribution name (`indico-plugin-...`)
3489324
to
427d8d7
Compare
There was a problem hiding this 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(''); |
There was a problem hiding this comment.
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')), |
There was a problem hiding this comment.
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') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'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})>' |
There was a problem hiding this comment.
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
zr_id = get_zoom_room_id(link_obj.room) | ||
|
||
# do not bother doing anything if the room is not ZR-enabled | ||
if zr_id: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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' |
There was a problem hiding this comment.
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
friendly_name = 'Zoom Rooms' |
if ( | ||
room | ||
and (attributes := room.attributes) | ||
and ( | ||
user_id_attr := attributes.filter(RoomAttribute.name == 'zoom-rooms-calendar-id') | ||
.join(RoomAttribute) | ||
.first() | ||
) | ||
): |
There was a problem hiding this comment.
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)
This is the third instalment of indico/indico#6475. See also indico/indico-plugins#236
Changes:
TODO:
https://link/to/docs
with the true URL, once there is one. Or even better, add a plugin setting to set the URL.