├── images ├── demo.gif ├── setup1.png └── setup2.png ├── .env.example ├── extension.json ├── package.json ├── .gitignore ├── LICENSE ├── README.md └── index.html /images/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnalogMemory/contentful-tables/HEAD/images/demo.gif -------------------------------------------------------------------------------- /images/setup1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnalogMemory/contentful-tables/HEAD/images/setup1.png -------------------------------------------------------------------------------- /images/setup2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnalogMemory/contentful-tables/HEAD/images/setup2.png -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | export SPACE_ID=xxxxxxxxxxxx 2 | export CONTENTFUL_MANAGEMENT_ACCESS_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -------------------------------------------------------------------------------- /extension.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Contentful Tables", 3 | "id": "cf-contentful-ui-am-tables", 4 | "fieldTypes": ["Object"], 5 | "srcdoc": "./index.html" 6 | } 7 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "contentful-tables", 3 | "version": "1.0.0", 4 | "description": "A Contentful UI-Extension to add editable tabular data", 5 | "main": "index.js", 6 | "engines": { 7 | "node": ">=7.6" 8 | }, 9 | "scripts": { 10 | "create": "contentful-extension create --space-id ${SPACE_ID}", 11 | "update": "contentful-extension update --space-id ${SPACE_ID} --force" 12 | }, 13 | "repository": { 14 | "type": "git", 15 | "url": "https://github.com/AnalogMemory/contentful-tables.git" 16 | }, 17 | "keywords": [ 18 | "contentful", 19 | "extension", 20 | "tables" 21 | ], 22 | "author": "Alex M", 23 | "license": "MIT", 24 | "bugs": { 25 | "url": "https://github.com/AnalogMemory/contentful-tables/issues" 26 | }, 27 | "homepage": "https://github.com/AnalogMemory/contentful-tables#readme", 28 | "devDependencies": { 29 | "contentful-extension-cli": "^2.0.0" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Runtime data 9 | pids 10 | *.pid 11 | *.seed 12 | *.pid.lock 13 | 14 | # Directory for instrumented libs generated by jscoverage/JSCover 15 | lib-cov 16 | 17 | # Coverage directory used by tools like istanbul 18 | coverage 19 | 20 | # nyc test coverage 21 | .nyc_output 22 | 23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 24 | .grunt 25 | 26 | # Bower dependency directory (https://bower.io/) 27 | bower_components 28 | 29 | # node-waf configuration 30 | .lock-wscript 31 | 32 | # Compiled binary addons (http://nodejs.org/api/addons.html) 33 | build/Release 34 | 35 | # Dependency directories 36 | node_modules/ 37 | jspm_packages/ 38 | 39 | # Typescript v1 declaration files 40 | typings/ 41 | 42 | # Optional npm cache directory 43 | .npm 44 | 45 | # Optional eslint cache 46 | .eslintcache 47 | 48 | # Optional REPL history 49 | .node_repl_history 50 | 51 | # Output of 'npm pack' 52 | *.tgz 53 | 54 | # Yarn Integrity file 55 | .yarn-integrity 56 | 57 | # dotenv environment variables file 58 | .env 59 | 60 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Contentful Developer Relations 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Contentful Tables 2 | 3 | An ui-extension to add an editable table to handle tabular data as a [Contentful UI Extension](https://www.contentful.com/developers/docs/concepts/uiextensions/). 4 | 5 | ### ⚙️ Setup field Content Models 6 | 7 | Add JSON Object field 8 | ![figure](https://github.com/AnalogMemory/contentful-tables/blob/master/images/setup1.png "Add JSON Object field") 9 | 10 | Configure appearance to use **Contentful Tables** 11 | ![figure](https://github.com/AnalogMemory/contentful-tables/blob/master/images/setup2.png "Configure appearance") 12 | 13 | ### 📝 Editing Table 14 | 15 | ![figure](https://github.com/AnalogMemory/contentful-tables/blob/master/images/demo.gif "Editing the table") 16 | 17 | ## ✅ Easy Installation in Contentful Web App 18 | 19 | * In the contentful web app to to `Settings > Extensions` 20 | * Click the `Add extension` 21 | * Choose `Install from Github` 22 | * Paste this link `https://github.com/AnalogMemory/contentful-tables/blob/master/extension.json` 23 | 24 | ### Manual Installation 25 | 26 | ```sh 27 | git clone https://github.com/AnalogMemory/contentful-tables.git 28 | cd contentful-tables 29 | npm install 30 | ``` 31 | 32 | ### Configure 33 | 34 | Create a configuration file with your credentials for Contentful. 35 | 36 | ```sh 37 | cp .env.example .env 38 | ``` 39 | 40 | Open `.env` in a editor of your liking and add your Contentful space ID, and management token. [Learn how to obtain a token](https://www.contentful.com/developers/docs/references/authentication/#getting-an-oauth-token). 41 | 42 | Load environment variables 43 | 44 | ```sh 45 | source .env 46 | ``` 47 | 48 | ### Create 49 | 50 | ```sh 51 | npm run create 52 | ``` 53 | 54 | Create task will register the extension in your space on Contentful. 55 | 56 | ### Update 57 | 58 | ```sh 59 | npm run update 60 | ``` 61 | 62 | Update task will upload the extension to your space on Contentful. 63 | 64 | ## License 65 | 66 | Copyright © Contentful Developer Relations 67 | 68 | Licensed under the [MIT license](https://github.com/contentful-labs/ui-editable-table/blob/master/LICENSE). 69 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Tables for Contentful UI 6 | 10 | 11 | 77 | 78 | 79 |
80 |
81 |
82 | 208 | 209 | 210 | --------------------------------------------------------------------------------