toggle help on kebab click (#339)
* toggle help on kebab click fixes: #305 * changed realm info to server info and fixed mobile layout * added on off indication * changed to use single key for enabled and disabled
This commit is contained in:
parent
4137394964
commit
8590b9cafa
3 changed files with 12 additions and 5 deletions
|
@ -15,7 +15,7 @@ import {
|
||||||
} from "@patternfly/react-core";
|
} from "@patternfly/react-core";
|
||||||
import { HelpIcon } from "@patternfly/react-icons";
|
import { HelpIcon } from "@patternfly/react-icons";
|
||||||
import { WhoAmIContext } from "./context/whoami/WhoAmI";
|
import { WhoAmIContext } from "./context/whoami/WhoAmI";
|
||||||
import { HelpHeader } from "./components/help-enabler/HelpHeader";
|
import { HelpContext, HelpHeader } from "./components/help-enabler/HelpHeader";
|
||||||
import { Link, useHistory } from "react-router-dom";
|
import { Link, useHistory } from "react-router-dom";
|
||||||
import { useAdminClient } from "./context/auth/AdminClient";
|
import { useAdminClient } from "./context/auth/AdminClient";
|
||||||
import { useRealm } from "./context/realm-context/RealmContext";
|
import { useRealm } from "./context/realm-context/RealmContext";
|
||||||
|
@ -75,7 +75,12 @@ export const Header = () => {
|
||||||
|
|
||||||
const HelpDropdownItem = () => {
|
const HelpDropdownItem = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
return <DropdownItem icon={<HelpIcon />}>{t("help")}</DropdownItem>;
|
const { enabled, toggleHelp } = useContext(HelpContext);
|
||||||
|
return (
|
||||||
|
<DropdownItem icon={<HelpIcon />} onClick={toggleHelp}>
|
||||||
|
{enabled ? t("helpEnabled") : t("helpDisabled")}
|
||||||
|
</DropdownItem>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const kebabDropdownItems = [
|
const kebabDropdownItems = [
|
||||||
|
|
|
@ -36,6 +36,8 @@
|
||||||
"realmInfo": "Realm info",
|
"realmInfo": "Realm info",
|
||||||
"help": "Help",
|
"help": "Help",
|
||||||
"helpLabel": "More help for {{label}}",
|
"helpLabel": "More help for {{label}}",
|
||||||
|
"helpEnabled": "Help on",
|
||||||
|
"helpDisabled": "Help off",
|
||||||
"documentation": "Documentation",
|
"documentation": "Documentation",
|
||||||
"enableHelpMode": "Enable help mode",
|
"enableHelpMode": "Enable help mode",
|
||||||
"learnMore": "Learn more",
|
"learnMore": "Learn more",
|
||||||
|
|
|
@ -51,7 +51,7 @@ const EmptyDashboard = () => {
|
||||||
</Title>
|
</Title>
|
||||||
<EmptyStateBody>{t("introduction")}</EmptyStateBody>
|
<EmptyStateBody>{t("introduction")}</EmptyStateBody>
|
||||||
<Button variant="link" onClick={() => setRealm("master")}>
|
<Button variant="link" onClick={() => setRealm("master")}>
|
||||||
{t("common:providerInfo")}
|
{t("common:serverInfo")}
|
||||||
</Button>
|
</Button>
|
||||||
</EmptyState>
|
</EmptyState>
|
||||||
</PageSection>
|
</PageSection>
|
||||||
|
@ -86,7 +86,7 @@ const Dashboard = () => {
|
||||||
</PageSection>
|
</PageSection>
|
||||||
<PageSection>
|
<PageSection>
|
||||||
<Grid hasGutter>
|
<Grid hasGutter>
|
||||||
<GridItem span={2}>
|
<GridItem lg={2} sm={12}>
|
||||||
<Card className="keycloak__dashboard_card">
|
<Card className="keycloak__dashboard_card">
|
||||||
<CardTitle>{t("serverInfo")}</CardTitle>
|
<CardTitle>{t("serverInfo")}</CardTitle>
|
||||||
<CardBody>
|
<CardBody>
|
||||||
|
@ -105,7 +105,7 @@ const Dashboard = () => {
|
||||||
</CardBody>
|
</CardBody>
|
||||||
</Card>
|
</Card>
|
||||||
</GridItem>
|
</GridItem>
|
||||||
<GridItem span={10}>
|
<GridItem lg={10} sm={12}>
|
||||||
<Card className="keycloak__dashboard_card">
|
<Card className="keycloak__dashboard_card">
|
||||||
<CardTitle>{t("profile")}</CardTitle>
|
<CardTitle>{t("profile")}</CardTitle>
|
||||||
<CardBody>
|
<CardBody>
|
||||||
|
|
Loading…
Reference in a new issue