Skip to content

Commit

Permalink
chore: remove feature flag influxqlUI (#6809)
Browse files Browse the repository at this point in the history
* chore: remove flag `influxqlUI`

chore: lint

* chore: fix clear script for influxql

* chore(test): add some time for influxql to set up dbrp

* chore: fix typo
  • Loading branch information
appletreeisyellow authored Sep 25, 2023
1 parent b5d997e commit da2a963
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
4 changes: 1 addition & 3 deletions cypress/e2e/cloud/scriptQueryBuilder.influxql.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,7 @@ describe('Script Builder', () => {
})

beforeEach(() => {
cy.scriptsLoginWithFlags({
influxqlUI: true,
}).then(() => {
cy.scriptsLoginWithFlags({}).then(() => {
cy.clearInfluxQLScriptSession()
cy.getByTestID('editor-sync--toggle')
cy.getByTestID('influxql-editor', {timeout: DELAY_FOR_LAZY_LOAD_EDITOR})
Expand Down
4 changes: 2 additions & 2 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -821,8 +821,8 @@ const setScriptToLanguage = (
) => {
return cy.isIoxOrg().then(isIox => {
if (lang === 'influxql') {
// give cypress some time to turn on the feature flag `influxqlUI`
// this block can be removed after this feature flag is removed
// give cypress some time to set up
// database and retention policy (DBRP) mappings
cy.wait(1000)
}

Expand Down
8 changes: 6 additions & 2 deletions src/dataExplorer/components/SaveAsScript.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {QueryContext} from 'src/shared/contexts/query'
import {ResultsContext} from 'src/dataExplorer/context/results'
import {PersistenceContext} from 'src/dataExplorer/context/persistence'
import {ResultsViewContext} from 'src/dataExplorer/context/resultsView'
import {DBRPContext} from 'src/shared/contexts/dbrps'

// Types
import {RemoteDataState} from 'src/types'
Expand All @@ -45,7 +46,6 @@ import {
copyToClipboardFailed,
copyToClipboardSuccess,
} from 'src/shared/copy/notifications'
import {isFlagEnabled} from 'src/shared/utils/featureFlag'

import './SaveAsScript.scss'

Expand All @@ -62,6 +62,7 @@ const SaveAsScript: FC<Props> = ({language, onClose, setOverlayType, type}) => {
const {hasChanged, resource, setResource, save} =
useContext(PersistenceContext)
const isIoxOrg = useSelector(isOrgIOx)
const {hasDBRPs} = useContext(DBRPContext)
const {cancel} = useContext(QueryContext)
const {setStatus, setResult} = useContext(ResultsContext)
const {clear: clearViewOptions} = useContext(ResultsViewContext)
Expand Down Expand Up @@ -111,7 +112,10 @@ const SaveAsScript: FC<Props> = ({language, onClose, setOverlayType, type}) => {
setResult(null)
clearViewOptions()

if (isIoxOrg || isFlagEnabled('influxqlUI')) {
// InfluxQL works on both IOx and TSM, so if an account has
// any database and retention policy (DBRP) mappings, the url
// should include the parameter `language={}`
if (isIoxOrg || hasDBRPs()) {
history.replace(
`/orgs/${org.id}/data-explorer/from/script?language=${language}&${SCRIPT_EDITOR_PARAMS}`
)
Expand Down
6 changes: 3 additions & 3 deletions src/dataExplorer/components/ScriptQueryBuilder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ const ScriptQueryBuilder: FC = () => {
{option}
</Dropdown.Item>
))}
{isFlagEnabled('influxqlUI') && hasDBRPs() ? (
{hasDBRPs() ? (
<Dropdown.Item
className={`script-dropdown__${LanguageType.INFLUXQL}`}
key={LanguageType.INFLUXQL}
Expand All @@ -168,7 +168,7 @@ const ScriptQueryBuilder: FC = () => {
{option}
</Dropdown.Item>
))}
{isFlagEnabled('influxqlUI') && hasDBRPs() ? (
{hasDBRPs() ? (
<Dropdown.Item
className={`script-dropdown__${LanguageType.INFLUXQL}`}
key={LanguageType.INFLUXQL}
Expand Down Expand Up @@ -196,7 +196,7 @@ const ScriptQueryBuilder: FC = () => {
)

const tsmNewScriptDropDown =
isFlagEnabled('influxqlUI') && hasDBRPs() && CLOUD ? (
hasDBRPs() && CLOUD ? (
<Dropdown
menu={menuTSM}
button={button}
Expand Down

0 comments on commit da2a963

Please sign in to comment.