Skip to content

Commit

Permalink
Fixed lint
Browse files Browse the repository at this point in the history
  • Loading branch information
bisht-richa committed Jan 14, 2025
1 parent f137ab6 commit d62b39d
Show file tree
Hide file tree
Showing 13 changed files with 51 additions and 51 deletions.
2 changes: 1 addition & 1 deletion testsuite/features/secondary/min_action_chain.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@
}

.panel-heading,
th > a,
th .orderBy {
border: none;
padding: 0;
Expand Down
30 changes: 11 additions & 19 deletions web/html/src/components/buttons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
*/
Expand Down Expand Up @@ -174,12 +169,12 @@ export class Button extends _ButtonBase<ButtonProps> {
onClick={this.props.handler}
disabled={this.props.disabled}
>
{(
{
<>
{this.renderIcon()}
{text}
</>
)}
}
</button>
);
}
Expand All @@ -202,18 +197,17 @@ type LinkProps = BaseProps & {
export class LinkButton extends _ButtonBase<LinkProps> {
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<React.HTMLProps<HTMLAnchorElement>> =
this.props.target === "_blank"
? {
target: "_blank",
rel: "noopener noreferrer",
}
target: "_blank",
rel: "noopener noreferrer",
}
: {
target: this.props.target,
};
target: this.props.target,
};
return (
<a
role="button"
Expand All @@ -224,14 +218,12 @@ export class LinkButton extends _ButtonBase<LinkProps> {
onClick={this.props.handler}
{...targetProps}
>
{this.props.unstyled ? (
<>{this.renderIcon()}</>
) : (
{
<>
{this.renderIcon()}
{text}
</>
)}
}
</a>
);
}
Expand Down
6 changes: 2 additions & 4 deletions web/html/src/components/dialog/ModalLink.tsx
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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 && <i className={"fa " + props.icon + margin} />;

return (
<Button
id={props.id}
Expand Down
7 changes: 2 additions & 5 deletions web/html/src/components/table/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,9 @@ export function Header(props: HeaderProps) {

return (
<th style={thStyle} className={thClass}>
<a
className="orderBy"
onClick={() => props.onSortChange?.(props.columnKey || null, newDirection)}
>
<button className="orderBy" onClick={() => props.onSortChange?.(props.columnKey || null, newDirection)}>
{props.children}
</a>
</button>
</th>
);
}
Expand Down
6 changes: 2 additions & 4 deletions web/html/src/components/table/SearchPanel.tsx
Original file line number Diff line number Diff line change
@@ -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 */
Expand Down Expand Up @@ -67,9 +67,7 @@ export function SearchPanel(props: SearchPanelProps) {
&nbsp;/&nbsp;
</span>
)}
{props.selectable && (
<Button className="btn-tertiary" handler={props.onSelectAll} text={t("Select All")} />
)}
{props.selectable && <Button className="btn-tertiary" handler={props.onSelectAll} text={t("Select All")} />}
</div>
</div>
);
Expand Down
8 changes: 6 additions & 2 deletions web/html/src/core/spa/spa-engine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import App, { HtmlScreen } from "senna";

import SpaRenderer from "core/spa/spa-renderer";

import { showErrorToastr } from "components/toastr";
import { Button } from "components/buttons";
import { showErrorToastr } from "components/toastr";

