console: show remote shema / event trigger intro sections always (#4044)

This commit is contained in:
Rikin Kachhia 2020-03-26 18:45:37 +05:30 committed by GitHub
parent fd6535b861
commit 84c6b00c84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 42 deletions

View File

@ -102,3 +102,4 @@
- console: add design system base components (#3866)
- docs: add docs for redeliver_event API
- option to reload remote schemas in 'reload_metadata' API (fix #3792, #4117)
- console: show remote schema / event trigger intro sections always (#4044)

View File

@ -23,7 +23,7 @@ class EventTrigger extends Component {
}
render() {
const { dispatch, listingTrigger, readOnlyMode } = this.props;
const { dispatch, readOnlyMode } = this.props;
const styles = require('../../../Common/Layout/LeftSubSidebar/LeftSubSidebar.scss');
@ -32,24 +32,6 @@ class EventTrigger extends Component {
affected_rows
}
}`;
const showIntroSection = !listingTrigger.length;
const getIntroSection = () => {
if (!showIntroSection) {
return null;
}
return (
<div>
<TopicDescription
title="What are Event Triggers?"
imgUrl={`${globals.assetsPath}/common/img/event-trigger.png`}
imgAlt="Event Triggers"
description="Hasura can be used to create event triggers on tables. An Event Trigger atomically captures events (insert, update, delete) on a specified table and then reliably calls a webhook that can carry out any custom logic."
/>
<hr className={styles.clear_fix} />
</div>
);
};
const getAddBtn = () => {
if (readOnlyMode) {
@ -96,7 +78,13 @@ class EventTrigger extends Component {
</div>
<hr />
{getIntroSection()}
<TopicDescription
title="What are Event Triggers?"
imgUrl={`${globals.assetsPath}/common/img/event-trigger.png`}
imgAlt="Event Triggers"
description="Hasura can be used to create event triggers on tables. An Event Trigger atomically captures events (insert, update, delete) on a specified table and then reliably calls a webhook that can carry out any custom logic."
/>
<hr className={styles.clear_fix} />
<TryItOut
service="eventTrigger"
@ -108,7 +96,7 @@ class EventTrigger extends Component {
MicrosoftAzureLink="https://github.com/hasura/graphql-engine/tree/master/community/boilerplates/event-triggers/azure-functions/nodejs"
awsLink="https://github.com/hasura/graphql-engine/tree/master/community/boilerplates/event-triggers/aws-lambda/nodejs8"
adMoreLink="https://github.com/hasura/graphql-engine/tree/master/community/boilerplates/event-triggers/"
isAvailable={showIntroSection}
isAvailable
/>
</div>
</div>

View File

@ -12,25 +12,7 @@ class RemoteSchema extends React.Component {
render() {
const styles = require('../RemoteSchema.scss');
const { dispatch, readOnlyMode, remoteSchemaList } = this.props;
const showIntroSection = !remoteSchemaList.remoteSchemas.length;
const getIntroSection = () => {
if (!showIntroSection) {
return null;
}
return (
<div>
<TopicDescription
title="What are Remote Schemas?"
imgUrl={`${globals.assetsPath}/common/img/remote_schema.png`}
imgAlt="Remote Schema"
description="Remote schemas are external GraphQL services which can be merged with Hasura to provide a unified GraphQL API. Think of it like automated schema stitching. All you need to do is build a GraphQL service and then provide its HTTP endpoint to Hasura. Your GraphQL service can be written in any language or framework."
/>
<hr className={styles.clear_fix} />
</div>
);
};
const { dispatch, readOnlyMode } = this.props;
const getAddBtn = () => {
if (readOnlyMode) {
@ -70,7 +52,13 @@ class RemoteSchema extends React.Component {
</div>
<hr />
{getIntroSection()}
<TopicDescription
title="What are Remote Schemas?"
imgUrl={`${globals.assetsPath}/common/img/remote_schema.png`}
imgAlt="Remote Schema"
description="Remote schemas are external GraphQL services which can be merged with Hasura to provide a unified GraphQL API. Think of it like automated schema stitching. All you need to do is build a GraphQL service and then provide its HTTP endpoint to Hasura. Your GraphQL service can be written in any language or framework."
/>
<hr className={styles.clear_fix} />
<TryItOut
service="remoteSchema"
@ -82,7 +70,7 @@ class RemoteSchema extends React.Component {
MicrosoftAzureLink="https://github.com/hasura/graphql-engine/tree/master/community/boilerplates/remote-schemas/azure-functions/nodejs"
awsLink="https://github.com/hasura/graphql-engine/tree/master/community/boilerplates/remote-schemas/aws-lambda/nodejs"
adMoreLink="https://github.com/hasura/graphql-engine/tree/master/community/boilerplates/remote-schemas/"
isAvailable={showIntroSection}
isAvailable
/>
</div>
</div>