X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/3b53b656e65fdabc32b3bc748074eb35e9df98eb..f0a64666816383d2641d5fa7ea22019441ac4464:/src/store/collections-content-address-panel/collections-content-address-middleware-service.ts diff --git a/src/store/collections-content-address-panel/collections-content-address-middleware-service.ts b/src/store/collections-content-address-panel/collections-content-address-middleware-service.ts index 642e7b82..57d09bf4 100644 --- a/src/store/collections-content-address-panel/collections-content-address-middleware-service.ts +++ b/src/store/collections-content-address-panel/collections-content-address-middleware-service.ts @@ -6,6 +6,7 @@ import { ServiceRepository } from '~/services/services'; import { MiddlewareAPI, Dispatch } from 'redux'; import { DataExplorerMiddlewareService } from '~/store/data-explorer/data-explorer-middleware-service'; import { RootState } from '~/store/store'; +import { getUserUuid } from "~/common/getuser"; import { snackbarActions, SnackbarKind } from '~/store/snackbar/snackbar-actions'; import { getDataExplorer } from '~/store/data-explorer/data-explorer-reducer'; import { resourcesActions } from '~/store/resources/resources-actions'; @@ -48,7 +49,7 @@ export class CollectionsWithSameContentAddressMiddlewareService extends DataExpl } try { api.dispatch(progressIndicatorActions.START_WORKING(this.getId())); - const userUuid = api.getState().auth.user!.uuid; + const userUuid = getUserUuid(api.getState()); const pathname = api.getState().router.location!.pathname; const contentAddress = pathname.split('/')[2]; const response = await this.services.collectionService.list({ @@ -88,11 +89,11 @@ export class CollectionsWithSameContentAddressMiddlewareService extends DataExpl .addIn('uuid', groupUuids) .getFilters() }); - responseUsers.items.map(it=>{ - api.dispatch(ownerNameActions.SET_OWNER_NAME({name: it.uuid === userUuid ? 'User: Me' : `User: ${it.firstName} ${it.lastName}`, uuid: it.uuid})); + responseUsers.items.map(it => { + api.dispatch(ownerNameActions.SET_OWNER_NAME({ name: it.uuid === userUuid ? 'User: Me' : `User: ${it.firstName} ${it.lastName}`, uuid: it.uuid })); }); - responseGroups.items.map(it=>{ - api.dispatch(ownerNameActions.SET_OWNER_NAME({name: `Project: ${it.name}`, uuid: it.uuid})); + responseGroups.items.map(it => { + api.dispatch(ownerNameActions.SET_OWNER_NAME({ name: `Project: ${it.name}`, uuid: it.uuid })); }); api.dispatch(setBreadcrumbs([{ label: 'Projects', uuid: userUuid }])); api.dispatch(updateFavorites(response.items.map(item => item.uuid))); @@ -134,4 +135,4 @@ const couldNotFetchCollections = () => snackbarActions.OPEN_SNACKBAR({ message: 'Could not fetch collection with this content address.', kind: SnackbarKind.ERROR - }); \ No newline at end of file + });