// SPDX-License-Identifier: AGPL-3.0
import { Dispatch } from "redux";
-import { RootState } from "~/store/store";
-import { getUserUuid } from "~/common/getuser";
-import { ServiceRepository, createServices, setAuthorizationHeader } from "~/services/services";
-import { setBreadcrumbs } from "~/store/breadcrumbs/breadcrumbs-actions";
-import { snackbarActions, SnackbarKind } from "~/store/snackbar/snackbar-actions";
-import { LinkAccountType, AccountToLink, LinkAccountStatus } from "~/models/link-account";
-import { authActions, getConfig } from "~/store/auth/auth-action";
-import { unionize, ofType, UnionOf } from '~/common/unionize';
-import { UserResource } from "~/models/user";
-import { GroupResource } from "~/models/group";
+import { RootState } from "store/store";
+import { getUserUuid } from "common/getuser";
+import { ServiceRepository, createServices, setAuthorizationHeader } from "services/services";
+import { setBreadcrumbs } from "store/breadcrumbs/breadcrumbs-actions";
+import { snackbarActions, SnackbarKind } from "store/snackbar/snackbar-actions";
+import { LinkAccountType, AccountToLink, LinkAccountStatus } from "models/link-account";
+import { authActions, getConfig } from "store/auth/auth-action";
+import { unionize, ofType, UnionOf } from 'common/unionize';
+import { UserResource } from "models/user";
+import { GroupResource } from "models/group";
import { LinkAccountPanelError, OriginatingUser } from "./link-account-panel-reducer";
-import { login, logout } from "~/store/auth/auth-action";
-import { progressIndicatorActions } from "~/store/progress-indicator/progress-indicator-actions";
-import { WORKBENCH_LOADING_SCREEN } from '~/store/workbench/workbench-actions';
+import { login, logout } from "store/auth/auth-action";
+import { progressIndicatorActions } from "store/progress-indicator/progress-indicator-actions";
+import { WORKBENCH_LOADING_SCREEN } from 'store/workbench/workbench-actions';
export const linkAccountPanelActions = unionize({
LINK_INIT: ofType<{
let msg: string;
let msgKind: SnackbarKind;
if (status.valueOf() === LinkAccountStatus.CANCELLED) {
- msg = "Account link cancelled!", msgKind = SnackbarKind.INFO;
+ msg = "Account link cancelled!";
+ msgKind = SnackbarKind.INFO;
}
else if (status.valueOf() === LinkAccountStatus.FAILED) {
- msg = "Account link failed!", msgKind = SnackbarKind.ERROR;
+ msg = "Account link failed!";
+ msgKind = SnackbarKind.ERROR;
}
else if (status.valueOf() === LinkAccountStatus.SUCCESS) {
- msg = "Account link success!", msgKind = SnackbarKind.SUCCESS;
+ msg = "Account link success!";
+ msgKind = SnackbarKind.SUCCESS;
}
else {
- msg = "Unknown Error!", msgKind = SnackbarKind.ERROR;
+ msg = "Unknown Error!";
+ msgKind = SnackbarKind.ERROR;
}
dispatch(snackbarActions.OPEN_SNACKBAR({ message: msg, kind: msgKind, hideDuration: 3000 }));
services.linkAccountService.removeLinkOpStatus();
}
services.linkAccountService.removeAccountToLink();
services.linkAccountService.saveLinkOpStatus(LinkAccountStatus.FAILED);
- location.reload();
+ window.location.reload();
};
export const loadLinkAccountPanel = () =>
}
finally {
if (reload) {
- location.reload();
+ window.location.reload();
}
else {
dispatch(progressIndicatorActions.STOP_WORKING(WORKBENCH_LOADING_SCREEN));
dispatch(switchUser(linkState.targetUser, linkState.targetUserToken));
services.linkAccountService.removeAccountToLink();
services.linkAccountService.saveLinkOpStatus(LinkAccountStatus.SUCCESS);
- location.reload();
+ window.location.reload();
}
catch (e) {
// If the link operation fails, delete the previously made project