question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

setAttributes should be exposed for overriding on the autofields object

See original GitHub issue

It would be helpful (and make this plugin more useful/extensible) if setAttributes was exposed for overriding (monkey-patching) on the autofields object.

If a consumer wants to override that method, currently they have to do the following (in addition to writing their own implementation):

  • Create a local dictionary of mutators & overriding registerMutator to use that
  • Duplicating getLabel & getInput & modifying them to use the replacement setAttributes implementation
  • Duplicating getFieldContainer & modifying it to use the replacement setAttributes implementation
  • Overriding the field method ($autofieldsProvider.field) with an implementation that uses the custom getFieldContainer imlpementation. This will use the local dictionary of mutators.

All that could be avoided if Autofields exposed (and used) setAttributes on the autofields object.

As a less pressing issue, it would be handy if the helper (i.e. CamelToTitle etc) was exposed too.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
JustMaiercommented, Nov 11, 2018

Pulled. Thanks for that!

0reactions
flakey-bitcommented, Nov 9, 2018

PR #64 submitted 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

setAttribute without overriding another class attribute [duplicate]
I have created a code that when you select an option in a select to the body of my website includes a new...
Read more >
Overriding Metadata Generated by a Transformation
You can override object and field attributes. For example, you can change a field name that is extracted from a Salesforce object so...
Read more >
Element.setAttribute() - Web APIs | MDN
Sets the value of an attribute on the specified element. If the attribute already exists, the value is updated; otherwise a new attribute...
Read more >
pyfields
pyfields provides a simple and elegant way to define fields in python classes. With pyfields you explicitly define all aspects of a field...
Read more >
Overwriting attribute in super-class or sub-class - CodeQL
Subclasses should not set attributes that are set in the superclass. ... #Attribute set in both superclass and subclass class C(object): def __init__(self): ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found