{"action":"created","comment":{"url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/pulls/comments/58407345","id":58407345,"diff_hunk":"@@ -0,0 +1,72 @@\n+/*!\n+ * Copyright 2010 - 2016 Pentaho Corporation. All rights reserved.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+define([\n+  \"../../lang/Base\"\n+], function(Base) {\n+  \"use strict\";\n+\n+  var ConfigurationService = Base.extend(\"pentaho.type.config.ConfigurationService\", /** @lends pentaho.type.config.ConfigurationService#*/{\n+    /**\n+     * @private\n+     */\n+    ruleStore: {},\n+\n+    constructor: function() {\n+    },\n+\n+    add: function(config) {\n+      if (config.rules) {\n+        config.rules.forEach(function(rule) {\n+          this.addRule(rule);\n+        }, this);\n+      }\n+    },\n+\n+    addRule: function(rule) {\n+      var select = rule.select || {};\n+      var typeIds = select.type || [\"pentaho/type/Instance\"];\n+      if (!Array.isArray(typeIds)) {\n+        typeIds = [typeIds];\n+      }\n+\n+      typeIds.forEach(function(typeId) {\n+        // TODO Replace with custom collection with ordered insert\n+        if (!this.ruleStore[typeId]) {\n+          this.ruleStore[typeId] = [];\n+        }\n+\n+        this.ruleStore[typeId].push(rule);\n+      }, this);\n+    },\n+\n+    select: function(typeId, context) {\n+      // TODO Select the apropriate rules, merge them and return\n+\n+      // Temporary placeholder mock implementation\n+      // always return first configuration (or empty, if none)\n+      var rules = [];","path":"package-res/resources/web/pentaho/type/config/ConfigurationService.js","position":60,"original_position":60,"commit_id":"d7c405c32236b6fe0104b0175515301f1ca22c63","original_commit_id":"ed490cc7b4d5c7b5e605d71a79275a9bc5ac9f01","user":{"login":"dcleao","id":284983,"avatar_url":"https://avatars.githubusercontent.com/u/284983?v=3","gravatar_id":"","url":"https://api.github.com/users/dcleao","html_url":"https://github.com/dcleao","followers_url":"https://api.github.com/users/dcleao/followers","following_url":"https://api.github.com/users/dcleao/following{/other_user}","gists_url":"https://api.github.com/users/dcleao/gists{/gist_id}","starred_url":"https://api.github.com/users/dcleao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcleao/subscriptions","organizations_url":"https://api.github.com/users/dcleao/orgs","repos_url":"https://api.github.com/users/dcleao/repos","events_url":"https://api.github.com/users/dcleao/events{/privacy}","received_events_url":"https://api.github.com/users/dcleao/received_events","type":"User","site_admin":false},"body":"`var configs` or configSpecs ?","created_at":"2016-04-04T16:45:53Z","updated_at":"2016-04-04T16:45:53Z","html_url":"https://github.com/pentaho/pentaho-platform-plugin-common-ui/pull/730#discussion_r58407345","pull_request_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/pulls/730","_links":{"self":{"href":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/pulls/comments/58407345"},"html":{"href":"https://github.com/pentaho/pentaho-platform-plugin-common-ui/pull/730#discussion_r58407345"},"pull_request":{"href":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/pulls/730"}}},"pull_request":{"url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/pulls/730","id":65155101,"html_url":"https://github.com/pentaho/pentaho-platform-plugin-common-ui/pull/730","diff_url":"https://github.com/pentaho/pentaho-platform-plugin-common-ui/pull/730.diff","patch_url":"https://github.com/pentaho/pentaho-platform-plugin-common-ui/pull/730.patch","issue_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/issues/730","number":730,"state":"open","locked":false,"title":"[BACKLOG-6733] Initial implementation of the configuration service","user":{"login":"nantunes","id":209365,"avatar_url":"https://avatars.githubusercontent.com/u/209365?v=3","gravatar_id":"","url":"https://api.github.com/users/nantunes","html_url":"https://github.com/nantunes","followers_url":"https://api.github.com/users/nantunes/followers","following_url":"https://api.github.com/users/nantunes/following{/other_user}","gists_url":"https://api.github.com/users/nantunes/gists{/gist_id}","starred_url":"https://api.github.com/users/nantunes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nantunes/subscriptions","organizations_url":"https://api.github.com/users/nantunes/orgs","repos_url":"https://api.github.com/users/nantunes/repos","events_url":"https://api.github.com/users/nantunes/events{/privacy}","received_events_url":"https://api.github.com/users/nantunes/received_events","type":"User","site_admin":false},"body":"@dcleao please take a look.","created_at":"2016-04-04T14:34:33Z","updated_at":"2016-04-04T16:45:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8fa1192d528aa8eedffba302aac8c3a7e398b6a9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/pulls/730/commits","review_comments_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/pulls/730/comments","review_comment_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/issues/730/comments","statuses_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/statuses/d7c405c32236b6fe0104b0175515301f1ca22c63","head":{"label":"nantunes:BACKLOG-6733/ConfigurationService","ref":"BACKLOG-6733/ConfigurationService","sha":"d7c405c32236b6fe0104b0175515301f1ca22c63","user":{"login":"nantunes","id":209365,"avatar_url":"https://avatars.githubusercontent.com/u/209365?v=3","gravatar_id":"","url":"https://api.github.com/users/nantunes","html_url":"https://github.com/nantunes","followers_url":"https://api.github.com/users/nantunes/followers","following_url":"https://api.github.com/users/nantunes/following{/other_user}","gists_url":"https://api.github.com/users/nantunes/gists{/gist_id}","starred_url":"https://api.github.com/users/nantunes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nantunes/subscriptions","organizations_url":"https://api.github.com/users/nantunes/orgs","repos_url":"https://api.github.com/users/nantunes/repos","events_url":"https://api.github.com/users/nantunes/events{/privacy}","received_events_url":"https://api.github.com/users/nantunes/received_events","type":"User","site_admin":false},"repo":{"id":48502836,"name":"pentaho-platform-plugin-common-ui","full_name":"nantunes/pentaho-platform-plugin-common-ui","owner":{"login":"nantunes","id":209365,"avatar_url":"https://avatars.githubusercontent.com/u/209365?v=3","gravatar_id":"","url":"https://api.github.com/users/nantunes","html_url":"https://github.com/nantunes","followers_url":"https://api.github.com/users/nantunes/followers","following_url":"https://api.github.com/users/nantunes/following{/other_user}","gists_url":"https://api.github.com/users/nantunes/gists{/gist_id}","starred_url":"https://api.github.com/users/nantunes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nantunes/subscriptions","organizations_url":"https://api.github.com/users/nantunes/orgs","repos_url":"https://api.github.com/users/nantunes/repos","events_url":"https://api.github.com/users/nantunes/events{/privacy}","received_events_url":"https://api.github.com/users/nantunes/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nantunes/pentaho-platform-plugin-common-ui","description":"","fork":true,"url":"https://api.github.com/repos/nantunes/pentaho-platform-plugin-common-ui","forks_url":"https://api.github.com/repos/nantunes/pentaho-platform-plugin-common-ui/forks","keys_url":"https://api.github.com/repos/nantunes/pentaho-platform-plugin-common-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nantunes/pentaho-platform-plugin-common-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nantunes/pentaho-platform-plugin-common-ui/teams","hooks_url":"https://api.github.com/repos/nantunes/pentaho-platform-plugin-common-ui/hooks","issue_events_url":"https://api.github.com/repos/nantunes/pentaho-platform-plugin-common-ui/issues/events{/number}","events_url":"https://api.github.com/repos/nantunes/pentaho-platform-plugin-common-ui/events","assignees_url":"https://api.github.com/repos/nantunes/pentaho-platform-plugin-common-ui/assignees{/user}","branches_url":"https://api.github.com/repos/nantunes/pentaho-platform-plugin-common-ui/branches{/branch}","tags_url":"https://api.github.com/repos/nantunes/pentaho-platform-plugin-common-ui/tags","blobs_url":"https://api.github.com/repos/nantunes/pentaho-platform-plugin-common-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nantunes/pentaho-platform-plugin-common-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nantunes/pentaho-platform-plugin-common-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/nantunes/pentaho-platform-plugin-common-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nantunes/pentaho-platform-plugin-common-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/nantunes/pentaho-platform-plugin-common-ui/languages","stargazers_url":"https://api.github.com/repos/nantunes/pentaho-platform-plugin-common-ui/stargazers","contributors_url":"https://api.github.com/repos/nantunes/pentaho-platform-plugin-common-ui/contributors","subscribers_url":"https://api.github.com/repos/nantunes/pentaho-platform-plugin-common-ui/subscribers","subscription_url":"https://api.github.com/repos/nantunes/pentaho-platform-plugin-common-ui/subscription","commits_url":"https://api.github.com/repos/nantunes/pentaho-platform-plugin-common-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/nantunes/pentaho-platform-plugin-common-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/nantunes/pentaho-platform-plugin-common-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/nantunes/pentaho-platform-plugin-common-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/nantunes/pentaho-platform-plugin-common-ui/contents/{+path}","compare_url":"https://api.github.com/repos/nantunes/pentaho-platform-plugin-common-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nantunes/pentaho-platform-plugin-common-ui/merges","archive_url":"https://api.github.com/repos/nantunes/pentaho-platform-plugin-common-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nantunes/pentaho-platform-plugin-common-ui/downloads","issues_url":"https://api.github.com/repos/nantunes/pentaho-platform-plugin-common-ui/issues{/number}","pulls_url":"https://api.github.com/repos/nantunes/pentaho-platform-plugin-common-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/nantunes/pentaho-platform-plugin-common-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/nantunes/pentaho-platform-plugin-common-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nantunes/pentaho-platform-plugin-common-ui/labels{/name}","releases_url":"https://api.github.com/repos/nantunes/pentaho-platform-plugin-common-ui/releases{/id}","deployments_url":"https://api.github.com/repos/nantunes/pentaho-platform-plugin-common-ui/deployments","created_at":"2015-12-23T17:30:20Z","updated_at":"2016-02-25T15:00:58Z","pushed_at":"2016-04-04T16:10:04Z","git_url":"git://github.com/nantunes/pentaho-platform-plugin-common-ui.git","ssh_url":"git@github.com:nantunes/pentaho-platform-plugin-common-ui.git","clone_url":"https://github.com/nantunes/pentaho-platform-plugin-common-ui.git","svn_url":"https://github.com/nantunes/pentaho-platform-plugin-common-ui","homepage":null,"size":15748,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pentaho:master","ref":"master","sha":"0681d30048231c256dfa8304d3811db6540b9f00","user":{"login":"pentaho","id":1022787,"avatar_url":"https://avatars.githubusercontent.com/u/1022787?v=3","gravatar_id":"","url":"https://api.github.com/users/pentaho","html_url":"https://github.com/pentaho","followers_url":"https://api.github.com/users/pentaho/followers","following_url":"https://api.github.com/users/pentaho/following{/other_user}","gists_url":"https://api.github.com/users/pentaho/gists{/gist_id}","starred_url":"https://api.github.com/users/pentaho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pentaho/subscriptions","organizations_url":"https://api.github.com/users/pentaho/orgs","repos_url":"https://api.github.com/users/pentaho/repos","events_url":"https://api.github.com/users/pentaho/events{/privacy}","received_events_url":"https://api.github.com/users/pentaho/received_events","type":"Organization","site_admin":false},"repo":{"id":4597815,"name":"pentaho-platform-plugin-common-ui","full_name":"pentaho/pentaho-platform-plugin-common-ui","owner":{"login":"pentaho","id":1022787,"avatar_url":"https://avatars.githubusercontent.com/u/1022787?v=3","gravatar_id":"","url":"https://api.github.com/users/pentaho","html_url":"https://github.com/pentaho","followers_url":"https://api.github.com/users/pentaho/followers","following_url":"https://api.github.com/users/pentaho/following{/other_user}","gists_url":"https://api.github.com/users/pentaho/gists{/gist_id}","starred_url":"https://api.github.com/users/pentaho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pentaho/subscriptions","organizations_url":"https://api.github.com/users/pentaho/orgs","repos_url":"https://api.github.com/users/pentaho/repos","events_url":"https://api.github.com/users/pentaho/events{/privacy}","received_events_url":"https://api.github.com/users/pentaho/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pentaho/pentaho-platform-plugin-common-ui","description":"","fork":false,"url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui","forks_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/forks","keys_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/teams","hooks_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/hooks","issue_events_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/issues/events{/number}","events_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/events","assignees_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/assignees{/user}","branches_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/branches{/branch}","tags_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/tags","blobs_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/languages","stargazers_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/stargazers","contributors_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/contributors","subscribers_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/subscribers","subscription_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/subscription","commits_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/contents/{+path}","compare_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/merges","archive_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/downloads","issues_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/issues{/number}","pulls_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/labels{/name}","releases_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/releases{/id}","deployments_url":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/deployments","created_at":"2012-06-08T13:53:13Z","updated_at":"2016-01-12T14:57:20Z","pushed_at":"2016-04-04T16:39:05Z","git_url":"git://github.com/pentaho/pentaho-platform-plugin-common-ui.git","ssh_url":"git@github.com:pentaho/pentaho-platform-plugin-common-ui.git","clone_url":"https://github.com/pentaho/pentaho-platform-plugin-common-ui.git","svn_url":"https://github.com/pentaho/pentaho-platform-plugin-common-ui","homepage":null,"size":16308,"stargazers_count":7,"watchers_count":7,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":71,"mirror_url":null,"open_issues_count":6,"forks":71,"open_issues":6,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/pulls/730"},"html":{"href":"https://github.com/pentaho/pentaho-platform-plugin-common-ui/pull/730"},"issue":{"href":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/issues/730"},"comments":{"href":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/issues/730/comments"},"review_comments":{"href":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/pulls/730/comments"},"review_comment":{"href":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/pulls/730/commits"},"statuses":{"href":"https://api.github.com/repos/pentaho/pentaho-platform-plugin-common-ui/statuses/d7c405c32236b6fe0104b0175515301f1ca22c63"}}}}