Add tooltips to list objects actions (#1339)

Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
This commit is contained in:
Daniel Valdivia
2021-12-23 09:05:07 -08:00
committed by GitHub
parent 7123c054a4
commit e51bde0fd2

View File

@@ -29,7 +29,9 @@ import {
RewindObjectList,
} from "./types";
import api from "../../../../../../common/api";
import TableWrapper from "../../../../Common/TableWrapper/TableWrapper";
import TableWrapper, {
ItemActions,
} from "../../../../Common/TableWrapper/TableWrapper";
import {
decodeFileName,
encodeFileName,
@@ -763,21 +765,29 @@ const ListObjects = ({
setSelectedPreview(null);
};
const tableActions = [
{ type: "view", onClick: openPath, sendOnlyId: true },
const tableActions: ItemActions[] = [
{
type: "view",
label: "View",
onClick: openPath,
sendOnlyId: true,
},
{
type: "preview",
label: "Preview",
onClick: openPreview,
disableButtonFunction: (item: string) =>
extensionPreview(item) === "none",
},
{
type: "share",
label: "Share",
onClick: openShare,
disableButtonFunction: (item: string) => item.endsWith("/"),
},
{
type: "download",
label: "Download",
onClick: downloadObject,
showLoaderFunction: (item: string) =>
downloadingFiles.includes(`${match.params["bucket"]}/${item}`),
@@ -798,6 +808,7 @@ const ListObjects = ({
if (displayDeleteObject) {
tableActions.push({
type: "delete",
label: "Delete",
onClick: confirmDeleteObject,
disableButtonFunction: () => {
return rewindEnabled;