Page tree
Skip to end of metadata
Go to start of metadata

MGNLPN-65 - Getting issue details... STATUS

Intro

When assigning segments to the variant, we currently display only path which does not really tell us any details about the segment. Preview should display all necessary informations about a segment in a nice preview (like in contacts or assets)

Preview

  • using of info.magnolia.ui.form.field.component.AbstractContentPreviewComponent to implement the look of preview

Options

  1. we will probably need to add new method to the voters (e.g. getDescription) or override toString method
  2. Interesting concept could be something like (or a simplified version of it)
    • org.hamcrest.SelfDescribing

    • org.hamcrest.Description

    • see Example below
  3. Simple approach: use title/description of the segment for the moment
Example option 2.
/**
 * Implement this interface to enable stringification of your voter.
 */
public interface SelfDescribing {
    String describeTo(Description description);
}
/**
 * Description of a {@link info.magnolia.voting.Voter} or a {@link info.magnolia.voting.voters.VoterSet}.
 */
public interface Description {
    /**
     * Appends the description of a {@link SelfDescribing} value to this description.
     */
    Description appendDescriptionOf(SelfDescribing value);
}

We would then implement the above interface in the Voter or VoterSet.

Pros:

  • Flexible

Cons:

  • Can be difficult to translate
  • No labels