这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

(Add entries here in the order of: server, console, cli, docs, others)

- console: update sidebar icons for different action and trigger types

## `v1.3.0`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,17 @@ const LeftSidebarSection = ({
itemList = [...items];
}

const getServiceIcon = () => {
switch (service) {
case 'cron':
return 'fa-calendar';
case 'data':
return 'fa-database';
default:
return 'fa-wrench';
}
};

const getChildList = () => {
let childList;
if (itemList.length === 0) {
Expand All @@ -62,6 +73,8 @@ const LeftSidebarSection = ({
</li>
);
} else {
const serviceIcon = getServiceIcon();

childList = itemList.map(a => {
let activeTableClass = '';
if (currentItem && currentItem.name === a.name) {
Expand All @@ -76,7 +89,7 @@ const LeftSidebarSection = ({
>
<Link to={getServiceEntityLink(a.name)} data-test={a.name}>
<i
className={`${styles.tableIcon} fa fa-wrench`}
className={`${styles.tableIcon} fa ${serviceIcon}`}
aria-hidden="true"
/>
{a.name}
Expand Down
15 changes: 14 additions & 1 deletion console/src/components/Services/Actions/Sidebar/LeftSidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@ const LeftSidebar = ({
actionsList = [...actions];
}

const getActionIcon = action => {
switch (action.action_defn.type) {
case 'mutation':
return 'fa-pencil-square-o';
case 'query':
return 'fa-book';
default:
return 'fa-wrench';
}
};

const getChildList = () => {
let childList;
if (actionsList.length === 0) {
Expand All @@ -59,6 +70,8 @@ const LeftSidebar = ({
activeTableClass = styles.activeLink;
}

const actionIcon = getActionIcon(a);

return (
<li
className={activeTableClass}
Expand All @@ -70,7 +83,7 @@ const LeftSidebar = ({
data-test={a.action_name}
>
<i
className={styles.tableIcon + ' fa fa-wrench'}
className={styles.tableIcon + ' fa ' + actionIcon}
aria-hidden="true"
/>
{a.action_name}
Expand Down
3 changes: 1 addition & 2 deletions console/src/components/Services/Data/Schema/Schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -536,8 +536,7 @@ class Schema extends Component {
'Relationships inferred via foreign-keys that are not exposed over the GraphQL API',
<>
<KnowMoreLink href="https://hasura.io/docs/1.0/graphql/manual/schema/table-relationships/index.html" />
&nbsp;
{getTrackAllBtn()}
<span className={styles.add_mar_left}>{getTrackAllBtn()}</span>
</>
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const Info: React.FC = () => {
<div className={styles.padd_left}>
<TopicDescription
title="What are Scheduled events?"
imgUrl={`${globals.assetsPath}/common/img/scheduled-trigger.png`}
imgUrl={`${globals.assetsPath}/common/img/scheduled-event.png`}
imgAlt={ADHOC_EVENTS_HEADING}
description={topicDescription}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const Landing: React.FC<Props> = props => {
<div>
<TopicDescription
title="What are Cron Triggers?"
imgUrl={`${globals.assetsPath}/common/img/scheduled-trigger.png`}
imgUrl={`${globals.assetsPath}/common/img/cron-trigger.png`}
imgAlt={CRON_TRIGGER}
description={topicDescription}
/>
Expand Down