Skip to content

Commit

Permalink
release v3.1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Hao Liu committed Aug 5, 2015
1 parent 5987261 commit 5fe42e0
Show file tree
Hide file tree
Showing 17 changed files with 237 additions and 73 deletions.
21 changes: 21 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,27 @@ Release History
---------------


Release 3.1.7 (2015-07-29)
++++++++++++++++++
* Enhancement:
- Add `with sharing` for `Utility Class` in template
- When you want to view code coverage, if you didn't download code, you can't view code coverage and you will get the reminder message in the status bar
- Before v33.0, tooling API doesn't support relationship query just like ``ApexClass.LastModifiedBy.Name``, when you save code to server, plugin will check your code has conflict with server and tell you ``who change the code at when?``, because relationship query is not supported, plugin will need to issue a query request to fetch the LastModifiedBy Name by the LastModifiedById, from this version, it will not necessary.
- Add comments for some settings
- Move metadata.json from ``metadata.sublime-settings`` to ``.config/metadata.json``, when you create new project, if the ``metadata.json`` is exist in the ``.config`` path, plugin will skip the describe process, however, if you want to refresh the cache, you can execute ``Metadata > Describe Metadata`` to refresh the ``metadata.json`` cache file

* Bug Fix:
- After you select all test class, you can't deselect all when you run tests
- Problem when ``diff with other server``, see detail in issue #61

* New Feature:
- Add a new command named ``destruct_package_xml`` in the context menu, which is used for destructing members defined in ``package.xml`` from current server, so if you want to remove some components from production, you can get the package.xml by ``Metadata > Build Package.xml``, and then execute ``destruct_package_xml`` to remove them from production

* Update:
- Update keymap of ``retrieve from this server`` from ``super+shift+r`` to ``alt+shift+r``, fix issue #68
- Update keymap of ``deploy to this server`` from ``super+shift+s`` to ``alt+shift+s``


