-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Description
Bug report
Describe the bug
I added my own field. Visually it is some kind of schedule which is saved in JSON format and as longtext in the mySQL database. As it has some columns I wish it to be taking maximum available space in the admin UI to provide a good user experience, but instead it gets rendered taking 6 of the 12 available grid cols.
To get this working, I tried to overwrite the content-manager plugin and to set 12 cols as default size for components. But it does not seem to work (still taking 50 % of the space). Either the original file won’t be overwritten or I am looking at the wrong place.
Steps to reproduce the behavior
- Copy file
packages/strapi-plugin-content-manager/admin/src/utils/layout.jsto./extensions/content-manager/admin/src/utils/layout.js - Change default col span from 6 to 12 (see code snippet below).
- Rebuild Admin UI with
yarn build - Components still render with class
.col-6and take 50 % of the available space.
Expected behavior
Expecting the wrapper for the field to render with class="col-12" or class="col".
Code snippets
Here I altered default size of 6 to 12 (I guessed).
// ./extensions/content-manager/admin/src/utils/layout.js
const getInputSize = type => {
switch (type) {
case 'boolean':
case 'date':
case 'integer':
case 'float':
case 'biginteger':
case 'decimal':
case 'time':
return 4;
case 'json':
case 'component':
case 'richtext':
case 'dynamiczone':
return 12;
default:
// return 6;
return 12;
}
};System
I am working with the latest docker image started by a docker-compose.yml
version: "3"
services:
strapi:
image: strapi/strapi
container_name: ig-corporate-strapi
restart: unless-stopped
env_file: .env
environment:
DATABASE_CLIENT: ${DATABASE_CLIENT}
DATABASE_HOST: ${DATABASE_HOST}
DATABASE_PORT: ${DATABASE_PORT}
DATABASE_NAME: ${DATABASE_NAME}
DATABASE_USERNAME: ${DATABASE_USERNAME}
DATABASE_PASSWORD: ${DATABASE_PASSWORD}
networks:
- ig-corporate-network
volumes:
- ./app:/srv/app
ports:
- "1337:1337"
- "8010:8000" # admin dev mode
depends_on:
- mysql
mysql:
image: mysql:5.7
container_name: ig-corporate-mysql
restart: unless-stopped
command: --default-authentication-plugin=mysql_native_password
env_file: .env
environment:
MYSQL_DATABASE: ${DATABASE_NAME}
MYSQL_USER: ${DATABASE_USERNAME}
MYSQL_PASSWORD: ${DATABASE_PASSWORD}
MYSQL_ROOT_PASSWORD: ${DATABASE_ROOT_PASSWORD}
networks:
- ig-corporate-network
volumes:
- ./db:/var/lib/mysql
ports:
- 3306:3306
networks:
ig-corporate-network:
driver: bridge
volumes:
strapidata:#8094 could be a relational issue
Thanks in advance!