Skip to content
This repository was archived by the owner on Jun 28, 2025. It is now read-only.

Commit 85062fe

Browse files
authored
Merge pull request #26 from vim/feature/dynamic-content
Feature/dynamic content
2 parents f5c892d + e240662 commit 85062fe

File tree

31 files changed

+1747
-264
lines changed

31 files changed

+1747
-264
lines changed

.github/workflows/verify-web.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ on:
1717
jobs:
1818
build:
1919
runs-on: ubuntu-latest
20-
20+
env:
21+
CMS_API: ${{ vars.CMS_API }}
2122
steps:
2223
- name: Checkout repository
2324
uses: actions/checkout@v2

cms/package-lock.json

Lines changed: 11 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cms/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@
2020
"@strapi/strapi": "4.14.5",
2121
"mysql": "2.18.1",
2222
"mysql2": "^3.6.2",
23-
"strapi-plugin-config-sync": "^1.2.3",
24-
"strapi-plugin-menus": "^1.6.1"
23+
"strapi-plugin-config-sync": "^1.2.3",
24+
"strapi-plugin-menus": "^1.6.1",
25+
"strapi-plugin-populate-deep": "^3.0.1"
2526
},
2627
"devDependencies": {
2728
"@babel/eslint-parser": "^7.23.10",
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"kind": "singleType",
3+
"collectionName": "home",
4+
"info": {
5+
"singularName": "home",
6+
"pluralName": "homes",
7+
"displayName": "home",
8+
"description": ""
9+
},
10+
"options": {
11+
"draftAndPublish": true
12+
},
13+
"pluginOptions": {},
14+
"attributes": {
15+
"Hero": {
16+
"type": "component",
17+
"repeatable": false,
18+
"component": "sections.hero-section",
19+
"required": true
20+
},
21+
"body": {
22+
"type": "dynamiczone",
23+
"components": ["sections.news-section", "general.button", "general.card"]
24+
}
25+
}
26+
}

cms/src/api/home/controllers/home.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* home controller
3+
*/
4+
5+
import { factories } from "@strapi/strapi";
6+
7+
export default factories.createCoreController("api::home.home", () => ({
8+
async find(ctx) {
9+
const response = await super.find(ctx);
10+
11+
return { ...response };
12+
},
13+
}));

cms/src/api/home/routes/home.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/**
2+
* home router
3+
*/
4+
5+
import { factories } from "@strapi/strapi";
6+
7+
export default factories.createCoreRouter("api::home.home");

cms/src/api/home/services/home.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/**
2+
* home service
3+
*/
4+
5+
import { factories } from "@strapi/strapi";
6+
7+
export default factories.createCoreService("api::home.home");
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"collectionName": "components_general_list_items",
3+
"info": {
4+
"displayName": "ListItem"
5+
},
6+
"options": {},
7+
"attributes": {
8+
"text": {
9+
"type": "string"
10+
}
11+
}
12+
}

cms/src/components/general/list.json

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
{
2-
"collectionName": "components_general_lists",
3-
"info": {
4-
"displayName": "list",
5-
"icon": "bulletList"
6-
},
7-
"options": {},
8-
"attributes": {
9-
"item": {
10-
"type": "string"
11-
}
12-
}
2+
"collectionName": "components_general_lists",
3+
"info": {
4+
"displayName": "List",
5+
"icon": "bulletList"
6+
},
7+
"options": {},
8+
"attributes": {
9+
"items": {
10+
"displayName": "ListItem",
11+
"type": "component",
12+
"repeatable": true,
13+
"component": "general.list-item"
14+
}
15+
}
1316
}
Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
{
2-
"collectionName": "components_sections_hero_sections",
3-
"info": {
4-
"displayName": "Hero Section",
5-
"icon": "star"
6-
},
7-
"options": {},
8-
"attributes": {
9-
"headline": {
10-
"type": "string"
11-
},
12-
"listItems": {
13-
"displayName": "list",
14-
"type": "component",
15-
"repeatable": true,
16-
"component": "general.list"
17-
},
18-
"cta": {
19-
"type": "component",
20-
"repeatable": false,
21-
"component": "general.button"
22-
}
23-
}
2+
"collectionName": "components_sections_hero_sections",
3+
"info": {
4+
"displayName": "Hero Section",
5+
"icon": "star",
6+
"description": ""
7+
},
8+
"options": {},
9+
"attributes": {
10+
"headline": {
11+
"type": "string"
12+
},
13+
"cta": {
14+
"type": "component",
15+
"repeatable": false,
16+
"component": "general.button"
17+
},
18+
"list": {
19+
"type": "component",
20+
"repeatable": true,
21+
"component": "general.list-item"
22+
}
23+
}
2424
}

0 commit comments

Comments
 (0)