diff --git a/esp/src/src-react/components/DFUWorkunits.tsx b/esp/src/src-react/components/DFUWorkunits.tsx index 2c5e941c813..e0032f2a383 100644 --- a/esp/src/src-react/components/DFUWorkunits.tsx +++ b/esp/src/src-react/components/DFUWorkunits.tsx @@ -207,7 +207,7 @@ export const DFUWorkunits: React.FunctionComponent = ({ } }, { - key: "mine", text: nlsHPCC.Mine, disabled: !currentUser?.username, iconProps: { iconName: "Contact" }, canCheck: true, checked: filter["Owner"] === currentUser.username, + key: "mine", text: nlsHPCC.Mine, disabled: !currentUser?.username || !total, iconProps: { iconName: "Contact" }, canCheck: true, checked: filter["Owner"] === currentUser.username, onClick: () => { if (filter["Owner"] === currentUser.username) { filter["Owner"] = ""; @@ -217,7 +217,7 @@ export const DFUWorkunits: React.FunctionComponent = ({ pushParams(filter); } }, - ], [currentUser, filter, hasFilter, refreshTable, selection, setShowDeleteConfirm, store, uiState.hasNotProtected, uiState.hasProtected, uiState.hasSelection]); + ], [currentUser, filter, hasFilter, refreshTable, selection, setShowDeleteConfirm, store, total, uiState.hasNotProtected, uiState.hasProtected, uiState.hasSelection]); const copyButtons = useCopyButtons(columns, selection, "dfuworkunits"); diff --git a/esp/src/src-react/components/EventScheduler.tsx b/esp/src/src-react/components/EventScheduler.tsx index 7ce97d0951e..a10c1391b2b 100644 --- a/esp/src/src-react/components/EventScheduler.tsx +++ b/esp/src/src-react/components/EventScheduler.tsx @@ -144,7 +144,7 @@ export const EventScheduler: React.FunctionComponent = ({ }, { key: "divider_3", itemType: ContextualMenuItemType.Divider, onRender: () => }, { - key: "mine", text: nlsHPCC.Mine, disabled: !currentUser?.username, iconProps: { iconName: "Contact" }, canCheck: true, checked: filter["Owner"] === currentUser.username, + key: "mine", text: nlsHPCC.Mine, disabled: !currentUser?.username || !total, iconProps: { iconName: "Contact" }, canCheck: true, checked: filter["Owner"] === currentUser.username, onClick: () => { if (filter["Owner"] === currentUser.username) { filter["Owner"] = ""; @@ -154,7 +154,7 @@ export const EventScheduler: React.FunctionComponent = ({ pushParams(filter); } }, - ], [currentUser, filter, hasFilter, refreshTable, selection, setShowDescheduleConfirm, store]); + ], [currentUser, filter, hasFilter, refreshTable, selection, setShowDescheduleConfirm, store, total]); return } diff --git a/esp/src/src-react/components/Files.tsx b/esp/src/src-react/components/Files.tsx index e759a3d5d22..177d0910b05 100644 --- a/esp/src/src-react/components/Files.tsx +++ b/esp/src/src-react/components/Files.tsx @@ -293,7 +293,7 @@ export const Files: React.FunctionComponent = ({ }, { key: "divider_5", itemType: ContextualMenuItemType.Divider, onRender: () => }, { - key: "mine", text: nlsHPCC.Mine, disabled: !currentUser?.username, iconProps: { iconName: "Contact" }, canCheck: true, checked: filter["Owner"] === currentUser.username, + key: "mine", text: nlsHPCC.Mine, disabled: !currentUser?.username || !total, iconProps: { iconName: "Contact" }, canCheck: true, checked: filter["Owner"] === currentUser.username, onClick: () => { if (filter["Owner"] === currentUser.username) { filter["Owner"] = ""; @@ -303,7 +303,7 @@ export const Files: React.FunctionComponent = ({ pushParams(filter); } }, - ], [currentUser, filter, hasFilter, refreshTable, selection, setShowDeleteConfirm, store, uiState.hasSelection, viewByScope]); + ], [currentUser, filter, hasFilter, refreshTable, selection, setShowDeleteConfirm, store, total, uiState.hasSelection, viewByScope]); // Filter --- const filterFields: Fields = {}; diff --git a/esp/src/src-react/components/Queries.tsx b/esp/src/src-react/components/Queries.tsx index 415c3bb61d2..b30922e3f49 100644 --- a/esp/src/src-react/components/Queries.tsx +++ b/esp/src/src-react/components/Queries.tsx @@ -232,7 +232,7 @@ export const Queries: React.FunctionComponent = ({ } }, { - key: "mine", text: nlsHPCC.Mine, disabled: !currentUser?.username, iconProps: { iconName: "Contact" }, canCheck: true, checked: filter["PublishedBy"] === currentUser.username, + key: "mine", text: nlsHPCC.Mine, disabled: !currentUser?.username || !total, iconProps: { iconName: "Contact" }, canCheck: true, checked: filter["PublishedBy"] === currentUser.username, onClick: () => { if (filter["PublishedBy"] === currentUser.username) { filter["PublishedBy"] = ""; @@ -242,7 +242,7 @@ export const Queries: React.FunctionComponent = ({ pushParams(filter); } }, - ], [currentUser.username, filter, hasFilter, refreshTable, selection, setShowDeleteConfirm, store, uiState.hasSelection, uiState.isActive, uiState.isNotActive, uiState.isNotSuspended, uiState.isSuspended, wuid]); + ], [currentUser.username, filter, hasFilter, refreshTable, selection, setShowDeleteConfirm, store, total, uiState.hasSelection, uiState.isActive, uiState.isNotActive, uiState.isNotSuspended, uiState.isSuspended, wuid]); // Filter --- const filterFields: Fields = {}; diff --git a/esp/src/src-react/components/Scopes.tsx b/esp/src/src-react/components/Scopes.tsx index de391dbdad7..5c89c66e0b0 100644 --- a/esp/src/src-react/components/Scopes.tsx +++ b/esp/src/src-react/components/Scopes.tsx @@ -294,7 +294,7 @@ export const Scopes: React.FunctionComponent = ({ }, { key: "divider_5", itemType: ContextualMenuItemType.Divider, onRender: () => }, { - key: "mine", text: nlsHPCC.Mine, disabled: !currentUser?.username, iconProps: { iconName: "Contact" }, canCheck: true, checked: filter.Owner === currentUser.username, + key: "mine", text: nlsHPCC.Mine, disabled: !currentUser?.username || !data.length, iconProps: { iconName: "Contact" }, canCheck: true, checked: filter.Owner === currentUser.username, onClick: () => { if (filter.Owner === currentUser.username) { filter.Owner = ""; diff --git a/esp/src/src-react/components/Workunits.tsx b/esp/src/src-react/components/Workunits.tsx index 06182233675..855cb6eedc2 100644 --- a/esp/src/src-react/components/Workunits.tsx +++ b/esp/src/src-react/components/Workunits.tsx @@ -256,7 +256,7 @@ export const Workunits: React.FunctionComponent = ({ onClick: () => { setShowFilter(true); } }, { - key: "mine", text: nlsHPCC.Mine, disabled: !currentUser?.username, iconProps: { iconName: "Contact" }, canCheck: true, checked: filter.Owner === currentUser.username, + key: "mine", text: nlsHPCC.Mine, disabled: !currentUser?.username || !total, iconProps: { iconName: "Contact" }, canCheck: true, checked: filter.Owner === currentUser.username, onClick: () => { if (filter.Owner === currentUser.username) { filter.Owner = ""; @@ -266,7 +266,7 @@ export const Workunits: React.FunctionComponent = ({ pushParams(filter); } }, - ], [currentUser, filter, hasFilter, refreshTable, selection, setShowAbortConfirm, setShowDeleteConfirm, store, uiState.hasNotCompleted, uiState.hasNotProtected, uiState.hasProtected, uiState.hasSelection]); + ], [currentUser, filter, hasFilter, refreshTable, selection, setShowAbortConfirm, setShowDeleteConfirm, store, total, uiState.hasNotCompleted, uiState.hasNotProtected, uiState.hasProtected, uiState.hasSelection]); // Selection --- React.useEffect(() => {