├── .gitignore ├── sfswitch ├── __init__.py ├── asgi.py ├── wsgi.py ├── urls.py └── settings.py ├── enable_disable ├── __init__.py ├── management │ ├── __init__.py │ └── commands │ │ ├── __init__.py │ │ └── delete_jobs.py ├── migrations │ ├── __init__.py │ └── 0001_initial.py ├── tests.py ├── apps.py ├── forms.py ├── admin.py ├── models.py ├── views.py └── tasks.py ├── runtime.txt ├── db.sqlite3 ├── static ├── images │ ├── icon.png │ ├── logo.png │ ├── favicon.ico │ ├── i-icon.png │ ├── loading.gif │ ├── oh-dear.png │ ├── logo-small.png │ └── tquila-logo@1x.png ├── bootstrap │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.ttf │ │ └── glyphicons-halflings-regular.woff │ └── css │ │ ├── bootstrap-theme.min.css │ │ ├── bootstrap-theme.css.map │ │ └── bootstrap-theme.css ├── js │ ├── cookie.js │ ├── main.js │ ├── metadata_update.js │ ├── jquery-migrate-1.1.0.min.js │ └── bootstrap-switch.min.js ├── jquery-syntaxhighlighter │ ├── prettify │ │ ├── prettify.min.css │ │ └── prettify.min.js │ ├── styles │ │ ├── style.min.css │ │ └── theme-balupton.min.css │ └── jquery.syntaxhighlighter.min.js └── css │ ├── styles.css │ └── bootstrap-switch.min.css ├── Procfile ├── templates ├── 500.html ├── logout.html ├── 404.html ├── loading.html ├── oauth_response.html ├── index.html ├── base.html └── job.html ├── README.md ├── manage.py └── requirements.txt /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc -------------------------------------------------------------------------------- /sfswitch/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /enable_disable/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /runtime.txt: -------------------------------------------------------------------------------- 1 | python-3.11.2 -------------------------------------------------------------------------------- /enable_disable/management/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /enable_disable/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /enable_disable/management/commands/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benedwards44/sfswitch/HEAD/db.sqlite3 -------------------------------------------------------------------------------- /enable_disable/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /static/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benedwards44/sfswitch/HEAD/static/images/icon.png -------------------------------------------------------------------------------- /static/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benedwards44/sfswitch/HEAD/static/images/logo.png -------------------------------------------------------------------------------- /static/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benedwards44/sfswitch/HEAD/static/images/favicon.ico -------------------------------------------------------------------------------- /static/images/i-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benedwards44/sfswitch/HEAD/static/images/i-icon.png -------------------------------------------------------------------------------- /static/images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benedwards44/sfswitch/HEAD/static/images/loading.gif -------------------------------------------------------------------------------- /static/images/oh-dear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benedwards44/sfswitch/HEAD/static/images/oh-dear.png -------------------------------------------------------------------------------- /static/images/logo-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benedwards44/sfswitch/HEAD/static/images/logo-small.png -------------------------------------------------------------------------------- /static/images/tquila-logo@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benedwards44/sfswitch/HEAD/static/images/tquila-logo@1x.png -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: gunicorn sfswitch.wsgi --workers $WEB_CONCURRENCY 2 | worker: celery -A enable_disable.tasks worker -B --loglevel=info -------------------------------------------------------------------------------- /static/bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benedwards44/sfswitch/HEAD/static/bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /static/bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benedwards44/sfswitch/HEAD/static/bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /static/bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benedwards44/sfswitch/HEAD/static/bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /enable_disable/apps.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from __future__ import unicode_literals 3 | 4 | from django.apps import AppConfig 5 | 6 | class EnableDisableConfig(AppConfig): 7 | name = 'enable_disable' 8 | -------------------------------------------------------------------------------- /enable_disable/forms.py: -------------------------------------------------------------------------------- 1 | from django import forms 2 | from django.forms import ModelForm 3 | 4 | class LoginForm(forms.Form): 5 | environment = forms.CharField(required=False) 6 | access_token = forms.CharField(required=False) 7 | instance_url = forms.CharField(required=False) 8 | username = forms.CharField(required=False) 9 | org_name = forms.CharField(required=False) 10 | org_id = forms.CharField(required=False) -------------------------------------------------------------------------------- /templates/500.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | {% block content %} 4 | 5 |
10 |
11 |
10 |
11 | 9 | This tool provides an interface to easily enable and disable components in your Salesforce Org - Workflows, Triggers and Validation Rules. Very useful when doing data migrations and needing to disable certain automation. 10 |
11 |12 | None of your organisation information or data is captured or kept from running this tool. 13 |
14 | 15 |
19 | Building a list of validation rules, workflows and triggers...
24 |9 | This tool provides an interface to easily enable and disable components in your Salesforce Org - Workflows, Triggers and Validation Rules. Very useful when doing data migrations and needing to disable certain automation. 10 |
11 |12 | None of your organisation information or data is captured or kept from running this tool. 13 |
14 | 15 |9 | This tool provides an interface to easily enable and disable components in your Salesforce Org - Workflows, Triggers and Validation Rules. Very useful when doing data migrations and needing to disable certain automation. 10 |
11 |12 | None of your organisation information or data is captured or kept from running this tool. 13 |
14 |' + $(this).find('textarea.content').val() + '' + $(this).find('textarea.meta_content').val()
16 | .replace(//g,'>')
18 | .replace(/\n/g, '
') + '');
19 | $content.syntaxHighlight();
20 | $('#viewMetadataBody').html($content);
21 | $.SyntaxHighlighter.init();
22 | $('#viewMetadataModal .modal-dialog').width('90%');
23 | }
24 | else
25 | {
26 | $('#viewMetadataLabel').text($(this).find('div').attr('id'));
27 | $('#viewMetadataBody').html($(this).find('div').html());
28 | $('#viewMetadataModal .modal-dialog').width('800px');
29 | }
30 |
31 | $('#viewMetadataModal').modal();
32 | });
33 |
34 | // Enable all button
35 | $('.enable').click(function ()
36 | {
37 | $(this).closest('table').find('input[type=checkbox]').bootstrapSwitch('state', true);
38 | });
39 |
40 | // Disable all button
41 | $('.disable').click(function ()
42 | {
43 | $(this).closest('table').find('input[type=checkbox]').bootstrapSwitch('state', false);
44 | });
45 |
46 | // Deploy changes
47 | $('.submit').click(function ()
48 | {
49 | var metadata_type = $(this).attr('id').split('__')[1];
50 | var componentIds = [];
51 |
52 | $(this).parent().parent().find('td.' + metadata_type).each(function ()
53 | {
54 | var new_value = $(this).find('.new_value').bootstrapSwitch('state');
55 | var old_value = $(this).find('.old_value').val() == 'True' || $(this).find('.old_value').val() == 'true';
56 |
57 | if (new_value != old_value)
58 | {
59 | // Push to component update array
60 | var component = {
61 | component_id: $(this).attr('id'),
62 | enable: new_value
63 | };
64 | componentIds.push(component);
65 |
66 | // Set new old_value
67 | $(this).find('.old_value').val($(this).find('.new_value').bootstrapSwitch('state'));
68 | }
69 |
70 | });
71 |
72 | update_metadata(componentIds, metadata_type);
73 |
74 | });
75 |
76 | // Rollback changes
77 | $('.rollback').click(function ()
78 | {
79 |
80 | var rollbackAll = confirm('This will rollback all metadata for this metadata type to it\'s original state from when the metadata was first queried.');
81 |
82 | if (rollbackAll)
83 | {
84 |
85 | var metadata_type = $(this).attr('id').split('__')[1];
86 | var componentIds = [];
87 |
88 | $(this).parent().parent().find('td.' + metadata_type).each(function ()
89 | {
90 | var new_value = $(this).find('.new_value').bootstrapSwitch('state');
91 | var orig_value = $(this).find('.orig_value').val() == 'True' || $(this).find('.orig_value').val() == 'true';
92 |
93 | if (new_value != orig_value)
94 | {
95 | // Push to component update array
96 | var component = {
97 | component_id: $(this).attr('id'),
98 | enable: orig_value
99 | };
100 | componentIds.push(component);
101 |
102 | // Set old and new value back to original state
103 | $(this).find('.old_value').val(orig_value);
104 | $(this).find('.new_value').val(orig_value);
105 | $(this).find('.new_value').bootstrapSwitch('state', orig_value);
106 | }
107 |
108 | });
109 |
110 | update_metadata(componentIds, metadata_type);
111 | }
112 |
113 | });
114 |
115 | });
116 |
117 | function updateModal(header, body, allow_close)
118 | {
119 | if (allow_close)
120 | {
121 | $('#progressModal .modal-header').html('| 132 | {{ obj_name }} 133 | | 134 |135 | 138 | 139 | | 140 |141 | 144 | | 145 |
|---|---|---|
| 158 | 159 | {{ val_rule.name }} 160 | 161 | 193 | | 194 |195 | 196 | 197 | 198 | | 199 ||
| 250 | {{ obj_name }} 251 | | 252 |253 | 256 | 257 | | 258 |259 | 262 | | 263 |
|---|---|---|
| 275 | 276 | {{ workflow_rule.name }} 277 | 278 | 336 | | 337 |338 | 339 | 340 | 341 | | 342 ||
| 391 | 392 | | 393 | 396 | | 397 | 398 |399 | 402 | | 403 | 404 |
|---|---|---|
| 415 | {{ flow.name }} 416 | | 417 | 418 |419 | 420 | 421 | 422 | | 423 | 424 ||
| 474 | 475 | | 476 | 479 | | 480 | 481 |482 | 485 | | 486 | 487 |
|---|---|---|
| 498 | {{ trigger.name }} 499 | 500 | 501 | | 502 | 503 |504 | 505 | 506 | 507 | | 508 | 509 ||