Skip to content

Commit

Permalink
Merge pull request #42 from openimis/hotfix/moldova-fix
Browse files Browse the repository at this point in the history
hotfix: hide tools on moldova instance
  • Loading branch information
malinowskikam authored Mar 1, 2024
2 parents 267f7bf + 00bfbfa commit 3e281e8
Showing 1 changed file with 10 additions and 24 deletions.
34 changes: 10 additions & 24 deletions src/components/ToolsMainMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ import { connect } from "react-redux";
import { RIGHT_REGISTERS, RIGHT_REPORTS, RIGHT_EXTRACTS } from "../constants";

class ToolsMainMenu extends Component {
constructor(props) {
super(props);
this.isWorker = props.modulesManager.getConf("fe-core", "isWorker", false);
}

enablers = (enablers) => {
var e;
for (e of enablers) {
Expand All @@ -15,28 +20,17 @@ class ToolsMainMenu extends Component {
};

render() {
const { rights } = this.props;
if (this.isWorker) return null;

let entries = [];

if (this.enablers(RIGHT_REGISTERS)) {
entries.push({
text: formatMessage(this.props.intl, "tools", "menu.registers"),
icon: <ImportExport />,
route: "/tools/registers",
});
}
// Renewals are preformed automatically now.
// if (rights.includes(RIGHT_POLICY_RENEWALS)) {
// entries.push(
// { text: formatMessage(this.props.intl, "tools", "menu.renewals"), icon: <Autorenew />, route: "/tools/policyRenewals" }
// )
// }
// SMS sending feature is normally done automatically now. We'll consider adding this back if necessary
// if (rights.includes(RIGHT_FEEDBACK_PROMPT)) {
// entries.push(
// { text: formatMessage(this.props.intl, "tools", "menu.feedbacks"), icon: <Feedback />, route: "/tools/feedbackPrompts" },
// )
// }
// Extracts page is not implemented in the modular version yet. As it's not used as of now.
if (this.enablers(RIGHT_EXTRACTS)) {
entries.push(
{ text: formatMessage(this.props.intl, "tools", "menu.extracts"), icon: <SaveAlt />, route: "/tools/extracts" },
Expand All @@ -49,17 +43,9 @@ class ToolsMainMenu extends Component {
route: "/tools/reports",
});
}
// if (this.enablers(RIGHT_UTILITIES)) {
// entries.push(
// { text: formatMessage(this.props.intl, "tools", "menu.utilities"), icon: <Build />, route: "/tools/utilities" },
// )
// }
// if (rights.includes(RIGHT_EMAILSETTING)) {
// entries.push(
// { text: formatMessage(this.props.intl, "tools", "menu.emails"), icon: <EmailOutlined />, route: "/tools/emailSettings" }
// )
// }

if (!entries.length) return null;

return (
<MainMenuContribution
{...this.props}
Expand Down

0 comments on commit 3e281e8

Please sign in to comment.