X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/9456a165e6ebdbf1ead5847a619a8f9acdf1932f..52b5bb0ea3c28cd2095837fea61509a70eb792fb:/src/store/public-favorites/public-favorites-actions.ts diff --git a/src/store/public-favorites/public-favorites-actions.ts b/src/store/public-favorites/public-favorites-actions.ts index b5aa9fce..2d4539ad 100644 --- a/src/store/public-favorites/public-favorites-actions.ts +++ b/src/store/public-favorites/public-favorites-actions.ts @@ -2,15 +2,13 @@ // // SPDX-License-Identifier: AGPL-3.0 -import { unionize, ofType, UnionOf } from "~/common/unionize"; +import { unionize, ofType, UnionOf } from "common/unionize"; import { Dispatch } from "redux"; import { RootState } from "../store"; import { checkPublicFavorite } from "./public-favorites-reducer"; -import { snackbarActions, SnackbarKind } from "~/store/snackbar/snackbar-actions"; -import { ServiceRepository } from "~/services/services"; -import { progressIndicatorActions } from "~/store/progress-indicator/progress-indicator-actions"; -import { getResource } from '~/store/resources/resources'; -import { LinkResource } from "~/models/link"; +import { snackbarActions, SnackbarKind } from "store/snackbar/snackbar-actions"; +import { ServiceRepository } from "services/services"; +import { progressIndicatorActions } from "store/progress-indicator/progress-indicator-actions"; export const publicFavoritesActions = unionize({ TOGGLE_PUBLIC_FAVORITE: ofType<{ resourceUuid: string }>(), @@ -23,8 +21,8 @@ export type PublicFavoritesAction = UnionOf; export const togglePublicFavorite = (resource: { uuid: string; name: string }) => (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository): Promise => { dispatch(progressIndicatorActions.START_WORKING("togglePublicFavorite")); - const uuidPrefix = getState().config.uuidPrefix; - const uuid = `${uuidPrefix}-j7d0g-fffffffffffffff`; + const uuidPrefix = getState().auth.config.uuidPrefix; + const uuid = `${uuidPrefix}-j7d0g-publicfavorites`; dispatch(publicFavoritesActions.TOGGLE_PUBLIC_FAVORITE({ resourceUuid: resource.uuid })); const isPublicFavorite = checkPublicFavorite(resource.uuid, getState().publicFavorites); dispatch(snackbarActions.OPEN_SNACKBAR({ @@ -59,8 +57,8 @@ export const togglePublicFavorite = (resource: { uuid: string; name: string }) = export const updatePublicFavorites = (resourceUuids: string[]) => async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { - const uuidPrefix = getState().config.uuidPrefix; - const uuid = `${uuidPrefix}-j7d0g-fffffffffffffff`; + const uuidPrefix = getState().auth.config.uuidPrefix; + const uuid = `${uuidPrefix}-j7d0g-publicfavorites`; dispatch(publicFavoritesActions.CHECK_PRESENCE_IN_PUBLIC_FAVORITES(resourceUuids)); services.favoriteService .checkPresenceInFavorites(uuid, resourceUuids) @@ -69,12 +67,6 @@ export const updatePublicFavorites = (resourceUuids: string[]) => }); }; -export const getHeadUuid = (uuid: string) => - (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { - const resource = getResource(uuid)(getState().resources); - return resource!.headUuid; - }; - export const getIsAdmin = () => (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { const resource = getState().auth.user!.isAdmin;