Use showIntegrationsManager in other places
This commit is contained in:
parent
54aaabac74
commit
d4af8d4993
3 changed files with 9 additions and 13 deletions
|
@ -23,6 +23,7 @@ import sdk from "./index";
|
||||||
import Modal from "./Modal";
|
import Modal from "./Modal";
|
||||||
import MatrixClientPeg from "./MatrixClientPeg";
|
import MatrixClientPeg from "./MatrixClientPeg";
|
||||||
import RoomViewStore from "./stores/RoomViewStore";
|
import RoomViewStore from "./stores/RoomViewStore";
|
||||||
|
import { showIntegrationsManager } from './integrations/integrations';
|
||||||
|
|
||||||
const WIDGET_API_VERSION = '0.0.2'; // Current API version
|
const WIDGET_API_VERSION = '0.0.2'; // Current API version
|
||||||
const SUPPORTED_WIDGET_API_VERSIONS = [
|
const SUPPORTED_WIDGET_API_VERSIONS = [
|
||||||
|
@ -193,13 +194,11 @@ export default class FromWidgetPostMessageApi {
|
||||||
const integType = (data && data.integType) ? data.integType : null;
|
const integType = (data && data.integType) ? data.integType : null;
|
||||||
const integId = (data && data.integId) ? data.integId : null;
|
const integId = (data && data.integId) ? data.integId : null;
|
||||||
|
|
||||||
// The dialog will take care of scalar auth for us
|
showIntegrationsManager({
|
||||||
const IntegrationsManager = sdk.getComponent("views.settings.IntegrationsManager");
|
|
||||||
Modal.createTrackedDialog('Integrations Manager', '', IntegrationsManager, {
|
|
||||||
room: MatrixClientPeg.get().getRoom(RoomViewStore.getRoomId()),
|
room: MatrixClientPeg.get().getRoom(RoomViewStore.getRoomId()),
|
||||||
screen: 'type_' + integType,
|
screen: 'type_' + integType,
|
||||||
integrationId: integId,
|
integrationId: integId,
|
||||||
}, "mx_IntegrationsManager");
|
});
|
||||||
} else if (action === 'set_always_on_screen') {
|
} else if (action === 'set_always_on_screen') {
|
||||||
// This is a new message: there is no reason to support the deprecated widgetData here
|
// This is a new message: there is no reason to support the deprecated widgetData here
|
||||||
const data = event.data.data;
|
const data = event.data.data;
|
||||||
|
|
|
@ -35,6 +35,7 @@ import WidgetUtils from '../../../utils/WidgetUtils';
|
||||||
import dis from '../../../dispatcher';
|
import dis from '../../../dispatcher';
|
||||||
import ActiveWidgetStore from '../../../stores/ActiveWidgetStore';
|
import ActiveWidgetStore from '../../../stores/ActiveWidgetStore';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
import { showIntegrationsManager } from '../../../integrations/integrations';
|
||||||
|
|
||||||
const ALLOWED_APP_URL_SCHEMES = ['https:', 'http:'];
|
const ALLOWED_APP_URL_SCHEMES = ['https:', 'http:'];
|
||||||
const ENABLE_REACT_PERF = false;
|
const ENABLE_REACT_PERF = false;
|
||||||
|
@ -240,13 +241,11 @@ export default class AppTile extends React.Component {
|
||||||
if (this.props.onEditClick) {
|
if (this.props.onEditClick) {
|
||||||
this.props.onEditClick();
|
this.props.onEditClick();
|
||||||
} else {
|
} else {
|
||||||
// The dialog handles scalar auth for us
|
showIntegrationsManager({
|
||||||
const IntegrationsManager = sdk.getComponent("views.settings.IntegrationsManager");
|
|
||||||
Modal.createTrackedDialog('Integrations Manager', '', IntegrationsManager, {
|
|
||||||
room: this.props.room,
|
room: this.props.room,
|
||||||
screen: 'type_' + this.props.type,
|
screen: 'type_' + this.props.type,
|
||||||
integrationId: this.props.id,
|
integrationId: this.props.id,
|
||||||
}, "mx_IntegrationsManager");
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@ import AccessibleButton from '../elements/AccessibleButton';
|
||||||
import WidgetUtils from '../../../utils/WidgetUtils';
|
import WidgetUtils from '../../../utils/WidgetUtils';
|
||||||
import ActiveWidgetStore from '../../../stores/ActiveWidgetStore';
|
import ActiveWidgetStore from '../../../stores/ActiveWidgetStore';
|
||||||
import PersistedElement from "../elements/PersistedElement";
|
import PersistedElement from "../elements/PersistedElement";
|
||||||
|
import { showIntegrationsManager } from '../../../integrations/integrations';
|
||||||
|
|
||||||
const widgetType = 'm.stickerpicker';
|
const widgetType = 'm.stickerpicker';
|
||||||
|
|
||||||
|
@ -348,14 +349,11 @@ export default class Stickerpicker extends React.Component {
|
||||||
* Launch the integrations manager on the stickers integration page
|
* Launch the integrations manager on the stickers integration page
|
||||||
*/
|
*/
|
||||||
_launchManageIntegrations() {
|
_launchManageIntegrations() {
|
||||||
const IntegrationsManager = sdk.getComponent("views.settings.IntegrationsManager");
|
showIntegrationsManager({
|
||||||
|
|
||||||
// The integrations manager will handle scalar auth for us.
|
|
||||||
Modal.createTrackedDialog('Integrations Manager', '', IntegrationsManager, {
|
|
||||||
room: this.props.room,
|
room: this.props.room,
|
||||||
screen: `type_${widgetType}`,
|
screen: `type_${widgetType}`,
|
||||||
integrationId: this.state.widgetId,
|
integrationId: this.state.widgetId,
|
||||||
}, "mx_IntegrationsManager");
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue