From 9e3c1fbc7ac6a7e1da09e9a82406497ec388d2af Mon Sep 17 00:00:00 2001 From: Richard Lewis Date: Fri, 9 Feb 2018 11:44:27 +0000 Subject: [PATCH] Pass room name. --- src/ScalarAuthClient.js | 5 ++++- src/components/views/elements/AppTile.js | 2 +- src/components/views/elements/ManageIntegsButton.js | 4 ++-- src/components/views/rooms/AppsDrawer.js | 2 +- src/components/views/rooms/RoomHeader.js | 2 +- src/components/views/rooms/Stickerpack.js | 2 +- 6 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/ScalarAuthClient.js b/src/ScalarAuthClient.js index 3e775a94ab..756965d41e 100644 --- a/src/ScalarAuthClient.js +++ b/src/ScalarAuthClient.js @@ -105,10 +105,13 @@ class ScalarAuthClient { return defer.promise; } - getScalarInterfaceUrlForRoom(roomId, screen, id) { + getScalarInterfaceUrlForRoom(room, screen, id) { + const roomId = room.roomId; + const roomName = room.name; let url = SdkConfig.get().integrations_ui_url; url += "?scalar_token=" + encodeURIComponent(this.scalarToken); url += "&room_id=" + encodeURIComponent(roomId); + url += "&room_name=" + encodeURIComponent(roomName); if (id) { url += '&integ_id=' + encodeURIComponent(id); } diff --git a/src/components/views/elements/AppTile.js b/src/components/views/elements/AppTile.js index 9d76e3410e..cc11a8542a 100644 --- a/src/components/views/elements/AppTile.js +++ b/src/components/views/elements/AppTile.js @@ -277,7 +277,7 @@ export default class AppTile extends React.Component { } else { const IntegrationsManager = sdk.getComponent("views.settings.IntegrationsManager"); const src = this._scalarClient.getScalarInterfaceUrlForRoom( - this.props.room.roomId, 'type_' + this.props.type, this.props.id); + this.props.room, 'type_' + this.props.type, this.props.id); Modal.createTrackedDialog('Integrations Manager', '', IntegrationsManager, { src: src, }, "mx_IntegrationsManager"); diff --git a/src/components/views/elements/ManageIntegsButton.js b/src/components/views/elements/ManageIntegsButton.js index 17dbbeee62..024c5feda5 100644 --- a/src/components/views/elements/ManageIntegsButton.js +++ b/src/components/views/elements/ManageIntegsButton.js @@ -64,7 +64,7 @@ export default class ManageIntegsButton extends React.Component { const IntegrationsManager = sdk.getComponent("views.settings.IntegrationsManager"); Modal.createDialog(IntegrationsManager, { src: (this.scalarClient !== null && this.scalarClient.hasCredentials()) ? - this.scalarClient.getScalarInterfaceUrlForRoom(this.props.roomId) : + this.scalarClient.getScalarInterfaceUrlForRoom(this.props.room) : null, }, "mx_IntegrationsManager"); } @@ -103,5 +103,5 @@ export default class ManageIntegsButton extends React.Component { } ManageIntegsButton.propTypes = { - roomId: PropTypes.string.isRequired, + room: PropTypes.object.isRequired, }; diff --git a/src/components/views/rooms/AppsDrawer.js b/src/components/views/rooms/AppsDrawer.js index 78677e138b..7541b304a2 100644 --- a/src/components/views/rooms/AppsDrawer.js +++ b/src/components/views/rooms/AppsDrawer.js @@ -189,7 +189,7 @@ module.exports = React.createClass({ _launchManageIntegrations: function() { const IntegrationsManager = sdk.getComponent("views.settings.IntegrationsManager"); const src = (this.scalarClient !== null && this.scalarClient.hasCredentials()) ? - this.scalarClient.getScalarInterfaceUrlForRoom(this.props.room.roomId, 'add_integ') : + this.scalarClient.getScalarInterfaceUrlForRoom(this.props.room, 'add_integ') : null; Modal.createTrackedDialog('Integrations Manager', '', IntegrationsManager, { src: src, diff --git a/src/components/views/rooms/RoomHeader.js b/src/components/views/rooms/RoomHeader.js index aee229c5da..67ede1a011 100644 --- a/src/components/views/rooms/RoomHeader.js +++ b/src/components/views/rooms/RoomHeader.js @@ -391,7 +391,7 @@ module.exports = React.createClass({ let manageIntegsButton; if (this.props.room && this.props.room.roomId && this.props.inRoom) { manageIntegsButton = ; } diff --git a/src/components/views/rooms/Stickerpack.js b/src/components/views/rooms/Stickerpack.js index 24bd44c3d3..983a357d86 100644 --- a/src/components/views/rooms/Stickerpack.js +++ b/src/components/views/rooms/Stickerpack.js @@ -208,7 +208,7 @@ export default class Stickerpack extends React.Component { const IntegrationsManager = sdk.getComponent("views.settings.IntegrationsManager"); const src = (this.scalarClient !== null && this.scalarClient.hasCredentials()) ? this.scalarClient.getScalarInterfaceUrlForRoom( - this.props.room.roomId, + this.props.room, 'type_stickerpack', this.widgetId, ) :