Comments (3)
What I'd sketched out earlier with @MKwenhua was the following addition to the Wizard spec, which would be an object within the fields
array:
{
"cell": {
"name": "asset_info",
"method": "alternative_cell_render_method",
"config": {
"data_field_id": 2,
"display": {
"grid_width": 12,
"styles": {
"height": "500px"
}
}
}
}
}
The only issue with this is this concept of 'cells' now conflicts with the naming of the 'fields' array in the spec - this doesn't make much sense. Perhaps we can come up with a better name for 'fields', but that might require restructuring/renaming of stuff in our app/cells directory.
from cortex.
Why not just refer to what was once fields:
as data:
- it is directly referring to the implementation of low level data for the fields / methods on the ContentItem
Additionally - I was thinking that we could structure it in a way that would lend itself directly to the cell it would be creating, since we know all of the view plugins in cells:
would be...well...cells...
I would counter propose a structure like this:
{
...other stuff...
data: [
cell: {
location: "Plugins::EmployerBlog::SpecificPluginModuleCellName",
render_method: "alternative_cell_render_method",
context: { ...specifics for the context object to go into the cell... },
model: 2,
display: {
classes: "class_one class_two just_like_haml",
id: "same as classes"
}
}
]
}
Just a few things to note:
- We are already tracking display information like the grid_width and whatnot when we create the column in the decorator, which we would still be doing prior to the fields (or whatever we rename it) array - however we are continuing to track display specific to the field, cell, or model, just like in the rest of the decorator
method
has been renamed torender_method
for consistencycontext
is, quite obviously, any context necessary to the cell that the User would need in their cell, since this is just a detached implementation of the cell systemlocation
would directly reference the location of the User's cell plugin, just like we're doing withPlugins::Core::SpecificFieldCell
in./app/cells/wizard/fields/show.haml
. This approach would allow a User to insert and easily reference their own Plugin cells which would always stem out ofPlugins::
model
needs some work admittedly, but I can't think of a better way to pass information along...any thoughts?
from cortex.
As per our discussion, here is the proposed final object:
{
"columns":
[
{
"elements": [
{
"cell": {
"class_name": "Plugins::EmployerBlog::SpecificPluginModuleCellName",
"render_method": "alternative_cell_render_method",
"config": {
"thumbnail": "large"
},
"data": {
"field_id": 2,
"field_method": "dynamic_method"
},
"display": {
"classes": ["class_one", "class_two", "just_like_haml"],
"id": ["same", "as", "classes"]
}
}
}
]
}
]
}
from cortex.
Related Issues (20)
- Tenants as Subdomains
- Content Libraries
- Dynamic Plugin Installation
- GraphQL + ElasticSearch HOT 16
- Research + Implement Citus Sharding/Tenancy HOT 2
- Indices Lack Scoped Uniqueness Constraints
- FieldType Subclass Cell Templates Have Implicit Dependencies On Decorator Data Structure
- Proposal: Flatten/Standardize ContentType Decorator's Object Shape HOT 3
- Migrate to ElasticSearch v6
- Refactor ContentType/Field Reference
- Rails 5.2 Upgrade
- Should We Use Sass Modules? HOT 2
- Schema/DSL for Decorators + FieldItems HOT 1
- GraphQL Authorization
- Refactor and Decouple Seeds HOT 1
- Ruby 2.5 Upgrade HOT 1
- Refactor Tree FieldType HOT 4
- Class-based GraphQL Schema Definition
- WYSIWYG Widget System Refactor
- Refactor ContentItem State (Published/Draft/etc) System
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cortex.