Comments (11)
@januszm, I think you're hitting a few things here, one of which was a mistake by me.
- Could you describe in more detail what custom modifications you're making with the view templates?
- We don't use Bootstrap, we have our own small CSS framework in Administrate itself,
- The search input issues were probably caused by #2492 and fixed in #2512,
- How does the Datepicker fail? Just not load at all?
Could you try with current main
and let me know what's still broken?
from administrate.
@nickcharlton thanks for your quick reply, let me clarify this as I was already able to resolve issue 1.
First, problem with template from 0.19 that was customized, and below are diffs that solved it:
- ... ) if valid_action?(:edit) && show_action?(:edit, page.resource) %>
+ ... ) if accessible_action?(page.resource, :edit) %>
(valid_action? => accessible_action?)
- <% page.attributes.each do |attribute| %>
+ <% page.attributes.each do |title, attributes| %>
this is I believe what caused the no method error name
for [...]
Array, (attribute vs attributes)
Search box with weird blue background on hover (see attachment)
Datepicker actually WORKS but it uses white font color on white background which of course makes the text invisible and suggests that it isn't working. (see attachment)
from administrate.
@nickcharlton also, the last two (visual) issues are solved on the main
branch. I've just updated the gem and it looks good.
So the potential, future "Upgrade to v1" Guide should contain information about the need to re-generated the customized partials and re-apply added code. I think that's all.
from administrate.
One more request, I noticed that after the upgrade the <pre>
elements don't have white-space pre-wrap set anymore. I have some dashboards where I dump jsonb
data with JSON.pretty_generate
. It produces <pre>
tags (just a poor-mans way for supporting jsonb with administrate). In 0.19 long lines were nicely wrapped. In v1 I have to somehow inject pre { white-space: pre-wrap; }
Or, can I somehow enforce applying this class to specific field?
.preserve-whitespace {
white-space: pre-wrap;
word-wrap: break-word;
}
from administrate.
So the potential, future "Upgrade to v1" Guide should contain information about the need to re-generated the customized partials and re-apply added code. I think that's all.
Alright, cool! I'll add a mention to explicitly call that out in the migration guide. It is something we started highlighting in the CHANGELOG, but that's always easy to miss.
from administrate.
Re: <pre>
, can you tell if that's something that changed in the linting PR? If it was, I think we should undo that specific change as it wasn't intentional.
from administrate.
ReL <pre>
, for a regular field it looks ok, both white-space and word-wrap attributes are set properly.
In my case the issue is with a custom field (data type) that I called PrettyJson (it's a type that I use to dump a typical jsonb column data).
It generates the following css class which is missing the necessary white-space attr attribute-data attribute-data--pretty-json-field
from administrate.
UPDATE: @nickcharlton please disregard my comments about <pre>
. After all it was because I had a custom field with a custom template and in that template I used <pre>
tag. The solution was to add a CSS class to this custom view partial.
Any chance I can tell my custom field class to use preserve-whitespace
CSS class on the generated element? Just like for the Field::Text class.
from administrate.
Ah, hah! Excellent. Glad to hear you figured it out.
Is that everything you were having trouble with?
from administrate.
All good now.
I'd make this section of the migrating .md file a bit more detailed, e.g.
As with most upgrades, if you're upgrading between versions with changes to the
templates, and if you've customised them, you may need to apply recent changes.
You can see those which changed in the [CHANGELOG][].
This applies to both modified files in `app/views/admin` and `app/views/fields`
if you have your own Field classes defined. A good way is to use the same command
to generate the view as for the earlier version:
`rails generate administrate:views:ACTION MyModel`
noting the changes and re-applying the modifications
from administrate.
Oh, yes, that's a great idea. I'll do that.
I'll close this now, but please open new issues if you find problems.
from administrate.
Related Issues (20)
- Will v1.0.0 provide built-in support for Active Storage and Action Text? HOT 1
- Handling of scoped dynamic routes HOT 2
- Flakey spec: Search admin search with a filter with arguments HOT 1
- Cannot see the value of most fields in edit forms unless you mouseover them (1.0.0.beta1) HOT 2
- Selectize removes the blank options from selects HOT 1
- How to type an attribute that returns a model but doesn't use a has_one association HOT 1
- generator `administrate:install` fails if ActionCable is disabled HOT 6
- White Font Color in Text Input Box on demo site HOT 3
- the has_one looks different in edit page HOT 1
- In title on object creation form name of object showing in plural form
- Incompatibility with strict loading HOT 1
- view variants support
- Field::HasMany loading too many records in Edit view
- Field Select - Default selected option not working
- One model, two dashboards HOT 1
- Potential peformance improvements with Field::BelongsTo
- Is it possible to not require the image_processing gem?
- Snakecased routes not being properly generate on show pages of resources
- PG::DuplicatePstatement: ERROR: prepared statement already exists
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 administrate.