webpack/scenes/Subscriptions/Manifest/SimpleContentAccess.js in katello-3.17.3 vs webpack/scenes/Subscriptions/Manifest/SimpleContentAccess.js in katello-3.18.0.rc1
- old
+ new
@@ -9,20 +9,32 @@
const {
canToggleSimpleContentAccess,
isSimpleContentAccessEnabled,
enableSimpleContentAccess,
disableSimpleContentAccess,
+ simpleContentAccessEligible,
} = props;
const toggleSimpleContentAccess = () => {
if (isSimpleContentAccessEnabled) {
disableSimpleContentAccess();
} else {
enableSimpleContentAccess();
}
};
+ const simpleContentAccessText = () => {
+ // don't show this text unless explicitly told to
+ if (simpleContentAccessEligible !== undefined) {
+ if (!simpleContentAccessEligible && !isSimpleContentAccessEnabled) {
+ return __('Simple Content Access has been disabled by the upstream organization administrator.');
+ }
+ }
+
+ return __('Toggling Simple Content Access will refresh your manifest.');
+ };
+
return (
<div id="simple-content-access">
<Col sm={5}>
<ControlLabel
className="control-label"
@@ -34,11 +46,11 @@
</LevelItem>
<LevelItem>
<OverlayTrigger
overlay={
<Tooltip id="sca-refresh-tooltip">
- {__('When Simple Content Access is enabled, hosts can consume from all repositories in their Content View regardless of subscription status.')}
+ {__('When Simple Content Access is enabled, hosts are not required to have subscriptions attached to access repositories.')}
</Tooltip>
}
placement="bottom"
trigger={['hover', 'focus']}
rootClose={false}
@@ -59,11 +71,11 @@
data-testid="switch"
label=" "
/>
</div>
<div>
- <i>{__('Toggling Simple Content Access will refresh your manifest.')}</i>
+ <i>{simpleContentAccessText()}</i>
</div>
</Col>
</div>
);
};
@@ -71,8 +83,13 @@
SimpleContentAccess.propTypes = {
enableSimpleContentAccess: PropTypes.func.isRequired,
disableSimpleContentAccess: PropTypes.func.isRequired,
isSimpleContentAccessEnabled: PropTypes.bool.isRequired,
canToggleSimpleContentAccess: PropTypes.bool.isRequired,
+ simpleContentAccessEligible: PropTypes.bool,
+};
+
+SimpleContentAccess.defaultProps = {
+ simpleContentAccessEligible: undefined,
};
export default SimpleContentAccess;