X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/27d2ca4c2691cad55993f25a4427d48e86ec6166..fd49462a5a09e107b7bb5c0ef8635db328b399b8:/src/store/collections/collection-info-actions.ts diff --git a/src/store/collections/collection-info-actions.ts b/src/store/collections/collection-info-actions.ts index 1509206d..6107c409 100644 --- a/src/store/collections/collection-info-actions.ts +++ b/src/store/collections/collection-info-actions.ts @@ -3,9 +3,11 @@ // SPDX-License-Identifier: AGPL-3.0 import { Dispatch } from "redux"; -import { RootState } from "~/store/store"; -import { ServiceRepository } from "~/services/services"; -import { dialogActions } from '~/store/dialog/dialog-actions'; +import { RootState } from "store/store"; +import { ServiceRepository } from "services/services"; +import { dialogActions } from 'store/dialog/dialog-actions'; +import { getNewExtraToken } from "../auth/auth-action"; +import { CollectionResource } from "models/collection"; export const COLLECTION_WEBDAV_S3_DIALOG_NAME = 'collectionWebdavS3Dialog'; @@ -13,25 +15,28 @@ export interface WebDavS3InfoDialogData { uuid: string; token: string; downloadUrl: string; - homeCluster: string; + collectionsUrl: string; localCluster: string; username: string; activeTab: number; + collectionName: string; setActiveTab: (event: any, tabNr: number) => void; } export const openWebDavS3InfoDialog = (uuid: string, activeTab?: number) => - (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { + async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { + await dispatch(getNewExtraToken(true)); dispatch(dialogActions.OPEN_DIALOG({ id: COLLECTION_WEBDAV_S3_DIALOG_NAME, data: { - title: 'Access Collection using WebDAV or S3', - token: getState().auth.apiToken, - downloadUrl: getState().auth.config.keepWebInlineServiceUrl, - homeCluster: getState().auth.homeCluster, + title: 'Open with 3rd party client', + token: getState().auth.extraApiToken || getState().auth.apiToken, + downloadUrl: getState().auth.config.keepWebServiceUrl, + collectionsUrl: getState().auth.config.keepWebInlineServiceUrl, localCluster: getState().auth.localCluster, username: getState().auth.user!.username, activeTab: activeTab || 0, + collectionName: (getState().resources[uuid] as CollectionResource).name, setActiveTab: (event: any, tabNr: number) => dispatch(openWebDavS3InfoDialog(uuid, tabNr)), uuid }