From 797591c51012fa82dd887fd8bd78b336df6a418a Mon Sep 17 00:00:00 2001 From: blam Date: Fri, 2 Sep 2022 13:20:59 +0200 Subject: [PATCH 01/15] chore: change how we load jest Signed-off-by: blam --- packages/cli/config/jest.js | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/packages/cli/config/jest.js b/packages/cli/config/jest.js index 028cc8d389..224927a215 100644 --- a/packages/cli/config/jest.js +++ b/packages/cli/config/jest.js @@ -131,10 +131,39 @@ async function getProjectConfig(targetPath, displayName) { }, transform: { - '\\.(js|jsx|ts|tsx|mjs|cjs)$': [ + '\\.(mjs|cjs)$': [ require.resolve('./jestSwcTransform'), { sourceMaps: envOptions.enableSourceMaps || envOptions.nextTests, + jsc: { + target: 'es2019', + parser: { + syntax: 'ecmascript', + }, + transform: { + react: { + runtime: 'automatic', + }, + }, + }, + }, + ], + '^.+\\.(t|j)sx?$': [ + require.resolve('./jestSwcTransform'), + { + sourceMaps: envOptions.enableSourceMaps || envOptions.nextTests, + jsc: { + parser: { + syntax: 'typescript', + tsx: true, + }, + + transform: { + react: { + runtime: 'automatic', + }, + }, + }, }, ], '\\.(bmp|gif|jpg|jpeg|png|frag|xml|svg|eot|woff|woff2|ttf)$': From 742cb4f3d7dc48a07e63fe3204d1d9c73d32ac47 Mon Sep 17 00:00:00 2001 From: blam Date: Fri, 2 Sep 2022 13:34:03 +0200 Subject: [PATCH 02/15] chore: update the config and add changeset Signed-off-by: blam --- .changeset/itchy-brooms-end.md | 5 +++++ packages/cli/config/jest.js | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 .changeset/itchy-brooms-end.md diff --git a/.changeset/itchy-brooms-end.md b/.changeset/itchy-brooms-end.md new file mode 100644 index 0000000000..632eb33d97 --- /dev/null +++ b/.changeset/itchy-brooms-end.md @@ -0,0 +1,5 @@ +--- +'@backstage/cli': patch +--- + +Fix issue when using `.jsx` files inside tests diff --git a/packages/cli/config/jest.js b/packages/cli/config/jest.js index 224927a215..a98149480e 100644 --- a/packages/cli/config/jest.js +++ b/packages/cli/config/jest.js @@ -148,7 +148,7 @@ async function getProjectConfig(targetPath, displayName) { }, }, ], - '^.+\\.(t|j)sx?$': [ + '\\.(t|j)sx?$': [ require.resolve('./jestSwcTransform'), { sourceMaps: envOptions.enableSourceMaps || envOptions.nextTests, @@ -157,7 +157,6 @@ async function getProjectConfig(targetPath, displayName) { syntax: 'typescript', tsx: true, }, - transform: { react: { runtime: 'automatic', From b46b4565014bc8c6dabd5647514dfa22fef5f3a7 Mon Sep 17 00:00:00 2001 From: blam Date: Fri, 2 Sep 2022 13:41:39 +0200 Subject: [PATCH 03/15] chore: split up the config Signed-off-by: blam --- packages/cli/config/jest.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/packages/cli/config/jest.js b/packages/cli/config/jest.js index a98149480e..1615c8a3fc 100644 --- a/packages/cli/config/jest.js +++ b/packages/cli/config/jest.js @@ -148,7 +148,24 @@ async function getProjectConfig(targetPath, displayName) { }, }, ], - '\\.(t|j)sx?$': [ + '\\.jsx?$': [ + require.resolve('./jestSwcTransform'), + { + sourceMaps: envOptions.enableSourceMaps || envOptions.nextTests, + jsc: { + parser: { + syntax: 'ecmascript', + jsx: true, + }, + transform: { + react: { + runtime: 'automatic', + }, + }, + }, + }, + ], + '\\.tsx?$': [ require.resolve('./jestSwcTransform'), { sourceMaps: envOptions.enableSourceMaps || envOptions.nextTests, From c68a6ecbe6aacbe10db4d586356f0dcc9798b1bc Mon Sep 17 00:00:00 2001 From: blam Date: Fri, 2 Sep 2022 13:51:29 +0200 Subject: [PATCH 04/15] chore: turn off tsx for .ts files Signed-off-by: blam --- packages/cli/config/jest.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/packages/cli/config/jest.js b/packages/cli/config/jest.js index 1615c8a3fc..82b6ace46b 100644 --- a/packages/cli/config/jest.js +++ b/packages/cli/config/jest.js @@ -136,7 +136,6 @@ async function getProjectConfig(targetPath, displayName) { { sourceMaps: envOptions.enableSourceMaps || envOptions.nextTests, jsc: { - target: 'es2019', parser: { syntax: 'ecmascript', }, @@ -165,7 +164,23 @@ async function getProjectConfig(targetPath, displayName) { }, }, ], - '\\.tsx?$': [ + '\\.ts$': [ + require.resolve('./jestSwcTransform'), + { + sourceMaps: envOptions.enableSourceMaps || envOptions.nextTests, + jsc: { + parser: { + syntax: 'typescript', + }, + transform: { + react: { + runtime: 'automatic', + }, + }, + }, + }, + ], + '\\.tsx$': [ require.resolve('./jestSwcTransform'), { sourceMaps: envOptions.enableSourceMaps || envOptions.nextTests, From d62982e62e2925cdba8dc5ca8a242b84ad8619fe Mon Sep 17 00:00:00 2001 From: blam Date: Fri, 2 Sep 2022 13:57:50 +0200 Subject: [PATCH 05/15] chore: starting to look nicer Signed-off-by: blam --- packages/cli/config/jest.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/cli/config/jest.js b/packages/cli/config/jest.js index 82b6ace46b..f4e84106eb 100644 --- a/packages/cli/config/jest.js +++ b/packages/cli/config/jest.js @@ -131,7 +131,7 @@ async function getProjectConfig(targetPath, displayName) { }, transform: { - '\\.(mjs|cjs)$': [ + '\\.(mjs|cjs|js)$': [ require.resolve('./jestSwcTransform'), { sourceMaps: envOptions.enableSourceMaps || envOptions.nextTests, @@ -147,7 +147,7 @@ async function getProjectConfig(targetPath, displayName) { }, }, ], - '\\.jsx?$': [ + '\\.jsx$': [ require.resolve('./jestSwcTransform'), { sourceMaps: envOptions.enableSourceMaps || envOptions.nextTests, @@ -172,11 +172,6 @@ async function getProjectConfig(targetPath, displayName) { parser: { syntax: 'typescript', }, - transform: { - react: { - runtime: 'automatic', - }, - }, }, }, ], From fd26698a4241358535216758f2e775fba6ad37a9 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Fri, 2 Sep 2022 13:04:37 +0200 Subject: [PATCH 06/15] graphiql: switch GraphiQLPage to .jsx Signed-off-by: Patrik Oldsberg --- .changeset/shaggy-buses-juggle.md | 5 +++++ .../GraphiQLPage/{GraphiQLPage.tsx => GraphiQLPage.jsx} | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 .changeset/shaggy-buses-juggle.md rename plugins/graphiql/src/components/GraphiQLPage/{GraphiQLPage.tsx => GraphiQLPage.jsx} (89%) diff --git a/.changeset/shaggy-buses-juggle.md b/.changeset/shaggy-buses-juggle.md new file mode 100644 index 0000000000..f43747a877 --- /dev/null +++ b/.changeset/shaggy-buses-juggle.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-graphiql': patch +--- + +Internal refactor diff --git a/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.tsx b/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.jsx similarity index 89% rename from plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.tsx rename to plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.jsx index 0b4399948a..a23193de39 100644 --- a/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.tsx +++ b/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.jsx @@ -13,6 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +// @ts-check +// NOTE: This file is intentionally .jsx, so that there is one file in this repo where we make sure .jsx files work. + import React from 'react'; import { useApi } from '@backstage/core-plugin-api'; import useAsync from 'react-use/lib/useAsync'; @@ -33,7 +37,8 @@ export const GraphiQLPage = () => { const graphQlBrowseApi = useApi(graphQlBrowseApiRef); const endpoints = useAsync(() => graphQlBrowseApi.getEndpoints()); - let content: JSX.Element; + /** @type JSX.Element */ + let content; if (endpoints.loading) { content = ( @@ -53,7 +58,7 @@ export const GraphiQLPage = () => { } else { content = ( - + ); } From ff142d29cccd1a5d81127911a35a49994e68179a Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Mon, 5 Sep 2022 10:59:09 +0200 Subject: [PATCH 07/15] cli: remove unnecessary react transforms in jest swc config Signed-off-by: Patrik Oldsberg --- packages/cli/config/jest.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/packages/cli/config/jest.js b/packages/cli/config/jest.js index f4e84106eb..9d113989ff 100644 --- a/packages/cli/config/jest.js +++ b/packages/cli/config/jest.js @@ -139,11 +139,6 @@ async function getProjectConfig(targetPath, displayName) { parser: { syntax: 'ecmascript', }, - transform: { - react: { - runtime: 'automatic', - }, - }, }, }, ], From f2d767f0226611f9815b48bd8db9944ff2da7278 Mon Sep 17 00:00:00 2001 From: blam Date: Tue, 6 Sep 2022 09:03:19 +0200 Subject: [PATCH 08/15] chore: expect an error for this as it could potentially be undefined Signed-off-by: blam --- plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.jsx b/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.jsx index a23193de39..4608278805 100644 --- a/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.jsx +++ b/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.jsx @@ -58,6 +58,7 @@ export const GraphiQLPage = () => { } else { content = ( + {/* @ts-expect-error */} ); From 1f00a3bd43146a7b9570239b996522720f52ca52 Mon Sep 17 00:00:00 2001 From: blam Date: Tue, 6 Sep 2022 09:04:57 +0200 Subject: [PATCH 09/15] chore: fixing the typescript stuff Signed-off-by: blam --- .../src/components/GraphiQLPage/GraphiQLPage.jsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.jsx b/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.jsx index 4608278805..b7f78f34c6 100644 --- a/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.jsx +++ b/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.jsx @@ -55,10 +55,17 @@ export const GraphiQLPage = () => { ); + } else if (!endpoints.value) { + content = ( + + + No GraphQL endpoints available + + + ); } else { content = ( - {/* @ts-expect-error */} ); From 06407c0ec082d2ea62d2610b0b4c0fbb837346e8 Mon Sep 17 00:00:00 2001 From: blam Date: Tue, 6 Sep 2022 10:28:28 +0200 Subject: [PATCH 10/15] chore: commit with warnings for now Signed-off-by: blam --- plugins/graphiql/api-report.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/graphiql/api-report.md b/plugins/graphiql/api-report.md index c96966c585..a879bd6489 100644 --- a/plugins/graphiql/api-report.md +++ b/plugins/graphiql/api-report.md @@ -72,8 +72,10 @@ export class GraphQLEndpoints implements GraphQLBrowseApi { static github(config: GithubEndpointConfig): GraphQLEndpoint; } +// Warning: (ae-missing-release-tag) "GraphiQLPage" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// // @public (undocumented) -export const Router: () => JSX.Element; +export function Router(): JSX.Element; // (No @packageDocumentation comment for this package) ``` From 74c89cfabc729981c89f238fdc2d3742faf9259c Mon Sep 17 00:00:00 2001 From: blam Date: Tue, 6 Sep 2022 10:46:35 +0200 Subject: [PATCH 11/15] chore: reset this plugin Signed-off-by: blam --- plugins/graphiql/api-report.md | 4 +- .../components/GraphiQLPage/GraphiQLPage.tsx | 70 +++++++++++++++++++ 2 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.tsx diff --git a/plugins/graphiql/api-report.md b/plugins/graphiql/api-report.md index a879bd6489..c96966c585 100644 --- a/plugins/graphiql/api-report.md +++ b/plugins/graphiql/api-report.md @@ -72,10 +72,8 @@ export class GraphQLEndpoints implements GraphQLBrowseApi { static github(config: GithubEndpointConfig): GraphQLEndpoint; } -// Warning: (ae-missing-release-tag) "GraphiQLPage" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) -export function Router(): JSX.Element; +export const Router: () => JSX.Element; // (No @packageDocumentation comment for this package) ``` diff --git a/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.tsx b/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.tsx new file mode 100644 index 0000000000..0b4399948a --- /dev/null +++ b/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.tsx @@ -0,0 +1,70 @@ +/* + * Copyright 2020 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import React from 'react'; +import { useApi } from '@backstage/core-plugin-api'; +import useAsync from 'react-use/lib/useAsync'; +import 'graphiql/graphiql.css'; +import { graphQlBrowseApiRef } from '../../lib/api'; +import { GraphiQLBrowser } from '../GraphiQLBrowser'; +import { Typography } from '@material-ui/core'; +import { + Content, + Header, + HeaderLabel, + Page, + Progress, +} from '@backstage/core-components'; + +/** @public */ +export const GraphiQLPage = () => { + const graphQlBrowseApi = useApi(graphQlBrowseApiRef); + const endpoints = useAsync(() => graphQlBrowseApi.getEndpoints()); + + let content: JSX.Element; + + if (endpoints.loading) { + content = ( + + + + ); + } else if (endpoints.error) { + content = ( + + + {/* TODO: provide a proper error component */} + Failed to load GraphQL endpoints, {String(endpoints.error)} + + + ); + } else { + content = ( + + + + ); + } + + return ( + +
+ + +
+ {content} +
+ ); +}; From 87516c49f735364bdc9cf410906ff2a3a4cedc28 Mon Sep 17 00:00:00 2001 From: blam Date: Tue, 6 Sep 2022 10:58:22 +0200 Subject: [PATCH 12/15] chore: make jsx Signed-off-by: blam --- .../{AdvancedSettings.tsx => AdvancedSettings.jsx} | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) rename packages/app/src/components/advancedSettings/{AdvancedSettings.tsx => AdvancedSettings.jsx} (85%) diff --git a/packages/app/src/components/advancedSettings/AdvancedSettings.tsx b/packages/app/src/components/advancedSettings/AdvancedSettings.jsx similarity index 85% rename from packages/app/src/components/advancedSettings/AdvancedSettings.tsx rename to packages/app/src/components/advancedSettings/AdvancedSettings.jsx index 9a1e0fd162..469f9a6035 100644 --- a/packages/app/src/components/advancedSettings/AdvancedSettings.tsx +++ b/packages/app/src/components/advancedSettings/AdvancedSettings.jsx @@ -14,6 +14,9 @@ * limitations under the License. */ +// @ts-check +// NOTE: This file is intentionally .jsx, so that there is one file in this repo where we make sure .jsx files work. + import React from 'react'; import { InfoCard } from '@backstage/core-components'; import { @@ -27,12 +30,11 @@ import { import useLocalStorage from 'react-use/lib/useLocalStorage'; export function AdvancedSettings() { - const [value, setValue] = useLocalStorage<'on' | 'off'>( - 'advanced-option', - 'off', - ); + const [value, setValue] = useLocalStorage('advanced-option', 'off'); - const toggleValue = (ev: React.ChangeEvent) => { + const toggleValue = ( + /** @type {React.ChangeEvent} */ ev, + ) => { setValue(ev.currentTarget.checked ? 'on' : 'off'); }; From 45b6d35c1b778075339136a2465a8930b1962b48 Mon Sep 17 00:00:00 2001 From: blam Date: Tue, 6 Sep 2022 11:01:55 +0200 Subject: [PATCH 13/15] chore: remove the bonus page Signed-off-by: blam --- .../components/GraphiQLPage/GraphiQLPage.jsx | 83 ------------------- 1 file changed, 83 deletions(-) delete mode 100644 plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.jsx diff --git a/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.jsx b/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.jsx deleted file mode 100644 index b7f78f34c6..0000000000 --- a/plugins/graphiql/src/components/GraphiQLPage/GraphiQLPage.jsx +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright 2020 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// @ts-check -// NOTE: This file is intentionally .jsx, so that there is one file in this repo where we make sure .jsx files work. - -import React from 'react'; -import { useApi } from '@backstage/core-plugin-api'; -import useAsync from 'react-use/lib/useAsync'; -import 'graphiql/graphiql.css'; -import { graphQlBrowseApiRef } from '../../lib/api'; -import { GraphiQLBrowser } from '../GraphiQLBrowser'; -import { Typography } from '@material-ui/core'; -import { - Content, - Header, - HeaderLabel, - Page, - Progress, -} from '@backstage/core-components'; - -/** @public */ -export const GraphiQLPage = () => { - const graphQlBrowseApi = useApi(graphQlBrowseApiRef); - const endpoints = useAsync(() => graphQlBrowseApi.getEndpoints()); - - /** @type JSX.Element */ - let content; - - if (endpoints.loading) { - content = ( - - - - ); - } else if (endpoints.error) { - content = ( - - - {/* TODO: provide a proper error component */} - Failed to load GraphQL endpoints, {String(endpoints.error)} - - - ); - } else if (!endpoints.value) { - content = ( - - - No GraphQL endpoints available - - - ); - } else { - content = ( - - - - ); - } - - return ( - -
- - -
- {content} -
- ); -}; From 638d81413b180fe67f4237221e53315ea4902c4d Mon Sep 17 00:00:00 2001 From: blam Date: Tue, 6 Sep 2022 11:20:31 +0200 Subject: [PATCH 14/15] chore: Use the `LogoIcon` instead Signed-off-by: blam --- .../Root/{LogoIcon.tsx => LogoIcon.jsx} | 2 + .../advancedSettings/AdvancedSettings.tsx | 63 +++++++++++++++++++ 2 files changed, 65 insertions(+) rename packages/app/src/components/Root/{LogoIcon.tsx => LogoIcon.jsx} (96%) create mode 100644 packages/app/src/components/advancedSettings/AdvancedSettings.tsx diff --git a/packages/app/src/components/Root/LogoIcon.tsx b/packages/app/src/components/Root/LogoIcon.jsx similarity index 96% rename from packages/app/src/components/Root/LogoIcon.tsx rename to packages/app/src/components/Root/LogoIcon.jsx index 073cf6edad..5ec778cca2 100644 --- a/packages/app/src/components/Root/LogoIcon.tsx +++ b/packages/app/src/components/Root/LogoIcon.jsx @@ -13,6 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// @ts-check +// NOTE: This file is intentionally .jsx, so that there is one file in this repo where we make sure .jsx files work. import React from 'react'; import { makeStyles } from '@material-ui/core'; diff --git a/packages/app/src/components/advancedSettings/AdvancedSettings.tsx b/packages/app/src/components/advancedSettings/AdvancedSettings.tsx new file mode 100644 index 0000000000..9a1e0fd162 --- /dev/null +++ b/packages/app/src/components/advancedSettings/AdvancedSettings.tsx @@ -0,0 +1,63 @@ +/* + * Copyright 2022 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import React from 'react'; +import { InfoCard } from '@backstage/core-components'; +import { + List, + Grid, + ListItem, + ListItemText, + ListItemSecondaryAction, + Switch, +} from '@material-ui/core'; +import useLocalStorage from 'react-use/lib/useLocalStorage'; + +export function AdvancedSettings() { + const [value, setValue] = useLocalStorage<'on' | 'off'>( + 'advanced-option', + 'off', + ); + + const toggleValue = (ev: React.ChangeEvent) => { + setValue(ev.currentTarget.checked ? 'on' : 'off'); + }; + + return ( + + + + + + + + + + + + + + + ); +} From f0d6a7c29a0d5ec4dec2ab35e10479248d8b3a1b Mon Sep 17 00:00:00 2001 From: blam Date: Tue, 6 Sep 2022 11:21:12 +0200 Subject: [PATCH 15/15] chore: remove bonus settings Signed-off-by: blam --- .../advancedSettings/AdvancedSettings.jsx | 65 ------------------- 1 file changed, 65 deletions(-) delete mode 100644 packages/app/src/components/advancedSettings/AdvancedSettings.jsx diff --git a/packages/app/src/components/advancedSettings/AdvancedSettings.jsx b/packages/app/src/components/advancedSettings/AdvancedSettings.jsx deleted file mode 100644 index 469f9a6035..0000000000 --- a/packages/app/src/components/advancedSettings/AdvancedSettings.jsx +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2022 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// @ts-check -// NOTE: This file is intentionally .jsx, so that there is one file in this repo where we make sure .jsx files work. - -import React from 'react'; -import { InfoCard } from '@backstage/core-components'; -import { - List, - Grid, - ListItem, - ListItemText, - ListItemSecondaryAction, - Switch, -} from '@material-ui/core'; -import useLocalStorage from 'react-use/lib/useLocalStorage'; - -export function AdvancedSettings() { - const [value, setValue] = useLocalStorage('advanced-option', 'off'); - - const toggleValue = ( - /** @type {React.ChangeEvent} */ ev, - ) => { - setValue(ev.currentTarget.checked ? 'on' : 'off'); - }; - - return ( - - - - - - - - - - - - - - - ); -}