mirror of
https://github.com/apache/superset.git
synced 2026-04-20 00:24:38 +00:00
chore: make TS enums strictly PascalCase (#26875)
This commit is contained in:
@@ -108,8 +108,8 @@ export const addDangerToast = addDangerToastAction;
|
||||
export const addWarningToast = addWarningToastAction;
|
||||
|
||||
export const CtasEnum = {
|
||||
TABLE: 'TABLE',
|
||||
VIEW: 'VIEW',
|
||||
Table: 'TABLE',
|
||||
View: 'VIEW',
|
||||
};
|
||||
const ERR_MSG_CANT_LOAD_QUERY = t("The query couldn't be loaded");
|
||||
|
||||
@@ -513,7 +513,7 @@ export function migrateQueryEditorFromLocalStorage(
|
||||
|
||||
export function addQueryEditor(queryEditor) {
|
||||
return function (dispatch) {
|
||||
const sync = isFeatureEnabled(FeatureFlag.SQLLAB_BACKEND_PERSISTENCE)
|
||||
const sync = isFeatureEnabled(FeatureFlag.SqllabBackendPersistence)
|
||||
? SupersetClient.post({
|
||||
endpoint: '/tabstateview/',
|
||||
postPayload: { queryEditor },
|
||||
@@ -562,7 +562,7 @@ export function addNewQueryEditor() {
|
||||
...(unsavedQueryEditor.id === activeQueryEditor?.id &&
|
||||
unsavedQueryEditor),
|
||||
};
|
||||
const warning = isFeatureEnabled(FeatureFlag.SQLLAB_BACKEND_PERSISTENCE)
|
||||
const warning = isFeatureEnabled(FeatureFlag.SqllabBackendPersistence)
|
||||
? ''
|
||||
: t(
|
||||
'-- Note: Unless you save your query, these tabs will NOT persist if you clear your cookies or change browsers.\n\n',
|
||||
@@ -613,7 +613,7 @@ export function cloneQueryToNewTab(query, autorun) {
|
||||
|
||||
export function setActiveQueryEditor(queryEditor) {
|
||||
return function (dispatch) {
|
||||
const sync = isFeatureEnabled(FeatureFlag.SQLLAB_BACKEND_PERSISTENCE)
|
||||
const sync = isFeatureEnabled(FeatureFlag.SqllabBackendPersistence)
|
||||
? SupersetClient.post({
|
||||
endpoint: encodeURI(`/tabstateview/${queryEditor.id}/activate`),
|
||||
})
|
||||
@@ -676,7 +676,7 @@ export function setTables(tableSchemas) {
|
||||
export function switchQueryEditor(queryEditor, displayLimit) {
|
||||
return function (dispatch) {
|
||||
if (
|
||||
isFeatureEnabled(FeatureFlag.SQLLAB_BACKEND_PERSISTENCE) &&
|
||||
isFeatureEnabled(FeatureFlag.SqllabBackendPersistence) &&
|
||||
queryEditor &&
|
||||
!queryEditor.loaded
|
||||
) {
|
||||
@@ -735,7 +735,7 @@ export function toggleLeftBar(queryEditor) {
|
||||
|
||||
export function removeQueryEditor(queryEditor) {
|
||||
return function (dispatch) {
|
||||
const sync = isFeatureEnabled(FeatureFlag.SQLLAB_BACKEND_PERSISTENCE)
|
||||
const sync = isFeatureEnabled(FeatureFlag.SqllabBackendPersistence)
|
||||
? SupersetClient.delete({
|
||||
endpoint: encodeURI(`/tabstateview/${queryEditor.id}`),
|
||||
})
|
||||
@@ -768,7 +768,7 @@ export function removeAllOtherQueryEditors(queryEditor) {
|
||||
|
||||
export function removeQuery(query) {
|
||||
return function (dispatch) {
|
||||
const sync = isFeatureEnabled(FeatureFlag.SQLLAB_BACKEND_PERSISTENCE)
|
||||
const sync = isFeatureEnabled(FeatureFlag.SqllabBackendPersistence)
|
||||
? SupersetClient.delete({
|
||||
endpoint: encodeURI(
|
||||
`/tabstateview/${query.sqlEditorId}/query/${query.id}`,
|
||||
@@ -843,7 +843,7 @@ export function saveQuery(query, clientId) {
|
||||
|
||||
export const addSavedQueryToTabState =
|
||||
(queryEditor, savedQuery) => dispatch => {
|
||||
const sync = isFeatureEnabled(FeatureFlag.SQLLAB_BACKEND_PERSISTENCE)
|
||||
const sync = isFeatureEnabled(FeatureFlag.SqllabBackendPersistence)
|
||||
? SupersetClient.put({
|
||||
endpoint: `/tabstateview/${queryEditor.id}`,
|
||||
postPayload: { saved_query_id: savedQuery.remoteId },
|
||||
@@ -893,7 +893,7 @@ export function queryEditorSetAndSaveSql(targetQueryEditor, sql, queryId) {
|
||||
const queryEditor = getUpToDateQuery(getState(), targetQueryEditor);
|
||||
// saved query and set tab state use this action
|
||||
dispatch(queryEditorSetSql(queryEditor, sql, queryId));
|
||||
if (isFeatureEnabled(FeatureFlag.SQLLAB_BACKEND_PERSISTENCE)) {
|
||||
if (isFeatureEnabled(FeatureFlag.SqllabBackendPersistence)) {
|
||||
return SupersetClient.put({
|
||||
endpoint: encodeURI(`/tabstateview/${queryEditor.id}`),
|
||||
postPayload: { sql, latest_query_id: queryId },
|
||||
@@ -1016,7 +1016,7 @@ export function runTablePreviewQuery(newTable) {
|
||||
|
||||
export function syncTable(table, tableMetadata) {
|
||||
return function (dispatch) {
|
||||
const sync = isFeatureEnabled(FeatureFlag.SQLLAB_BACKEND_PERSISTENCE)
|
||||
const sync = isFeatureEnabled(FeatureFlag.SqllabBackendPersistence)
|
||||
? SupersetClient.post({
|
||||
endpoint: encodeURI('/tableschemaview/'),
|
||||
postPayload: { table: { ...tableMetadata, ...table } },
|
||||
@@ -1075,7 +1075,7 @@ export function reFetchQueryResults(query) {
|
||||
|
||||
export function expandTable(table) {
|
||||
return function (dispatch) {
|
||||
const sync = isFeatureEnabled(FeatureFlag.SQLLAB_BACKEND_PERSISTENCE)
|
||||
const sync = isFeatureEnabled(FeatureFlag.SqllabBackendPersistence)
|
||||
? SupersetClient.post({
|
||||
endpoint: encodeURI(`/tableschemaview/${table.id}/expanded`),
|
||||
postPayload: { expanded: true },
|
||||
@@ -1099,7 +1099,7 @@ export function expandTable(table) {
|
||||
|
||||
export function collapseTable(table) {
|
||||
return function (dispatch) {
|
||||
const sync = isFeatureEnabled(FeatureFlag.SQLLAB_BACKEND_PERSISTENCE)
|
||||
const sync = isFeatureEnabled(FeatureFlag.SqllabBackendPersistence)
|
||||
? SupersetClient.post({
|
||||
endpoint: encodeURI(`/tableschemaview/${table.id}/expanded`),
|
||||
postPayload: { expanded: false },
|
||||
@@ -1124,7 +1124,7 @@ export function collapseTable(table) {
|
||||
export function removeTables(tables) {
|
||||
return function (dispatch) {
|
||||
const tablesToRemove = tables?.filter(Boolean) ?? [];
|
||||
const sync = isFeatureEnabled(FeatureFlag.SQLLAB_BACKEND_PERSISTENCE)
|
||||
const sync = isFeatureEnabled(FeatureFlag.SqllabBackendPersistence)
|
||||
? Promise.all(
|
||||
tablesToRemove.map(table =>
|
||||
SupersetClient.delete({
|
||||
|
||||
Reference in New Issue
Block a user