mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-02-27 06:27:59 +00:00
Fix code formatting issues
This commit is contained in:
parent
70682128bf
commit
8c74353794
@ -1,9 +1,9 @@
|
||||
import { Platform, configContext } from "../ConfigContext";
|
||||
|
||||
export let StyleConstants = require("less-vars-loader!../../less/Common/Constants.less");
|
||||
export const StyleConstants = require("less-vars-loader!../../less/Common/Constants.less");
|
||||
|
||||
export function updateStyles(): void {
|
||||
if (configContext.platform == Platform.Fabric) {
|
||||
if (configContext.platform === Platform.Fabric) {
|
||||
StyleConstants.AccentMediumHigh = StyleConstants.FabricAccentMediumHigh;
|
||||
StyleConstants.AccentMedium = StyleConstants.FabricAccentMedium;
|
||||
StyleConstants.AccentLight = StyleConstants.FabricAccentLight;
|
||||
|
@ -1321,8 +1321,9 @@ export default class Explorer {
|
||||
await useNotebook.getState().refreshNotebooksEnabledStateForAccount();
|
||||
|
||||
// TODO: remove reference to isNotebookEnabled and isNotebooksEnabledForAccount
|
||||
const isNotebookEnabled = configContext.platform != Platform.Fabric && (
|
||||
userContext.features.notebooksDownBanner ||
|
||||
const isNotebookEnabled =
|
||||
configContext.platform !== Platform.Fabric &&
|
||||
(userContext.features.notebooksDownBanner ||
|
||||
useNotebook.getState().isPhoenixNotebooks ||
|
||||
useNotebook.getState().isPhoenixFeatures);
|
||||
useNotebook.getState().setIsNotebookEnabled(isNotebookEnabled);
|
||||
|
@ -83,16 +83,19 @@ export const CommandBar: React.FC<Props> = ({ container }: Props) => {
|
||||
);
|
||||
}
|
||||
|
||||
const rootStyle = configContext.platform == Platform.Fabric ? {
|
||||
const rootStyle =
|
||||
configContext.platform == Platform.Fabric
|
||||
? {
|
||||
root: {
|
||||
backgroundColor: "transparent",
|
||||
padding: "0px 14px 0px 14px"
|
||||
padding: "0px 14px 0px 14px",
|
||||
},
|
||||
}
|
||||
} : {
|
||||
: {
|
||||
root: {
|
||||
backgroundColor: backgroundColor,
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="commandBarContainer">
|
||||
|
@ -54,7 +54,12 @@ export function createStaticCommandBarButtons(
|
||||
const buttons: CommandButtonComponentProps[] = [];
|
||||
|
||||
buttons.push(newCollectionBtn);
|
||||
if (userContext.apiType !== "Tables" && userContext.apiType !== "Cassandra" && configContext.platform != Platform.Fabric) {
|
||||
if (
|
||||
configContext.platform !== Platform.Fabric &&
|
||||
userContext.apiType !== "Tables" &&
|
||||
userContext.apiType !== "Cassandra"
|
||||
|
||||
) {
|
||||
const addSynapseLink = createOpenSynapseLinkDialogButton(container);
|
||||
|
||||
if (addSynapseLink) {
|
||||
@ -257,7 +262,9 @@ export function createDivider(): CommandButtonComponentProps {
|
||||
}
|
||||
|
||||
function areScriptsSupported(): boolean {
|
||||
return configContext.platform != Platform.Fabric && (userContext.apiType === "SQL" || userContext.apiType === "Gremlin");
|
||||
return (
|
||||
configContext.platform !== Platform.Fabric && (userContext.apiType === "SQL" || userContext.apiType === "Gremlin")
|
||||
);
|
||||
}
|
||||
|
||||
function createNewCollectionGroup(container: Explorer): CommandButtonComponentProps {
|
||||
|
@ -26,7 +26,8 @@ import { MemoryTracker } from "./MemoryTrackerComponent";
|
||||
export const convertButton = (btns: CommandButtonComponentProps[], backgroundColor: string): ICommandBarItemProps[] => {
|
||||
const buttonHeightPx = StyleConstants.CommandBarButtonHeight;
|
||||
|
||||
const hoverColor = configContext.platform == Platform.Fabric ? StyleConstants.FabricAccentLight : StyleConstants.AccentLight;
|
||||
const hoverColor =
|
||||
configContext.platform == Platform.Fabric ? StyleConstants.FabricAccentLight : StyleConstants.AccentLight;
|
||||
|
||||
const getFilter = (isDisabled: boolean): string => {
|
||||
if (isDisabled) {
|
||||
|
11
src/Main.tsx
11
src/Main.tsx
@ -144,14 +144,15 @@ const App: React.FunctionComponent = () => {
|
||||
ReactDOM.render(<App />, document.body);
|
||||
|
||||
function LoadFabricOverrides(): JSX.Element {
|
||||
|
||||
if (configContext.platform == Platform.Fabric) {
|
||||
if (configContext.platform === Platform.Fabric) {
|
||||
const FabricStyle = React.lazy(() => import("./Platform/Fabric/FabricPlatform"));
|
||||
return (
|
||||
<React.Suspense fallback={<div></div>}><FabricStyle /></React.Suspense>
|
||||
)
|
||||
<React.Suspense fallback={<div></div>}>
|
||||
<FabricStyle />
|
||||
</React.Suspense>
|
||||
);
|
||||
} else {
|
||||
return (<></>);
|
||||
return <></>;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,5 @@
|
||||
import React from "react";
|
||||
import "../../../less/documentDBFabric.less";
|
||||
export default function InitFabric() {
|
||||
return (
|
||||
<></>
|
||||
);
|
||||
return <></>;
|
||||
}
|
@ -204,5 +204,5 @@ export const appThemeFabric: Theme = createTheme({
|
||||
* Color code for greenLight.
|
||||
*/
|
||||
greenLight: "#13a10e",
|
||||
}
|
||||
},
|
||||
});
|
@ -5,7 +5,8 @@ export const getDataExplorerWindow = (currentWindow: Window): Window | undefined
|
||||
if (currentWindow.parent === currentWindow) {
|
||||
return undefined;
|
||||
}
|
||||
if (currentWindow.parent.parent === currentWindow.top) { // Fabric
|
||||
if (currentWindow.parent.parent === currentWindow.top) {
|
||||
// Fabric
|
||||
return currentWindow;
|
||||
}
|
||||
if (currentWindow.parent === currentWindow.top) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user