mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-05-15 09:47:30 +01:00
Add Session Id (#2263)
* adding sessionId to UserContext * add session id * add session id to settings pane and fix npm run compile * Add conditional for Portal * set default session id on userContext init * fix tests --------- Co-authored-by: Asier Isayas <aisayas@microsoft.com>
This commit is contained in:
@@ -5,6 +5,12 @@ import { updateUserContext } from "../../../UserContext";
|
||||
import { SettingsPane } from "./SettingsPane";
|
||||
|
||||
describe("Settings Pane", () => {
|
||||
beforeEach(() => {
|
||||
updateUserContext({
|
||||
sessionId: "1234-5678",
|
||||
});
|
||||
});
|
||||
|
||||
it("should render Default properly", () => {
|
||||
const wrapper = shallow(<SettingsPane explorer={null} />);
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
|
||||
@@ -212,6 +212,7 @@ export const SettingsPane: FunctionComponent<{ explorer: Explorer }> = ({
|
||||
const styles = useStyles();
|
||||
|
||||
const explorerVersion = configContext.gitSha;
|
||||
const sessionId: string = userContext.sessionId;
|
||||
const isEmulator = configContext.platform === Platform.Emulator;
|
||||
const shouldShowQueryPageOptions = userContext.apiType === "SQL";
|
||||
const showRetrySettings =
|
||||
@@ -1227,6 +1228,12 @@ export const SettingsPane: FunctionComponent<{ explorer: Explorer }> = ({
|
||||
<div>{explorerVersion}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="settingsSection">
|
||||
<div className="settingsSectionPart">
|
||||
<div className="settingsSectionLabel">Session ID</div>
|
||||
<div>{sessionId}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</RightPaneForm>
|
||||
);
|
||||
|
||||
@@ -649,6 +649,22 @@ exports[`Settings Pane should render Default properly 1`] = `
|
||||
<div />
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
className="settingsSection"
|
||||
>
|
||||
<div
|
||||
className="settingsSectionPart"
|
||||
>
|
||||
<div
|
||||
className="settingsSectionLabel"
|
||||
>
|
||||
Session ID
|
||||
</div>
|
||||
<div>
|
||||
1234-5678
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</RightPaneForm>
|
||||
`;
|
||||
@@ -958,6 +974,22 @@ exports[`Settings Pane should render Gremlin properly 1`] = `
|
||||
<div />
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
className="settingsSection"
|
||||
>
|
||||
<div
|
||||
className="settingsSectionPart"
|
||||
>
|
||||
<div
|
||||
className="settingsSectionLabel"
|
||||
>
|
||||
Session ID
|
||||
</div>
|
||||
<div>
|
||||
1234-5678
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</RightPaneForm>
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user