mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-14 17:02:49 +03:00
remove console feature version checks (#3494)
This commit is contained in:
parent
eeb0c7acdd
commit
ee9482ffc6
@ -30,7 +30,7 @@ import {
|
||||
setLoveConsentState,
|
||||
} from './loveConsentLocalStorage';
|
||||
|
||||
import { versionGT, FT_JWT_ANALYZER } from '../../helpers/versionUtils';
|
||||
import { versionGT } from '../../helpers/versionUtils';
|
||||
import { getSchemaBaseRoute } from '../Common/utils/routesUtils';
|
||||
|
||||
class Main extends React.Component {
|
||||
@ -65,22 +65,8 @@ class Main extends React.Component {
|
||||
this.setShowUpdateNotification();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
const {
|
||||
[FT_JWT_ANALYZER]: currJwtAnalyzerCompatibility,
|
||||
} = this.props.featuresCompatibility;
|
||||
const {
|
||||
[FT_JWT_ANALYZER]: nextJwtAnalyzerCompatibility,
|
||||
} = nextProps.featuresCompatibility;
|
||||
|
||||
if (
|
||||
currJwtAnalyzerCompatibility !== nextJwtAnalyzerCompatibility &&
|
||||
nextJwtAnalyzerCompatibility
|
||||
) {
|
||||
this.fetchServerConfig();
|
||||
}
|
||||
dispatch(fetchServerConfig());
|
||||
}
|
||||
|
||||
setShowUpdateNotification() {
|
||||
@ -105,12 +91,6 @@ class Main extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
fetchServerConfig() {
|
||||
const { dispatch } = this.props;
|
||||
|
||||
dispatch(fetchServerConfig());
|
||||
}
|
||||
|
||||
handleBodyClick(e) {
|
||||
const heartDropDown = document.getElementById('dropdown_wrapper');
|
||||
const heartDropDownOpen = document.querySelectorAll(
|
||||
|
@ -20,8 +20,6 @@ import { loadInconsistentObjects } from '../Settings/Actions';
|
||||
import { filterInconsistentMetadataObjects } from '../Settings/utils';
|
||||
import globals from '../../../Globals';
|
||||
|
||||
import { COMPUTED_FIELDS_SUPPORT } from '../../../helpers/versionUtils';
|
||||
|
||||
import {
|
||||
fetchTrackedTableReferencedFkQuery,
|
||||
fetchTrackedTableFkQuery,
|
||||
@ -61,16 +59,6 @@ const MAKE_REQUEST = 'ModifyTable/MAKE_REQUEST';
|
||||
const REQUEST_SUCCESS = 'ModifyTable/REQUEST_SUCCESS';
|
||||
const REQUEST_ERROR = 'ModifyTable/REQUEST_ERROR';
|
||||
|
||||
const useCompositeFnsNewCheck =
|
||||
globals.featuresCompatibility &&
|
||||
globals.featuresCompatibility[COMPUTED_FIELDS_SUPPORT];
|
||||
|
||||
const compositeFnCheck = useCompositeFnsNewCheck
|
||||
? 'c'
|
||||
: {
|
||||
$ilike: '%composite%',
|
||||
};
|
||||
|
||||
const initQueries = {
|
||||
schemaList: {
|
||||
type: 'select',
|
||||
@ -134,7 +122,7 @@ const initQueries = {
|
||||
function_schema: '', // needs to be set later
|
||||
has_variadic: false,
|
||||
returns_set: true,
|
||||
return_type_type: compositeFnCheck, // COMPOSITE type
|
||||
return_type_type: 'c', // COMPOSITE type
|
||||
$or: [
|
||||
{
|
||||
function_type: {
|
||||
@ -178,7 +166,7 @@ const initQueries = {
|
||||
$not: {
|
||||
has_variadic: false,
|
||||
returns_set: true,
|
||||
return_type_type: compositeFnCheck, // COMPOSITE type
|
||||
return_type_type: 'c', // COMPOSITE type
|
||||
$or: [
|
||||
{
|
||||
function_type: {
|
||||
|
@ -18,8 +18,6 @@ import { showSuccessNotification } from '../../Common/Notification';
|
||||
|
||||
import { fetchTrackedFunctions } from '../DataActions';
|
||||
|
||||
import { COMPUTED_FIELDS_SUPPORT } from '../../../../helpers/versionUtils';
|
||||
|
||||
import _push from '../push';
|
||||
import { getSchemaBaseRoute } from '../../../Common/utils/routesUtils';
|
||||
|
||||
@ -186,15 +184,8 @@ const deleteFunctionSql = () => {
|
||||
inputArgTypes.forEach((inputArg, i) => {
|
||||
functionArgString += i > 0 ? ', ' : '';
|
||||
|
||||
if (
|
||||
globals.featuresCompatibility &&
|
||||
globals.featuresCompatibility[COMPUTED_FIELDS_SUPPORT]
|
||||
) {
|
||||
functionArgString +=
|
||||
'"' + inputArg.schema + '"' + '.' + '"' + inputArg.name + '"';
|
||||
} else {
|
||||
functionArgString += inputArg;
|
||||
}
|
||||
functionArgString +=
|
||||
'"' + inputArg.schema + '"' + '.' + '"' + inputArg.name + '"';
|
||||
});
|
||||
functionArgString += ')';
|
||||
}
|
||||
|
@ -5,10 +5,6 @@ import CustomInputAutoSuggest from '../../../Common/CustomInputAutoSuggest/Custo
|
||||
|
||||
import { getValidAlterOptions } from './utils';
|
||||
import Tooltip from '../../../Common/Tooltip/Tooltip';
|
||||
import {
|
||||
checkFeatureSupport,
|
||||
CUSTOM_GRAPHQL_FIELDS_SUPPORT,
|
||||
} from '../../../../helpers/versionUtils';
|
||||
|
||||
const ColumnEditor = ({
|
||||
onSubmit,
|
||||
@ -80,8 +76,6 @@ const ColumnEditor = ({
|
||||
};
|
||||
|
||||
const getColumnCustomFieldInput = () => {
|
||||
if (!checkFeatureSupport(CUSTOM_GRAPHQL_FIELDS_SUPPORT)) return;
|
||||
|
||||
return (
|
||||
<div className={`${styles.display_flex} form-group`}>
|
||||
<label className={'col-xs-4'}>
|
||||
|
@ -22,10 +22,6 @@ import GqlCompatibilityWarning from '../../../Common/GqlCompatibilityWarning/Gql
|
||||
|
||||
import styles from './ModifyTable.scss';
|
||||
import { getConfirmation } from '../../../Common/utils/jsUtils';
|
||||
import {
|
||||
checkFeatureSupport,
|
||||
CUSTOM_GRAPHQL_FIELDS_SUPPORT,
|
||||
} from '../../../../helpers/versionUtils';
|
||||
|
||||
const ColumnEditorList = ({
|
||||
tableSchema,
|
||||
@ -82,12 +78,9 @@ const ColumnEditorList = ({
|
||||
// uniqueConstraint: columnUniqueConstraints[colName],
|
||||
default: col.column_default || '',
|
||||
comment: col.comment || '',
|
||||
customFieldName: customColumnNames[colName] || '',
|
||||
};
|
||||
|
||||
if (checkFeatureSupport(CUSTOM_GRAPHQL_FIELDS_SUPPORT)) {
|
||||
columnProperties.customFieldName = customColumnNames[colName] || '';
|
||||
}
|
||||
|
||||
const onSubmit = toggleEditor => {
|
||||
dispatch(saveColumnChangesSql(colName, col, toggleEditor));
|
||||
};
|
||||
|
@ -60,11 +60,6 @@ import {
|
||||
getTableModifyRoute,
|
||||
} from '../../../Common/utils/routesUtils';
|
||||
|
||||
import {
|
||||
checkFeatureSupport,
|
||||
CUSTOM_GRAPHQL_FIELDS_SUPPORT,
|
||||
} from '../../../../helpers/versionUtils';
|
||||
|
||||
const DELETE_PK_WARNING =
|
||||
'Without a primary key there is no way to uniquely identify a row of a table';
|
||||
|
||||
@ -1623,42 +1618,46 @@ const saveColumnChangesSql = (colName, column, onSuccess) => {
|
||||
: [];
|
||||
|
||||
/* column custom field up/down migration*/
|
||||
if (checkFeatureSupport(CUSTOM_GRAPHQL_FIELDS_SUPPORT)) {
|
||||
const existingCustomColumnNames = getTableCustomColumnNames(table);
|
||||
const existingRootFields = getTableCustomRootFields(table);
|
||||
const newCustomColumnNames = { ...existingCustomColumnNames };
|
||||
let isCustomFieldNameChanged = false;
|
||||
if (customFieldName) {
|
||||
if (customFieldName !== existingCustomColumnNames[colName]) {
|
||||
isCustomFieldNameChanged = true;
|
||||
newCustomColumnNames[colName] = customFieldName;
|
||||
}
|
||||
} else {
|
||||
if (existingCustomColumnNames[colName]) {
|
||||
isCustomFieldNameChanged = true;
|
||||
delete newCustomColumnNames[colName];
|
||||
}
|
||||
const existingCustomColumnNames = getTableCustomColumnNames(table);
|
||||
const existingRootFields = getTableCustomRootFields(table);
|
||||
const newCustomColumnNames = { ...existingCustomColumnNames };
|
||||
let isCustomFieldNameChanged = false;
|
||||
if (customFieldName) {
|
||||
if (customFieldName !== existingCustomColumnNames[colName]) {
|
||||
isCustomFieldNameChanged = true;
|
||||
newCustomColumnNames[colName] = customFieldName.trim();
|
||||
}
|
||||
if (isCustomFieldNameChanged) {
|
||||
schemaChangesUp.push(
|
||||
getSetCustomRootFieldsQuery(
|
||||
tableDef,
|
||||
existingRootFields,
|
||||
newCustomColumnNames
|
||||
)
|
||||
);
|
||||
schemaChangesDown.push(
|
||||
getSetCustomRootFieldsQuery(
|
||||
tableDef,
|
||||
existingRootFields,
|
||||
existingCustomColumnNames
|
||||
)
|
||||
);
|
||||
} else {
|
||||
if (existingCustomColumnNames[colName]) {
|
||||
isCustomFieldNameChanged = true;
|
||||
delete newCustomColumnNames[colName];
|
||||
}
|
||||
}
|
||||
if (isCustomFieldNameChanged) {
|
||||
schemaChangesUp.push(
|
||||
getSetCustomRootFieldsQuery(
|
||||
tableDef,
|
||||
existingRootFields,
|
||||
newCustomColumnNames
|
||||
)
|
||||
);
|
||||
schemaChangesDown.push(
|
||||
getSetCustomRootFieldsQuery(
|
||||
tableDef,
|
||||
existingRootFields,
|
||||
existingCustomColumnNames
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
const colDefaultWithQuotes = (colType === 'text' && !isPostgresFunction(colDefault)) ? `'${colDefault}'` : colDefault;
|
||||
const originalColDefaultWithQuotes = (colType === 'text' && !isPostgresFunction(originalColDefault)) ? `'${originalColDefault}'` : originalColDefault;
|
||||
const colDefaultWithQuotes =
|
||||
colType === 'text' && !isPostgresFunction(colDefault)
|
||||
? `'${colDefault}'`
|
||||
: colDefault;
|
||||
const originalColDefaultWithQuotes =
|
||||
colType === 'text' && !isPostgresFunction(originalColDefault)
|
||||
? `'${originalColDefault}'`
|
||||
: originalColDefault;
|
||||
|
||||
/* column default up/down migration */
|
||||
let columnDefaultUpQuery;
|
||||
@ -1701,37 +1700,37 @@ const saveColumnChangesSql = (colName, column, onSuccess) => {
|
||||
|
||||
if (originalColDefault !== '') {
|
||||
columnDefaultDownQuery =
|
||||
'ALTER TABLE ONLY ' +
|
||||
'"' +
|
||||
currentSchema +
|
||||
'"' +
|
||||
'.' +
|
||||
'"' +
|
||||
tableName +
|
||||
'"' +
|
||||
' ALTER COLUMN ' +
|
||||
'"' +
|
||||
colName +
|
||||
'"' +
|
||||
' SET DEFAULT ' +
|
||||
originalColDefaultWithQuotes +
|
||||
';';
|
||||
'ALTER TABLE ONLY ' +
|
||||
'"' +
|
||||
currentSchema +
|
||||
'"' +
|
||||
'.' +
|
||||
'"' +
|
||||
tableName +
|
||||
'"' +
|
||||
' ALTER COLUMN ' +
|
||||
'"' +
|
||||
colName +
|
||||
'"' +
|
||||
' SET DEFAULT ' +
|
||||
originalColDefaultWithQuotes +
|
||||
';';
|
||||
} else {
|
||||
// there was no default value originally. so drop default.
|
||||
columnDefaultDownQuery =
|
||||
'ALTER TABLE ONLY ' +
|
||||
'"' +
|
||||
currentSchema +
|
||||
'"' +
|
||||
'.' +
|
||||
'"' +
|
||||
tableName +
|
||||
'"' +
|
||||
' ALTER COLUMN ' +
|
||||
'"' +
|
||||
colName +
|
||||
'"' +
|
||||
' DROP DEFAULT;';
|
||||
'ALTER TABLE ONLY ' +
|
||||
'"' +
|
||||
currentSchema +
|
||||
'"' +
|
||||
'.' +
|
||||
'"' +
|
||||
tableName +
|
||||
'"' +
|
||||
' ALTER COLUMN ' +
|
||||
'"' +
|
||||
colName +
|
||||
'"' +
|
||||
' DROP DEFAULT;';
|
||||
}
|
||||
|
||||
// check if default is unchanged and then do a drop. if not skip
|
||||
|
@ -4,13 +4,6 @@ import TableHeader from '../TableCommon/TableHeader';
|
||||
|
||||
import { getAllDataTypeMap } from '../Common/utils';
|
||||
|
||||
import {
|
||||
checkFeatureSupport,
|
||||
CUSTOM_GRAPHQL_FIELDS_SUPPORT,
|
||||
TABLE_ENUMS_SUPPORT,
|
||||
} from '../../../../helpers/versionUtils';
|
||||
import globals from '../../../../Globals';
|
||||
|
||||
import {
|
||||
deleteTableSql,
|
||||
untrackTableSql,
|
||||
@ -136,11 +129,6 @@ class ModifyTable extends React.Component {
|
||||
);
|
||||
|
||||
const getEnumsSection = () => {
|
||||
const supportEnums =
|
||||
globals.featuresCompatibility &&
|
||||
globals.featuresCompatibility[TABLE_ENUMS_SUPPORT];
|
||||
if (!supportEnums) return null;
|
||||
|
||||
const toggleEnum = () => dispatch(toggleTableAsEnum(table.is_enum));
|
||||
|
||||
return (
|
||||
@ -157,8 +145,6 @@ class ModifyTable extends React.Component {
|
||||
|
||||
// if (table.primary_key.columns > 0) {}
|
||||
const getTableRootFieldsSection = () => {
|
||||
if (!checkFeatureSupport(CUSTOM_GRAPHQL_FIELDS_SUPPORT)) return null;
|
||||
|
||||
const existingRootFields = getTableCustomRootFields(table);
|
||||
|
||||
return (
|
||||
|
@ -15,10 +15,6 @@ import Button from '../../../Common/Button/Button';
|
||||
import { NotFoundError } from '../../../Error/PageNotFound';
|
||||
|
||||
import { getConfirmation } from '../../../Common/utils/jsUtils';
|
||||
import {
|
||||
checkFeatureSupport,
|
||||
CUSTOM_GRAPHQL_FIELDS_SUPPORT,
|
||||
} from '../../../../helpers/versionUtils';
|
||||
import {
|
||||
findTable,
|
||||
generateTableDef,
|
||||
@ -117,8 +113,6 @@ class ModifyView extends Component {
|
||||
};
|
||||
|
||||
const getViewRootFieldsSection = () => {
|
||||
if (!checkFeatureSupport(CUSTOM_GRAPHQL_FIELDS_SUPPORT)) return null;
|
||||
|
||||
const existingRootFields = getTableCustomRootFields(tableSchema);
|
||||
|
||||
return (
|
||||
|
@ -44,9 +44,6 @@ import {
|
||||
isObject,
|
||||
} from '../../../../Common/utils/jsUtils';
|
||||
|
||||
import { EXISTS_PERMISSION_SUPPORT } from '../../../../../helpers/versionUtils';
|
||||
import globals from '../../../../../Globals';
|
||||
|
||||
class PermissionBuilder extends React.Component {
|
||||
static propTypes = {
|
||||
allTableSchemas: PropTypes.array.isRequired,
|
||||
@ -894,20 +891,11 @@ class PermissionBuilder extends React.Component {
|
||||
|
||||
const columnOptions = tableColumnNames.concat(tableRelationshipNames);
|
||||
|
||||
const existsSupported =
|
||||
globals.featuresCompatibility &&
|
||||
globals.featuresCompatibility[EXISTS_PERMISSION_SUPPORT];
|
||||
|
||||
let operatorOptions;
|
||||
if (existsSupported) {
|
||||
operatorOptions = boolOperators
|
||||
.concat(['---'])
|
||||
.concat(existOperators)
|
||||
.concat(['---'])
|
||||
.concat(columnOptions);
|
||||
} else {
|
||||
operatorOptions = boolOperators.concat(['---']).concat(columnOptions);
|
||||
}
|
||||
const operatorOptions = boolOperators
|
||||
.concat(['---'])
|
||||
.concat(existOperators)
|
||||
.concat(['---'])
|
||||
.concat(columnOptions);
|
||||
|
||||
const _boolExpKey = renderSelect(
|
||||
dispatchOperationSelect,
|
||||
|
@ -1,6 +1,4 @@
|
||||
import {
|
||||
TABLE_ENUMS_SUPPORT,
|
||||
CUSTOM_GRAPHQL_FIELDS_SUPPORT,
|
||||
READ_ONLY_RUN_SQL_QUERIES,
|
||||
checkFeatureSupport,
|
||||
} from '../../../helpers/versionUtils';
|
||||
@ -216,6 +214,8 @@ export const fetchTrackedTableListQuery = options => {
|
||||
columns: [
|
||||
'table_schema',
|
||||
'table_name',
|
||||
'is_enum',
|
||||
'configuration',
|
||||
{
|
||||
name: 'primary_key',
|
||||
columns: ['*'],
|
||||
@ -245,14 +245,6 @@ export const fetchTrackedTableListQuery = options => {
|
||||
},
|
||||
};
|
||||
|
||||
if (checkFeatureSupport(TABLE_ENUMS_SUPPORT)) {
|
||||
query.args.columns.push('is_enum');
|
||||
}
|
||||
|
||||
if (checkFeatureSupport(CUSTOM_GRAPHQL_FIELDS_SUPPORT)) {
|
||||
query.args.columns.push('configuration');
|
||||
}
|
||||
|
||||
if (
|
||||
(options.schemas && options.schemas.length !== 0) ||
|
||||
(options.tables && options.tables.length !== 0)
|
||||
|
@ -21,7 +21,6 @@ import { getEventTriggersQuery } from './utils';
|
||||
|
||||
import { CLI_CONSOLE_MODE, SERVER_CONSOLE_MODE } from '../../../constants';
|
||||
import { REQUEST_COMPLETE, REQUEST_ONGOING } from './Modify/Actions';
|
||||
import { IMPROVED_EVENT_FETCH_QUERY } from '../../../helpers/versionUtils';
|
||||
|
||||
const SET_TRIGGER = 'Event/SET_TRIGGER';
|
||||
const LOAD_TRIGGER_LIST = 'Event/LOAD_TRIGGER_LIST';
|
||||
@ -107,7 +106,7 @@ const loadPendingEvents = () => (dispatch, getState) => {
|
||||
'*',
|
||||
{ name: 'logs', columns: ['*'], order_by: ['-created_at'] },
|
||||
],
|
||||
where: { delivered: false, error: false, tries: 0 },
|
||||
where: { delivered: false, error: false, tries: 0, archived: false },
|
||||
order_by: ['-created_at'],
|
||||
limit: 10,
|
||||
},
|
||||
@ -115,13 +114,6 @@ const loadPendingEvents = () => (dispatch, getState) => {
|
||||
},
|
||||
};
|
||||
|
||||
if (
|
||||
globals.featuresCompatibility &&
|
||||
globals.featuresCompatibility[IMPROVED_EVENT_FETCH_QUERY]
|
||||
) {
|
||||
body.args.columns[1].where.archived = false;
|
||||
}
|
||||
|
||||
const options = {
|
||||
credentials: globalCookiePolicy,
|
||||
method: 'POST',
|
||||
@ -155,7 +147,12 @@ const loadRunningEvents = () => (dispatch, getState) => {
|
||||
'*',
|
||||
{ name: 'logs', columns: ['*'], order_by: ['-created_at'] },
|
||||
],
|
||||
where: { delivered: false, error: false, tries: { $gt: 0 } },
|
||||
where: {
|
||||
delivered: false,
|
||||
error: false,
|
||||
tries: { $gt: 0 },
|
||||
archived: false,
|
||||
},
|
||||
order_by: ['-created_at'],
|
||||
limit: 10,
|
||||
},
|
||||
@ -163,13 +160,6 @@ const loadRunningEvents = () => (dispatch, getState) => {
|
||||
},
|
||||
};
|
||||
|
||||
if (
|
||||
globals.featuresCompatibility &&
|
||||
globals.featuresCompatibility[IMPROVED_EVENT_FETCH_QUERY]
|
||||
) {
|
||||
body.args.columns[1].where.archived = false;
|
||||
}
|
||||
|
||||
const options = {
|
||||
credentials: globalCookiePolicy,
|
||||
method: 'POST',
|
||||
@ -226,7 +216,9 @@ const loadEventLogs = triggerName => (dispatch, getState) => {
|
||||
columns: ['*'],
|
||||
},
|
||||
],
|
||||
where: { event: { trigger_name: triggerData[0].name } },
|
||||
where: {
|
||||
event: { trigger_name: triggerData[0].name, archived: false },
|
||||
},
|
||||
order_by: ['-created_at'],
|
||||
limit: 10,
|
||||
},
|
||||
@ -234,13 +226,6 @@ const loadEventLogs = triggerName => (dispatch, getState) => {
|
||||
],
|
||||
};
|
||||
|
||||
if (
|
||||
globals.featuresCompatibility &&
|
||||
globals.featuresCompatibility[IMPROVED_EVENT_FETCH_QUERY]
|
||||
) {
|
||||
body.args[0].args.where.event.archived = false;
|
||||
}
|
||||
|
||||
const logOptions = {
|
||||
credentials: globalCookiePolicy,
|
||||
method: 'POST',
|
||||
|
@ -4,8 +4,6 @@ import requestAction from '../../../../utils/requestAction';
|
||||
import pendingFilterReducer from './FilterActions';
|
||||
import { findTableFromRel } from '../utils';
|
||||
import dataHeaders from '../Common/Headers';
|
||||
import globals from '../../../../Globals';
|
||||
import { IMPROVED_EVENT_FETCH_QUERY } from '../../../../helpers/versionUtils';
|
||||
|
||||
/* ****************** View actions *************/
|
||||
const V_SET_DEFAULTS = 'PendingEvents/V_SET_DEFAULTS';
|
||||
@ -58,6 +56,7 @@ const vMakeRequest = () => {
|
||||
currentQuery.columns[1].where = {
|
||||
delivered: false,
|
||||
error: false,
|
||||
archived: false,
|
||||
};
|
||||
}
|
||||
currentQuery.where = { name: state.triggers.currentTrigger };
|
||||
@ -65,20 +64,10 @@ const vMakeRequest = () => {
|
||||
trigger_name: state.triggers.currentTrigger,
|
||||
delivered: false,
|
||||
error: false,
|
||||
archived: false,
|
||||
};
|
||||
}
|
||||
|
||||
if (
|
||||
globals.featuresCompatibility &&
|
||||
globals.featuresCompatibility[IMPROVED_EVENT_FETCH_QUERY]
|
||||
) {
|
||||
if (currentQuery.columns[1]) {
|
||||
currentQuery.columns[1].where = currentQuery.columns[1].where || {};
|
||||
currentQuery.columns[1].where.archived = false;
|
||||
}
|
||||
countQuery.where.archived = false;
|
||||
}
|
||||
|
||||
// order_by for relationship
|
||||
const currentOrderBy = state.triggers.view.query.order_by;
|
||||
if (currentOrderBy) {
|
||||
|
@ -9,8 +9,6 @@ import {
|
||||
} from '../../Common/Notification';
|
||||
import dataHeaders from '../Common/Headers';
|
||||
import { getConfirmation } from '../../../Common/utils/jsUtils';
|
||||
import globals from '../../../../Globals';
|
||||
import { IMPROVED_EVENT_FETCH_QUERY } from '../../../../helpers/versionUtils';
|
||||
|
||||
/* ****************** View actions *************/
|
||||
const V_SET_DEFAULTS = 'ProcessedEvents/V_SET_DEFAULTS';
|
||||
@ -71,6 +69,7 @@ const vMakeRequest = () => {
|
||||
if (currentQuery.columns[1]) {
|
||||
currentQuery.columns[1].where = {
|
||||
$or: [{ delivered: { $eq: true } }, { error: { $eq: true } }],
|
||||
archived: false,
|
||||
};
|
||||
}
|
||||
currentQuery.where = { name: state.triggers.currentTrigger };
|
||||
@ -79,20 +78,10 @@ const vMakeRequest = () => {
|
||||
{ trigger_name: state.triggers.currentTrigger },
|
||||
{ $or: [{ delivered: { $eq: true } }, { error: { $eq: true } }] },
|
||||
],
|
||||
archived: false,
|
||||
};
|
||||
}
|
||||
|
||||
if (
|
||||
globals.featuresCompatibility &&
|
||||
globals.featuresCompatibility[IMPROVED_EVENT_FETCH_QUERY]
|
||||
) {
|
||||
if (currentQuery.columns[1]) {
|
||||
currentQuery.columns[1].where = currentQuery.columns[1].where || {};
|
||||
currentQuery.columns[1].where.archived = false;
|
||||
}
|
||||
countQuery.where.archived = false;
|
||||
}
|
||||
|
||||
// order_by for relationship
|
||||
const currentOrderBy = state.triggers.view.query.order_by;
|
||||
if (currentOrderBy) {
|
||||
|
@ -4,8 +4,6 @@ import requestAction from 'utils/requestAction';
|
||||
import pendingFilterReducer from './FilterActions';
|
||||
import { findTableFromRel } from '../utils';
|
||||
import dataHeaders from '../Common/Headers';
|
||||
import globals from '../../../../Globals';
|
||||
import { IMPROVED_EVENT_FETCH_QUERY } from '../../../../helpers/versionUtils';
|
||||
|
||||
/* ****************** View actions *************/
|
||||
const V_SET_DEFAULTS = 'RunningEvents/V_SET_DEFAULTS';
|
||||
@ -63,6 +61,7 @@ const vMakeRequest = () => {
|
||||
delivered: false,
|
||||
error: false,
|
||||
tries: { $gt: 0 },
|
||||
archived: false,
|
||||
};
|
||||
}
|
||||
currentQuery.where = { name: state.triggers.currentTrigger };
|
||||
@ -71,20 +70,10 @@ const vMakeRequest = () => {
|
||||
delivered: false,
|
||||
error: false,
|
||||
tries: { $gt: 0 },
|
||||
archived: false,
|
||||
};
|
||||
}
|
||||
|
||||
if (
|
||||
globals.featuresCompatibility &&
|
||||
globals.featuresCompatibility[IMPROVED_EVENT_FETCH_QUERY]
|
||||
) {
|
||||
if (currentQuery.columns[1]) {
|
||||
currentQuery.columns[1].where = currentQuery.columns[1].where || {};
|
||||
currentQuery.columns[1].where.archived = false;
|
||||
}
|
||||
countQuery.where.archived = false;
|
||||
}
|
||||
|
||||
// order_by for relationship
|
||||
const currentOrderBy = state.triggers.view.query.order_by;
|
||||
if (currentOrderBy) {
|
||||
|
@ -2,8 +2,6 @@ import { defaultLogState } from '../EventState';
|
||||
import Endpoints, { globalCookiePolicy } from '../../../../Endpoints';
|
||||
import requestAction from 'utils/requestAction';
|
||||
import dataHeaders from '../Common/Headers';
|
||||
import globals from '../../../../Globals';
|
||||
import { IMPROVED_EVENT_FETCH_QUERY } from '../../../../helpers/versionUtils';
|
||||
|
||||
/* ****************** View actions *************/
|
||||
const V_SET_DEFAULTS = 'StreamingLogs/V_SET_DEFAULTS';
|
||||
@ -42,15 +40,10 @@ const vMakeRequest = triggerName => {
|
||||
const countQuery = JSON.parse(JSON.stringify(state.triggers.log.query));
|
||||
countQuery.columns = ['id'];
|
||||
|
||||
currentQuery.where = { event: { trigger_name: triggerName } };
|
||||
|
||||
if (
|
||||
globals.featuresCompatibility &&
|
||||
globals.featuresCompatibility[IMPROVED_EVENT_FETCH_QUERY]
|
||||
) {
|
||||
currentQuery.where.event.archived = false;
|
||||
countQuery.where.event.archived = false;
|
||||
}
|
||||
currentQuery.where = {
|
||||
event: { trigger_name: triggerName, archived: false },
|
||||
};
|
||||
countQuery.where.event.archived = false;
|
||||
|
||||
// order_by for relationship
|
||||
currentQuery.order_by = ['-created_at'];
|
||||
@ -118,17 +111,11 @@ const loadNewerEvents = (latestTimestamp, triggerName) => {
|
||||
countQuery.columns = ['id'];
|
||||
|
||||
currentQuery.where = {
|
||||
event: { trigger_name: triggerName },
|
||||
event: { trigger_name: triggerName, archived: false },
|
||||
created_at: { $gt: latestTimestamp },
|
||||
};
|
||||
|
||||
if (
|
||||
globals.featuresCompatibility &&
|
||||
globals.featuresCompatibility[IMPROVED_EVENT_FETCH_QUERY]
|
||||
) {
|
||||
currentQuery.where.event.archived = false;
|
||||
countQuery.where.event.archived = false;
|
||||
}
|
||||
countQuery.where.event.archived = false;
|
||||
|
||||
// order_by for relationship
|
||||
currentQuery.order_by = ['-created_at'];
|
||||
@ -216,17 +203,11 @@ const loadOlderEvents = (oldestTimestamp, triggerName) => {
|
||||
countQuery.columns = ['id'];
|
||||
|
||||
currentQuery.where = {
|
||||
event: { trigger_name: triggerName },
|
||||
event: { trigger_name: triggerName, archived: false },
|
||||
created_at: { $lt: oldestTimestamp },
|
||||
};
|
||||
|
||||
if (
|
||||
globals.featuresCompatibility &&
|
||||
globals.featuresCompatibility[IMPROVED_EVENT_FETCH_QUERY]
|
||||
) {
|
||||
currentQuery.where.event.archived = false;
|
||||
countQuery.where.event.archived = false;
|
||||
}
|
||||
countQuery.where.event.archived = false;
|
||||
|
||||
// order_by for relationship
|
||||
currentQuery.order_by = ['-created_at'];
|
||||
|
@ -1,6 +1,4 @@
|
||||
import React from 'react';
|
||||
import globals from '../../../../Globals';
|
||||
import { REMOTE_SCHEMA_TIMEOUT_CONF_SUPPORT } from '../../../../helpers/versionUtils';
|
||||
import PropTypes from 'prop-types';
|
||||
import OverlayTrigger from 'react-bootstrap/lib/OverlayTrigger';
|
||||
import Tooltip from 'react-bootstrap/lib/Tooltip';
|
||||
@ -81,14 +79,6 @@ class Common extends React.Component {
|
||||
};
|
||||
|
||||
const getTimeoutSection = () => {
|
||||
const supportTimeoutConf =
|
||||
globals.featuresCompatibility &&
|
||||
globals.featuresCompatibility[REMOTE_SCHEMA_TIMEOUT_CONF_SUPPORT];
|
||||
|
||||
if (!supportTimeoutConf) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div className={styles.subheading_text}>
|
||||
|
@ -4,7 +4,6 @@ import globals from '../../../Globals';
|
||||
import endpoints from '../../../Endpoints';
|
||||
import defaultState from './State';
|
||||
import { filterInconsistentMetadataObjects } from './utils';
|
||||
import { RELOAD_METADATA_API_CHANGE } from '../../../helpers/versionUtils';
|
||||
import {
|
||||
setConsistentSchema,
|
||||
setConsistentFunctions,
|
||||
@ -261,11 +260,10 @@ export const loadInconsistentObjects = (
|
||||
export const reloadRemoteSchema = (remoteSchemaName, successCb, failureCb) => {
|
||||
return (dispatch, getState) => {
|
||||
const headers = getState().tables.dataHeaders;
|
||||
const { featuresCompatibility } = getState().main;
|
||||
|
||||
const reloadQuery = featuresCompatibility[RELOAD_METADATA_API_CHANGE]
|
||||
? reloadRemoteSchemaCacheAndGetInconsistentObjectsQuery(remoteSchemaName)
|
||||
: reloadCacheAndGetInconsistentObjectsQuery;
|
||||
const reloadQuery = reloadRemoteSchemaCacheAndGetInconsistentObjectsQuery(
|
||||
remoteSchemaName
|
||||
);
|
||||
|
||||
dispatch({ type: LOADING_METADATA });
|
||||
return dispatch(
|
||||
|
@ -2,29 +2,12 @@ import globals from '../Globals';
|
||||
|
||||
const semver = require('semver');
|
||||
|
||||
export const FT_JWT_ANALYZER = 'JWTAnalyzer';
|
||||
export const RELOAD_METADATA_API_CHANGE = 'reloadMetaDataApiChange';
|
||||
export const REMOTE_SCHEMA_TIMEOUT_CONF_SUPPORT =
|
||||
'remoteSchemaTimeoutConfSupport';
|
||||
export const TABLE_ENUMS_SUPPORT = 'tableEnumsSupport';
|
||||
export const EXISTS_PERMISSION_SUPPORT = 'existsPermissionSupport';
|
||||
export const CUSTOM_GRAPHQL_FIELDS_SUPPORT = 'customGraphQLFieldsSupport';
|
||||
export const COMPUTED_FIELDS_SUPPORT = 'computedFieldsSupport';
|
||||
export const IMPROVED_EVENT_FETCH_QUERY = 'improvedEventFetchQuery';
|
||||
export const READ_ONLY_RUN_SQL_QUERIES = 'readOnlyRunSqlQueries';
|
||||
|
||||
// list of feature launch versions
|
||||
const featureLaunchVersions = {
|
||||
// feature: 'v1.0.0'
|
||||
[RELOAD_METADATA_API_CHANGE]: 'v1.0.0-beta.3',
|
||||
[FT_JWT_ANALYZER]: 'v1.0.0-beta.3',
|
||||
[REMOTE_SCHEMA_TIMEOUT_CONF_SUPPORT]: 'v1.0.0-beta.5',
|
||||
[TABLE_ENUMS_SUPPORT]: 'v1.0.0-beta.6',
|
||||
[EXISTS_PERMISSION_SUPPORT]: 'v1.0.0-beta.7',
|
||||
[CUSTOM_GRAPHQL_FIELDS_SUPPORT]: 'v1.0.0-beta.8',
|
||||
[COMPUTED_FIELDS_SUPPORT]: 'v1.0.0-beta.8',
|
||||
[IMPROVED_EVENT_FETCH_QUERY]: 'v1.0.0-beta.10',
|
||||
[READ_ONLY_RUN_SQL_QUERIES]: 'v1.0.0-rc.2',
|
||||
[READ_ONLY_RUN_SQL_QUERIES]: 'v1.1.0',
|
||||
};
|
||||
|
||||
export const checkValidServerVersion = version => {
|
||||
|
Loading…
Reference in New Issue
Block a user