Skip to content

Commit

Permalink
42 create infrastructure page (#62)
Browse files Browse the repository at this point in the history
* feat(backend): ✨ Add infrastructure data to strapi and generate types in backend

* feat(frontend): ✨ Add content block to infrastruct page

* feat(frontend): 💩 Try to fix styling

* style(frontend): 💄 Style the block content in structure

Create BlockRendererClient component for styling the block content in infrastructure.

* refactor(frontend): ♻️ Run prettier and use runtime edge

Improve code readability and use edge to build Cloudflare pages

* fix(frontend): 🚨 Fix merge conflicts

---------

Co-authored-by: Lukas Thrane <lukas@thrane.name>
  • Loading branch information
2 people authored and GitHub committed Jan 31, 2024
1 parent c9db0df commit 20eb5be
Show file tree
Hide file tree
Showing 14 changed files with 2,976 additions and 624 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"kind": "singleType",
"collectionName": "infrastructures",
"info": {
"singularName": "infrastructure",
"pluralName": "infrastructures",
"displayName": "Infrastructure"
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"Content": {
"type": "blocks"
}
}
}
9 changes: 9 additions & 0 deletions backend/src/api/infrastructure/controllers/infrastructure.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

/**
* infrastructure controller
*/

const { createCoreController } = require('@strapi/strapi').factories;

module.exports = createCoreController('api::infrastructure.infrastructure');
324 changes: 324 additions & 0 deletions backend/src/api/infrastructure/documentation/1.0.0/infrastructure.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,324 @@
{
"/infrastructure": {
"get": {
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InfrastructureResponse"
}
}
}
},
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "Forbidden",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Not Found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"500": {
"description": "Internal Server Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
},
"tags": [
"Infrastructure"
],
"parameters": [
{
"name": "sort",
"in": "query",
"description": "Sort by attributes ascending (asc) or descending (desc)",
"deprecated": false,
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "pagination[withCount]",
"in": "query",
"description": "Return page/pageSize (default: true)",
"deprecated": false,
"required": false,
"schema": {
"type": "boolean"
}
},
{
"name": "pagination[page]",
"in": "query",
"description": "Page number (default: 0)",
"deprecated": false,
"required": false,
"schema": {
"type": "integer"
}
},
{
"name": "pagination[pageSize]",
"in": "query",
"description": "Page size (default: 25)",
"deprecated": false,
"required": false,
"schema": {
"type": "integer"
}
},
{
"name": "pagination[start]",
"in": "query",
"description": "Offset value (default: 0)",
"deprecated": false,
"required": false,
"schema": {
"type": "integer"
}
},
{
"name": "pagination[limit]",
"in": "query",
"description": "Number of entities to return (default: 25)",
"deprecated": false,
"required": false,
"schema": {
"type": "integer"
}
},
{
"name": "fields",
"in": "query",
"description": "Fields to return (ex: title,author)",
"deprecated": false,
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "populate",
"in": "query",
"description": "Relations to return",
"deprecated": false,
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "filters",
"in": "query",
"description": "Filters to apply",
"deprecated": false,
"required": false,
"schema": {
"type": "object"
},
"style": "deepObject"
},
{
"name": "locale",
"in": "query",
"description": "Locale to apply",
"deprecated": false,
"required": false,
"schema": {
"type": "string"
}
}
],
"operationId": "get/infrastructure"
},
"put": {
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InfrastructureResponse"
}
}
}
},
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "Forbidden",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Not Found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"500": {
"description": "Internal Server Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
},
"tags": [
"Infrastructure"
],
"parameters": [],
"operationId": "put/infrastructure",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InfrastructureRequest"
}
}
}
}
},
"delete": {
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "integer",
"format": "int64"
}
}
}
},
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "Forbidden",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Not Found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"500": {
"description": "Internal Server Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
},
"tags": [
"Infrastructure"
],
"parameters": [],
"operationId": "delete/infrastructure"
}
}
}
9 changes: 9 additions & 0 deletions backend/src/api/infrastructure/routes/infrastructure.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

/**
* infrastructure router
*/

const { createCoreRouter } = require('@strapi/strapi').factories;

module.exports = createCoreRouter('api::infrastructure.infrastructure');
9 changes: 9 additions & 0 deletions backend/src/api/infrastructure/services/infrastructure.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

/**
* infrastructure service
*/

const { createCoreService } = require('@strapi/strapi').factories;

module.exports = createCoreService('api::infrastructure.infrastructure');
Loading

0 comments on commit 20eb5be

Please sign in to comment.