Skip to content

Commit

Permalink
Set individual labels for field and field option in image-,video-,lin…
Browse files Browse the repository at this point in the history
…kset
  • Loading branch information
eschleb committed Mar 22, 2024
1 parent 7f863ee commit ee34451
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

public class ImageSetDefinitionBuilder extends AbstractImageSetDefinitionBuilder<ImageSetDefinitionBuilder> {
protected static final String LABEL_PREFIX = "merkle.customDefinitions.imageSet.";
protected static final String FIELD_LABEL_PREFIX = LABEL_PREFIX + "field.";

public ImageSetDefinitionBuilder() {
super(LABEL_PREFIX);
Expand All @@ -24,7 +25,7 @@ protected FieldOption<ImageType> dam() {
ImageTypes.DAM,
n -> new SingleSwitchableForm<>(
new AssetLinkDefinitionBuilder()
.label(LABEL_PREFIX + ImageTypes.DAM.getLabel())
.label(FIELD_LABEL_PREFIX + ImageTypes.DAM.getLabel())
.build(n)
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class LinkSetDefinitionBuilder extends AbstractSwitchableLinkSetDefinitio
public static final UnaryOperator<String> LINK_TEXT_PROPERTY_NAME_PROVIDER = name -> name + "_text";
public static final UnaryOperator<String> OPEN_IN_NEW_TAB_PROPERTY_NAME_PROVIDER = name -> name + "_in_new_window";
protected static final String LABEL_PREFIX = "merkle.customDefinitions.linkSet.";
protected static final String FIELD_LABEL_PREFIX = LABEL_PREFIX + "field.";

public LinkSetDefinitionBuilder() {
super(LABEL_PREFIX);
Expand Down Expand Up @@ -44,7 +45,7 @@ protected FieldOption<LinkType> internal(final LinkType linkType) {
.linkText(linkText(name))
.openInNewWindow(openInNewTab(name))
.label("")
.build(name, new InternalLinkDefinitionBuilder().label(LABEL_PREFIX + linkType.getLabel()).build(name))
.build(name, new InternalLinkDefinitionBuilder().label(FIELD_LABEL_PREFIX + linkType.getLabel()).build(name))
);
}

Expand All @@ -56,7 +57,7 @@ protected FieldOption<LinkType> external(final LinkType linkType) {
.linkText(linkText(name))
.openInNewWindow(openInNewTab(name))
.label("")
.build(name, new TextFieldDefinitionBuilder().label(LABEL_PREFIX + linkType.getLabel()).build(name))
.build(name, new TextFieldDefinitionBuilder().label(FIELD_LABEL_PREFIX + linkType.getLabel()).build(name))
);
}

Expand All @@ -67,7 +68,7 @@ protected FieldOption<LinkType> asset(final LinkType linkType) {
.linkText(linkText(name))
.openInNewWindow(openInNewTab(name))
.label("")
.build(name, new AssetLinkDefinitionBuilder().label(LABEL_PREFIX + linkType.getLabel()).build(name))
.build(name, new AssetLinkDefinitionBuilder().label(FIELD_LABEL_PREFIX + linkType.getLabel()).build(name))
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

public class VideoSetDefinitionBuilder extends AbstractVideoSetDefinitionBuilder<VideoSetDefinitionBuilder> {
protected static final String LABEL_PREFIX = "merkle.customDefinitions.videoSet.";
protected static final String FIELD_LABEL_PREFIX = LABEL_PREFIX + "field.";

public VideoSetDefinitionBuilder() {
this(new ImageSetDefinitionBuilder());
Expand Down Expand Up @@ -39,7 +40,7 @@ private FieldOption<VideoType> vimeo() {
VideoTypes.VIMEO,
name -> new SingleSwitchableForm<>(
new TextFieldDefinitionBuilder()
.label(LABEL_PREFIX + VideoTypes.VIMEO.getLabel())
.label(FIELD_LABEL_PREFIX + VideoTypes.VIMEO.getLabel())
.converterClass(VimeoTextValueConverter.class)
.build(name)
)
Expand All @@ -51,7 +52,7 @@ private FieldOption<VideoType> youtube() {
VideoTypes.YOUTUBE,
name -> new SingleSwitchableForm<>(
new TextFieldDefinitionBuilder()
.label(LABEL_PREFIX + VideoTypes.YOUTUBE.getLabel())
.label(FIELD_LABEL_PREFIX + VideoTypes.YOUTUBE.getLabel())
.converterClass(YoutubeTextValueConverter.class)
.build(name)
)
Expand All @@ -63,7 +64,7 @@ private FieldOption<VideoType> dam() {
VideoTypes.DAM,
name -> new SingleSwitchableForm<>(
new AssetLinkDefinitionBuilder()
.label(LABEL_PREFIX + VideoTypes.DAM.getLabel())
.label(FIELD_LABEL_PREFIX + VideoTypes.DAM.getLabel())
.build(name)
)
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
merkle.customDefinitions.linkSet.linkType.internal.label=Internal
merkle.customDefinitions.linkSet.linkType.external.label=External
merkle.customDefinitions.linkSet.linkType.asset_dam.label=Magnolia Asset
merkle.customDefinitions.linkSet.field.linkType.internal.label=Page
merkle.customDefinitions.linkSet.field.linkType.external.label=Link
merkle.customDefinitions.linkSet.field.linkType.asset_dam.label=Asset
merkle.customDefinitions.linkSet.anchorId.label=Anchor id
merkle.customDefinitions.linkSet.anchorId.errorMessage.pattern=Anchor id must be alphanumeric
merkle.customDefinitions.linkSet.text.label=Link Text
merkle.customDefinitions.linkSet.openInNewWindow.label=
merkle.customDefinitions.linkSet.openInNewWindow.buttonLabel=Open in new window

merkle.customDefinitions.imageSet.imageType.dam.label=Magnolia
merkle.customDefinitions.imageSet.field.imageType.dam.label=Asset
merkle.customDefinitions.imageSet.image.label=Image Source
merkle.customDefinitions.imageSet.altText.label=Alternative text

merkle.customDefinitions.videoSet.videoType.dam.label=Magnolia
merkle.customDefinitions.videoSet.videoType.youtube.label=Youtube
merkle.customDefinitions.videoSet.videoType.vimeo.label=Vimeo
merkle.customDefinitions.videoSet.field.videoType.dam.label=Asset
merkle.customDefinitions.videoSet.field.videoType.youtube.label=Youtube ID
merkle.customDefinitions.videoSet.field.videoType.vimeo.label=Vimeo ID
merkle.customDefinitions.videoSet.video.label=Video source
merkle.customDefinitions.videoSet.previewImage.label=Preview image

Expand Down

0 comments on commit ee34451

Please sign in to comment.