Skip to content

Commit c913705

Browse files
authored
Merge pull request #132 from pluginpal/feature/fix-component-syncing
chore: setup components in the playground
2 parents e9628ec + 75634a3 commit c913705

File tree

17 files changed

+1150
-8
lines changed

17 files changed

+1150
-8
lines changed

playground/.strapi/client/app.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/**
2+
* This file was automatically generated by Strapi.
3+
* Any modifications made will be discarded.
4+
*/
5+
import i18N from "@strapi/plugin-i18n/strapi-admin";
6+
import usersPermissions from "@strapi/plugin-users-permissions/strapi-admin";
7+
import configSync from "strapi-plugin-config-sync/strapi-admin";
8+
import { renderAdmin } from "@strapi/strapi/admin";
9+
10+
renderAdmin(document.getElementById("strapi"), {
11+
plugins: {
12+
i18n: i18N,
13+
"users-permissions": usersPermissions,
14+
"config-sync": configSync,
15+
},
16+
});
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<!--
4+
This file was automatically generated by Strapi.
5+
Any modifications made will be discarded.
6+
-->
7+
<head>
8+
<meta charset="utf-8" />
9+
<meta
10+
name="viewport"
11+
content="width=device-width, initial-scale=1, viewport-fit=cover"
12+
/>
13+
<meta name="robots" content="noindex" />
14+
<meta name="referrer" content="same-origin" />
15+
<title>Strapi Admin</title>
16+
<style>
17+
html,
18+
body,
19+
#strapi {
20+
height: 100%;
21+
}
22+
body {
23+
margin: 0;
24+
-webkit-font-smoothing: antialiased;
25+
}
26+
</style>
27+
</head>
28+
<body>
29+
<div id="strapi"></div>
30+
<noscript
31+
><div class="strapi--root">
32+
<div class="strapi--no-js">
33+
<style type="text/css">
34+
.strapi--root {
35+
position: absolute;
36+
top: 0;
37+
right: 0;
38+
left: 0;
39+
bottom: 0;
40+
background: #fff;
41+
}
42+
43+
.strapi--no-js {
44+
position: absolute;
45+
top: 50%;
46+
left: 50%;
47+
transform: translate(-50%, -50%);
48+
text-align: center;
49+
font-family: helvetica, arial, sans-serif;
50+
}
51+
</style>
52+
<h1>JavaScript disabled</h1>
53+
<p>
54+
Please
55+
<a href="https://www.enable-javascript.com/">enable JavaScript</a>
56+
in your browser and reload the page to proceed.
57+
</p>
58+
</div>
59+
</div></noscript
60+
>
61+
</body>
62+
</html>

playground/config/plugins.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,18 @@ module.exports = {
33
enabled: true,
44
config: {
55
importOnBootstrap: false,
6-
minify: true,
6+
minify: false,
7+
customTypes: [
8+
{
9+
configName: "home",
10+
queryString: "api::home.home",
11+
uid: ["slug"],
12+
components: [
13+
"Profile",
14+
"Profile.ContactInfo",
15+
],
16+
}
17+
]
718
},
819
},
920
};
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"kind": "singleType",
3+
"collectionName": "homes",
4+
"info": {
5+
"singularName": "home",
6+
"pluralName": "homes",
7+
"displayName": "Home",
8+
"description": ""
9+
},
10+
"options": {
11+
"draftAndPublish": false
12+
},
13+
"pluginOptions": {},
14+
"attributes": {
15+
"title": {
16+
"type": "string"
17+
},
18+
"Profile": {
19+
"type": "component",
20+
"repeatable": false,
21+
"component": "core.profile"
22+
},
23+
"slug": {
24+
"type": "uid",
25+
"targetField": "title"
26+
}
27+
}
28+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
'use strict';
2+
3+
/**
4+
* home controller
5+
*/
6+
7+
const { createCoreController } = require('@strapi/strapi').factories;
8+
9+
module.exports = createCoreController('api::home.home');
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
'use strict';
2+
3+
/**
4+
* home router
5+
*/
6+
7+
const { createCoreRouter } = require('@strapi/strapi').factories;
8+
9+
module.exports = createCoreRouter('api::home.home');
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
'use strict';
2+
3+
/**
4+
* home service
5+
*/
6+
7+
const { createCoreService } = require('@strapi/strapi').factories;
8+
9+
module.exports = createCoreService('api::home.home');
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"kind": "collectionType",
3+
"collectionName": "pages",
4+
"info": {
5+
"singularName": "page",
6+
"pluralName": "pages",
7+
"displayName": "Page"
8+
},
9+
"options": {
10+
"draftAndPublish": false
11+
},
12+
"pluginOptions": {},
13+
"attributes": {
14+
"title": {
15+
"type": "string",
16+
"required": true
17+
}
18+
}
19+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
'use strict';
2+
3+
/**
4+
* page controller
5+
*/
6+
7+
const { createCoreController } = require('@strapi/strapi').factories;
8+
9+
module.exports = createCoreController('api::page.page');
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
'use strict';
2+
3+
/**
4+
* page router
5+
*/
6+
7+
const { createCoreRouter } = require('@strapi/strapi').factories;
8+
9+
module.exports = createCoreRouter('api::page.page');

0 commit comments

Comments
 (0)