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

TNO-2749: Console warnings #1963

Merged
merged 3 commits into from
Jun 20, 2024
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
2 changes: 1 addition & 1 deletion app/subscriber/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ function App() {
</Show>
<ToastContainer />
<Tooltip
opacity={1}
style={{
backgroundColor: '#FFFFCC',
color: 'black',
opacity: '1',
boxShadow: '0 0 8px #464545',
zIndex: '999',
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ export const FolderSubMenu: React.FC<IFolderSubMenuProps> = ({ selectedContent }
className="folder-menu"
place="bottom"
openOnClick
style={{ opacity: '1', boxShadow: '0 0 8px #464545', zIndex: '999' }}
opacity={1}
style={{ boxShadow: '0 0 8px #464545', zIndex: '999' }}
id="folder"
>
<FolderMenu content={toFolderContent(selectedContent)} />
Expand Down
3 changes: 2 additions & 1 deletion app/subscriber/src/components/share-menu/ShareMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ export const ShareMenu: React.FC<IShareSubMenuProps> = ({ content }) => {
className="share-menu"
place="bottom"
openOnClick
style={{ opacity: '1', boxShadow: '0 0 8px #464545', zIndex: '999' }}
opacity={1}
style={{ boxShadow: '0 0 8px #464545', zIndex: '999' }}
id="share"
>
<FaEnvelope /> SHARE WITH A COLLEAGUE:
Expand Down
3 changes: 2 additions & 1 deletion app/subscriber/src/components/user-profile/UserProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ export const UserProfile: React.FC = () => {
closeOnEsc
isOpen={profileMenu}
setIsOpen={setProfileMenu}
style={{ opacity: '1', boxShadow: '0 0 8px #464545', zIndex: '999' }}
opacity={1}
style={{ boxShadow: '0 0 8px #464545', zIndex: '999' }}
id="my-info"
>
<h1>My Profile</h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const MyMinisterSettings: React.FC = () => {
const user = createUser();

try {
await updateUser(user);
await updateUser(user, !!impersonate);
toast.success('Your minister(s) have successfully been updated.');
} catch (error) {
// Handle the error, if needed
Expand Down
8 changes: 4 additions & 4 deletions app/subscriber/src/store/hooks/subscriber/useUsers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ import {
interface IUserController {
getUser: () => Promise<ISubscriberUserModel>;
findUsers: (filter: IUserFilter) => Promise<IPaged<IUserModel>>;
updateUser: (model: ISubscriberUserModel) => Promise<ISubscriberUserModel>;
updateUser: (model: ISubscriberUserModel, impersonate?: boolean) => Promise<ISubscriberUserModel>;
}

export const useUsers = (): IUserController => {
const { findUsers } = useApiAdminUsers();
const { getUser, updateUser } = useApiSubscriberUsers();
const dispatch = useAjaxWrapper();
const [, { storeMyProfile }] = useProfileStore();
const [, { storeMyProfile, storeImpersonate }] = useProfileStore();
const [{ userInfo }, { storeUserInfo }] = useAppStore();

const controller = React.useMemo(
Expand All @@ -33,11 +33,11 @@ export const useUsers = (): IUserController => {
const response = await dispatch('find-users', () => findUsers(filter));
return response.data;
},
updateUser: async (model: ISubscriberUserModel) => {
updateUser: async (model: ISubscriberUserModel, impersonate?: boolean) => {
const response = await dispatch<ISubscriberUserModel>('update-user', () =>
updateUser(model),
);
storeMyProfile(response.data);
impersonate ? storeImpersonate(response.data) : storeMyProfile(response.data);
if (userInfo) storeUserInfo({ ...userInfo, preferences: response.data.preferences });
return response.data;
},
Expand Down
Loading