Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display InheritedValue for TopicReference attribute type #40

Open
JeremyCaney opened this issue Apr 1, 2021 · 0 comments
Open

Display InheritedValue for TopicReference attribute type #40

JeremyCaney opened this issue Apr 1, 2021 · 0 comments
Labels
Area: Attribute Types Related to attribute type definitions or plugins. Priority: 2 Severity 0: Nice to Have Status 0: Discussion Needs further evaluation of requirements and prioritization. Type: Improvement Improves the functionality or interface of an existing feature.

Comments

@JeremyCaney
Copy link
Member

JeremyCaney commented Apr 1, 2021

Previously, we implemented InheritedValue support (alongside DefaultValue and ImplicitValue) for most attribute types. This was not implemented into TopicReference, however, as this introduces specific challenges that aren't trivial to mitigate. This will require further research and is thus being deferred for further evaluation.

This will likely require additional JavaScript to be introduced to display a “phantom” token with the InheritedValue—but it should only be displayed if there isn’t an existing value. It may be that the tokenized input plugin we're using supports something like this, though it's unlikely.

@JeremyCaney JeremyCaney added Priority: 2 Severity 0: Nice to Have Status 0: Discussion Needs further evaluation of requirements and prioritization. Type: Improvement Improves the functionality or interface of an existing feature. Area: Attribute Types Related to attribute type definitions or plugins. labels Apr 1, 2021
JeremyCaney added a commit that referenced this issue Apr 1, 2021
Introduced support for displaying placeholders for inferred values, such as `DefaultValue`, `InheritedValue`, and `ImplicitValue`. For text input fields, this is straightforward, and simply required extending the `placeholder` definition. For dropdown lists—such as `FileList` and `TopicList`—this required changing the instructional label if an inferred value was present. For the `Boolean` attribute, I introduced a third, empty-valued radio button which displayed the inferred value. For both dropdown lists and radio buttons, I provide not only the inferred value, but also the source of the inferred value—i.e., "default value", "inherited value", or "implicit value". This satisfies the requirements of #26.

Note: This does _not_ account for the `TopicReference`, which introduces unique challenges. That will be deferred to a later date based on further evaluation. A new issue, #40, has been created for tracking that, but it hasn't been assigned to a milestone yet.
JeremyCaney added a commit that referenced this issue Apr 1, 2021
This update ensures that if the `DefaultValue` is defined on an attribute, then it is set on that attribute _after_ submit, assuming the topic doesn't have a `BaseTopic` defined (b1dc5ec). We want to do this afterwards, as opposed to before, to ensure that the `DefaultValue` doesn't get set in the case that a `BaseTopic` _is_ defined; in that case, it should inherit the value from the `BaseTopic`. As part of this, the client-side (ea1c325) and server-side (00fa995) to ensure that a value is only required if `IsRequired` is true _and_ a `DefaultValue` is not defined. This satisfies the requirements of #25.

While I was at it, I also addressed the closely related issue #40, in which values were being deleted if the `AttributeBindingModel` couldn't be found. This indicates an underlying error in the attribute type view, and should result in an exception, not an assumption that the value should be removed. This is now accounted for (70f9b5a).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Attribute Types Related to attribute type definitions or plugins. Priority: 2 Severity 0: Nice to Have Status 0: Discussion Needs further evaluation of requirements and prioritization. Type: Improvement Improves the functionality or interface of an existing feature.
Projects
None yet
Development

No branches or pull requests

1 participant