From 7fcdc4028e6ccbb0be02875063d111334cdba3ee Mon Sep 17 00:00:00 2001 From: chrismclarke Date: Mon, 13 Nov 2023 12:14:15 -0800 Subject: [PATCH] chore: rename sami-admin plugin --- backend/config/plugins.js | 4 ++-- backend/package.json | 4 ++-- .../api/project-type/content-types/project-type/schema.json | 4 ++++ backend/src/plugins/sami-admin/README.md | 4 ++-- .../plugins/sami-admin/admin/src/pages/HomePage/index.tsx | 4 ++-- backend/src/plugins/sami-admin/package.json | 6 +++--- backend/src/plugins/sami-admin/server/bootstrap.ts | 2 +- .../plugins/sami-admin/server/controllers/my-controller.ts | 4 ++-- backend/src/plugins/sami-admin/server/routes/index.ts | 4 ++-- 9 files changed, 20 insertions(+), 16 deletions(-) diff --git a/backend/config/plugins.js b/backend/config/plugins.js index fa1ae4af..51133eb1 100644 --- a/backend/config/plugins.js +++ b/backend/config/plugins.js @@ -16,8 +16,8 @@ module.exports = ({ env }) => ({ "import-export-entries": { enabled: true, }, - "sami-website-deploy": { + "sami-admin": { enabled: true, - resolve: "./src/plugins/sami-website-deploy", + resolve: "./src/plugins/sami-admin", }, }); diff --git a/backend/package.json b/backend/package.json index 3a282ef4..e4ef95f6 100644 --- a/backend/package.json +++ b/backend/package.json @@ -7,8 +7,8 @@ "start": "strapi develop", "start:prod": "strapi start", "build": "yarn plugins:build && strapi build", - "plugins:build": "cd src/plugins/sami-website-deploy && npm run build", - "plugins:dev": "cd src/plugins/sami-website-deploy && npm run develop", + "plugins:build": "cd src/plugins/sami-admin && npm run build", + "plugins:dev": "cd src/plugins/sami-admin && npm run develop", "strapi": "strapi" }, "dependencies": { diff --git a/backend/src/api/project-type/content-types/project-type/schema.json b/backend/src/api/project-type/content-types/project-type/schema.json index dbb0de32..aea2d236 100644 --- a/backend/src/api/project-type/content-types/project-type/schema.json +++ b/backend/src/api/project-type/content-types/project-type/schema.json @@ -44,6 +44,10 @@ "type": "string", "required": true, "unique": true + }, + "Status": { + "type": "enumeration", + "enum": ["Ongoing", "Completed"] } } } diff --git a/backend/src/plugins/sami-admin/README.md b/backend/src/plugins/sami-admin/README.md index 67c7afc6..7b91cea6 100644 --- a/backend/src/plugins/sami-admin/README.md +++ b/backend/src/plugins/sami-admin/README.md @@ -1,6 +1,6 @@ -# Strapi plugin sami-website-deploy +# Strapi plugin sami-admin -A quick description of sami-website-deploy. +A quick description of sami-admin. Build plugin and backend diff --git a/backend/src/plugins/sami-admin/admin/src/pages/HomePage/index.tsx b/backend/src/plugins/sami-admin/admin/src/pages/HomePage/index.tsx index 1bb3a63c..91ac51fe 100644 --- a/backend/src/plugins/sami-admin/admin/src/pages/HomePage/index.tsx +++ b/backend/src/plugins/sami-admin/admin/src/pages/HomePage/index.tsx @@ -25,7 +25,7 @@ const HomePage = () => { setDeployDisabled(true); setUpdates([]); setShowOutput(true); - const io = socket("http://localhost:1337", { path: "/sami-website-deploy/" }); //Connecting to Socket.io backend + const io = socket("http://localhost:1337", { path: "/sami-admin/" }); //Connecting to Socket.io backend io.on("message", async (data: string, error) => { //Listening for a message connection @@ -93,7 +93,7 @@ export default HomePage; // const triggerDeploy = () => { // console.log("triggering deploy"); -// fetch("/sami-website-deploy/deploy", { +// fetch("/sami-admin/deploy", { // method: "GET", // default, so we can ignore // }) // .then((response) => response.json()) diff --git a/backend/src/plugins/sami-admin/package.json b/backend/src/plugins/sami-admin/package.json index 4f119ead..d4e3ce17 100644 --- a/backend/src/plugins/sami-admin/package.json +++ b/backend/src/plugins/sami-admin/package.json @@ -1,10 +1,10 @@ { - "name": "sami-website-deploy", + "name": "sami-admin", "version": "0.0.0", "description": "This is the description of the plugin.", "strapi": { - "name": "sami-website-deploy", - "description": "Description of sami-website-deploy plugin", + "name": "sami-admin", + "description": "Description of sami-admin plugin", "kind": "plugin" }, "dependencies": { diff --git a/backend/src/plugins/sami-admin/server/bootstrap.ts b/backend/src/plugins/sami-admin/server/bootstrap.ts index 26f767cf..4fb86d89 100644 --- a/backend/src/plugins/sami-admin/server/bootstrap.ts +++ b/backend/src/plugins/sami-admin/server/bootstrap.ts @@ -19,7 +19,7 @@ export default ({ strapi }: { strapi: Strapi }) => { allowedHeaders: ["my-custom-header"], credentials: true, }, - path: "/sami-website-deploy/", + path: "/sami-admin/", }); // register deployment service websocket handler new DeployWebsocketService(io).register(); diff --git a/backend/src/plugins/sami-admin/server/controllers/my-controller.ts b/backend/src/plugins/sami-admin/server/controllers/my-controller.ts index 3826d6e0..13300027 100644 --- a/backend/src/plugins/sami-admin/server/controllers/my-controller.ts +++ b/backend/src/plugins/sami-admin/server/controllers/my-controller.ts @@ -3,9 +3,9 @@ import { Strapi } from "@strapi/strapi"; export default ({ strapi }: { strapi: Strapi }) => ({ index(ctx) { ctx.body = "Plugin Loaded"; - // ctx.body = strapi.plugin("sami-website-deploy").service("myService").getWelcomeMessage(); + // ctx.body = strapi.plugin("sami-admin").service("myService").getWelcomeMessage(); }, // async deploy(ctx) { - // ctx.body = await strapi.plugin("sami-website-deploy").service("myService").deploy(); + // ctx.body = await strapi.plugin("sami-admin").service("myService").deploy(); // }, }); diff --git a/backend/src/plugins/sami-admin/server/routes/index.ts b/backend/src/plugins/sami-admin/server/routes/index.ts index f4516921..bacb2daf 100644 --- a/backend/src/plugins/sami-admin/server/routes/index.ts +++ b/backend/src/plugins/sami-admin/server/routes/index.ts @@ -1,5 +1,5 @@ export default [ - // http://localhost:1337/sami-website-deploy + // http://localhost:1337/sami-admin // { // method: "GET", // path: "/", @@ -9,7 +9,7 @@ export default [ // auth: false, // }, // }, - // http://localhost:1337/sami-website-deploy/deploy + // http://localhost:1337/sami-admin/deploy // { // method: "GET", // path: "/deploy",