Skip to content

Commit

Permalink
Merge pull request #26 from openimis/feature/OM-131
Browse files Browse the repository at this point in the history
OM-131: change isworker source, do not display change password if isW…
  • Loading branch information
malinowskikam authored Mar 1, 2024
2 parents 29c2e24 + 946f36e commit a1475e9
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions src/components/ProfileMainMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const PROFILE_MAIN_MENU_CONTRIBUTION_KEY = "profile.MainMenu";
class ProfileMainMenu extends Component {
constructor(props) {
super(props);
this.isWorker = props.modulesManager.getConf("fe-insuree", "isWorker", false);
this.isWorker = props.modulesManager.getConf("fe-core", "isWorker", false);
}

render() {
Expand All @@ -28,21 +28,13 @@ class ProfileMainMenu extends Component {
},
];

this.isWorker
? entries.push({
text: formatMessage(intl, "profile", "menu.changePassword"),
icon: <Fingerprint />,
route: "/profile/mobile/password",
})
: entries.push({
text: formatMessage(
this.props.intl,
"profile",
"menu.changePassword"
),
icon: <Fingerprint />,
route: "/profile/changePassword",
});
if (!this.isWorker) {
entries.push({
text: formatMessage(intl, "profile", "menu.changePassword"),
icon: <Fingerprint />,
route: "/profile/changePassword",
});
}

entries.push(
...modulesManager
Expand All @@ -65,4 +57,6 @@ const mapStateToProps = (state) => ({
rights: state.core?.user?.i_user?.rights ?? [],
});

export default injectIntl(withModulesManager(connect(mapStateToProps)(ProfileMainMenu)));
export default injectIntl(
withModulesManager(connect(mapStateToProps)(ProfileMainMenu))
);

0 comments on commit a1475e9

Please sign in to comment.