diff --git a/services/web/app/views/project/editor/file-tree-react.pug b/services/web/app/views/project/editor/file-tree-react.pug index 8ba1659383..87170f89f2 100644 --- a/services/web/app/views/project/editor/file-tree-react.pug +++ b/services/web/app/views/project/editor/file-tree-react.pug @@ -19,7 +19,7 @@ aside.editor-sidebar.full-size( on-select="onSelect" on-init="onInit" is-connected="isConnected" - has-feature="hasFeature" + user-has-feature="hasFeature" ref-providers="refProviders" reindex-references="reindexReferences" set-ref-provider-enabled="setRefProviderEnabled" diff --git a/services/web/frontend/js/features/file-tree/components/file-tree-context.js b/services/web/frontend/js/features/file-tree/components/file-tree-context.js index b665f1adab..a480cdd8ce 100644 --- a/services/web/frontend/js/features/file-tree/components/file-tree-context.js +++ b/services/web/frontend/js/features/file-tree/components/file-tree-context.js @@ -17,7 +17,7 @@ function FileTreeContext({ rootFolder, hasWritePermissions, rootDocId, - hasFeature, + userHasFeature, refProviders, reindexReferences, setRefProviderEnabled, @@ -29,7 +29,7 @@ function FileTreeContext({ - ide.$scope.project.features[feature] || ide.$scope.user.features[feature] + $scope.userHasFeature = feature => ide.$scope.user.features[feature] $scope.$watch('permissions.write', hasWritePermissions => { $scope.hasWritePermissions = hasWritePermissions diff --git a/services/web/frontend/stories/modals/create-file/create-file-modal-decorator.js b/services/web/frontend/stories/modals/create-file/create-file-modal-decorator.js index c460689887..a49d613c7d 100644 --- a/services/web/frontend/stories/modals/create-file/create-file-modal-decorator.js +++ b/services/web/frontend/stories/modals/create-file/create-file-modal-decorator.js @@ -9,7 +9,7 @@ import PropTypes from 'prop-types' const defaultContextProps = { projectId: 'project-1', hasWritePermissions: true, - hasFeature: () => true, + userHasFeature: () => true, refProviders: {}, reindexReferences: () => { console.log('reindex references') diff --git a/services/web/frontend/stories/modals/create-file/create-file-modal.stories.js b/services/web/frontend/stories/modals/create-file/create-file-modal.stories.js index cc04cd03b4..c4bedde8a1 100644 --- a/services/web/frontend/stories/modals/create-file/create-file-modal.stories.js +++ b/services/web/frontend/stories/modals/create-file/create-file-modal.stories.js @@ -5,7 +5,7 @@ import FileTreeModalCreateFile from '../../../js/features/file-tree/components/m export const MinimalFeatures = args => MinimalFeatures.decorators = [ createFileModalDecorator({ - hasFeature: () => false + userHasFeature: () => false }) ] diff --git a/services/web/test/frontend/features/file-tree/components/file-tree-create/context-props.js b/services/web/test/frontend/features/file-tree/components/file-tree-create/context-props.js index f0aac3be25..cde817ae14 100644 --- a/services/web/test/frontend/features/file-tree/components/file-tree-create/context-props.js +++ b/services/web/test/frontend/features/file-tree/components/file-tree-create/context-props.js @@ -3,7 +3,7 @@ import sinon from 'sinon' export const contextProps = { projectId: 'test-project', hasWritePermissions: true, - hasFeature: () => true, + userHasFeature: () => true, refProviders: {}, reindexReferences: () => { console.log('reindex references') diff --git a/services/web/test/frontend/features/file-tree/components/file-tree-root.test.js b/services/web/test/frontend/features/file-tree/components/file-tree-root.test.js index 9e77889fd1..6f92946e64 100644 --- a/services/web/test/frontend/features/file-tree/components/file-tree-root.test.js +++ b/services/web/test/frontend/features/file-tree/components/file-tree-root.test.js @@ -36,7 +36,7 @@ describe('', function() { rootFolder={rootFolder} projectId="123abc" hasWritePermissions={false} - hasFeature={() => true} + userHasFeature={() => true} refProviders={{}} reindexReferences={() => null} setRefProviderEnabled={() => null} @@ -72,7 +72,7 @@ describe('', function() { rootFolder={rootFolder} projectId="123abc" hasWritePermissions - hasFeature={() => true} + userHasFeature={() => true} refProviders={{}} reindexReferences={() => null} setRefProviderEnabled={() => null} @@ -113,7 +113,7 @@ describe('', function() { onSelect={onSelect} onInit={onInit} isConnected={false} - hasFeature={() => true} + userHasFeature={() => true} refProviders={{}} reindexReferences={() => null} setRefProviderEnabled={() => null} @@ -142,7 +142,7 @@ describe('', function() { projectId="123abc" rootDocId="456def" hasWritePermissions={false} - hasFeature={() => true} + userHasFeature={() => true} refProviders={{}} reindexReferences={() => null} setRefProviderEnabled={() => null} @@ -195,7 +195,7 @@ describe('', function() { projectId="123abc" rootDocId="456def" hasWritePermissions={false} - hasFeature={() => true} + userHasFeature={() => true} refProviders={{}} reindexReferences={() => null} setRefProviderEnabled={() => null} diff --git a/services/web/test/frontend/features/file-tree/flows/context-menu.test.js b/services/web/test/frontend/features/file-tree/flows/context-menu.test.js index 077cad3ce1..2143644802 100644 --- a/services/web/test/frontend/features/file-tree/flows/context-menu.test.js +++ b/services/web/test/frontend/features/file-tree/flows/context-menu.test.js @@ -23,7 +23,7 @@ describe('FileTree Context Menu Flow', function() { rootFolder={rootFolder} projectId="123abc" hasWritePermissions - hasFeature={() => true} + userHasFeature={() => true} refProviders={{}} reindexReferences={() => null} setRefProviderEnabled={() => null} @@ -57,7 +57,7 @@ describe('FileTree Context Menu Flow', function() { rootFolder={rootFolder} projectId="123abc" hasWritePermissions={false} - hasFeature={() => true} + userHasFeature={() => true} refProviders={{}} reindexReferences={() => null} setRefProviderEnabled={() => null} diff --git a/services/web/test/frontend/features/file-tree/flows/create-folder.test.js b/services/web/test/frontend/features/file-tree/flows/create-folder.test.js index cd10a2e29f..2ff6c466c7 100644 --- a/services/web/test/frontend/features/file-tree/flows/create-folder.test.js +++ b/services/web/test/frontend/features/file-tree/flows/create-folder.test.js @@ -40,7 +40,7 @@ describe('FileTree Create Folder Flow', function() { rootFolder={rootFolder} projectId="123abc" hasWritePermissions - hasFeature={() => true} + userHasFeature={() => true} refProviders={{}} reindexReferences={() => null} setRefProviderEnabled={() => null} @@ -100,7 +100,7 @@ describe('FileTree Create Folder Flow', function() { rootFolder={rootFolder} projectId="123abc" hasWritePermissions - hasFeature={() => true} + userHasFeature={() => true} refProviders={{}} reindexReferences={() => null} setRefProviderEnabled={() => null} @@ -170,7 +170,7 @@ describe('FileTree Create Folder Flow', function() { rootFolder={rootFolder} projectId="123abc" hasWritePermissions - hasFeature={() => true} + userHasFeature={() => true} refProviders={{}} reindexReferences={() => null} setRefProviderEnabled={() => null} @@ -229,7 +229,7 @@ describe('FileTree Create Folder Flow', function() { rootFolder={rootFolder} projectId="123abc" hasWritePermissions - hasFeature={() => true} + userHasFeature={() => true} refProviders={{}} reindexReferences={() => null} setRefProviderEnabled={() => null} diff --git a/services/web/test/frontend/features/file-tree/flows/delete-entity.test.js b/services/web/test/frontend/features/file-tree/flows/delete-entity.test.js index 913c96c58b..f438f3f368 100644 --- a/services/web/test/frontend/features/file-tree/flows/delete-entity.test.js +++ b/services/web/test/frontend/features/file-tree/flows/delete-entity.test.js @@ -39,7 +39,7 @@ describe('FileTree Delete Entity Flow', function() { rootFolder={rootFolder} projectId="123abc" hasWritePermissions - hasFeature={() => true} + userHasFeature={() => true} refProviders={{}} reindexReferences={() => null} setRefProviderEnabled={() => null} @@ -153,7 +153,7 @@ describe('FileTree Delete Entity Flow', function() { rootFolder={rootFolder} projectId="123abc" hasWritePermissions - hasFeature={() => true} + userHasFeature={() => true} refProviders={{}} reindexReferences={() => null} setRefProviderEnabled={() => null} @@ -207,7 +207,7 @@ describe('FileTree Delete Entity Flow', function() { rootFolder={rootFolder} projectId="123abc" hasWritePermissions - hasFeature={() => true} + userHasFeature={() => true} refProviders={{}} reindexReferences={() => null} setRefProviderEnabled={() => null} diff --git a/services/web/test/frontend/features/file-tree/flows/rename-entity.test.js b/services/web/test/frontend/features/file-tree/flows/rename-entity.test.js index 860c1c6306..0349f258ca 100644 --- a/services/web/test/frontend/features/file-tree/flows/rename-entity.test.js +++ b/services/web/test/frontend/features/file-tree/flows/rename-entity.test.js @@ -51,7 +51,7 @@ describe('FileTree Rename Entity Flow', function() { rootFolder={rootFolder} projectId="123abc" hasWritePermissions - hasFeature={() => true} + userHasFeature={() => true} refProviders={{}} reindexReferences={() => null} setRefProviderEnabled={() => null} diff --git a/services/web/test/frontend/features/file-tree/helpers/render-with-context.js b/services/web/test/frontend/features/file-tree/helpers/render-with-context.js index 4dcd249f94..58e4fa9033 100644 --- a/services/web/test/frontend/features/file-tree/helpers/render-with-context.js +++ b/services/web/test/frontend/features/file-tree/helpers/render-with-context.js @@ -14,7 +14,7 @@ export default (children, options = {}) => { } ], hasWritePermissions: true, - hasFeature: () => true, + userHasFeature: () => true, refProviders: {}, reindexReferences: () => { console.log('reindex references')