Pass room name.
This commit is contained in:
parent
234ca8b062
commit
9e3c1fbc7a
6 changed files with 10 additions and 7 deletions
|
@ -105,10 +105,13 @@ class ScalarAuthClient {
|
||||||
return defer.promise;
|
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;
|
let url = SdkConfig.get().integrations_ui_url;
|
||||||
url += "?scalar_token=" + encodeURIComponent(this.scalarToken);
|
url += "?scalar_token=" + encodeURIComponent(this.scalarToken);
|
||||||
url += "&room_id=" + encodeURIComponent(roomId);
|
url += "&room_id=" + encodeURIComponent(roomId);
|
||||||
|
url += "&room_name=" + encodeURIComponent(roomName);
|
||||||
if (id) {
|
if (id) {
|
||||||
url += '&integ_id=' + encodeURIComponent(id);
|
url += '&integ_id=' + encodeURIComponent(id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -277,7 +277,7 @@ export default class AppTile extends React.Component {
|
||||||
} else {
|
} else {
|
||||||
const IntegrationsManager = sdk.getComponent("views.settings.IntegrationsManager");
|
const IntegrationsManager = sdk.getComponent("views.settings.IntegrationsManager");
|
||||||
const src = this._scalarClient.getScalarInterfaceUrlForRoom(
|
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, {
|
Modal.createTrackedDialog('Integrations Manager', '', IntegrationsManager, {
|
||||||
src: src,
|
src: src,
|
||||||
}, "mx_IntegrationsManager");
|
}, "mx_IntegrationsManager");
|
||||||
|
|
|
@ -64,7 +64,7 @@ export default class ManageIntegsButton extends React.Component {
|
||||||
const IntegrationsManager = sdk.getComponent("views.settings.IntegrationsManager");
|
const IntegrationsManager = sdk.getComponent("views.settings.IntegrationsManager");
|
||||||
Modal.createDialog(IntegrationsManager, {
|
Modal.createDialog(IntegrationsManager, {
|
||||||
src: (this.scalarClient !== null && this.scalarClient.hasCredentials()) ?
|
src: (this.scalarClient !== null && this.scalarClient.hasCredentials()) ?
|
||||||
this.scalarClient.getScalarInterfaceUrlForRoom(this.props.roomId) :
|
this.scalarClient.getScalarInterfaceUrlForRoom(this.props.room) :
|
||||||
null,
|
null,
|
||||||
}, "mx_IntegrationsManager");
|
}, "mx_IntegrationsManager");
|
||||||
}
|
}
|
||||||
|
@ -103,5 +103,5 @@ export default class ManageIntegsButton extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
ManageIntegsButton.propTypes = {
|
ManageIntegsButton.propTypes = {
|
||||||
roomId: PropTypes.string.isRequired,
|
room: PropTypes.object.isRequired,
|
||||||
};
|
};
|
||||||
|
|
|
@ -189,7 +189,7 @@ module.exports = React.createClass({
|
||||||
_launchManageIntegrations: function() {
|
_launchManageIntegrations: function() {
|
||||||
const IntegrationsManager = sdk.getComponent("views.settings.IntegrationsManager");
|
const IntegrationsManager = sdk.getComponent("views.settings.IntegrationsManager");
|
||||||
const src = (this.scalarClient !== null && this.scalarClient.hasCredentials()) ?
|
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;
|
null;
|
||||||
Modal.createTrackedDialog('Integrations Manager', '', IntegrationsManager, {
|
Modal.createTrackedDialog('Integrations Manager', '', IntegrationsManager, {
|
||||||
src: src,
|
src: src,
|
||||||
|
|
|
@ -391,7 +391,7 @@ module.exports = React.createClass({
|
||||||
let manageIntegsButton;
|
let manageIntegsButton;
|
||||||
if (this.props.room && this.props.room.roomId && this.props.inRoom) {
|
if (this.props.room && this.props.room.roomId && this.props.inRoom) {
|
||||||
manageIntegsButton = <ManageIntegsButton
|
manageIntegsButton = <ManageIntegsButton
|
||||||
roomId={this.props.room.roomId}
|
room={this.props.room}
|
||||||
/>;
|
/>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -208,7 +208,7 @@ export default class Stickerpack extends React.Component {
|
||||||
const IntegrationsManager = sdk.getComponent("views.settings.IntegrationsManager");
|
const IntegrationsManager = sdk.getComponent("views.settings.IntegrationsManager");
|
||||||
const src = (this.scalarClient !== null && this.scalarClient.hasCredentials()) ?
|
const src = (this.scalarClient !== null && this.scalarClient.hasCredentials()) ?
|
||||||
this.scalarClient.getScalarInterfaceUrlForRoom(
|
this.scalarClient.getScalarInterfaceUrlForRoom(
|
||||||
this.props.room.roomId,
|
this.props.room,
|
||||||
'type_stickerpack',
|
'type_stickerpack',
|
||||||
this.widgetId,
|
this.widgetId,
|
||||||
) :
|
) :
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue