mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-14 08:02:15 +03:00
Disable Permissions feature flag for native sources
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9601 GitOrigin-RevId: 02b85aa80a8c3bbb88f32ba2456c8a3e558468be
This commit is contained in:
parent
bd55c39d3a
commit
6c615fb733
@ -101,13 +101,6 @@ import {
|
||||
getPermissionsModalTitle,
|
||||
getPermissionsModalDescription,
|
||||
} from './RootFieldPermissions/PermissionsConfirmationModal.utils';
|
||||
import {
|
||||
FeatureFlagToast,
|
||||
useFeatureFlags,
|
||||
availableFeatureFlagIds,
|
||||
FeatureFlagFloatingButton,
|
||||
} from '../../../../features/FeatureFlags';
|
||||
import { PermissionsTab } from '../../../../features/Permissions/PermissionsTab';
|
||||
import {
|
||||
MetadataSelectors,
|
||||
useMetadata,
|
||||
@ -1977,66 +1970,39 @@ class Permissions extends Component {
|
||||
const supportedQueryTypes =
|
||||
dataSource.getTableSupportedQueries(currentTableSchema);
|
||||
|
||||
const table = {
|
||||
name: this.props.tableName,
|
||||
[this.props.isBigQuery ? 'dataset' : 'schema']: this.props.currentSchema,
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<RightContainer
|
||||
style={
|
||||
// Remove overflow for the new UI because it causes a double scrollbar and broken layout
|
||||
this.props.showNewUI
|
||||
? {
|
||||
overflow: 'unset',
|
||||
}
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
<Analytics name="Permissions" {...REDACT_EVERYTHING}>
|
||||
<div className={clsx(styles.container, 'bootstrap-jail')}>
|
||||
{getHeader(currentTableSchema)}
|
||||
<br />
|
||||
{this.props.showNewUI ? (
|
||||
<PermissionsTab
|
||||
dataSourceName={this.props.currentSource}
|
||||
table={table}
|
||||
/>
|
||||
) : (
|
||||
<>
|
||||
<div className={styles.padd_left_remove}>
|
||||
<div className={`${styles.padd_remove} col-xs-12`}>
|
||||
<h4 className={styles.subheading_text}>Permissions</h4>
|
||||
{getPermissionsTable(
|
||||
currentTableSchema,
|
||||
supportedQueryTypes,
|
||||
allRoles
|
||||
)}
|
||||
{getBulkSection(currentTableSchema)}
|
||||
{getEditSection(
|
||||
currentTableSchema,
|
||||
supportedQueryTypes,
|
||||
allRoles
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<div className={`${styles.fixed} hidden`}>
|
||||
{getAlertHtml(
|
||||
ongoingRequest,
|
||||
lastError,
|
||||
lastSuccess,
|
||||
lastFormError
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
<RightContainer>
|
||||
<Analytics name="Permissions" {...REDACT_EVERYTHING}>
|
||||
<div className={clsx(styles.container, 'bootstrap-jail')}>
|
||||
{getHeader(currentTableSchema)}
|
||||
<br />
|
||||
<div className={styles.padd_left_remove}>
|
||||
<div className={`${styles.padd_remove} col-xs-12`}>
|
||||
<h4 className={styles.subheading_text}>Permissions</h4>
|
||||
{getPermissionsTable(
|
||||
currentTableSchema,
|
||||
supportedQueryTypes,
|
||||
allRoles
|
||||
)}
|
||||
{getBulkSection(currentTableSchema)}
|
||||
{getEditSection(
|
||||
currentTableSchema,
|
||||
supportedQueryTypes,
|
||||
allRoles
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<div className={`${styles.fixed} hidden`}>
|
||||
{getAlertHtml(
|
||||
ongoingRequest,
|
||||
lastError,
|
||||
lastSuccess,
|
||||
lastFormError
|
||||
)}
|
||||
</div>
|
||||
</Analytics>
|
||||
</RightContainer>
|
||||
<FeatureFlagToast flagId={availableFeatureFlagIds.permissionsNewUI} />
|
||||
<FeatureFlagFloatingButton />
|
||||
</>
|
||||
</div>
|
||||
</Analytics>
|
||||
</RightContainer>
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -2075,30 +2041,14 @@ const mapStateToProps = (state, ownProps) => ({
|
||||
});
|
||||
|
||||
const PermissionsWrapper = props => {
|
||||
const { data: featureFlagsData, isLoading: isFeatureFlagsLoading } =
|
||||
useFeatureFlags();
|
||||
|
||||
const { data: source, isLoading: isLoadingMetadata } = useMetadata(
|
||||
MetadataSelectors.findSource(props.currentSource)
|
||||
);
|
||||
const isBigQuery = source?.kind === 'bigquery';
|
||||
|
||||
if (isFeatureFlagsLoading || isLoadingMetadata) return <div>Loading...</div>;
|
||||
if (isLoadingMetadata) return <div>Loading...</div>;
|
||||
|
||||
const newPermissionsTabIsEnabled =
|
||||
featureFlagsData &&
|
||||
featureFlagsData?.length > 0 &&
|
||||
featureFlagsData.find(
|
||||
featureFlag => featureFlag.id === availableFeatureFlagIds.permissionsNewUI
|
||||
)?.state?.enabled;
|
||||
|
||||
return (
|
||||
<Permissions
|
||||
{...props}
|
||||
showNewUI={newPermissionsTabIsEnabled}
|
||||
isBigQuery={isBigQuery}
|
||||
/>
|
||||
);
|
||||
return <Permissions {...props} isBigQuery={isBigQuery} />;
|
||||
};
|
||||
|
||||
const permissionsConnector = connect => {
|
||||
|
@ -4,7 +4,6 @@ import globals from '../../Globals';
|
||||
|
||||
const relationshipTabTablesId = 'f6c57c31-abd3-46d9-aae9-b97435793273';
|
||||
const importActionFromOpenApiId = '12e5aaf4-c794-4b8f-b762-5fda0bff946a';
|
||||
const permissionsNewUI = '5f7b1673-b2ef-4c98-89f7-f30cb64f0136';
|
||||
const trackingSectionUI = 'c2536b28-0ea3-11ee-be56-0242ac120002';
|
||||
|
||||
const importActionFromOpenApi: FeatureFlagDefinition = {
|
||||
@ -21,7 +20,6 @@ const importActionFromOpenApi: FeatureFlagDefinition = {
|
||||
export const availableFeatureFlagIds = {
|
||||
relationshipTabTablesId,
|
||||
importActionFromOpenApiId,
|
||||
permissionsNewUI,
|
||||
trackingSectionUI,
|
||||
};
|
||||
|
||||
@ -36,15 +34,6 @@ export const availableFeatureFlags: FeatureFlagDefinition[] = [
|
||||
defaultValue: true,
|
||||
discussionUrl: '',
|
||||
},
|
||||
{
|
||||
id: permissionsNewUI,
|
||||
title: 'Enable the revamped UI for Permissions',
|
||||
description: 'Try out the new UI experience for setting table permissions.',
|
||||
section: 'data',
|
||||
status: 'experimental',
|
||||
defaultValue: false,
|
||||
discussionUrl: '',
|
||||
},
|
||||
{
|
||||
id: trackingSectionUI,
|
||||
title: 'Enable new Table Tracking UI for Postgres & SQL Server',
|
||||
|
Loading…
Reference in New Issue
Block a user