summaryrefslogtreecommitdiff
path: root/server/src
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2026-02-05 14:53:17 +0300
committerValentin Popov <valentin@popov.link>2026-02-05 14:53:17 +0300
commit7fe5502dc173cfee7c3b3178fb233264ad7c6dc3 (patch)
treee8d82ba993ae0a044c3ce322114851aa9683b51c /server/src
parentefa89313fa4152252b477aafd88f7cf4a66747d8 (diff)
downloadstrapi-plugin-checkbox-list-7fe5502dc173cfee7c3b3178fb233264ad7c6dc3.tar.xz
strapi-plugin-checkbox-list-7fe5502dc173cfee7c3b3178fb233264ad7c6dc3.zip
Add checkbox-list custom field plugin to Strapi
- Introduced a new custom field type 'checkbox-list' with associated input component. - Updated package.json to reflect the new plugin name. - Added necessary server-side files for plugin registration, including bootstrap, destroy, and service methods. - Updated package-lock.json to include new dependencies and versions. - Enhanced admin interface with custom field registration and input handling.
Diffstat (limited to 'server/src')
-rw-r--r--server/src/bootstrap.js6
-rw-r--r--server/src/config/index.js6
-rw-r--r--server/src/content-types/index.js3
-rw-r--r--server/src/controllers/controller.js12
-rw-r--r--server/src/controllers/index.js9
-rw-r--r--server/src/destroy.js6
-rw-r--r--server/src/index.js33
-rw-r--r--server/src/middlewares/index.js3
-rw-r--r--server/src/policies/index.js3
-rw-r--r--server/src/register.js11
-rw-r--r--server/src/register.ts5
-rw-r--r--server/src/routes/admin/index.js6
-rw-r--r--server/src/routes/content-api/index.js16
-rw-r--r--server/src/routes/index.js12
-rw-r--r--server/src/services/index.js9
-rw-r--r--server/src/services/service.js8
16 files changed, 148 insertions, 0 deletions
diff --git a/server/src/bootstrap.js b/server/src/bootstrap.js
new file mode 100644
index 0000000..be1c0a6
--- /dev/null
+++ b/server/src/bootstrap.js
@@ -0,0 +1,6 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const bootstrap = ({ strapi }) => {
+ // bootstrap phase
+};
+exports.default = bootstrap;
diff --git a/server/src/config/index.js b/server/src/config/index.js
new file mode 100644
index 0000000..abd2118
--- /dev/null
+++ b/server/src/config/index.js
@@ -0,0 +1,6 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.default = {
+ default: {},
+ validator() { },
+};
diff --git a/server/src/content-types/index.js b/server/src/content-types/index.js
new file mode 100644
index 0000000..2367d85
--- /dev/null
+++ b/server/src/content-types/index.js
@@ -0,0 +1,3 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.default = {};
diff --git a/server/src/controllers/controller.js b/server/src/controllers/controller.js
new file mode 100644
index 0000000..dbd8811
--- /dev/null
+++ b/server/src/controllers/controller.js
@@ -0,0 +1,12 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const controller = ({ strapi }) => ({
+ index(ctx) {
+ ctx.body = strapi
+ .plugin('strapi-plugin-checkbox-list')
+ // the name of the service file & the method.
+ .service('service')
+ .getWelcomeMessage();
+ },
+});
+exports.default = controller;
diff --git a/server/src/controllers/index.js b/server/src/controllers/index.js
new file mode 100644
index 0000000..45ec37c
--- /dev/null
+++ b/server/src/controllers/index.js
@@ -0,0 +1,9 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const controller_1 = __importDefault(require("./controller"));
+exports.default = {
+ controller: controller_1.default,
+};
diff --git a/server/src/destroy.js b/server/src/destroy.js
new file mode 100644
index 0000000..43372ad
--- /dev/null
+++ b/server/src/destroy.js
@@ -0,0 +1,6 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const destroy = ({ strapi }) => {
+ // destroy phase
+};
+exports.default = destroy;
diff --git a/server/src/index.js b/server/src/index.js
new file mode 100644
index 0000000..e7b95cd
--- /dev/null
+++ b/server/src/index.js
@@ -0,0 +1,33 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+/**
+ * Application methods
+ */
+const bootstrap_1 = __importDefault(require("./bootstrap"));
+const destroy_1 = __importDefault(require("./destroy"));
+const register_1 = __importDefault(require("./register"));
+/**
+ * Plugin server methods
+ */
+const config_1 = __importDefault(require("./config"));
+const content_types_1 = __importDefault(require("./content-types"));
+const controllers_1 = __importDefault(require("./controllers"));
+const middlewares_1 = __importDefault(require("./middlewares"));
+const policies_1 = __importDefault(require("./policies"));
+const routes_1 = __importDefault(require("./routes"));
+const services_1 = __importDefault(require("./services"));
+exports.default = {
+ register: register_1.default,
+ bootstrap: bootstrap_1.default,
+ destroy: destroy_1.default,
+ config: config_1.default,
+ controllers: controllers_1.default,
+ routes: routes_1.default,
+ services: services_1.default,
+ contentTypes: content_types_1.default,
+ policies: policies_1.default,
+ middlewares: middlewares_1.default,
+};
diff --git a/server/src/middlewares/index.js b/server/src/middlewares/index.js
new file mode 100644
index 0000000..2367d85
--- /dev/null
+++ b/server/src/middlewares/index.js
@@ -0,0 +1,3 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.default = {};
diff --git a/server/src/policies/index.js b/server/src/policies/index.js
new file mode 100644
index 0000000..2367d85
--- /dev/null
+++ b/server/src/policies/index.js
@@ -0,0 +1,3 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.default = {};
diff --git a/server/src/register.js b/server/src/register.js
new file mode 100644
index 0000000..205846a
--- /dev/null
+++ b/server/src/register.js
@@ -0,0 +1,11 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const register = ({ strapi }) => {
+ // register phase
+ strapi.customFields.register({
+ name: 'checkbox-list',
+ plugin: 'checkbox-list',
+ type: 'json',
+ });
+};
+exports.default = register;
diff --git a/server/src/register.ts b/server/src/register.ts
index 482402d..0d0bbd9 100644
--- a/server/src/register.ts
+++ b/server/src/register.ts
@@ -2,6 +2,11 @@ import type { Core } from '@strapi/strapi';
const register = ({ strapi }: { strapi: Core.Strapi }) => {
// register phase
+ strapi.customFields.register({
+ name: 'checkbox-list',
+ plugin: 'checkbox-list',
+ type: 'json',
+ });
};
export default register;
diff --git a/server/src/routes/admin/index.js b/server/src/routes/admin/index.js
new file mode 100644
index 0000000..c660c05
--- /dev/null
+++ b/server/src/routes/admin/index.js
@@ -0,0 +1,6 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.default = () => ({
+ type: 'admin',
+ routes: [],
+});
diff --git a/server/src/routes/content-api/index.js b/server/src/routes/content-api/index.js
new file mode 100644
index 0000000..5b4fd7c
--- /dev/null
+++ b/server/src/routes/content-api/index.js
@@ -0,0 +1,16 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.default = () => ({
+ type: 'content-api',
+ routes: [
+ {
+ method: 'GET',
+ path: '/',
+ // name of the controller file & the method.
+ handler: 'controller.index',
+ config: {
+ policies: [],
+ },
+ },
+ ],
+});
diff --git a/server/src/routes/index.js b/server/src/routes/index.js
new file mode 100644
index 0000000..12b1061
--- /dev/null
+++ b/server/src/routes/index.js
@@ -0,0 +1,12 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const content_api_1 = __importDefault(require("./content-api"));
+const admin_1 = __importDefault(require("./admin"));
+const routes = {
+ 'content-api': content_api_1.default,
+ admin: admin_1.default,
+};
+exports.default = routes;
diff --git a/server/src/services/index.js b/server/src/services/index.js
new file mode 100644
index 0000000..1a108f0
--- /dev/null
+++ b/server/src/services/index.js
@@ -0,0 +1,9 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const service_1 = __importDefault(require("./service"));
+exports.default = {
+ service: service_1.default,
+};
diff --git a/server/src/services/service.js b/server/src/services/service.js
new file mode 100644
index 0000000..cdf4038
--- /dev/null
+++ b/server/src/services/service.js
@@ -0,0 +1,8 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const service = ({ strapi }) => ({
+ getWelcomeMessage() {
+ return 'Welcome to Strapi 🚀';
+ },
+});
+exports.default = service;