Skip to content

Commit 576efe6

Browse files
authored
Add settings modal (#1128)
1 parent 2044a79 commit 576efe6

27 files changed

+231
-24
lines changed

.changeset/calm-seals-happen.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"apollo-client-devtools": patch
3+
---
4+
5+
Adds settings modal that displays the current devtools version with a link to the GitHub release page

jest.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ module.exports = {
22
preset: "ts-jest",
33
setupFilesAfterEnv: ["./test.setup.ts"],
44
testEnvironment: "jsdom",
5+
globals: {
6+
VERSION: "0.0.0",
7+
},
58
testPathIgnorePatterns: [
69
"<rootDir>/build",
710
"<rootDir>/dist",

package-lock.json

Lines changed: 37 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
"@apollo/client": "^3.7.10",
3838
"@apollo/space-kit": "^9.11.0",
3939
"@emotion/react": "^11.11.1",
40+
"@headlessui/react": "^1.7.17",
41+
"@heroicons/react": "^2.0.18",
4042
"@radix-ui/react-tabs": "^1.0.2",
4143
"graphql": "^16.0.0",
4244
"graphql-tag": "^2.11.0",
@@ -92,6 +94,7 @@
9294
"postcss": "8.4.31",
9395
"postcss-loader": "7.3.3",
9496
"prettier": "3.0.3",
97+
"resize-observer-polyfill": "1.5.1",
9598
"rimraf": "5.0.5",
9699
"style-loader": "3.3.3",
97100
"tailwindcss": "3.3.3",

src/application/components/Cache/Cache.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,10 @@ export function Cache({
8383
<Header>
8484
{dataExists ? (
8585
<Fragment>
86-
<h1 className="font-monospace font-normal text-xl">
86+
<h1
87+
className="font-monospace font-normal text-xl"
88+
data-testid="cache-id"
89+
>
8790
<code>{cacheId || undefined}</code>
8891
</h1>
8992
<span className="font-sans text-grey-light uppercase text-xs mt-1 ml-2">

src/application/components/Cache/__tests__/Cache.test.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,8 @@ describe("Cache component tests", () => {
7070

7171
it("should leave the header blank instead of trying to show a cache ID", async () => {
7272
renderWithApolloClient(<Cache navigationProps={navigationProps} />);
73-
const header = screen.getByTestId("header");
74-
await waitFor(() => {
75-
expect(header.firstChild).not.toBeInTheDocument();
76-
});
73+
const cacheId = screen.queryByTestId("cache-id");
74+
expect(cacheId).toBeNull();
7775
});
7876
});
7977

src/application/components/Cache/main/EntityView.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @jsxImportSource @emotion/react */
12
import { css } from "@emotion/react";
23
import { JSONTree } from "react-json-tree";
34
import { rem } from "polished";

src/application/components/Cache/sidebar/EntityList.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @jsxImportSource @emotion/react */
12
import { css } from "@emotion/react";
23
import { List } from "@apollo/space-kit/List";
34
import { ListItem } from "@apollo/space-kit/ListItem";

src/application/components/Cache/sidebar/Search.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @jsxImportSource @emotion/react */
12
import { IconSearch } from "@apollo/space-kit/icons/IconSearch";
23
import { TextField } from "@apollo/space-kit/TextField";
34
import { colors } from "@apollo/space-kit/colors";

src/application/components/Explorer/Explorer.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/** @jsxImportSource @emotion/react */
12
import { useMemo } from "react";
23
import { css } from "@emotion/react";
34
import { rem } from "polished";
@@ -48,7 +49,7 @@ export enum FetchPolicy {
4849
const headerStyles = css`
4950
display: flex;
5051
align-items: center;
51-
padding: 0 ${rem(16)};
52+
padding: 0 0.75rem;
5253
background-color: var(--primary);
5354
box-shadow: 0 ${rem(-1)} 0 0 rgba(255, 255, 255, 0.3) inset;
5455
`;

0 commit comments

Comments
 (0)