Directus: initial structure
Description
Changes done:
- Added the initial folder structure of the Directus plugin.
- Added the cms models definition.
Context
New botonic plugin that will integrate the Directus cms. For now text, button and image will be the models that will be used in the plugin.
Approach taken / Explain the design
In plugin.ts file: There is the plugin constructor. For now the DirectusOptions are the credentials used to authenticate through the directus sdk. The token is a static token defined in the frontend.
In cms/contents.ts file:
-
Created an abstract class called Content that stores the common information shared by the three subclasses.(Text,Button,Image)
-
Added the three subclasses that will store specific information of each model.
In cms/cms.ts file:
- Added the supported content types and locales.
- Created an interface called CMS that will be used to access the contents through an id and a context (locale).
In directus/contents folder: There will be the code to convert the received data from contentful to a cms content model.
In directus/delivery folder: There will be the code that will acces to the data through directus sdk.
In render folder: There will be the class that will be used to convert the cms content model to content that botonic/react will recognize and will be able to render.
To document / Usage example
Testing
The pull request...
- doesn't need tests because is the initial structure of the plugin.