You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by GitBox <gi...@apache.org> on 2021/05/28 17:38:24 UTC

[GitHub] [brooklyn-ui] algairim commented on a change in pull request #206: Allow downstream to configure edit.dsl controller

algairim commented on a change in pull request #206:
URL: https://github.com/apache/brooklyn-ui/pull/206#discussion_r641711647



##########
File path: ui-modules/blueprint-composer/app/views/main/graphical/edit/dsl/edit.dsl.controller.js
##########
@@ -131,27 +127,31 @@ export const graphicalEditDslState = {
         index: {
             value: '',
             squash: true
-        }
+        },
+        isConfig: true // This flag identifies whether DSL edit is for configuration or something else. Configuration is a default.
     },
     template: template,
     controller: ['$scope', '$state', '$stateParams', 'objectCache', 'state', EditDslController],
     controllerAs: 'vm',
     resolve: {
-        state: ['$state', '$stateParams', 'entity', 'brSnackbar', 'objectCache', ($state, $stateParams, entity, brSnackbar, objectCache) => {
-            let definition = entity.miscData.get('config').find(config => config.name === $stateParams.for);
+        state: ['$state', '$stateParams', 'entity', 'brSnackbar', 'objectCache', 'composerOverrides', ($state, $stateParams, entity, brSnackbar, objectCache, composerOverrides) => {
+
+            // Initialize dsl-edit helpers
+            $state.getDefinition = getConfigDefinition;
+            $state.getRootDsl = getConfigRootDsl;
+            $state.setRootDsl = setConfigRootDsl;
+
+            // Allow downstream to configure this controller and override helpers defined above, when required.
+            (composerOverrides.configureDslEdit || function () {})($state);

Review comment:
       This is a new feature to enable configuration of this controller, e.g. branding. No functional change.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org