Skip to content

Commit

Permalink
Missing styles in RichText for images #608
Browse files Browse the repository at this point in the history
  • Loading branch information
anatol-sialitski committed Oct 11, 2023
1 parent ee4a6a9 commit 080d748
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
group=com.enonic.app
projectName=guillotine
appName=com.enonic.app.guillotine
xpVersion=7.12.1
xpVersion=7.14.0-SNAPSHOT
version=7.0.0-SNAPSHOT

11 changes: 10 additions & 1 deletion src/main/java/com/enonic/app/guillotine/ServiceFacade.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.enonic.xp.portal.url.PortalUrlService;
import com.enonic.xp.schema.content.ContentTypeService;
import com.enonic.xp.schema.mixin.MixinService;
import com.enonic.xp.style.StyleDescriptorService;

@Component(immediate = true, service = ServiceFacade.class)
public class ServiceFacade
Expand All @@ -35,13 +36,16 @@ public class ServiceFacade

private final PageTemplateService pageTemplateService;

private final StyleDescriptorService styleDescriptorService;

@Activate
public ServiceFacade( final @Reference ContentService contentService, final @Reference ContentTypeService contentTypeService,
final @Reference ComponentDescriptorService componentDescriptorService,
final @Reference PortalUrlService portalUrlService, final @Reference NodeService nodeService,
final @Reference MixinService mixinService, final @Reference MacroService macroService,
final @Reference MacroDescriptorService macroDescriptorService,
final @Reference PageTemplateService pageTemplateService )
final @Reference PageTemplateService pageTemplateService,
final @Reference StyleDescriptorService styleDescriptorService )
{
this.contentService = contentService;
this.contentTypeService = contentTypeService;
Expand All @@ -52,6 +56,7 @@ public ServiceFacade( final @Reference ContentService contentService, final @Ref
this.macroService = macroService;
this.macroDescriptorService = macroDescriptorService;
this.pageTemplateService = pageTemplateService;
this.styleDescriptorService = styleDescriptorService;

Check warning on line 59 in src/main/java/com/enonic/app/guillotine/ServiceFacade.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/enonic/app/guillotine/ServiceFacade.java#L59

Added line #L59 was not covered by tests
}

public ContentService getContentService()
Expand Down Expand Up @@ -99,4 +104,8 @@ public PageTemplateService getPageTemplateService()
return pageTemplateService;
}

public StyleDescriptorService getStyleDescriptorService()
{
return styleDescriptorService;

Check warning on line 109 in src/main/java/com/enonic/app/guillotine/ServiceFacade.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/enonic/app/guillotine/ServiceFacade.java#L109

Added line #L109 was not covered by tests
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public Object get( final DataFetchingEnvironment environment )
Map<String, MacroDescriptor> registeredMacros = guillotineContext.getMacroDecorators();

htmlParams.processMacros( false );
htmlParams.customStyleDescriptorsCallback( () -> serviceFacade.getStyleDescriptorService().getAll() );
htmlParams.customHtmlProcessor( processor -> {
processor.processDefault( new CustomHtmlPostProcessor( links, images ) );

Expand Down

0 comments on commit 080d748

Please sign in to comment.