Rename components to be less EMS specific
This commit is contained in:
parent
129795c2ec
commit
7a358b1ca3
8 changed files with 23 additions and 23 deletions
|
@ -69,7 +69,7 @@
|
||||||
@import "./views/dialogs/_DeactivateAccountDialog.scss";
|
@import "./views/dialogs/_DeactivateAccountDialog.scss";
|
||||||
@import "./views/dialogs/_DevtoolsDialog.scss";
|
@import "./views/dialogs/_DevtoolsDialog.scss";
|
||||||
@import "./views/dialogs/_EditCommunityPrototypeDialog.scss";
|
@import "./views/dialogs/_EditCommunityPrototypeDialog.scss";
|
||||||
@import "./views/dialogs/_EMSElementProDialog.scss";
|
@import "./views/dialogs/_ElementProDialog.scss";
|
||||||
@import "./views/dialogs/_FeedbackDialog.scss";
|
@import "./views/dialogs/_FeedbackDialog.scss";
|
||||||
@import "./views/dialogs/_GroupAddressPicker.scss";
|
@import "./views/dialogs/_GroupAddressPicker.scss";
|
||||||
@import "./views/dialogs/_IncomingSasDialog.scss";
|
@import "./views/dialogs/_IncomingSasDialog.scss";
|
||||||
|
|
|
@ -14,16 +14,16 @@ See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.mx_EMSElementProDialog .mx_Dialog {
|
.mx_ElementProDialog .mx_Dialog {
|
||||||
height: 66%;
|
height: 66%;
|
||||||
min-width: 50%;
|
min-width: 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mx_EMSElementProBaseDialog {
|
.mx_ElementProBaseDialog {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mx_EMSElementProDialog_container {
|
.mx_ElementProDialog_container {
|
||||||
height: 90%;
|
height: 90%;
|
||||||
|
|
||||||
iframe {
|
iframe {
|
|
@ -15,7 +15,7 @@ limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import EMSElementProDialog from "../views/dialogs/EMSElementProDialog";
|
import ElementProDialog from "../views/dialogs/ElementProDialog";
|
||||||
import Modal, {IHandle} from "../../Modal";
|
import Modal, {IHandle} from "../../Modal";
|
||||||
import {
|
import {
|
||||||
IconizedContextMenuOption,
|
IconizedContextMenuOption,
|
||||||
|
@ -27,15 +27,15 @@ interface IProps {}
|
||||||
|
|
||||||
interface IState {}
|
interface IState {}
|
||||||
|
|
||||||
export default class EMSElementProAction extends React.PureComponent<IProps, IState> {
|
export default class ElementProAction extends React.PureComponent<IProps, IState> {
|
||||||
private closingAllowed = false;
|
private closingAllowed = false;
|
||||||
private modalRef: IHandle<void[]>;
|
private modalRef: IHandle<void[]>;
|
||||||
|
|
||||||
private openDialog = () => {
|
private openDialog = () => {
|
||||||
this.modalRef = Modal.createTrackedDialog(
|
this.modalRef = Modal.createTrackedDialog(
|
||||||
'Element Pro Open', '', EMSElementProDialog, {
|
'Element Pro Open', '', ElementProDialog, {
|
||||||
requestClose: this.requestClose,
|
requestClose: this.requestClose,
|
||||||
}, "mx_EMSElementProDialog", false, true, {
|
}, "mx_ElementProDialog", false, true, {
|
||||||
onBeforeClose: async () => this.closingAllowed,
|
onBeforeClose: async () => this.closingAllowed,
|
||||||
},
|
},
|
||||||
);
|
);
|
|
@ -51,7 +51,7 @@ import { RightPanelPhases } from "../../stores/RightPanelStorePhases";
|
||||||
import ErrorDialog from "../views/dialogs/ErrorDialog";
|
import ErrorDialog from "../views/dialogs/ErrorDialog";
|
||||||
import EditCommunityPrototypeDialog from "../views/dialogs/EditCommunityPrototypeDialog";
|
import EditCommunityPrototypeDialog from "../views/dialogs/EditCommunityPrototypeDialog";
|
||||||
import {UIFeature} from "../../settings/UIFeature";
|
import {UIFeature} from "../../settings/UIFeature";
|
||||||
import EMSElementProAction from "./EMSElementProAction";
|
import ElementProAction from "./ElementProAction";
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
isMinimized: boolean;
|
isMinimized: boolean;
|
||||||
|
@ -274,7 +274,7 @@ export default class UserMenu extends React.Component<IProps, IState> {
|
||||||
|
|
||||||
let topSection;
|
let topSection;
|
||||||
const signupLink = getHostingLink("user-context-menu");
|
const signupLink = getHostingLink("user-context-menu");
|
||||||
const elementProConfig = SdkConfig.get().ems_element_pro;
|
const elementProConfig = SdkConfig.get().element_pro;
|
||||||
if (MatrixClientPeg.get().isGuest()) {
|
if (MatrixClientPeg.get().isGuest()) {
|
||||||
topSection = (
|
topSection = (
|
||||||
<div className="mx_UserMenu_contextMenu_header mx_UserMenu_contextMenu_guestPrompts">
|
<div className="mx_UserMenu_contextMenu_header mx_UserMenu_contextMenu_guestPrompts">
|
||||||
|
@ -297,7 +297,7 @@ export default class UserMenu extends React.Component<IProps, IState> {
|
||||||
} else if (signupLink || elementProConfig) {
|
} else if (signupLink || elementProConfig) {
|
||||||
let elementProIFrame;
|
let elementProIFrame;
|
||||||
if (elementProConfig && elementProConfig.url) {
|
if (elementProConfig && elementProConfig.url) {
|
||||||
// If ems_element_pro.domains is set to a non-empty array, only show
|
// If element_pro.domains is set to a non-empty array, only show
|
||||||
// dialog if the user is on the domain or a subdomain.
|
// dialog if the user is on the domain or a subdomain.
|
||||||
const elementProDomains = elementProConfig.domains || [];
|
const elementProDomains = elementProConfig.domains || [];
|
||||||
const mxDomain = MatrixClientPeg.get().getDomain();
|
const mxDomain = MatrixClientPeg.get().getDomain();
|
||||||
|
@ -307,7 +307,7 @@ export default class UserMenu extends React.Component<IProps, IState> {
|
||||||
className=""
|
className=""
|
||||||
onClick={this.onCloseMenu}
|
onClick={this.onCloseMenu}
|
||||||
>
|
>
|
||||||
<EMSElementProAction />
|
<ElementProAction />
|
||||||
</div>;
|
</div>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ interface IState {}
|
||||||
/*
|
/*
|
||||||
* A dialog for confirming closing the Element Pro setup dialog.
|
* A dialog for confirming closing the Element Pro setup dialog.
|
||||||
*/
|
*/
|
||||||
export default class EMSElementProConfirmCloseDialog extends React.PureComponent<IProps, IState> {
|
export default class ElementProConfirmCloseDialog extends React.PureComponent<IProps, IState> {
|
||||||
public render() {
|
public render() {
|
||||||
return (
|
return (
|
||||||
<QuestionDialog
|
<QuestionDialog
|
|
@ -28,7 +28,7 @@ interface IState {}
|
||||||
/*
|
/*
|
||||||
* A dialog for confirming transfer of data to the Element Pro iframe.
|
* A dialog for confirming transfer of data to the Element Pro iframe.
|
||||||
*/
|
*/
|
||||||
export default class EMSElementProDataConfirmDialog extends React.PureComponent<IProps, IState> {
|
export default class ElementProDataConfirmDialog extends React.PureComponent<IProps, IState> {
|
||||||
public render() {
|
public render() {
|
||||||
return (
|
return (
|
||||||
<QuestionDialog
|
<QuestionDialog
|
|
@ -16,14 +16,14 @@ limitations under the License.
|
||||||
|
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import BaseDialog from '../../views/dialogs/BaseDialog';
|
import BaseDialog from '../../views/dialogs/BaseDialog';
|
||||||
import EMSElementProConfirmCloseDialog from './EMSElementProConfirmCloseDialog';
|
import ElementProConfirmCloseDialog from './ElementProConfirmCloseDialog';
|
||||||
import EMSElementProDataConfirmDialog from './EMSElementProDataConfirmDialog';
|
import ElementProDataConfirmDialog from './ElementProDataConfirmDialog';
|
||||||
import Modal from "../../../Modal";
|
import Modal from "../../../Modal";
|
||||||
import SdkConfig from "../../../SdkConfig";
|
import SdkConfig from "../../../SdkConfig";
|
||||||
import {_t} from "../../../languageHandler";
|
import {_t} from "../../../languageHandler";
|
||||||
import {MatrixClientPeg} from "../../../MatrixClientPeg";
|
import {MatrixClientPeg} from "../../../MatrixClientPeg";
|
||||||
import {OwnProfileStore} from "../../../stores/OwnProfileStore";
|
import {OwnProfileStore} from "../../../stores/OwnProfileStore";
|
||||||
import {IPostmessage, IPostmessageResponseData, PostmessageAction} from "./EMSElementProDialogTypes";
|
import {IPostmessage, IPostmessageResponseData, PostmessageAction} from "./ElementProDialogTypes";
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
requestClose(): void;
|
requestClose(): void;
|
||||||
|
@ -34,7 +34,7 @@ interface IState {
|
||||||
error: string;
|
error: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class EMSElementProDialog extends React.PureComponent<IProps, IState> {
|
export default class ElementProDialog extends React.PureComponent<IProps, IState> {
|
||||||
private iframeRef: React.RefObject<HTMLIFrameElement> = React.createRef();
|
private iframeRef: React.RefObject<HTMLIFrameElement> = React.createRef();
|
||||||
private readonly elementProSetupUrl: string;
|
private readonly elementProSetupUrl: string;
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ export default class EMSElementProDialog extends React.PureComponent<IProps, ISt
|
||||||
error: null,
|
error: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
this.elementProSetupUrl = SdkConfig.get().ems_element_pro.url;
|
this.elementProSetupUrl = SdkConfig.get().element_pro.url;
|
||||||
}
|
}
|
||||||
|
|
||||||
private messageHandler = (message: IPostmessage) => {
|
private messageHandler = (message: IPostmessage) => {
|
||||||
|
@ -56,7 +56,7 @@ export default class EMSElementProDialog extends React.PureComponent<IProps, ISt
|
||||||
switch (message.data.action) {
|
switch (message.data.action) {
|
||||||
case PostmessageAction.ElementProAccountDetailsRequest:
|
case PostmessageAction.ElementProAccountDetailsRequest:
|
||||||
Modal.createDialog(
|
Modal.createDialog(
|
||||||
EMSElementProDataConfirmDialog,
|
ElementProDataConfirmDialog,
|
||||||
{
|
{
|
||||||
onFinished: result => {
|
onFinished: result => {
|
||||||
if (result) {
|
if (result) {
|
||||||
|
@ -85,7 +85,7 @@ export default class EMSElementProDialog extends React.PureComponent<IProps, ISt
|
||||||
this.props.requestClose();
|
this.props.requestClose();
|
||||||
} else {
|
} else {
|
||||||
Modal.createDialog(
|
Modal.createDialog(
|
||||||
EMSElementProConfirmCloseDialog,
|
ElementProConfirmCloseDialog,
|
||||||
{
|
{
|
||||||
onFinished: result => {
|
onFinished: result => {
|
||||||
if (result) {
|
if (result) {
|
||||||
|
@ -133,13 +133,13 @@ export default class EMSElementProDialog extends React.PureComponent<IProps, ISt
|
||||||
public render(): React.ReactNode {
|
public render(): React.ReactNode {
|
||||||
return (
|
return (
|
||||||
<BaseDialog
|
<BaseDialog
|
||||||
className="mx_EMSElementProBaseDialog"
|
className="mx_ElementProBaseDialog"
|
||||||
onFinished={this.onFinished}
|
onFinished={this.onFinished}
|
||||||
title={_t("Set up your own personal Element host")}
|
title={_t("Set up your own personal Element host")}
|
||||||
hasCancel={true}
|
hasCancel={true}
|
||||||
fixedWidth={false}
|
fixedWidth={false}
|
||||||
>
|
>
|
||||||
<div className="mx_EMSElementProDialog_container">
|
<div className="mx_ElementProDialog_container">
|
||||||
<iframe
|
<iframe
|
||||||
src={this.elementProSetupUrl}
|
src={this.elementProSetupUrl}
|
||||||
ref={this.iframeRef}
|
ref={this.iframeRef}
|
Loading…
Reference in a new issue