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

View file

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

View file

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

View file

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