mirror of
https://github.com/apache/superset.git
synced 2026-04-23 01:55:09 +00:00
fix: feature flags typing (#15254)
* fix: feature flags typing * fix tests * add note in UPDATING.md * fix frontend * also move SCHEDULED_QUERIES to top level * fix test Co-authored-by: Ville Brofeldt <ville.v.brofeldt@gmail.com>
This commit is contained in:
committed by
GitHub
parent
02a9b84b14
commit
69f9ee8f5e
@@ -26,6 +26,12 @@ import { Form, FormItem } from 'src/components/Form';
|
||||
import './ScheduleQueryButton.less';
|
||||
import Button from 'src/components/Button';
|
||||
|
||||
const appContainer = document.getElementById('app');
|
||||
const bootstrapData = JSON.parse(
|
||||
appContainer?.getAttribute('data-bootstrap') || '{}',
|
||||
);
|
||||
const scheduledQueriesConf = bootstrapData?.common?.conf?.SCHEDULED_QUERIES;
|
||||
|
||||
const validators = {
|
||||
greater: (a: number, b: number) => a > b,
|
||||
greater_equal: (a: number, b: number) => a >= b,
|
||||
@@ -34,7 +40,7 @@ const validators = {
|
||||
};
|
||||
|
||||
const getJSONSchema = () => {
|
||||
const jsonSchema = window.featureFlags.SCHEDULED_QUERIES?.JSONSCHEMA;
|
||||
const jsonSchema = scheduledQueriesConf?.JSONSCHEMA;
|
||||
// parse date-time into usable value (eg, 'today' => `new Date()`)
|
||||
if (jsonSchema) {
|
||||
Object.entries(jsonSchema.properties).forEach(
|
||||
@@ -52,10 +58,9 @@ const getJSONSchema = () => {
|
||||
return {};
|
||||
};
|
||||
|
||||
const getUISchema = () => window.featureFlags.SCHEDULED_QUERIES?.UISCHEMA;
|
||||
const getUISchema = () => scheduledQueriesConf?.UISCHEMA;
|
||||
|
||||
const getValidationRules = () =>
|
||||
window.featureFlags.SCHEDULED_QUERIES?.VALIDATION || [];
|
||||
const getValidationRules = () => scheduledQueriesConf?.VALIDATION || [];
|
||||
|
||||
const getValidator = () => {
|
||||
const rules: any = getValidationRules();
|
||||
|
||||
Reference in New Issue
Block a user