From d62b39d3c51bfa411d9f5ca7131f9d92a6e5c558 Mon Sep 17 00:00:00 2001 From: Richa Date: Tue, 14 Jan 2025 17:25:10 +0100 Subject: [PATCH] Fixed lint --- .../secondary/min_action_chain.feature | 2 +- .../css/base/components/buttons.suma.scss | 1 + web/html/src/components/buttons.tsx | 30 +++++++------------ web/html/src/components/dialog/ModalLink.tsx | 6 ++-- web/html/src/components/table/Header.tsx | 7 ++--- web/html/src/components/table/SearchPanel.tsx | 6 ++-- web/html/src/core/spa/spa-engine.tsx | 8 +++-- .../manager/admin/setup/products/products.tsx | 4 +-- .../manager/appstreams/channel-appstreams.tsx | 3 +- .../list-filters/appstreams/appstreams.tsx | 5 ++-- .../list-filters/filter-form.tsx | 19 ++++++++---- web/html/src/manager/images/image-build.tsx | 3 +- .../minion/ansible/accordion-path-content.tsx | 8 ++--- 13 files changed, 51 insertions(+), 51 deletions(-) diff --git a/testsuite/features/secondary/min_action_chain.feature b/testsuite/features/secondary/min_action_chain.feature index bedfdb4ab715..7f3c6e4dbfc9 100644 --- a/testsuite/features/secondary/min_action_chain.feature +++ b/testsuite/features/secondary/min_action_chain.feature @@ -76,7 +76,7 @@ Feature: Action chains on Salt minions And I enter "virgo-dummy" as the filtered package name And I click on the filter button And I check "virgo-dummy" in the list - And I click on "Install Selected Packages" + And I click on "Install Packages" And I check radio button "schedule-by-action-chain" And I click on "Confirm" Then I should see a "Action has been successfully added to the Action Chain" text diff --git a/web/html/src/branding/css/base/components/buttons.suma.scss b/web/html/src/branding/css/base/components/buttons.suma.scss index 79eddd9b9903..0b5ee27d5ebe 100644 --- a/web/html/src/branding/css/base/components/buttons.suma.scss +++ b/web/html/src/branding/css/base/components/buttons.suma.scss @@ -202,6 +202,7 @@ } .panel-heading, +th > a, th .orderBy { border: none; padding: 0; diff --git a/web/html/src/components/buttons.tsx b/web/html/src/components/buttons.tsx index 9775ac2924d7..ef36edf71ccf 100644 --- a/web/html/src/components/buttons.tsx +++ b/web/html/src/components/buttons.tsx @@ -5,8 +5,6 @@ import * as React from "react"; * @module buttons */ -type ButtonVariant = "btn-primary" | "btn-default" | "btn-tertiary" | "btn-danger"; - type BaseProps = { /** Text to display on the button. */ text?: React.ReactNode; @@ -27,9 +25,6 @@ type BaseProps = { /** If true, disable the button. */ disabled?: boolean; - /** If true, add unstyled button style */ - unstyled?: boolean; - /** * Any additional css classes for the button, `"btn"` is prepended automatically */ @@ -174,12 +169,12 @@ export class Button extends _ButtonBase { onClick={this.props.handler} disabled={this.props.disabled} > - {( + { <> {this.renderIcon()} {text} - )} + } ); } @@ -202,18 +197,17 @@ type LinkProps = BaseProps & { export class LinkButton extends _ButtonBase { render() { const text = this.props.text ?? this.props.children; - const cssClasses = this.props.unstyled - ? "btn-tertiary " + (this.props.className ?? "") - : "btn " + this.props.className; + const cssClasses = "btn " + (this.props.className ?? "btn-default"); + const targetProps: Partial> = this.props.target === "_blank" ? { - target: "_blank", - rel: "noopener noreferrer", - } + target: "_blank", + rel: "noopener noreferrer", + } : { - target: this.props.target, - }; + target: this.props.target, + }; return ( { onClick={this.props.handler} {...targetProps} > - {this.props.unstyled ? ( - <>{this.renderIcon()} - ) : ( + { <> {this.renderIcon()} {text} - )} + } ); } diff --git a/web/html/src/components/dialog/ModalLink.tsx b/web/html/src/components/dialog/ModalLink.tsx index 2b7610540b83..c9c989055b85 100644 --- a/web/html/src/components/dialog/ModalLink.tsx +++ b/web/html/src/components/dialog/ModalLink.tsx @@ -1,7 +1,8 @@ import * as React from "react"; -import { showDialog } from "./util"; import { Button } from "components/buttons"; + +import { showDialog } from "./util"; type Props = { target: string; id?: string; @@ -19,9 +20,6 @@ type Props = { * Link to launch a modal dialog */ export function ModalLink(props: Props) { - const margin = props.text ? "" : " no-margin"; - var icon = props.icon && ; - return ( ); } diff --git a/web/html/src/components/table/SearchPanel.tsx b/web/html/src/components/table/SearchPanel.tsx index f51d413503ca..700c7267c77b 100644 --- a/web/html/src/components/table/SearchPanel.tsx +++ b/web/html/src/components/table/SearchPanel.tsx @@ -1,9 +1,9 @@ import * as React from "react"; +import { Button } from "components/buttons"; import { cloneReactElement } from "components/utils"; import styles from "./SearchPanel.module.scss"; -import { Button } from "components/buttons"; type SearchPanelProps = { /** number representing the number of the first displayed item */ @@ -67,9 +67,7 @@ export function SearchPanel(props: SearchPanelProps) {  /  )} - {props.selectable && ( -