attributes-kit icon indicating copy to clipboard operation
attributes-kit copied to clipboard

Attributes#onElementLinkClick should receive minim element

Open opichals opened this issue 7 years ago • 2 comments

Based on https://github.com/apiaryio/attributes-kit/pull/462 the onElementLinkClick() method is inconsistent when minim Element is used as input as it returns refract serialization as the second argument.

   this.context.onElementLinkClick(element.meta.id, element, event)

opichals avatar Jul 16 '18 13:07 opichals

In order for the internally rendered link tags to be consistent with the application it is being used in (e.g. to contain proper href attribute value or to have application-provided onClick handler), the interface could be changed so that optionally a data structure link renderer function is passed in (currently the is a hard-coded ParentInfoLink component).

For example as follows:

<Attrbutes renderDataStructureLink={this.renderDataStructureLinkTag} />

opichals avatar Jul 17 '18 08:07 opichals

Parametrize the link renderer seems to be better and more flexible option

char0n avatar Jul 17 '18 11:07 char0n