File tree Expand file tree Collapse file tree 2 files changed +17
-19
lines changed
ce/utils/BusinessFeatures Expand file tree Collapse file tree 2 files changed +17
-19
lines changed Original file line number Diff line number Diff line change @@ -176,9 +176,21 @@ export const hasCreateDSActionPermissionInApp = ({
176176 isEnabled : boolean ;
177177 pagePermissions ?: string [ ] ;
178178} ) => {
179- return ! ideType || ideType === IDE_TYPE . App
180- ? getHasCreateDatasourceActionPermission ( isEnabled , dsPermissions ) &&
181- getHasCreateActionPermission ( isEnabled , pagePermissions )
182- : ideType !== IDE_TYPE . Workspace &&
183- getHasCreateDatasourceActionPermission ( isEnabled , dsPermissions ) ;
179+ const hasDatasourcePermission = getHasCreateDatasourceActionPermission (
180+ isEnabled ,
181+ dsPermissions ,
182+ ) ;
183+
184+ if ( ideType === IDE_TYPE . Workspace ) {
185+ return false ;
186+ }
187+
188+ if ( ! ideType || ideType === IDE_TYPE . App ) {
189+ return (
190+ hasDatasourcePermission &&
191+ getHasCreateActionPermission ( isEnabled , pagePermissions )
192+ ) ;
193+ }
194+
195+ return hasDatasourcePermission ;
184196} ;
Original file line number Diff line number Diff line change @@ -16,8 +16,6 @@ import {
1616 PluginsNotFoundError ,
1717} from "entities/Engine" ;
1818import type { ReduxAction } from "actions/ReduxActionTypes" ;
19- import { waitForFetchEnvironments } from "ee/sagas/EnvironmentSagas" ;
20- import { fetchingEnvironmentConfigs } from "ee/actions/environmentAction" ;
2119import { getWorkspaceFromId } from "ee/selectors/workspaceSelectors" ;
2220import { fetchAllWorkspaces } from "ee/actions/workspaceActions" ;
2321
@@ -51,18 +49,6 @@ export default class WorkspaceEditorEngine {
5149 ReduxActionErrorTypes . FETCH_WORKSPACES_ERROR ,
5250 ] ) ;
5351 }
54-
55- // Fetch environment configs for the workspace
56- yield put (
57- fetchingEnvironmentConfigs ( {
58- workspaceId,
59- editorId : workspaceId ,
60- fetchDatasourceMeta : true ,
61- } ) ,
62- ) ;
63-
64- // Wait for environments to be fetched
65- yield call ( waitForFetchEnvironments ) ;
6652 }
6753
6854 public * setupEngine ( ) {
You can’t perform that action at this time.
0 commit comments