Skip to content

Commit

Permalink
Fix more issues with icons and editable table
Browse files Browse the repository at this point in the history
  • Loading branch information
droideck committed Nov 26, 2024
1 parent a523dbc commit 6fb7815
Show file tree
Hide file tree
Showing 37 changed files with 400 additions and 387 deletions.
1 change: 0 additions & 1 deletion src/cockpit/389-console/src/LDAPEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ import EditorTreeView from './lib/ldap_editor/treeView.jsx';
import { SearchDatabase } from './lib/ldap_editor/search.jsx';
import GenericWizard from './lib/ldap_editor/wizards/genericWizard.jsx';
import { SyncAltIcon } from '@patternfly/react-icons';
import '@fortawesome/fontawesome-svg-core/styles.css';
import { log_cmd } from "./lib/tools.jsx";

const _ = cockpit.gettext;
Expand Down
13 changes: 4 additions & 9 deletions src/cockpit/389-console/src/database.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,7 @@ import {
TextContent,
TextVariants,
} from "@patternfly/react-core";
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import {
faLeaf,
faTree,
faLink
} from '@fortawesome/free-solid-svg-icons';
import { TreeIcon, LeafIcon, LinkIcon } from '@patternfly/react-icons';
import {
CatalogIcon,
CogIcon,
Expand Down Expand Up @@ -467,11 +462,11 @@ export class Database extends React.Component {
processTree(suffixData) {
for (const suffix of suffixData) {
if (suffix.type === "suffix") {
suffix.icon = <FontAwesomeIcon size="sm" icon={faTree} />;
suffix.icon = <TreeIcon size="sm" />;
} else if (suffix.type === "subsuffix") {
suffix.icon = <FontAwesomeIcon size="sm" icon={faLeaf} />;
suffix.icon = <LeafIcon size="sm" />;
} else {
suffix.icon = <FontAwesomeIcon size="sm" icon={faLink} />;
suffix.icon = <LinkIcon size="sm" />;
}
if (suffix.children.length === 0) {
delete suffix.children;
Expand Down
14 changes: 3 additions & 11 deletions src/cockpit/389-console/src/lib/database/chaining.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1358,22 +1358,14 @@ export class ChainingConfig extends React.Component {
<GridItem span={10} className="ds-word-wrap">
<TextContent>
<Text className="ds-suffix-header" component={TextVariants.h3}>
<>
<Icon>
<LinkIcon size="sm" />
</Icon>{' '}
{this.props.suffix} (
<Text component={TextVariants.i} style={{ fontSize: '16px' }}>
{this.props.bename}
</Text>
)
</>
<LinkIcon />
&nbsp;&nbsp;{this.props.suffix} (<i>{this.props.bename}</i>)
<Button
variant="plain"
aria-label={_("Refresh database link")}
onClick={() => this.props.reload(this.props.suffix)}
>
<SyncAltIcon size="lg" />
<SyncAltIcon />
</Button>
</Text>
</TextContent>
Expand Down
19 changes: 8 additions & 11 deletions src/cockpit/389-console/src/lib/database/globalPwp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ import {
SelectOption
} from '@patternfly/react-core/deprecated';
import PropTypes from "prop-types";
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import {
faSyncAlt
} from '@fortawesome/free-solid-svg-icons';
import '@fortawesome/fontawesome-svg-core/styles.css';
import { SyncAltIcon } from '@patternfly/react-icons';

const _ = cockpit.gettext;

Expand Down Expand Up @@ -1639,13 +1635,14 @@ export class GlobalPwPolicy extends React.Component {
<TextContent>
<Text component={TextVariants.h3}>
{_("Global Password Policy")}
<FontAwesomeIcon
size="lg"
className="ds-left-margin ds-refresh"
icon={faSyncAlt}
title={_("Refresh global password policy settings")}
<Button
variant="plain"
aria-label={_("Refresh global password policy settings")}
onClick={this.handleLoadGlobal}
/>
className="ds-left-margin"
>
<SyncAltIcon />
</Button>
</Text>
</TextContent>
</GridItem>
Expand Down
18 changes: 7 additions & 11 deletions src/cockpit/389-console/src/lib/database/localPwp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ import {
SelectOption,
SelectVariant
} from '@patternfly/react-core/deprecated';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import {
faSyncAlt
} from '@fortawesome/free-solid-svg-icons';
import '@fortawesome/fontawesome-svg-core/styles.css';
import { SyncAltIcon } from "@patternfly/react-icons";
import PropTypes from "prop-types";

const _ = cockpit.gettext;
Expand Down Expand Up @@ -3231,13 +3227,13 @@ export class LocalPwPolicy extends React.Component {
<TextContent>
<Text component={TextVariants.h3}>
{_("Local Password Policies")}
<FontAwesomeIcon
size="lg"
className="ds-left-margin ds-refresh"
icon={faSyncAlt}
title={_("Refresh the local password policies")}
<Button
variant="plain"
aria-label={_("Refresh the local password policies")}
onClick={this.handleLoadPolicies}
/>
>
<SyncAltIcon />
</Button>
</Text>
</TextContent>
</GridItem>
Expand Down
33 changes: 17 additions & 16 deletions src/cockpit/389-console/src/lib/database/suffix.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,25 @@ import { SuffixReferrals } from "./referrals.jsx";
import { SuffixIndexes } from "./indexes.jsx";
import { VLVIndexes } from "./vlvIndexes.jsx";
import { log_cmd, bad_file_name } from "../tools.jsx";
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import {
faLeaf,
faTree,
faSyncAlt
} from '@fortawesome/free-solid-svg-icons';
import '@fortawesome/fontawesome-svg-core/styles.css';
import {
ImportModal,
ExportModal,
CreateSubSuffixModal,
CreateLinkModal,
} from "./databaseModal.jsx";
import {
Button,
Grid,
GridItem,
Tab,
Tabs,
TabTitleText
} from '@patternfly/react-core';
import {
FolderIcon,
LeafIcon,
SyncAltIcon
} from '@patternfly/react-icons';
import {
Dropdown,
DropdownToggle,
Expand Down Expand Up @@ -851,9 +850,9 @@ export class Suffix extends React.Component {
// Render the component
//
render () {
let suffixIcon = faTree;
let SuffixIcon = FolderIcon;
if (this.props.dbtype === "subsuffix") {
suffixIcon = faLeaf;
SuffixIcon = LeafIcon;
}
const { dropdownIsOpen, activeTabKey } = this.state;

Expand Down Expand Up @@ -883,21 +882,23 @@ export class Suffix extends React.Component {
<div id="suffix-page">
<Grid>
<GridItem className="ds-suffix-header" span={9}>
<FontAwesomeIcon size="sm" icon={suffixIcon} />&nbsp;&nbsp;{this.props.suffix} (<i>{this.props.bename}</i>)
<FontAwesomeIcon
className="ds-left-margin ds-refresh"
icon={faSyncAlt}
title={_("Refresh suffix")}
<SuffixIcon />
&nbsp;&nbsp;{this.props.suffix} (<i>{this.props.bename}</i>)
<Button
variant="plain"
aria-label={_("Refresh suffix")}
onClick={() => this.props.reload(this.props.suffix)}
/>
>
<SyncAltIcon />
</Button>
</GridItem>
<GridItem span={3}>
<Dropdown
className="ds-float-right"
position={DropdownPosition.right}
onSelect={this.handleSelect}
toggle={
<DropdownToggle id="suffix-dropdown" isPrimary onToggle={(event, isOpen) => this.handleToggle(event, isOpen)}>
<DropdownToggle id="suffix-dropdown" onToggle={(event, isOpen) => this.handleToggle(event, isOpen)}>
{_("Suffix Tasks")}
</DropdownToggle>
}
Expand Down
Loading

0 comments on commit 6fb7815

Please sign in to comment.