From 8fdad93bc4bb37bb4c689a3ba6987ebba6e42a5b Mon Sep 17 00:00:00 2001 From: Preston Mueller Date: Thu, 30 May 2024 18:46:43 -0400 Subject: [PATCH 01/12] feat: add nodejs to .tool-versions --- .tool-versions | 1 + 1 file changed, 1 insertion(+) diff --git a/.tool-versions b/.tool-versions index df967b0..4b1cbab 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,2 +1,3 @@ elixir 1.16.1-otp-26 erlang 26.2.2 +nodejs 20.14.0 \ No newline at end of file From 731cec4c405169cb8ee09b173754588758aaa831 Mon Sep 17 00:00:00 2001 From: Preston Mueller Date: Thu, 30 May 2024 18:47:58 -0400 Subject: [PATCH 02/12] feat: add react, react-dom, react-router-dom --- package-lock.json | 51 ++++++++++++++++++++++++++++++++++++++--------- package.json | 5 ++++- 2 files changed, 46 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index 345ed51..02dab79 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,9 @@ "dependencies": { "@tailwindcss/forms": "^0.5.7", "esbuild": "^0.21.3", + "react": "^18.3.1", + "react-dom": "^18.3.1", + "react-router-dom": "^6.23.1", "tailwindcss": "^3.4.3" }, "devDependencies": { @@ -2049,6 +2052,14 @@ "node": ">=14" } }, + "node_modules/@remix-run/router": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.16.1.tgz", + "integrity": "sha512-es2g3dq6Nb07iFxGk5GuHN20RwBZOsuDQN7izWIisUcv9r+d2C5jQxqmgkdebXgReWfiyUabcki6Fg77mSNrig==", + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/@sinclair/typebox": { "version": "0.27.8", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", @@ -7875,8 +7886,7 @@ "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, "node_modules/js-yaml": { "version": "4.1.0", @@ -8118,7 +8128,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "dev": true, "dependencies": { "js-tokens": "^3.0.0 || ^4.0.0" }, @@ -9109,8 +9118,6 @@ "version": "18.3.1", "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", - "dev": true, - "peer": true, "dependencies": { "loose-envify": "^1.1.0" }, @@ -9122,8 +9129,6 @@ "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", - "dev": true, - "peer": true, "dependencies": { "loose-envify": "^1.1.0", "scheduler": "^0.23.2" @@ -9138,6 +9143,36 @@ "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", "dev": true }, + "node_modules/react-router": { + "version": "6.23.1", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.23.1.tgz", + "integrity": "sha512-fzcOaRF69uvqbbM7OhvQyBTFDVrrGlsFdS3AL+1KfIBtGETibHzi3FkoTRyiDJnWNc2VxrfvR+657ROHjaNjqQ==", + "dependencies": { + "@remix-run/router": "1.16.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "react": ">=16.8" + } + }, + "node_modules/react-router-dom": { + "version": "6.23.1", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.23.1.tgz", + "integrity": "sha512-utP+K+aSTtEdbWpC+4gxhdlPFwuEfDKq8ZrPFU65bbRJY+l706qjR7yaidBpo3MSeA/fzwbXWbKBI6ftOnP3OQ==", + "dependencies": { + "@remix-run/router": "1.16.1", + "react-router": "6.23.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "react": ">=16.8", + "react-dom": ">=16.8" + } + }, "node_modules/read-cache": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", @@ -9432,8 +9467,6 @@ "version": "0.23.2", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", - "dev": true, - "peer": true, "dependencies": { "loose-envify": "^1.1.0" } diff --git a/package.json b/package.json index d93c4ca..aa1c084 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "orbit", "scripts": { "build:css": "tailwindcss -i css/app.css -o priv/static/assets/app.css", - "build:js": "NODE_PATH=deps/ esbuild js/app.ts --bundle --tsconfig=tsconfig.json --outdir=priv/static/assets --external:/fonts/* --external:/images/*", + "build:js": "NODE_PATH=deps/ esbuild js/app.tsx --bundle --tsconfig=tsconfig.json --outdir=priv/static/assets --external:/fonts/* --external:/images/*", "format": "prettier . --write", "test:eslint": "eslint .", "test:format": "prettier . --check", @@ -13,6 +13,9 @@ "dependencies": { "@tailwindcss/forms": "^0.5.7", "esbuild": "^0.21.3", + "react": "^18.3.1", + "react-dom": "^18.3.1", + "react-router-dom": "^6.23.1", "tailwindcss": "^3.4.3" }, "devDependencies": { From e1a8035d8e84f447651eb77f4c973ac721028769 Mon Sep 17 00:00:00 2001 From: Preston Mueller Date: Thu, 30 May 2024 18:48:44 -0400 Subject: [PATCH 03/12] remove stock typescript files --- js/app.ts | 3 --- js/helloWorld.test.ts | 15 --------------- js/helloWorld.ts | 7 ------- 3 files changed, 25 deletions(-) delete mode 100644 js/app.ts delete mode 100644 js/helloWorld.test.ts delete mode 100644 js/helloWorld.ts diff --git a/js/app.ts b/js/app.ts deleted file mode 100644 index 4fef019..0000000 --- a/js/app.ts +++ /dev/null @@ -1,3 +0,0 @@ -import "./phoenix.js"; - -console.log("Hello from javascript"); diff --git a/js/helloWorld.test.ts b/js/helloWorld.test.ts deleted file mode 100644 index b0a3594..0000000 --- a/js/helloWorld.test.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * This is a placeholder test to show that jest is set up and working - * It can be removed once we have our first real functionality to test - * (which will probably be a basic render() test when we set up React) - */ - -import { onePlusOne } from "./helloWorld"; - -describe("onePlusOne", () => { - test("can run a test", () => { - // using toBeOneOf shows that jest-extended-matchers is working - // and therefore that the setup script is being called - expect(onePlusOne()).toBeOneOf([1, 2, 3]); - }); -}); diff --git a/js/helloWorld.ts b/js/helloWorld.ts deleted file mode 100644 index 28fd0ee..0000000 --- a/js/helloWorld.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * This is a placeholder to show that jest is set up and working - * It can be removed once we have our first real functionality to test - * (which will probably be a the react ) - */ - -export const onePlusOne = () => 2; From 309b9cea48660e7238f7476fba6de0f964695afa Mon Sep 17 00:00:00 2001 From: Preston Mueller Date: Thu, 30 May 2024 18:49:50 -0400 Subject: [PATCH 04/12] feat: add client-side home and help pages; test phoenix page --- js/app.tsx | 6 ++++ js/components/app.tsx | 18 +++++++++++ js/components/help.tsx | 32 +++++++++++++++++++ js/components/home.tsx | 12 +++++++ .../components/layouts/app.html.heex | 26 --------------- .../components/layouts/root.html.heex | 10 ++---- .../controllers/control_panel_controller.ex | 10 ++++++ .../controllers/control_panel_html.ex | 5 +++ .../control_panel_html/index.html.heex | 3 ++ .../controllers/page_html/home.html.heex | 14 ++++---- lib/orbit_web/router.ex | 2 ++ 11 files changed, 97 insertions(+), 41 deletions(-) create mode 100644 js/app.tsx create mode 100644 js/components/app.tsx create mode 100644 js/components/help.tsx create mode 100644 js/components/home.tsx create mode 100644 lib/orbit_web/controllers/control_panel_controller.ex create mode 100644 lib/orbit_web/controllers/control_panel_html.ex create mode 100644 lib/orbit_web/controllers/control_panel_html/index.html.heex diff --git a/js/app.tsx b/js/app.tsx new file mode 100644 index 0000000..258a4f0 --- /dev/null +++ b/js/app.tsx @@ -0,0 +1,6 @@ +import "./phoenix.js"; +import { App } from "./components/app.js"; +import { createRoot } from "react-dom/client"; + +const root = createRoot(document.getElementById("app") as Element); +root.render(); diff --git a/js/components/app.tsx b/js/components/app.tsx new file mode 100644 index 0000000..71c6ff6 --- /dev/null +++ b/js/components/app.tsx @@ -0,0 +1,18 @@ +import { Help } from "./help"; +import { Home } from "./home"; +import { ReactElement } from "react"; +import { createBrowserRouter, RouterProvider } from "react-router-dom"; + +const router = createBrowserRouter([ + { + path: "/", + element: , + }, + { + path: "/help", + element: , + }, +]); +export const App = (): ReactElement => { + return ; +}; diff --git a/js/components/help.tsx b/js/components/help.tsx new file mode 100644 index 0000000..5a29106 --- /dev/null +++ b/js/components/help.tsx @@ -0,0 +1,32 @@ +import { ReactElement } from "react"; + +export const Help = (): ReactElement => { + return ( +
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod + tempor incididunt ut labore et dolore magna aliqua. Orci eu lobortis + elementum nibh tellus. In dictum non consectetur a erat nam at. At in + tellus integer feugiat scelerisque varius. Pulvinar etiam non quam lacus + suspendisse faucibus interdum posuere. Urna duis convallis convallis + tellus id interdum velit laoreet. Sed turpis tincidunt id aliquet risus. + Condimentum lacinia quis vel eros donec. Tincidunt augue interdum velit + euismod. Metus aliquam eleifend mi in nulla posuere. At ultrices mi tempus + imperdiet. Mattis pellentesque id nibh tortor id aliquet. Enim ut tellus + elementum sagittis vitae et leo. Sed viverra tellus in hac. Sed sed risus + pretium quam vulputate. Diam phasellus vestibulum lorem sed risus + ultricies tristique nulla. Habitant morbi tristique senectus et netus et. + Diam maecenas sed enim ut sem viverra aliquet. Nunc mi ipsum faucibus + vitae aliquet nec. Dictum varius duis at consectetur lorem donec massa + sapien faucibus. In dictum non consectetur a erat nam. Massa tempor nec + feugiat nisl. Sagittis eu volutpat odio facilisis mauris sit amet. Massa + placerat duis ultricies lacus sed turpis tincidunt id. Elit scelerisque + mauris pellentesque pulvinar pellentesque habitant morbi tristique + senectus. Tincidunt lobortis feugiat vivamus at augue eget arcu dictum. + Sit amet luctus venenatis lectus magna. Et netus et malesuada fames ac + turpis egestas. Pellentesque id nibh tortor id aliquet. Odio aenean sed + adipiscing diam donec adipiscing. Viverra justo nec ultrices dui sapien. + Venenatis lectus magna fringilla urna porttitor rhoncus dolor purus. Lacus + suspendisse faucibus interdum posuere lorem. +
+ ); +}; diff --git a/js/components/home.tsx b/js/components/home.tsx new file mode 100644 index 0000000..41a6235 --- /dev/null +++ b/js/components/home.tsx @@ -0,0 +1,12 @@ +import { ReactElement } from "react"; + +export const Home = (): ReactElement => { + return ( +
+ ๐Ÿช + O + r + bit +
+ ); +}; diff --git a/lib/orbit_web/components/layouts/app.html.heex b/lib/orbit_web/components/layouts/app.html.heex index e23bfc8..fec9a04 100644 --- a/lib/orbit_web/components/layouts/app.html.heex +++ b/lib/orbit_web/components/layouts/app.html.heex @@ -1,29 +1,3 @@ -
-
-
- - - -

- v<%= Application.spec(:phoenix, :vsn) %> -

-
- -
-
<.flash_group flash={@flash} /> diff --git a/lib/orbit_web/components/layouts/root.html.heex b/lib/orbit_web/components/layouts/root.html.heex index b875c0d..aaeccbd 100644 --- a/lib/orbit_web/components/layouts/root.html.heex +++ b/lib/orbit_web/components/layouts/root.html.heex @@ -1,15 +1,11 @@ - + - <.live_title suffix=" ยท Phoenix Framework"> - <%= assigns[:page_title] || "Orbit" %> - - - + <%= assigns[:page_title] || "Orbit" %> + <%= @inner_content %> diff --git a/lib/orbit_web/controllers/control_panel_controller.ex b/lib/orbit_web/controllers/control_panel_controller.ex new file mode 100644 index 0000000..01504fc --- /dev/null +++ b/lib/orbit_web/controllers/control_panel_controller.ex @@ -0,0 +1,10 @@ +defmodule OrbitWeb.ControlPanelController do + @moduledoc """ + Controller that runs a database query to check whether the webserver can connect to the database. + """ + use OrbitWeb, :controller + + def index(conn, _params) do + render(conn, :index) + end +end diff --git a/lib/orbit_web/controllers/control_panel_html.ex b/lib/orbit_web/controllers/control_panel_html.ex new file mode 100644 index 0000000..8b55bc1 --- /dev/null +++ b/lib/orbit_web/controllers/control_panel_html.ex @@ -0,0 +1,5 @@ +defmodule OrbitWeb.ControlPanelHTML do + use OrbitWeb, :html + + embed_templates "control_panel_html/*" +end diff --git a/lib/orbit_web/controllers/control_panel_html/index.html.heex b/lib/orbit_web/controllers/control_panel_html/index.html.heex new file mode 100644 index 0000000..744482c --- /dev/null +++ b/lib/orbit_web/controllers/control_panel_html/index.html.heex @@ -0,0 +1,3 @@ +
+ Control Panel +
diff --git a/lib/orbit_web/controllers/page_html/home.html.heex b/lib/orbit_web/controllers/page_html/home.html.heex index a0a1dde..f025a12 100644 --- a/lib/orbit_web/controllers/page_html/home.html.heex +++ b/lib/orbit_web/controllers/page_html/home.html.heex @@ -1,8 +1,6 @@ -<.flash_group flash={@flash} /> -<.header> - ๐Ÿช - Orbit - <:subtitle> - Hello World! - - + +
+ diff --git a/lib/orbit_web/router.ex b/lib/orbit_web/router.ex index f73ba2e..e1823c1 100644 --- a/lib/orbit_web/router.ex +++ b/lib/orbit_web/router.ex @@ -18,6 +18,8 @@ defmodule OrbitWeb.Router do pipe_through :browser get "/", PageController, :home + get "/help", PageController, :home + get "/control-panel", ControlPanelController, :index end scope "/", OrbitWeb do From fd8403995e000f93446fb181817ed5263555a2ae Mon Sep 17 00:00:00 2001 From: Preston Mueller Date: Thu, 30 May 2024 18:51:57 -0400 Subject: [PATCH 05/12] fix: add newline to end of .tool-versions --- .tool-versions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.tool-versions b/.tool-versions index 4b1cbab..6ac4bbd 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,3 +1,3 @@ elixir 1.16.1-otp-26 erlang 26.2.2 -nodejs 20.14.0 \ No newline at end of file +nodejs 20.14.0 From 31a82b44e49e5f9a57800c34ee3ee1b006c16ec7 Mon Sep 17 00:00:00 2001 From: Preston Mueller Date: Fri, 31 May 2024 10:52:08 -0400 Subject: [PATCH 06/12] test: add test for Home --- js/test/components/home.test.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 js/test/components/home.test.tsx diff --git a/js/test/components/home.test.tsx b/js/test/components/home.test.tsx new file mode 100644 index 0000000..f16ccab --- /dev/null +++ b/js/test/components/home.test.tsx @@ -0,0 +1,9 @@ +import { Home } from "../../components/home"; +import { render } from "@testing-library/react"; + +describe("home", () => { + test("loads orbit placeholder", () => { + const view = render(); + expect(view.getByText(/๐Ÿช/)).toBeInTheDocument(); + }); +}); From 7abca47b3035978535c3a68d25766801255044d2 Mon Sep 17 00:00:00 2001 From: Preston Mueller Date: Fri, 31 May 2024 10:59:02 -0400 Subject: [PATCH 07/12] refactor: rename PageController -> FrontendPageController --- lib/orbit_web/components/layouts/root.html.heex | 2 +- .../controllers/{page_html => frontend_html}/home.html.heex | 0 .../{page_controller.ex => frontend_page_controller.ex} | 2 +- lib/orbit_web/controllers/frontend_page_html.ex | 5 +++++ lib/orbit_web/controllers/page_html.ex | 5 ----- lib/orbit_web/router.ex | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) rename lib/orbit_web/controllers/{page_html => frontend_html}/home.html.heex (100%) rename lib/orbit_web/controllers/{page_controller.ex => frontend_page_controller.ex} (80%) create mode 100644 lib/orbit_web/controllers/frontend_page_html.ex delete mode 100644 lib/orbit_web/controllers/page_html.ex diff --git a/lib/orbit_web/components/layouts/root.html.heex b/lib/orbit_web/components/layouts/root.html.heex index aaeccbd..b72e94d 100644 --- a/lib/orbit_web/components/layouts/root.html.heex +++ b/lib/orbit_web/components/layouts/root.html.heex @@ -5,7 +5,7 @@ <%= assigns[:page_title] || "Orbit" %> - + <%= @inner_content %> diff --git a/lib/orbit_web/controllers/page_html/home.html.heex b/lib/orbit_web/controllers/frontend_html/home.html.heex similarity index 100% rename from lib/orbit_web/controllers/page_html/home.html.heex rename to lib/orbit_web/controllers/frontend_html/home.html.heex diff --git a/lib/orbit_web/controllers/page_controller.ex b/lib/orbit_web/controllers/frontend_page_controller.ex similarity index 80% rename from lib/orbit_web/controllers/page_controller.ex rename to lib/orbit_web/controllers/frontend_page_controller.ex index 513dc7a..39ce981 100644 --- a/lib/orbit_web/controllers/page_controller.ex +++ b/lib/orbit_web/controllers/frontend_page_controller.ex @@ -1,4 +1,4 @@ -defmodule OrbitWeb.PageController do +defmodule OrbitWeb.FrontendPageController do use OrbitWeb, :controller def home(conn, _params) do diff --git a/lib/orbit_web/controllers/frontend_page_html.ex b/lib/orbit_web/controllers/frontend_page_html.ex new file mode 100644 index 0000000..7126c53 --- /dev/null +++ b/lib/orbit_web/controllers/frontend_page_html.ex @@ -0,0 +1,5 @@ +defmodule OrbitWeb.FrontendPageHTML do + use OrbitWeb, :html + + embed_templates "frontend_html/*" +end diff --git a/lib/orbit_web/controllers/page_html.ex b/lib/orbit_web/controllers/page_html.ex deleted file mode 100644 index 00115ee..0000000 --- a/lib/orbit_web/controllers/page_html.ex +++ /dev/null @@ -1,5 +0,0 @@ -defmodule OrbitWeb.PageHTML do - use OrbitWeb, :html - - embed_templates "page_html/*" -end diff --git a/lib/orbit_web/router.ex b/lib/orbit_web/router.ex index e1823c1..7dab283 100644 --- a/lib/orbit_web/router.ex +++ b/lib/orbit_web/router.ex @@ -17,8 +17,8 @@ defmodule OrbitWeb.Router do scope "/", OrbitWeb do pipe_through :browser - get "/", PageController, :home - get "/help", PageController, :home + get "/", FrontendPageController, :home + get "/help", FrontendPageController, :home get "/control-panel", ControlPanelController, :index end From 709e4df4042b6b9f43060ddf2f3a515328e2bd6f Mon Sep 17 00:00:00 2001 From: Preston Mueller Date: Fri, 31 May 2024 11:10:25 -0400 Subject: [PATCH 08/12] put app.html.heex back --- .../components/layouts/app.html.heex | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/lib/orbit_web/components/layouts/app.html.heex b/lib/orbit_web/components/layouts/app.html.heex index fec9a04..e23bfc8 100644 --- a/lib/orbit_web/components/layouts/app.html.heex +++ b/lib/orbit_web/components/layouts/app.html.heex @@ -1,3 +1,29 @@ +
+
+
+ + + +

+ v<%= Application.spec(:phoenix, :vsn) %> +

+
+ +
+
<.flash_group flash={@flash} /> From 408d80987dd16bd73346031547134617e5443847 Mon Sep 17 00:00:00 2001 From: Preston Mueller Date: Fri, 31 May 2024 11:13:57 -0400 Subject: [PATCH 09/12] comment: avoid wildcard in router.ex --- lib/orbit_web/router.ex | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/orbit_web/router.ex b/lib/orbit_web/router.ex index 7dab283..de2a6fb 100644 --- a/lib/orbit_web/router.ex +++ b/lib/orbit_web/router.ex @@ -17,8 +17,11 @@ defmodule OrbitWeb.Router do scope "/", OrbitWeb do pipe_through :browser + # Routes that should be handled by React + # Avoid using a wildcard to prevent invalid 200 responses get "/", FrontendPageController, :home get "/help", FrontendPageController, :home + get "/control-panel", ControlPanelController, :index end From 99b64d3031f025328ee9de2fb213c2fb3bcdeab2 Mon Sep 17 00:00:00 2001 From: Preston Mueller Date: Fri, 31 May 2024 11:18:42 -0400 Subject: [PATCH 10/12] fix: remove phoenix page test --- lib/orbit_web/controllers/control_panel_controller.ex | 10 ---------- lib/orbit_web/controllers/control_panel_html.ex | 5 ----- .../controllers/control_panel_html/index.html.heex | 3 --- lib/orbit_web/router.ex | 2 -- 4 files changed, 20 deletions(-) delete mode 100644 lib/orbit_web/controllers/control_panel_controller.ex delete mode 100644 lib/orbit_web/controllers/control_panel_html.ex delete mode 100644 lib/orbit_web/controllers/control_panel_html/index.html.heex diff --git a/lib/orbit_web/controllers/control_panel_controller.ex b/lib/orbit_web/controllers/control_panel_controller.ex deleted file mode 100644 index 01504fc..0000000 --- a/lib/orbit_web/controllers/control_panel_controller.ex +++ /dev/null @@ -1,10 +0,0 @@ -defmodule OrbitWeb.ControlPanelController do - @moduledoc """ - Controller that runs a database query to check whether the webserver can connect to the database. - """ - use OrbitWeb, :controller - - def index(conn, _params) do - render(conn, :index) - end -end diff --git a/lib/orbit_web/controllers/control_panel_html.ex b/lib/orbit_web/controllers/control_panel_html.ex deleted file mode 100644 index 8b55bc1..0000000 --- a/lib/orbit_web/controllers/control_panel_html.ex +++ /dev/null @@ -1,5 +0,0 @@ -defmodule OrbitWeb.ControlPanelHTML do - use OrbitWeb, :html - - embed_templates "control_panel_html/*" -end diff --git a/lib/orbit_web/controllers/control_panel_html/index.html.heex b/lib/orbit_web/controllers/control_panel_html/index.html.heex deleted file mode 100644 index 744482c..0000000 --- a/lib/orbit_web/controllers/control_panel_html/index.html.heex +++ /dev/null @@ -1,3 +0,0 @@ -
- Control Panel -
diff --git a/lib/orbit_web/router.ex b/lib/orbit_web/router.ex index de2a6fb..14b8680 100644 --- a/lib/orbit_web/router.ex +++ b/lib/orbit_web/router.ex @@ -21,8 +21,6 @@ defmodule OrbitWeb.Router do # Avoid using a wildcard to prevent invalid 200 responses get "/", FrontendPageController, :home get "/help", FrontendPageController, :home - - get "/control-panel", ControlPanelController, :index end scope "/", OrbitWeb do From ce3baf5e9324ba0e072bcf94b4f4ce09d1ff69db Mon Sep 17 00:00:00 2001 From: Preston Mueller Date: Fri, 31 May 2024 15:37:46 -0400 Subject: [PATCH 11/12] fix: @lemald feedback --- js/app.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/app.tsx b/js/app.tsx index 258a4f0..cd83d8a 100644 --- a/js/app.tsx +++ b/js/app.tsx @@ -2,5 +2,5 @@ import "./phoenix.js"; import { App } from "./components/app.js"; import { createRoot } from "react-dom/client"; -const root = createRoot(document.getElementById("app") as Element); +const root = createRoot(document.getElementById("app")!); root.render(); From 51e0ebb0f55ed6d9a65f6ed65db42e42846d7dfb Mon Sep 17 00:00:00 2001 From: Preston Mueller Date: Fri, 31 May 2024 16:19:22 -0400 Subject: [PATCH 12/12] fix: override no-non-null-assertion --- js/app.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/js/app.tsx b/js/app.tsx index cd83d8a..72f8024 100644 --- a/js/app.tsx +++ b/js/app.tsx @@ -2,5 +2,6 @@ import "./phoenix.js"; import { App } from "./components/app.js"; import { createRoot } from "react-dom/client"; +// eslint-disable-next-line @typescript-eslint/no-non-null-assertion const root = createRoot(document.getElementById("app")!); root.render();