function isLoginPage(pathName) {
const allLoginPossiblePaths = ["/", "/rhn/manager/login"];
Expand Down Expand Up @@ -102,7 +102,11 @@ window.pageRenderers.spaengine.init = function init(timeout?: number) {
const message = (
<>
Request has timed out, please
<Button className="btn-tertiary" text="reload the page" handler={() => (window.location = navigation.path)} />
<Button
className="btn-tertiary"
text="reload the page"
handler={() => (window.location = navigation.path)}
/>
</>
);
showErrorToastr(message, { autoHide: false, containerId: "global" });
Expand Down
4 changes: 2 additions & 2 deletions web/html/src/manager/admin/setup/products/products.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,8 @@ class ProductsPageWrapper extends React.Component {
const submitButtonTitle = this.state.sccSyncRunning
? t("The product catalog is still refreshing, please wait.")
: this.state.selectedItems.length === 0
? t("Select some product first.")
: undefined;
? t("Select some product first.")
: undefined;
const addProductButton =
this.state.sccSyncRunning || this.state.selectedItems.length === 0 || this.state.addingProducts ? (
<Button
Expand Down
3 changes: 2 additions & 1 deletion web/html/src/manager/appstreams/channel-appstreams.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Button } from "components/buttons";

import { AppStreamModule, Channel } from "./appstreams.type";
import { getStreamName } from "./utils";
import { Button } from "components/buttons";

interface Props {
channel: Channel;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import * as React from "react";
import { useState } from "react";

import { Button } from "components/buttons";
import { showErrorToastr } from "components/toastr/toastr";

import Network from "utils/network";

import SelectInput from "./select-input";
import TextInput from "./text-input";
import { Button } from "components/buttons";

export default function AppStreams({ matcher }) {
const [channels, setChannels] = useState<{ id: string; name: string }[]>([]);
Expand Down Expand Up @@ -36,7 +36,8 @@ export default function AppStreams({ matcher }) {
className="btn-tertiary"
handler={enableBrowse}
icon={isLoading ? "fa-refresh fa-spin fa-fw" : "fa-search fa-fw"}
text="Browse available modules" />
text="Browse available modules"
/>
</div>
</div>
<TextInput />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as React from "react";
import { useEffect, useState } from "react";

import { Button } from "components/buttons";
import { DateTime, Form, Radio, Select, Text } from "components/input";

import { localizedMoment } from "utils";
Expand All @@ -10,7 +11,6 @@ import { clmFilterOptions, findClmFilterByKey, getClmFiltersOptions } from "../s
import { FilterFormType } from "../shared/type/filter.type";
import AppStreamsForm from "./appstreams/appstreams";
import TemplatesForm from "./templates";
import { Button } from "components/buttons";

enum FilterBy {
Type = "Type",
Expand Down Expand Up @@ -101,10 +101,19 @@ const FilterForm = (props: Props) => {
<div className="row form-group">
<div className="col-md-6 col-md-offset-3 offset-md-3">
{filterBy === FilterBy.Type ? (
<Button className="btn-tertiary" handler={() => setFilterBy(FilterBy.Template)} icon="fa-file-text-o" text={t("Use a template")} />
<Button
className="btn-tertiary"
handler={() => setFilterBy(FilterBy.Template)}
icon="fa-file-text-o"
text={t("Use a template")}
/>
) : (
<Button className="btn-tertiary" handler={() => setFilterBy(FilterBy.Type)}
icon="fa-filter" text={t("Use a manual filter")} />
<Button
className="btn-tertiary"
handler={() => setFilterBy(FilterBy.Type)}
icon="fa-filter"
text={t("Use a manual filter")}
/>
)}
</div>
</div>
Expand Down Expand Up @@ -311,7 +320,7 @@ const FilterForm = (props: Props) => {

{filterBy === FilterBy.Template ? <TemplatesForm {...props} /> : null}
</React.Fragment>
</Form >
</Form>
);
};

Expand Down
3 changes: 1 addition & 2 deletions web/html/src/manager/images/image-build.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,7 @@ class BuildImage extends React.Component<Props, State> {
"?url_bounce=" +
this.getBounceUrl()
}
className="pull-right"
unstyled
className="btn-tertiary pull-right"
/>
)}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,10 @@ class AccordionPathContent extends React.Component<PropsType, StateType> {
{this.state.errors.length > 0
? errors
: this.isPlaybookContent(this.state.content)
? this.renderPlaybookPathContent(this.state.content)
: this.isInventoryContent(this.state.content)
? this.renderInventoryPathContent(this.state.content)
: null}
? this.renderPlaybookPathContent(this.state.content)
: this.isInventoryContent(this.state.content)
? this.renderInventoryPathContent(this.state.content)
: null}
</>
) : null}
</div>
Expand Down

0 comments on commit d62b39d

Please sign in to comment.