Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENG-5100 remove logic for primary tenant menu rendering #1529

Merged
merged 2 commits into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/app-init/MfeDownloadManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { getUsername } from '@entando/apimanager';
import { fetchMfeConfigList } from 'state/mfe/actions';
import StartupWaitScreen from 'ui/app/StartupWaitScreen';
import RowSpinner from 'ui/pages/common/RowSpinner';
import { selectCurrentTenant, selectIsPrimaryTenant } from 'state/multi-tenancy/selectors';
import { selectCurrentTenant } from 'state/multi-tenancy/selectors';
import { fetchCurrentTenant } from 'state/multi-tenancy/actions';

const MFE_MANDATORY_SLOT = ['primary-menu'];
Expand All @@ -24,7 +24,7 @@ export default function MfeDownloadManager(props) {
const [isPolling, setIsPolling] = useState(false);
const currentUserName = useSelector(getUsername);
const currentTenant = useSelector(selectCurrentTenant);
const isPrimaryTenant = useSelector(selectIsPrimaryTenant);
// const isPrimaryTenant = useSelector(selectIsPrimaryTenant);

useEffect(() => {
// wait until apiManager is not initialised and only after that fetch the mfe config list
Expand All @@ -51,11 +51,9 @@ export default function MfeDownloadManager(props) {
configPolling = setTimeout(fetchConfig, 10000);
});
};
if (isPrimaryTenant) {
fetchConfig();
}
fetchConfig();
}
}, [dispatch, currentUserName, isPrimaryTenant]);
}, [dispatch, currentUserName]);

useEffect(() => {
if (currentUserName) {
Expand Down
6 changes: 3 additions & 3 deletions src/ui/internal-page/VerticalMenuContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import { dismissedWizardKey } from 'ui/app-tour/constant';
import { getMfeTargetPrimaryMenu } from 'state/mfe/selectors';
import MfeContainer from 'ui/app/MfeContainer';
import { getAppTourlastStep } from 'state/app-tour/selectors';
import { selectIsPrimaryTenant } from 'state/multi-tenancy/selectors';
// import { selectIsPrimaryTenant } from 'state/multi-tenancy/selectors';
import { selectCurrSystemConfigAdvancedSearch } from 'state/current-system-configuration/selectors';

const {
Expand Down Expand Up @@ -469,12 +469,12 @@ MfeMenuContainer.propTypes = {
const VerticalMenu = (props) => {
const mfeMenu = useSelector(getMfeTargetPrimaryMenu);
// const mfeHeaderMenu = useSelector(getMfeTargetPrimaryHeader);
const isPrimaryTenant = useSelector(selectIsPrimaryTenant);
// const isPrimaryTenant = useSelector(selectIsPrimaryTenant);

// TODO: remove when we have the ECR API is implemented
const isMFEMenuEnabled = process.env.USE_MFE || false;

return isMFEMenuEnabled && isPrimaryTenant
return isMFEMenuEnabled
?
<MfeMenuContainer
menuId={mfeMenu.id}
Expand Down