chore: Removes deprecated feature flags for 3.0 (#23663)

This commit is contained in:
Michael S. Molina 2023-04-17 10:48:05 -03:00 committed by GitHub
parent b39edc1002
commit 6234888c69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 9 additions and 32 deletions

View File

@ -93,7 +93,4 @@ These features flags currently default to True and **will be removed in a future
[//]: # "PLEASE KEEP THE LIST SORTED ALPHABETICALLY"
- ALLOW_DASHBOARD_DOMAIN_SHARDING
- DISPLAY_MARKDOWN_HTML
- FORCE_DATABASE_CONNECTIONS_SSL
- GENERIC_CHART_AXES

View File

@ -49,6 +49,7 @@ assists people when migrating to a new version.
### Breaking Changes
- [23651](https://github.com/apache/superset/pull/23651) Removes UX_BETA feature flag.
- [23663](https://github.com/apache/superset/pull/23663) Removes deprecated feature flags `ALLOW_DASHBOARD_DOMAIN_SHARDING`, `DISPLAY_MARKDOWN_HTML`, and `FORCE_DATABASE_CONNECTIONS_SSL`.
- [22798](https://github.com/apache/superset/pull/22798): To make the welcome page more relevant in production environments, the last tab on the welcome page has been changed from to feature all charts/dashboards the user has access to (previously only examples were shown). To keep current behavior unchanged, add the following to your `superset_config.py`: `WELCOME_PAGE_LAST_TAB = "examples"`
- [22328](https://github.com/apache/superset/pull/22328): For deployments that have enabled the "THUMBNAILS" feature flag, the function that calculates dashboard digests has been updated to consider additional properties to more accurately identify changes in the dashboard metadata. This change will invalidate all currently cached dashboard thumbnails.
- [21765](https://github.com/apache/superset/pull/21765): For deployments that have enabled the "ALERT_REPORTS" feature flag, Gamma users will no longer have read and write access to Alerts & Reports by default. To give Gamma users the ability to schedule reports from the Dashboard and Explore view like before, create an additional role with "can read on ReportSchedule" and "can write on ReportSchedule" permissions. To further give Gamma users access to the "Alerts & Reports" menu and CRUD view, add "menu access on Manage" and "menu access on Alerts & Report" permissions to the role.

View File

@ -44,12 +44,11 @@ function SafeMarkdown({
htmlSanitization = true,
htmlSchemaOverrides = {},
}: SafeMarkdownProps) {
const displayHtml = isFeatureEnabled(FeatureFlag.DISPLAY_MARKDOWN_HTML);
const escapeHtml = isFeatureEnabled(FeatureFlag.ESCAPE_MARKDOWN_HTML);
const rehypePlugins = useMemo(() => {
const rehypePlugins: any = [];
if (displayHtml && !escapeHtml) {
if (!escapeHtml) {
rehypePlugins.push(rehypeRaw);
if (htmlSanitization) {
const schema = getOverrideHtmlSchema(
@ -60,14 +59,14 @@ function SafeMarkdown({
}
}
return rehypePlugins;
}, [displayHtml, escapeHtml, htmlSanitization, htmlSchemaOverrides]);
}, [escapeHtml, htmlSanitization, htmlSchemaOverrides]);
// React Markdown escapes HTML by default
return (
<ReactMarkdown
rehypePlugins={rehypePlugins}
remarkPlugins={[remarkGfm]}
skipHtml={!displayHtml}
skipHtml={false}
>
{source}
</ReactMarkdown>

View File

@ -22,7 +22,6 @@ export enum FeatureFlag {
// PLEASE KEEP THE LIST SORTED ALPHABETICALLY
ALERTS_ATTACH_REPORTS = 'ALERTS_ATTACH_REPORTS',
ALERT_REPORTS = 'ALERT_REPORTS',
ALLOW_DASHBOARD_DOMAIN_SHARDING = 'ALLOW_DASHBOARD_DOMAIN_SHARDING',
ALLOW_FULL_CSV_EXPORT = 'ALLOW_FULL_CSV_EXPORT',
CLIENT_CACHE = 'CLIENT_CACHE',
DASHBOARD_CROSS_FILTERS = 'DASHBOARD_CROSS_FILTERS',
@ -36,7 +35,6 @@ export enum FeatureFlag {
DATAPANEL_CLOSED_BY_DEFAULT = 'DATAPANEL_CLOSED_BY_DEFAULT',
DISABLE_DATASET_SOURCE_EDIT = 'DISABLE_DATASET_SOURCE_EDIT',
DISABLE_LEGACY_DATASOURCE_EDITOR = 'DISABLE_LEGACY_DATASOURCE_EDITOR',
DISPLAY_MARKDOWN_HTML = 'DISPLAY_MARKDOWN_HTML',
DRILL_TO_DETAIL = 'DRILL_TO_DETAIL',
DRILL_BY = 'DRILL_BY',
DYNAMIC_PLUGINS = 'DYNAMIC_PLUGINS',
@ -50,7 +48,6 @@ export enum FeatureFlag {
ENABLE_TEMPLATE_REMOVE_FILTERS = 'ENABLE_TEMPLATE_REMOVE_FILTERS',
ESCAPE_MARKDOWN_HTML = 'ESCAPE_MARKDOWN_HTML',
ESTIMATE_QUERY_COST = 'ESTIMATE_QUERY_COST',
FORCE_DATABASE_CONNECTIONS_SSL = 'FORCE_DATABASE_CONNECTIONS_SSL',
GENERIC_CHART_AXES = 'GENERIC_CHART_AXES',
GLOBAL_ASYNC_QUERIES = 'GLOBAL_ASYNC_QUERIES',
HORIZONTAL_FILTER_BAR = 'HORIZONTAL_FILTER_BAR',

View File

@ -25,13 +25,11 @@ it('returns false and raises console error if feature flags have not been initia
value: undefined,
});
expect(isFeatureEnabled(FeatureFlag.ALLOW_DASHBOARD_DOMAIN_SHARDING)).toEqual(
false,
);
expect(isFeatureEnabled(FeatureFlag.DRILL_BY)).toEqual(false);
expect(console.error).toHaveBeenCalled();
// @ts-expect-error
expect(console.error.mock.calls[0][0]).toEqual(
'Failed to query feature flag ALLOW_DASHBOARD_DOMAIN_SHARDING',
'Failed to query feature flag DRILL_BY',
);
});
@ -40,9 +38,7 @@ it('returns false for unset feature flag', () => {
value: {},
});
expect(isFeatureEnabled(FeatureFlag.ALLOW_DASHBOARD_DOMAIN_SHARDING)).toEqual(
false,
);
expect(isFeatureEnabled(FeatureFlag.DRILL_BY)).toEqual(false);
});
it('returns true for set feature flag', () => {

View File

@ -588,9 +588,6 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
const dbImages = getDatabaseImages();
const connectionAlert = getConnectionAlert();
const isEditMode = !!databaseId;
const sslForced = isFeatureEnabled(
FeatureFlag.FORCE_DATABASE_CONNECTIONS_SSL,
);
const disableSSHTunnelingForEngine = (
availableDbs?.databases?.find(
(DB: DatabaseObject) =>
@ -1537,7 +1534,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
<DatabaseConnectionForm
isEditMode={isEditMode}
db={db as DatabaseObject}
sslForced={sslForced}
sslForced={false}
dbModel={dbModel}
onAddTableCatalog={() => {
setDB({ type: ActionType.addTableCatalogSheet });

View File

@ -16,8 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import { FeatureFlag } from '@superset-ui/core';
import { initFeatureFlags, isFeatureEnabled } from 'src/featureFlags';
import { initFeatureFlags } from 'src/featureFlags';
import getBootstrapData from './getBootstrapData';
function getDomainsConfig() {
@ -43,7 +42,6 @@ function getDomainsConfig() {
initFeatureFlags(bootstrapData.common.feature_flags);
if (
isFeatureEnabled(FeatureFlag.ALLOW_DASHBOARD_DOMAIN_SHARDING) &&
bootstrapData &&
bootstrapData.common &&
bootstrapData.common.conf &&

View File

@ -386,10 +386,6 @@ LANGUAGES = {}
# and FEATURE_FLAGS = { 'BAR': True, 'BAZ': True } in superset_config.py
# will result in combined feature flags of { 'FOO': True, 'BAR': True, 'BAZ': True }
DEFAULT_FEATURE_FLAGS: Dict[str, bool] = {
# allow dashboard to use sub-domains to send chart request
# you also need ENABLE_CORS and
# SUPERSET_WEBSERVER_DOMAINS for list of domains
"ALLOW_DASHBOARD_DOMAIN_SHARDING": True,
# Experimental feature introducing a client (browser) cache
"CLIENT_CACHE": False,
"DISABLE_DATASET_SOURCE_EDIT": False,
@ -428,8 +424,6 @@ DEFAULT_FEATURE_FLAGS: Dict[str, bool] = {
"TAGGING_SYSTEM": False,
"SQLLAB_BACKEND_PERSISTENCE": True,
"LISTVIEWS_DEFAULT_CARD_VIEW": False,
# When True, this flag allows display of HTML tags in Markdown components
"DISPLAY_MARKDOWN_HTML": True,
# When True, this escapes HTML (rather than rendering it) in Markdown components
"ESCAPE_MARKDOWN_HTML": False,
"DASHBOARD_NATIVE_FILTERS": True,
@ -454,8 +448,6 @@ DEFAULT_FEATURE_FLAGS: Dict[str, bool] = {
# for report with type 'report' still send with email and slack message with
# screenshot and link
"ALERTS_ATTACH_REPORTS": True,
# FORCE_DATABASE_CONNECTIONS_SSL is depreciated.
"FORCE_DATABASE_CONNECTIONS_SSL": False,
# Allow users to export full CSV of table viz type.
# This could cause the server to run out of memory or compute.
"ALLOW_FULL_CSV_EXPORT": False,