Skip to content

Commit

Permalink
Merge pull request #410 from communityconnectlabs/feat/update-flow-ed…
Browse files Browse the repository at this point in the history
…itor

feat: update flow editor + make analyzer available only for cclers
  • Loading branch information
teehamaral authored Jul 24, 2024
2 parents 1a4b013 + 16339e5 commit 4a478f3
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 4 deletions.
2 changes: 2 additions & 0 deletions docker/docker.settings
Original file line number Diff line number Diff line change
Expand Up @@ -257,3 +257,5 @@ GOOGLE_FONT_API_KEY = os.environ.get("GOOGLE_FONT_API_KEY", "")
FCM_API_KEY = os.environ.get("FCM_API_KEY", "")

TWO_FACTOR_ENABLED = os.environ.get("TWO_FACTOR_ENABLED", "false") == "true"

FLOW_ANALYZER_ENDPOINT = os.environ.get("FLOW_ANALYZER_ENDPOINT", None)
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
]
},
"dependencies": {
"@greatnonprofits-nfp/flow-editor": "1.17.7",
"@greatnonprofits-nfp/flow-editor": "1.17.9",
"@greatnonprofits-nfp/temba-analytics": "1.1.1",
"@greatnonprofits-nfp/temba-components": "0.26.1",
"@tailwindcss/ui": "0.2.2",
Expand Down
2 changes: 2 additions & 0 deletions temba/flows/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1451,6 +1451,8 @@ def get_context_data(self, *args, **kwargs):
context["dev_mode"] = dev_mode
context["is_starting"] = flow.is_starting()
context["feature_filters"] = json.dumps(self.get_features(flow.org, flow))
context["allow_analyzer"] = self.request.user.is_support()
context["analyzer_endpoint"] = settings.FLOW_ANALYZER_ENDPOINT

# check if there is no other users that edititing current flow
# then make this user as main editor and set expiration time of editing to this user
Expand Down
2 changes: 2 additions & 0 deletions temba/settings_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1492,3 +1492,5 @@

METABASE_SECRET_KEY = os.environ.get("METABASE_SECRET_KEY", "")
METABASE_SITE_URL = os.environ.get("METABASE_SITE_URL", "")

FLOW_ANALYZER_ENDPOINT = os.environ.get("FLOW_ANALYZER_ENDPOINT", None)
4 changes: 4 additions & 0 deletions templates/flows/flow_editor.haml
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,10 @@
{% if has_translator %}
translation: '/org/translate/',
{% endif %}

{% if allow_analyzer and analyzer_endpoint %}
analyzer: '{{analyzer_endpoint}}',
{% endif %}
},

};
Expand Down

0 comments on commit 4a478f3

Please sign in to comment.