Removed duplicate refresh buttons (#26857)

* fixed refresh btn for events

Signed-off-by: Agnieszka Gancarczyk <agancarc@redhat.com>

* cleanup

Signed-off-by: Agnieszka Gancarczyk <agancarc@redhat.com>

---------

Signed-off-by: Agnieszka Gancarczyk <agancarc@redhat.com>
Co-authored-by: Agnieszka Gancarczyk <agancarc@redhat.com>
This commit is contained in:
agagancarczyk 2024-02-07 11:24:52 +00:00 committed by GitHub
parent 1430b8b6cd
commit 2a8b54114f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 10 additions and 32 deletions

View file

@ -8,6 +8,7 @@ type DropdownPanelProps = {
children: React.ReactNode; children: React.ReactNode;
setSearchDropdownOpen: (open: boolean) => void; setSearchDropdownOpen: (open: boolean) => void;
searchDropdownOpen: boolean; searchDropdownOpen: boolean;
marginRight?: string;
width: string; width: string;
}; };
@ -16,6 +17,7 @@ const DropdownPanel: React.FC<DropdownPanelProps> = ({
children, children,
setSearchDropdownOpen, setSearchDropdownOpen,
searchDropdownOpen, searchDropdownOpen,
marginRight,
width, width,
}) => { }) => {
const dropdownRef = useRef<HTMLDivElement>(null); const dropdownRef = useRef<HTMLDivElement>(null);
@ -52,7 +54,7 @@ const DropdownPanel: React.FC<DropdownPanelProps> = ({
className="kc-dropdown-panel" className="kc-dropdown-panel"
onClick={() => setSearchDropdownOpen(!searchDropdownOpen)} onClick={() => setSearchDropdownOpen(!searchDropdownOpen)}
aria-label={buttonText} aria-label={buttonText}
style={{ width }} style={{ width, marginRight }}
data-testid="dropdown-panel-btn" data-testid="dropdown-panel-btn"
> >
{buttonText} {buttonText}

View file

@ -187,10 +187,6 @@ export const AdminEvents = () => {
setKey(key + 1); setKey(key + 1);
} }
function refresh() {
commitFilters();
}
const adminEventSearchFormDisplay = () => { const adminEventSearchFormDisplay = () => {
return ( return (
<Flex <Flex
@ -202,6 +198,7 @@ export const AdminEvents = () => {
buttonText={t("searchForAdminEvent")} buttonText={t("searchForAdminEvent")}
setSearchDropdownOpen={setSearchDropdownOpen} setSearchDropdownOpen={setSearchDropdownOpen}
searchDropdownOpen={searchDropdownOpen} searchDropdownOpen={searchDropdownOpen}
marginRight="2.5rem"
width="15vw" width="15vw"
> >
<Form <Form
@ -441,13 +438,6 @@ export const AdminEvents = () => {
</ActionGroup> </ActionGroup>
</Form> </Form>
</DropdownPanel> </DropdownPanel>
<Button
className="pf-u-ml-md"
onClick={refresh}
data-testid="refresh-btn"
>
{t("refresh")}
</Button>
</FlexItem> </FlexItem>
<FlexItem> <FlexItem>
{Object.entries(activeFilters).length > 0 && ( {Object.entries(activeFilters).length > 0 && (

View file

@ -220,10 +220,6 @@ export default function EventsSection() {
setKey(key + 1); setKey(key + 1);
} }
function refresh() {
commitFilters();
}
const userEventSearchFormDisplay = () => { const userEventSearchFormDisplay = () => {
return ( return (
<Flex <Flex
@ -235,6 +231,7 @@ export default function EventsSection() {
buttonText={t("searchForUserEvent")} buttonText={t("searchForUserEvent")}
setSearchDropdownOpen={setSearchDropdownOpen} setSearchDropdownOpen={setSearchDropdownOpen}
searchDropdownOpen={searchDropdownOpen} searchDropdownOpen={searchDropdownOpen}
marginRight="2.5rem"
width="15vw" width="15vw"
> >
<Form <Form
@ -394,13 +391,6 @@ export default function EventsSection() {
</ActionGroup> </ActionGroup>
</Form> </Form>
</DropdownPanel> </DropdownPanel>
<Button
className="pf-u-ml-md"
onClick={refresh}
data-testid="refresh-btn"
>
{t("refresh")}
</Button>
</FlexItem> </FlexItem>
<FlexItem> <FlexItem>
{Object.entries(activeFilters).length > 0 && ( {Object.entries(activeFilters).length > 0 && (

View file

@ -202,7 +202,10 @@ export const EffectiveMessageBundles = ({
> >
<FlexItem> <FlexItem>
<TextContent> <TextContent>
<Text className="pf-u-mb-md pf-u-mt-0" component={TextVariants.p}> <Text
className="pf-u-mb-md pf-u-mt-0 pf-u-mr-md"
component={TextVariants.p}
>
{t("effectiveMessageBundlesDescription")} {t("effectiveMessageBundlesDescription")}
</Text> </Text>
</TextContent> </TextContent>
@ -212,6 +215,7 @@ export const EffectiveMessageBundles = ({
buttonText={t("searchForEffectiveMessageBundles")} buttonText={t("searchForEffectiveMessageBundles")}
setSearchDropdownOpen={setSearchDropdownOpen} setSearchDropdownOpen={setSearchDropdownOpen}
searchDropdownOpen={searchDropdownOpen} searchDropdownOpen={searchDropdownOpen}
marginRight="2.5rem"
width="15vw" width="15vw"
> >
<Form <Form
@ -481,14 +485,6 @@ export const EffectiveMessageBundles = ({
</ActionGroup> </ActionGroup>
</Form> </Form>
</DropdownPanel> </DropdownPanel>
<Button
variant="primary"
className="pf-u-ml-md"
onClick={() => submitSearch()}
data-testid="refresh-effective-message-bundles-btn"
>
{t("refresh")}
</Button>
</FlexItem> </FlexItem>
<FlexItem> <FlexItem>
{Object.entries(activeFilters).length > 0 && ( {Object.entries(activeFilters).length > 0 && (