mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-19 17:01:13 +00:00
Removed broken feature to display PR url in DE console (#2249)
This commit is contained in:
@@ -7,7 +7,6 @@ const backendEndpoint = "https://cdb-ms-mpac-pbe.cosmos.azure.com";
|
|||||||
const previewSiteEndpoint = "https://dataexplorer-preview.azurewebsites.net";
|
const previewSiteEndpoint = "https://dataexplorer-preview.azurewebsites.net";
|
||||||
const previewStorageWebsiteEndpoint = "https://dataexplorerpreview.z5.web.core.windows.net/";
|
const previewStorageWebsiteEndpoint = "https://dataexplorerpreview.z5.web.core.windows.net/";
|
||||||
const githubApiUrl = "https://api.github.com/repos/Azure/cosmos-explorer";
|
const githubApiUrl = "https://api.github.com/repos/Azure/cosmos-explorer";
|
||||||
const githubPullRequestUrl = "https://github.com/Azure/cosmos-explorer/pull";
|
|
||||||
const azurePortalMpacEndpoint = "https://ms.portal.azure.com/";
|
const azurePortalMpacEndpoint = "https://ms.portal.azure.com/";
|
||||||
|
|
||||||
const api = createProxyMiddleware({
|
const api = createProxyMiddleware({
|
||||||
@@ -57,11 +56,7 @@ app.get("/pull/:pr(\\d+)", (req, res) => {
|
|||||||
|
|
||||||
fetch(`${githubApiUrl}/pulls/${pr}`)
|
fetch(`${githubApiUrl}/pulls/${pr}`)
|
||||||
.then((response) => response.json())
|
.then((response) => response.json())
|
||||||
.then(({ head: { ref, sha } }) => {
|
.then(({ head: { sha } }) => {
|
||||||
const prUrl = new URL(`${githubPullRequestUrl}/${pr}`);
|
|
||||||
prUrl.hash = ref;
|
|
||||||
search.set("feature.pr", prUrl.href);
|
|
||||||
|
|
||||||
const explorer = new URL(`${previewSiteEndpoint}/commit/${sha}/explorer.html`);
|
const explorer = new URL(`${previewSiteEndpoint}/commit/${sha}/explorer.html`);
|
||||||
explorer.search = search.toString();
|
explorer.search = search.toString();
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ import InfoIcon from "../../../../images/info_color.svg";
|
|||||||
import LoadingIcon from "../../../../images/loading.svg";
|
import LoadingIcon from "../../../../images/loading.svg";
|
||||||
import WarningIcon from "../../../../images/warning.svg";
|
import WarningIcon from "../../../../images/warning.svg";
|
||||||
import { ClientDefaults, KeyCodes } from "../../../Common/Constants";
|
import { ClientDefaults, KeyCodes } from "../../../Common/Constants";
|
||||||
import { userContext } from "../../../UserContext";
|
|
||||||
import { useNotificationConsole } from "../../../hooks/useNotificationConsole";
|
import { useNotificationConsole } from "../../../hooks/useNotificationConsole";
|
||||||
import { ConsoleData, ConsoleDataType } from "./ConsoleData";
|
import { ConsoleData, ConsoleDataType } from "./ConsoleData";
|
||||||
|
|
||||||
@@ -127,7 +126,6 @@ export class NotificationConsoleComponent extends React.Component<
|
|||||||
<span className="numWarningItems">{numWarningItems}</span>
|
<span className="numWarningItems">{numWarningItems}</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
{userContext.features.pr && <PrPreview pr={userContext.features.pr} />}
|
|
||||||
<span className="consoleSplitter" />
|
<span className="consoleSplitter" />
|
||||||
<span className="headerStatus">
|
<span className="headerStatus">
|
||||||
<span className="headerStatusEllipsis" aria-live="assertive" aria-atomic="true">
|
<span className="headerStatusEllipsis" aria-live="assertive" aria-atomic="true">
|
||||||
@@ -293,21 +291,6 @@ export class NotificationConsoleComponent extends React.Component<
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const PrPreview = (props: { pr: string }) => {
|
|
||||||
const url = new URL(props.pr);
|
|
||||||
const [, ref] = url.hash.split("#");
|
|
||||||
url.hash = "";
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<span className="consoleSplitter" />
|
|
||||||
<a target="_blank" rel="noreferrer" href={url.href} style={{ marginRight: "1em", fontWeight: "bold" }}>
|
|
||||||
{ref}
|
|
||||||
</a>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export const NotificationConsole: React.FC = () => {
|
export const NotificationConsole: React.FC = () => {
|
||||||
const setIsExpanded = useNotificationConsole((state) => state.setIsExpanded);
|
const setIsExpanded = useNotificationConsole((state) => state.setIsExpanded);
|
||||||
const isExpanded = useNotificationConsole((state) => state.isExpanded);
|
const isExpanded = useNotificationConsole((state) => state.isExpanded);
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ export type Features = {
|
|||||||
readonly notebookServerUrl?: string;
|
readonly notebookServerUrl?: string;
|
||||||
readonly sandboxNotebookOutputs: boolean;
|
readonly sandboxNotebookOutputs: boolean;
|
||||||
readonly selfServeType?: string;
|
readonly selfServeType?: string;
|
||||||
readonly pr?: string;
|
|
||||||
readonly showMinRUSurvey: boolean;
|
readonly showMinRUSurvey: boolean;
|
||||||
readonly ttl90Days: boolean;
|
readonly ttl90Days: boolean;
|
||||||
readonly mongoProxyEndpoint?: string;
|
readonly mongoProxyEndpoint?: string;
|
||||||
@@ -96,7 +95,6 @@ export function extractFeatures(given = new URLSearchParams(window.location.sear
|
|||||||
notebookServerUrl: get("notebookserverurl"),
|
notebookServerUrl: get("notebookserverurl"),
|
||||||
sandboxNotebookOutputs: "true" === get("sandboxnotebookoutputs", "true"),
|
sandboxNotebookOutputs: "true" === get("sandboxnotebookoutputs", "true"),
|
||||||
selfServeType: get("selfservetype"),
|
selfServeType: get("selfservetype"),
|
||||||
pr: get("pr"),
|
|
||||||
showMinRUSurvey: "true" === get("showminrusurvey"),
|
showMinRUSurvey: "true" === get("showminrusurvey"),
|
||||||
ttl90Days: "true" === get("ttl90days"),
|
ttl90Days: "true" === get("ttl90days"),
|
||||||
autoscaleDefault: "true" === get("autoscaledefault"),
|
autoscaleDefault: "true" === get("autoscaledefault"),
|
||||||
|
|||||||
Reference in New Issue
Block a user