Skip to content

Commit

Permalink
Merge pull request #18011 from jeclrsg/hpcc-30647-mine-button
Browse files Browse the repository at this point in the history
HPCC-30647 ECL Watch v9 disable "Mine" button until grid data defined
  • Loading branch information
GordonSmith authored Nov 9, 2023
2 parents e5d34f7 + bdd2b7f commit 531e746
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions esp/src/src-react/components/DFUWorkunits.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ export const DFUWorkunits: React.FunctionComponent<DFUWorkunitsProps> = ({
}
},
{
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"] = "";
Expand All @@ -217,7 +217,7 @@ export const DFUWorkunits: React.FunctionComponent<DFUWorkunitsProps> = ({
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");

Expand Down
4 changes: 2 additions & 2 deletions esp/src/src-react/components/EventScheduler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export const EventScheduler: React.FunctionComponent<EventSchedulerProps> = ({
},
{ key: "divider_3", itemType: ContextualMenuItemType.Divider, onRender: () => <ShortVerticalDivider /> },
{
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"] = "";
Expand All @@ -154,7 +154,7 @@ export const EventScheduler: React.FunctionComponent<EventSchedulerProps> = ({
pushParams(filter);
}
},
], [currentUser, filter, hasFilter, refreshTable, selection, setShowDescheduleConfirm, store]);
], [currentUser, filter, hasFilter, refreshTable, selection, setShowDescheduleConfirm, store, total]);

return <HolyGrail
header={<CommandBar items={buttons} farItems={copyButtons} />}
Expand Down
4 changes: 2 additions & 2 deletions esp/src/src-react/components/Files.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ export const Files: React.FunctionComponent<FilesProps> = ({
},
{ key: "divider_5", itemType: ContextualMenuItemType.Divider, onRender: () => <ShortVerticalDivider /> },
{
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"] = "";
Expand All @@ -303,7 +303,7 @@ export const Files: React.FunctionComponent<FilesProps> = ({
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 = {};
Expand Down
4 changes: 2 additions & 2 deletions esp/src/src-react/components/Queries.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ export const Queries: React.FunctionComponent<QueriesProps> = ({
}
},
{
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"] = "";
Expand All @@ -242,7 +242,7 @@ export const Queries: React.FunctionComponent<QueriesProps> = ({
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 = {};
Expand Down
2 changes: 1 addition & 1 deletion esp/src/src-react/components/Scopes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ export const Scopes: React.FunctionComponent<ScopesProps> = ({
},
{ key: "divider_5", itemType: ContextualMenuItemType.Divider, onRender: () => <ShortVerticalDivider /> },
{
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 = "";
Expand Down
4 changes: 2 additions & 2 deletions esp/src/src-react/components/Workunits.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ export const Workunits: React.FunctionComponent<WorkunitsProps> = ({
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 = "";
Expand All @@ -266,7 +266,7 @@ export const Workunits: React.FunctionComponent<WorkunitsProps> = ({
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(() => {
Expand Down

0 comments on commit 531e746

Please sign in to comment.