mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-09-20 15:09:02 +03:00
console: add a feature flag for schema sharing
https://github.com/hasura/graphql-engine-mono/pull/1786 GitOrigin-RevId: a35dfa98508a8ef1ea92fe8588e79fc6f8479a2d
This commit is contained in:
parent
9ec40be58d
commit
cdfb71c1da
@ -13,10 +13,10 @@
|
|||||||
field in the connection configuration
|
field in the connection configuration
|
||||||
- server: include action and event names in log output
|
- server: include action and event names in log output
|
||||||
- server: log all HTTP errors in remote schema calls as `remote-schema-error` with details
|
- server: log all HTTP errors in remote schema calls as `remote-schema-error` with details
|
||||||
- console: add schema sharing
|
|
||||||
- server: For BigQuery, make `global_select_limit` configuration optional with a default value of
|
- server: For BigQuery, make `global_select_limit` configuration optional with a default value of
|
||||||
`1000`
|
`1000`
|
||||||
|
|
||||||
|
|
||||||
## v2.0.1
|
## v2.0.1
|
||||||
|
|
||||||
- server: fix resetting metadata catalog version to 43 while initializing postgres source with v1.0 catalog
|
- server: fix resetting metadata catalog version to 43 while initializing postgres source with v1.0 catalog
|
||||||
|
@ -13,7 +13,7 @@ const setup = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const runSchemaSharingTests = () => {
|
export const runSchemaSharingTests = () => {
|
||||||
describe('schema sharing', () => {
|
describe.skip('schema sharing', () => {
|
||||||
it('display content', () => {
|
it('display content', () => {
|
||||||
cy.contains('default').click();
|
cy.contains('default').click();
|
||||||
cy.get('[data-test=schema-container-tabs-data-gallery]').click();
|
cy.get('[data-test=schema-container-tabs-data-gallery]').click();
|
||||||
|
@ -12,6 +12,11 @@ import {
|
|||||||
} from '../../../../../metadata/queryUtils';
|
} from '../../../../../metadata/queryUtils';
|
||||||
import { HasuraMetadataV3 } from '../../../../../metadata/types';
|
import { HasuraMetadataV3 } from '../../../../../metadata/types';
|
||||||
import { SchemaSharingFetchingStatus } from './types';
|
import { SchemaSharingFetchingStatus } from './types';
|
||||||
|
import {
|
||||||
|
BASE_URL_PUBLIC,
|
||||||
|
BASE_URL_TEMPLATE,
|
||||||
|
ROOT_CONFIG_PATH,
|
||||||
|
} from './schemaSharingConfig';
|
||||||
|
|
||||||
type SchemaSharingTemplateDetailFull = {
|
type SchemaSharingTemplateDetailFull = {
|
||||||
sql: string;
|
sql: string;
|
||||||
@ -156,14 +161,6 @@ export const schemaSharingSelectors = {
|
|||||||
.filter(section => section.templates.length > 0),
|
.filter(section => section.templates.length > 0),
|
||||||
};
|
};
|
||||||
|
|
||||||
const repo_owner = 'hasura';
|
|
||||||
const repo_name = 'schema-sharing';
|
|
||||||
const repo_branch = 'main';
|
|
||||||
|
|
||||||
export const BASE_URL_TEMPLATE = `https://raw.githubusercontent.com/${repo_owner}/${repo_name}/${repo_branch}`;
|
|
||||||
export const BASE_URL_PUBLIC = `https://github.com/${repo_owner}/${repo_name}/blob/${repo_branch}`;
|
|
||||||
export const ROOT_CONFIG_PATH = `${BASE_URL_TEMPLATE}/config.json`;
|
|
||||||
|
|
||||||
export const fetchGlobalSchemaSharingConfiguration = createAsyncThunk<
|
export const fetchGlobalSchemaSharingConfiguration = createAsyncThunk<
|
||||||
ServerJsonRootConfig,
|
ServerJsonRootConfig,
|
||||||
undefined,
|
undefined,
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
import { rest } from 'msw';
|
import { rest } from 'msw';
|
||||||
import {
|
import { ServerJsonRootConfig } from '../../Actions';
|
||||||
BASE_URL_TEMPLATE,
|
|
||||||
ROOT_CONFIG_PATH,
|
|
||||||
ServerJsonRootConfig,
|
|
||||||
} from '../../Actions';
|
|
||||||
import { HasuraMetadataV3 } from '../../../../../../../metadata/types';
|
import { HasuraMetadataV3 } from '../../../../../../../metadata/types';
|
||||||
|
import { BASE_URL_TEMPLATE, ROOT_CONFIG_PATH } from '../../schemaSharingConfig';
|
||||||
|
|
||||||
export const CATEGORY_1 = 'AAAAAAAA';
|
export const CATEGORY_1 = 'AAAAAAAA';
|
||||||
export const CATEGORY_2 = 'BBBBBBBB';
|
export const CATEGORY_2 = 'BBBBBBBB';
|
||||||
|
@ -0,0 +1,9 @@
|
|||||||
|
export const isSchemaSharingEnabled = false;
|
||||||
|
|
||||||
|
const repo_owner = 'hasura';
|
||||||
|
const repo_name = 'schema-sharing';
|
||||||
|
const repo_branch = 'main';
|
||||||
|
|
||||||
|
export const BASE_URL_TEMPLATE = `https://raw.githubusercontent.com/${repo_owner}/${repo_name}/${repo_branch}`;
|
||||||
|
export const BASE_URL_PUBLIC = `https://github.com/${repo_owner}/${repo_name}/blob/${repo_branch}`;
|
||||||
|
export const ROOT_CONFIG_PATH = `${BASE_URL_TEMPLATE}/config.json`;
|
@ -10,6 +10,7 @@ import { getSchemaPermissionsRoute } from '../../Common/utils/routesUtils';
|
|||||||
import _push from './push';
|
import _push from './push';
|
||||||
import { isFeatureSupported } from '../../../dataSources';
|
import { isFeatureSupported } from '../../../dataSources';
|
||||||
import Tabbed from './TabbedSchema';
|
import Tabbed from './TabbedSchema';
|
||||||
|
import { isSchemaSharingEnabled } from './Schema/SchemaSharing/schemaSharingConfig';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
dispatch: Dispatch;
|
dispatch: Dispatch;
|
||||||
@ -49,9 +50,16 @@ const SourceView: React.FC<Props> = props => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Tabbed tabName="display" currentDataSource={currentDataSource}>
|
<Tabbed tabName="display" currentDataSource={currentDataSource}>
|
||||||
<div>
|
<div className={styles.display_flex}>
|
||||||
|
{isSchemaSharingEnabled ? null : (
|
||||||
|
<h2
|
||||||
|
className={`${styles.headerText} ${styles.display_inline} ${styles.add_mar_right_mid}`}
|
||||||
|
>
|
||||||
|
{currentDataSource}
|
||||||
|
</h2>
|
||||||
|
)}
|
||||||
{isFeatureSupported('schemas.create.enabled') ? (
|
{isFeatureSupported('schemas.create.enabled') ? (
|
||||||
<span>
|
<>
|
||||||
{!isCreateActive ? (
|
{!isCreateActive ? (
|
||||||
<Button
|
<Button
|
||||||
data-test="data-create-schema"
|
data-test="data-create-schema"
|
||||||
@ -101,7 +109,7 @@ const SourceView: React.FC<Props> = props => {
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</span>
|
</>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
@ -7,6 +7,9 @@ import schemaStyles from './Schema/styles.scss';
|
|||||||
import { Tabs } from '../../Common/Layout/ReusableTabs/ReusableTabs';
|
import { Tabs } from '../../Common/Layout/ReusableTabs/ReusableTabs';
|
||||||
|
|
||||||
import styles from '../../../components/Common/Common.scss';
|
import styles from '../../../components/Common/Common.scss';
|
||||||
|
import { isSchemaSharingEnabled } from './Schema/SchemaSharing/schemaSharingConfig';
|
||||||
|
import { getDataSourceBaseRoute } from '../../Common/utils/routesUtils';
|
||||||
|
import BreadCrumb from '../../Common/Layout/BreadCrumb/BreadCrumb';
|
||||||
|
|
||||||
const tabs: Tabs = {
|
const tabs: Tabs = {
|
||||||
display: {
|
display: {
|
||||||
@ -23,6 +26,28 @@ const TabbedSchema: React.FC<{
|
|||||||
tabName: 'display' | 'gallery';
|
tabName: 'display' | 'gallery';
|
||||||
currentDataSource: string;
|
currentDataSource: string;
|
||||||
}> = ({ children, tabName, currentDataSource }) => {
|
}> = ({ children, tabName, currentDataSource }) => {
|
||||||
|
if (!isSchemaSharingEnabled) {
|
||||||
|
return (
|
||||||
|
<RightContainer>
|
||||||
|
<Helmet title={`${tabs[tabName]?.display_text} - Hasura`} />
|
||||||
|
<div
|
||||||
|
className={`${styles.view_stitch_schema_wrapper} ${styles.addWrapper}`}
|
||||||
|
>
|
||||||
|
<BreadCrumb
|
||||||
|
breadCrumbs={[
|
||||||
|
{ url: `/data`, title: 'Data' },
|
||||||
|
{
|
||||||
|
url: getDataSourceBaseRoute(currentDataSource),
|
||||||
|
title: currentDataSource,
|
||||||
|
prefix: <i className="fa fa-database" />,
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
{children}
|
||||||
|
</div>
|
||||||
|
</RightContainer>
|
||||||
|
);
|
||||||
|
}
|
||||||
const breadCrumbs = [
|
const breadCrumbs = [
|
||||||
{
|
{
|
||||||
title: 'Data',
|
title: 'Data',
|
||||||
|
Loading…
Reference in New Issue
Block a user