mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-02-16 17:25:58 +00:00
Merge branch 'master' of https://github.com/Azure/cosmos-explorer into new-accessibility-2262594
This commit is contained in:
commit
fe0457bcb0
@ -1,6 +1,7 @@
|
|||||||
import { FabricMessageTypes } from "Contracts/FabricMessageTypes";
|
import { FabricMessageTypes } from "Contracts/FabricMessageTypes";
|
||||||
import Q from "q";
|
import Q from "q";
|
||||||
import * as _ from "underscore";
|
import * as _ from "underscore";
|
||||||
|
import * as Logger from "../Common/Logger";
|
||||||
import { MessageTypes } from "../Contracts/ExplorerContracts";
|
import { MessageTypes } from "../Contracts/ExplorerContracts";
|
||||||
import { getDataExplorerWindow } from "../Utils/WindowUtils";
|
import { getDataExplorerWindow } from "../Utils/WindowUtils";
|
||||||
import * as Constants from "./Constants";
|
import * as Constants from "./Constants";
|
||||||
@ -96,10 +97,18 @@ const _sendMessage = (message: any): void => {
|
|||||||
const portalChildWindow = getDataExplorerWindow(window) || window;
|
const portalChildWindow = getDataExplorerWindow(window) || window;
|
||||||
if (portalChildWindow === window) {
|
if (portalChildWindow === window) {
|
||||||
// Current window is a child of portal, send message to portal window
|
// Current window is a child of portal, send message to portal window
|
||||||
portalChildWindow.parent.postMessage(message, portalChildWindow.document.referrer || "*");
|
if (portalChildWindow.document.referrer) {
|
||||||
|
portalChildWindow.parent.postMessage(message, portalChildWindow.document.referrer);
|
||||||
|
} else {
|
||||||
|
Logger.logError("Iframe failed to send message to portal", "MessageHandler");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// Current window is not a child of portal, send message to the child window instead (which is data explorer)
|
// Current window is not a child of portal, send message to the child window instead (which is data explorer)
|
||||||
portalChildWindow.postMessage(message, portalChildWindow.location.origin || "*");
|
if (portalChildWindow.location.origin) {
|
||||||
|
portalChildWindow.postMessage(message, portalChildWindow.location.origin);
|
||||||
|
} else {
|
||||||
|
Logger.logError("Iframe failed to send message to data explorer", "MessageHandler");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -162,7 +162,7 @@ export const addRootChildToGraph = (
|
|||||||
* @param value
|
* @param value
|
||||||
*/
|
*/
|
||||||
export const escapeDoubleQuotes = (value: string): string => {
|
export const escapeDoubleQuotes = (value: string): string => {
|
||||||
return value === undefined ? value : value.replace(/"/g, '\\"');
|
return value === undefined ? value : value.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -186,5 +186,5 @@ export const getQuotedPropValue = (ip: ViewModels.InputPropertyValue): string =>
|
|||||||
* @param value
|
* @param value
|
||||||
*/
|
*/
|
||||||
export const escapeSingleQuotes = (value: string): string => {
|
export const escapeSingleQuotes = (value: string): string => {
|
||||||
return value === undefined ? value : value.replace(/'/g, "\\'");
|
return value === undefined ? value : value.replace(/\\/g, "\\\\").replace(/'/g, "\\'");
|
||||||
};
|
};
|
||||||
|
@ -576,9 +576,7 @@ export class AddCollectionPanel extends React.Component<AddCollectionPanelProps,
|
|||||||
</TooltipHost>
|
</TooltipHost>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
<Text variant="small" aria-label="pkDescription">
|
<Text variant="small">{this.getPartitionKeySubtext()}</Text>
|
||||||
{this.getPartitionKeySubtext()}
|
|
||||||
</Text>
|
|
||||||
|
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
|
@ -264,7 +264,7 @@ export const ChangePartitionKeyPane: React.FC<ChangePartitionKeyPaneProps> = ({
|
|||||||
</TooltipHost>
|
</TooltipHost>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
<Text variant="small" aria-label="pkDescription">
|
<Text variant="small">
|
||||||
{getPartitionKeySubtext(userContext.features.partitionKeyDefault, userContext.apiType)}
|
{getPartitionKeySubtext(userContext.features.partitionKeyDefault, userContext.apiType)}
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
|
@ -223,7 +223,6 @@ exports[`AddCollectionPanel should render Default properly 1`] = `
|
|||||||
</StyledTooltipHostBase>
|
</StyledTooltipHostBase>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Text
|
<Text
|
||||||
aria-label="pkDescription"
|
|
||||||
variant="small"
|
variant="small"
|
||||||
/>
|
/>
|
||||||
<input
|
<input
|
||||||
|
Loading…
x
Reference in New Issue
Block a user