thoughtbot / thoughtbot/administrate

Provide more context to fields

Open
#2,363 0 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

epic fields-context
Dominant language
JavaScript
Stars
6k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

A common issue for users of Administrate is that fields do not receive enough context. The most typical use case is that they cannot modify the configuration of a field depending on the current user: hiding/showing the field, showing different select options, etc.

These are some relevant issues, marked https://github.com/thoughtbot/administrate/labels/fields-context. Some of these refer directly to the lack of context, others are a bit more indirect but still related:

My initial intuition would be to pass the current controller down to fields, so that it can be used as provider of context. This can be passed in turn to the call-able that some options take, as well to new options such as hide_if or something like that.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the linked fields-context issues to identify the recurring requirements around current-user access, conditional visibility, and dynamic select options. Then trace how fields receive configuration and how callable options are evaluated; done should provide a decided, documented context mechanism that supports these use cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
rails, ruby
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.