Skip to content

Commit

Permalink
HPCC-21665 Event Scheduler filter option added.
Browse files Browse the repository at this point in the history
Mine filter added to event scheduler page.

Signed-off-by: Kunal Aswani <[email protected]>
  • Loading branch information
kunalaswani committed Aug 8, 2023
1 parent 7fe7615 commit fe042be
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion esp/src/src-react/components/EventScheduler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { Filter } from "./forms/Filter";
import { PushEventForm } from "./forms/PushEvent";
import { ShortVerticalDivider } from "./Common";
import { QuerySortItem } from "src/store/Store";
import { useMyAccount } from "../hooks/user";

const logger = scopedLogger("src-react/components/EventScheduler.tsx");

Expand Down Expand Up @@ -52,6 +53,7 @@ export const EventScheduler: React.FunctionComponent<EventSchedulerProps> = ({

const [showFilter, setShowFilter] = React.useState(false);
const [showPushEvent, setShowPushEvent] = React.useState(false);
const { currentUser } = useMyAccount();

// Grid ---
const query = React.useMemo(() => {
Expand Down Expand Up @@ -138,7 +140,19 @@ export const EventScheduler: React.FunctionComponent<EventSchedulerProps> = ({
key: "pushEvent", text: nlsHPCC.PushEvent,
onClick: () => setShowPushEvent(true)
},
], [hasFilter, refreshTable, selection, setShowDescheduleConfirm, store]);
{ 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,
onClick: () => {
if (filter["Owner"] === currentUser.username) {
filter["Owner"] = "";
} else {
filter["Owner"] = currentUser.username;
}
pushParams(filter);
}
},
], [currentUser, hasFilter, refreshTable, selection, setShowDescheduleConfirm, store]);

Check warning on line 155 in esp/src/src-react/components/EventScheduler.tsx

View workflow job for this annotation

GitHub Actions / Check eclwatch and npm (16)

React Hook React.useMemo has a missing dependency: 'filter'. Either include it or remove the dependency array

Check warning on line 155 in esp/src/src-react/components/EventScheduler.tsx

View workflow job for this annotation

GitHub Actions / Check eclwatch and npm (18)

React Hook React.useMemo has a missing dependency: 'filter'. Either include it or remove the dependency array

return <HolyGrail
header={<CommandBar items={buttons} />}
Expand Down

0 comments on commit fe042be

Please sign in to comment.