Skip to content

Commit

Permalink
Change behavior: remove change addons on user icon menu and allow to …
Browse files Browse the repository at this point in the history
…change it on UserPage
  • Loading branch information
jlandowner committed Jul 21, 2024
1 parent e85c756 commit a6686d0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 25 deletions.
9 changes: 3 additions & 6 deletions web/dashboard-ui/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { ProgressProvider } from "./components/ProgressProvider";
import { AuthenticatorManageDialogContext } from "./views/organisms/AuthenticatorManageDialog";
import { EventDetailDialogContext } from "./views/organisms/EventDetailDialog";
import { PasswordChangeDialogContext } from "./views/organisms/PasswordChangeDialog";
import { UserAddonChangeDialogContext } from "./views/organisms/UserAddonsChangeDialog";
import { UserInfoDialogContext } from "./views/organisms/UserInfoDialog";
import { UserContext } from "./views/organisms/UserModule";
import { UserNameChangeDialogContext } from "./views/organisms/UserNameChangeDialog";
Expand Down Expand Up @@ -102,11 +101,9 @@ function App() {
<UserInfoDialogContext.Provider>
<AuthenticatorManageDialogContext.Provider>
<UserNameChangeDialogContext.Provider>
<UserAddonChangeDialogContext.Provider>
<PasswordChangeDialogContext.Provider>
<SwitchApp />
</PasswordChangeDialogContext.Provider>
</UserAddonChangeDialogContext.Provider>
<PasswordChangeDialogContext.Provider>
<SwitchApp />
</PasswordChangeDialogContext.Provider>
</UserNameChangeDialogContext.Provider>
</AuthenticatorManageDialogContext.Provider>
</UserInfoDialogContext.Provider>
Expand Down
1 change: 0 additions & 1 deletion web/dashboard-ui/src/views/pages/UserPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ const UserMenu: React.VFC<{ user: User }> = ({ user: us }) => {
<Box>
<IconButton
color="inherit"
disabled={loginUser?.name === us.name}
onClick={(e) => setAnchorEl(e.currentTarget)}
>
<MoreVert fontSize="small" />
Expand Down
18 changes: 0 additions & 18 deletions web/dashboard-ui/src/views/templates/PageTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
Menu as MenuIcon,
Notifications,
ReportProblem,
Settings,
SupervisorAccountTwoTone,
VpnKey,
Warning,
Expand Down Expand Up @@ -51,7 +50,6 @@ import { AuthenticatorManageDialogContext } from "../organisms/AuthenticatorMana
import { EventDetailDialogContext } from "../organisms/EventDetailDialog";
import { latestTime } from "../organisms/EventModule";
import { PasswordChangeDialogContext } from "../organisms/PasswordChangeDialog";
import { UserAddonChangeDialogContext } from "../organisms/UserAddonsChangeDialog";
import { UserInfoDialogContext } from "../organisms/UserInfoDialog";
import {
isAdminRole,
Expand Down Expand Up @@ -101,8 +99,6 @@ export const PageTemplate: React.FC<
AuthenticatorManageDialogContext.useDispatch();
const passwordChangeDialogDispach = PasswordChangeDialogContext.useDispatch();
const userNameChangeDialogDispach = UserNameChangeDialogContext.useDispatch();
const userAddonChangeDialogDispatch =
UserAddonChangeDialogContext.useDispatch();
const userInfoDialogDispatch = UserInfoDialogContext.useDispatch();
const isAdmin = isAdminUser(loginUser);
const isSignIn = Boolean(loginUser);
Expand Down Expand Up @@ -132,12 +128,6 @@ export const PageTemplate: React.FC<
setAnchorEl(null);
};

const changeAddons = () => {
console.log("changeAddons");
userAddonChangeDialogDispatch(true, { user: loginUser! });
setAnchorEl(null);
};

const openUserInfoDialog = () => {
console.log("openUserInfoDialog");
userInfoDialogDispatch(true, {
Expand Down Expand Up @@ -443,14 +433,6 @@ export const PageTemplate: React.FC<
<ListItemText>Change DisplayName...</ListItemText>
</MenuItem>
)}
{isSignIn && isAdmin && (
<MenuItem onClick={() => changeAddons()}>
<ListItemIcon>
<Settings fontSize="small" />
</ListItemIcon>
<ListItemText>Change Addons...</ListItemText>
</MenuItem>
)}
<Divider />
{isSignIn && (
<MenuItem onClick={() => logout()}>
Expand Down

0 comments on commit a6686d0

Please sign in to comment.