Skip to content

Commit

Permalink
Merge pull request #497 from BLasan/fix-issue-2163
Browse files Browse the repository at this point in the history
Fix: Unable to save an API Basic info from Publisher Portal when Developer Portal Visibility settings are changed from Restricted to Public after clearing roles in restricted mode #497
  • Loading branch information
BLasan authored Oct 2, 2023
2 parents a44b99d + c1ed619 commit d1cbe52
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,18 @@ export default function StoreVisibility(props) {
});
};

const handleChangeVisibility = (event) => {
if (event.target.value === 'PUBLIC') {
setRoleValidity(true);
// set role exist to true to avoid SAVE button getting frozen.
setRoleExists(true);
}
if (event.target.value === 'RESTRICTED' && api.visibleRoles.length === 0) {
setRoleValidity(false);
}
configDispatcher({ action: 'visibility', value: event.target.value });
}

return (
<>
<Box style={{ position: 'relative' }}>
Expand All @@ -131,7 +143,7 @@ export default function StoreVisibility(props) {
)}
value={api.visibility}
name='storeVisibility'
onChange={({ target: { value } }) => configDispatcher({ action: 'visibility', value })}
onChange={handleChangeVisibility}
SelectProps={{
MenuProps: {
className: classes.menu,
Expand Down

0 comments on commit d1cbe52

Please sign in to comment.