Release 3.1.6 (2015-07-29)
++++++++++++++++++
* Bug fix:
Expand Down
4 changes: 2 additions & 2 deletions aura.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def run(self, dirs, switch_project=True, source_org=None):
return self.window.run_command("switch_project", {
"callback_options": {
"callback_command": "deploy_lighting_to_server",
"args": {
"args": {
"switch_project": False,
"source_org": self.settings["default_project_name"],
"dirs": dirs
Expand Down Expand Up @@ -78,7 +78,7 @@ def preview_app(self):

def is_enabled(self):
self.settings = context.get_settings()
metadata = util.get_described_metadata(self.settings["username"])
metadata = util.get_described_metadata(self.settings)
self.namespace = metadata["organizationNamespace"]
if not self.namespace:
return False
Expand Down
2 changes: 1 addition & 1 deletion completions.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def on_query_completions(self, view, prefix, locations):
settings = context.get_settings()
completion_list = []

describe_metadata = util.get_described_metadata(settings["username"])
describe_metadata = util.get_described_metadata(settings)
if not describe_metadata:
if settings["debug_mode"]:
print ("You must execute describe_metadata command before have completion")
Expand Down
4 changes: 2 additions & 2 deletions config/keymap/Default (OSX).sublime-keymap
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
}
},
// Retrieve file from this server, which means not switch project
{"keys": ["command+shift+r"], "command": "retrieve_file_from_server",
{"keys": ["alt+shift+r"], "command": "retrieve_file_from_server",
"args": {
"switch": false
}
},
// Deploy file to this server, which means not switch project
{"keys": ["shift+command+s"], "command": "deploy_file_to_this_server"},
{"keys": ["alt+shift+s"], "command": "deploy_file_to_this_server"},

// Update the default project
{"keys": ["alt+r"], "command": "update_project"},
Expand Down
1 change: 1 addition & 0 deletions config/menus/Context.sublime-menu
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
[
{"caption": "-"},

{"caption": "Destruct Package.xml", "command": "destruct_package_xml"},
{"caption": "Retrieve Package.xml", "command": "retrieve_package_xml"},

{"caption": "-"},
Expand Down
12 changes: 6 additions & 6 deletions config/menus/Main.sublime-menu
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,7 @@
"children": [
{
"caption": "New Project",
"command": "describe_metadata",
"args": {
"callback_options": {
"callback_command": "create_new_project"
}
}
"command": "create_new_project"
},

{"caption": "-"},
Expand Down Expand Up @@ -497,6 +492,11 @@

{ "caption": "-" },

{
"caption": "Describe Metadata",
"command": "describe_metadata"
},

{
"caption": "Reload Project Cache",
"command": "reload_project_cache"
Expand Down
23 changes: 23 additions & 0 deletions config/messages/3.1.7.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Build 3.1.7
-----------
Release Date: 5 Aug 2015

* Enhancement:
- Add `with sharing` for `Utility Class` in template
- When you want to view code coverage, if you didn't download code, you can't view code coverage and you will get the reminder message in the status bar
- Before v33.0, tooling API doesn't support relationship query just like ``ApexClass.LastModifiedBy.Name``, when you save code to server, plugin will check your code has conflict with server and tell you ``who change the code at when?``, because relationship query is not supported, plugin will need to issue a query request to fetch the LastModifiedBy Name by the LastModifiedById, from this version, it will not necessary.
- Add comments for some settings
- Move metadata.json from ``metadata.sublime-settings`` to ``.config/metadata.json``, when you create new project, if the ``metadata.json`` is exist in the ``.config`` path, plugin will skip the describe process, however, if you want to refresh the cache, you can execute ``Metadata > Describe Metadata`` to refresh the ``metadata.json`` cache file

* Bug Fix:
- After you select all test class, you can't deselect all when you run tests
- Problem when ``diff with other server``, see detail in issue #61

* New Feature:
- Add a new command named ``destruct_package_xml`` in the context menu, which is used for destructing members defined in ``package.xml`` from current server, so if you want to remove some components from production, you can get the package.xml by ``Metadata > Build Package.xml``, and then execute ``destruct_package_xml`` to remove them from production

* Update:
- Update keymap of ``retrieve from this server`` from ``super+shift+r`` to ``alt+shift+r``, fix issue #68
- Update keymap of ``deploy to this server`` from ``super+shift+s`` to ``alt+shift+s``

* Restart your sublime when new version is installed
2 changes: 1 addition & 1 deletion config/settings/package.sublime-settings
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "HaoIDE",
"version": "3.1.6",
"version": "3.1.7",
"description": "HaoIDE is a Sublime Text 3 plugin for Salesforce and used for swift development on Force.com",
"author": "Hao Liu",
"email": "[email protected]",
Expand Down
16 changes: 8 additions & 8 deletions config/settings/template.sublime-settings
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@

"Component": {
"extension": ".cmp",
"body": "<aura:component>\n\t\n</aura:component>",
"body": "<aura:component>\n \n</aura:component>",
"children": ["Controller", "Helper", "Style", "Documentation", "Renderer"]
},

"Interface": {
"extension": ".intf",
"body": "<aura:interface description=\"Interface template\">\n\t<aura:attribute name=\"example\" type=\"String\" default=\"\" description=\"An example attribute.\"/>\n</aura:interface>",
"body": "<aura:interface description=\"Interface template\">\n <aura:attribute name=\"example\" type=\"String\" default=\"\" description=\"An example attribute.\"/>\n</aura:interface>",
"children": []
},

Expand All @@ -29,12 +29,12 @@
"AuraEelement": {
"Controller": {
"extension": ".js",
"body": "({\n\tmyAction : function(component, event, helper) {\n\t\t\n\t}\n})"
"body": "({\n myAction : function(component, event, helper) {\n \n }\n})"
},

"Helper": {
"extension": ".js",
"body": "({\n\thelperMethod : function() {\n\t\t\n\t}\n})"
"body": "({\n helperMethod : function() {\n \n }\n})"
},

"Style": {
Expand All @@ -44,25 +44,25 @@

"Documentation": {
"extension": ".auradoc",
"body": "<aura:documentation>\n\t<aura:description>Documentation</aura:description>\n\t<aura:example name=\"ExampleName\" ref=\"exampleComponentName\" label=\"Label\">\n\t\tExample Description\n\t</aura:example>\n</aura:documentation>"
"body": "<aura:documentation>\n <aura:description>Documentation</aura:description>\n <aura:example name=\"ExampleName\" ref=\"exampleComponentName\" label=\"Label\">\n Example Description\n </aura:example>\n</aura:documentation>"
},

"Renderer": {
"extension": ".js",
"body": "({\n\t// Your renderer method overrides go here\n})"
"body": "({\n // Your renderer method overrides go here\n})"
},
},

"ApexClass": {
"Utility Class": {
"extension": ".cls",
"description": "Utilities for invoker",
"body": "public class class_name {\n \n}"
"body": "public with sharing class class_name {\n \n}"
},
"Batch Class": {
"extension": ".cls",
"description": "Batch Class Template",
"body": "global class class_name implements Database.Batchable<sObject> {\n public String query;\n \n global class_name() {\n this.query = query;\n }\n \n global Database.QueryLocator start(Database.BatchableContext bc) {\n return Database.getQueryLocator(query);\n }\n \n global void execute(Database.BatchableContext BC, list<Sobject> scope) {}\n\n global void finish(Database.BatchableContext BC) {}\n}"
"body": "global class class_name implements Database.Batchable<sObject> {\n public String query;\n \n global class_name() {\n this.query = query;\n }\n \n global Database.QueryLocator start(Database.BatchableContext bc) {\n return Database.getQueryLocator(query);\n }\n \n global void execute(Database.BatchableContext BC, list<Sobject> scope) {}\n\n global void finish(Database.BatchableContext BC) {}\n}"
},
"Controller": {
"extension": ".cls",
Expand Down
11 changes: 7 additions & 4 deletions config/settings/toolingapi.sublime-settings
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"username" : "[email protected]",

/**
* Below are not required properties
* Below are optional properties
*/

// If you don't need security token,
Expand Down Expand Up @@ -69,6 +69,7 @@
],

// Solution for issue #49
// It works when reload sObjects cache or export workbooks
// Setting for controlling maximum concurrent connections with salesforce
"maximum_concurrent_connections": 30,

Expand Down Expand Up @@ -101,10 +102,11 @@
// every time when you open a file, plugin will reveal the file in the sidebar
"reveal_file_in_sidebar_on_file_activated": false,

// Debug Mode
// Debug Mode, after switch this settings to true,
// you can see some debug logs in the console
"debug_mode": false,

// Metadata polling frequency
// Metadata polling frequency, it works when retrieve files from server
"metadata_polling_frequency": 2,

// Indicate whether keep local change history of code file after code is saved successfully
Expand Down Expand Up @@ -202,7 +204,8 @@
}
],

// Deploy Options
// Deploy Options, if you just want to valid a deployment,
// you can copy this setting to user settings and set checkOnly to true
"deploy_options" : {
"allowMissingFiles" : false,
"autoUpdatePackage" : false,
Expand Down
15 changes: 10 additions & 5 deletions context.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ def get_settings():
settings["workflow_task_columns"] = s.get("workflow_task_columns")
settings["workflow_outbound_message_columns"] = s.get("workflow_outbound_message_columns")
settings["validation_rule_columns"] = s.get("validation_rule_columns")

# Set the polling interval for checking metadata job status
settings["metadata_polling_frequency"] = s.get("metadata_polling_frequency", 1)

# Document Reference Attrs
settings["docs"] = s.get("docs", {})
Expand All @@ -177,15 +180,17 @@ def get_settings():
settings["subscribed_metadata_objects"] = []

# 2. Check `.config/metadata_objects.json`, priority of 1 is higher than 2
st = sublime.load_settings("metadata.sublime-settings")
described_metadata = st.get(settings["username"])
cache_file = os.path.join(
settings["workspace"], ".config", "metadata.json"
)
described_metadata = None
if os.path.isfile(cache_file):
with open(cache_file) as fp:
described_metadata = json.loads(fp.read())
if described_metadata and "metadataObjects" in described_metadata:
settings = build_metadata_objects_settings(settings, described_metadata["metadataObjects"])
settings["organizationNamespace"] = described_metadata["organizationNamespace"]

# Set the polling interval for checking metadata job status
settings["metadata_polling_frequency"] = s.get("metadata_polling_frequency", 1)

return settings

def build_metadata_objects_settings(settings, metadata_objects):
Expand Down
15 changes: 7 additions & 8 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,17 +179,13 @@ def run(self, edit, switch=True, source_org=None):
source_org = self.settings["default_project_name"]

file_name = self.view.file_name()
attr = util.get_component_attribute(file_name)[0]
attr = util.get_component_attribute(file_name, switch)[0]

# If this component is not exist in chosen project, just stop
if not attr:
Printer.get("error").write("This component is not exist in chosen project")
return util.switch_project(source_org)

if "url" not in attr:
Printer.get("error").write("This feature does not support %s" % attr["type"])
return util.switch_project(source_org)

processor.handle_diff_with_server(attr, file_name, source_org)

def is_enabled(self):
Expand Down Expand Up @@ -221,7 +217,7 @@ def __init__(self, *args, **kwargs):
def run(self, callback_options={}):
self.settings = context.get_settings()
self.callback_options = callback_options
described_metadata = util.get_described_metadata(self.settings["username"])
described_metadata = util.get_described_metadata(self.settings)
if not described_metadata:
return self.window.run_command("describe_metadata", {
"callback_options": {
Expand Down Expand Up @@ -516,6 +512,8 @@ def run(self, edit, is_background=False, allowed_folders=None):
self.view.window().open_file(target_file)
else:
self.view.window().open_file(target_file)
else:
sublime.status_message("You may forget to download the code")

if is_background: self.view.window().focus_view(self.view)

Expand Down Expand Up @@ -1277,6 +1275,7 @@ def on_done(self, index):
else:
self.chosen_classes = []
for k, v in self.classmap.items():
if v == "*": continue
self.chosen_classes.append(v)
else:
class_name = class_attr
Expand Down Expand Up @@ -1827,7 +1826,7 @@ def on_done(self, index):
util.switch_project(default_project)

settings = context.get_settings()
described_metadata = util.get_described_metadata(settings["username"])
described_metadata = util.get_described_metadata(settings)
if not described_metadata:
return self.window.run_command("describe_metadata", {
"callback_options": self.callback_options
Expand Down Expand Up @@ -1925,7 +1924,7 @@ def __init__(self, *args, **kwargs):

def run(self):
settings = context.get_settings()
described_metadata = util.get_described_metadata(settings["username"])
described_metadata = util.get_described_metadata(settings)
if not described_metadata:
return self.window.run_command("describe_metadata", {
"callback_options": {
Expand Down
1 change: 1 addition & 0 deletions messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
"3.1.4": "config/messages/3.1.4.md",
"3.1.5": "config/messages/3.1.5.md",
"3.1.6": "config/messages/3.1.6.md",
"3.1.7": "config/messages/3.1.7.md",
"install": "config/messages/install.txt"
}
Loading

1 comment on commit 5fe42e0

@xjsender
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix issue #61 , #68

Please sign in to comment.