Skip to content

Commit a1475e9

Browse files
Merge pull request #26 from openimis/feature/OM-131
OM-131: change isworker source, do not display change password if isW…
2 parents 29c2e24 + 946f36e commit a1475e9

File tree

1 file changed

+11
-17
lines changed

1 file changed

+11
-17
lines changed

src/components/ProfileMainMenu.js

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const PROFILE_MAIN_MENU_CONTRIBUTION_KEY = "profile.MainMenu";
1515
class ProfileMainMenu extends Component {
1616
constructor(props) {
1717
super(props);
18-
this.isWorker = props.modulesManager.getConf("fe-insuree", "isWorker", false);
18+
this.isWorker = props.modulesManager.getConf("fe-core", "isWorker", false);
1919
}
2020

2121
render() {
@@ -28,21 +28,13 @@ class ProfileMainMenu extends Component {
2828
},
2929
];
3030

31-
this.isWorker
32-
? entries.push({
33-
text: formatMessage(intl, "profile", "menu.changePassword"),
34-
icon: <Fingerprint />,
35-
route: "/profile/mobile/password",
36-
})
37-
: entries.push({
38-
text: formatMessage(
39-
this.props.intl,
40-
"profile",
41-
"menu.changePassword"
42-
),
43-
icon: <Fingerprint />,
44-
route: "/profile/changePassword",
45-
});
31+
if (!this.isWorker) {
32+
entries.push({
33+
text: formatMessage(intl, "profile", "menu.changePassword"),
34+
icon: <Fingerprint />,
35+
route: "/profile/changePassword",
36+
});
37+
}
4638

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

68-
export default injectIntl(withModulesManager(connect(mapStateToProps)(ProfileMainMenu)));
60+
export default injectIntl(
61+
withModulesManager(connect(mapStateToProps)(ProfileMainMenu))
62+
);

0 commit comments

Comments
 (0)