Skip to content

Commit

Permalink
@trivial Review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
mohiaror committed Mar 20, 2024
1 parent bf0fd07 commit f927edc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
}
)
public class NGDMEnableRenderCondition extends SlingSafeMethodsServlet {

@Reference(cardinality= ReferenceCardinality.OPTIONAL, policyOption = ReferencePolicyOption.GREEDY)
private NextGenDynamicMediaConfig nextGenDynamicMediaConfig;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ void testRenderConditionDisabledWithNotEnabledConfig() throws Exception {
nextGenDynamicMediaConfig.setRepositoryId(REPOSITORY_ID);
context.registerService(NextGenDynamicMediaConfig.class, nextGenDynamicMediaConfig);
ngdmEnableRenderCondition = context.registerInjectActivateService(new NGDMEnableRenderCondition());

ngdmEnableRenderCondition.doGet(context.request(), context.response());

RenderCondition renderCondition = (RenderCondition) context.request().getAttribute(RenderCondition.class.getName());
assertFalse(renderCondition.check());
}
Expand All @@ -65,9 +63,7 @@ void testRenderConditionEnabled() throws Exception {
nextGenDynamicMediaConfig.setRepositoryId(REPOSITORY_ID);
context.registerService(NextGenDynamicMediaConfig.class, nextGenDynamicMediaConfig);
ngdmEnableRenderCondition = context.registerInjectActivateService(new NGDMEnableRenderCondition());

ngdmEnableRenderCondition.doGet(context.request(), context.response());

RenderCondition renderCondition = (RenderCondition) context.request().getAttribute(RenderCondition.class.getName());
assertTrue(renderCondition.check());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,17 @@
text="Enable DM features"
uncheckedValue="false"
value="{Boolean}true">
<granite:rendercondition
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/renderconditions/or">
<isDMEnabled
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/renderconditions/feature"
feature="com.adobe.dam.asset.scene7.feature.flag"/>
<isNGDMEnabled
jcr:primaryType="nt:unstructured"
sling:resourceType="core/wcm/components/rendercondition/isNGDMEnabled"/>
</granite:rendercondition>
</enableDmFeatures>
<enableAssetDelivery
jcr:primaryType="nt:unstructured"
Expand Down

0 comments on commit f927edc

Please sign in to comment.