Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load intercom only if necessary #1804

Closed
5 of 6 tasks
pmusaraj opened this issue May 31, 2018 · 0 comments · Fixed by #2285
Closed
5 of 6 tasks

Load intercom only if necessary #1804

pmusaraj opened this issue May 31, 2018 · 0 comments · Fixed by #2285
Assignees
Labels
enhancement Ideas, improvements and features

Comments

@pmusaraj
Copy link
Contributor

pmusaraj commented May 31, 2018

@jnm has revived this issue and elaborated below.

Only certain users will receive access to Intercom, and the Intercom JS will not be loaded at all for the other users.

  • Add a new model for conditional settings with condition, value when matched, and value when not matched
  • Allow any query that can be made on the user model to be a condition
    • Pseudocode:
      if User.objects.filter(pk=request.user.pk).filter(
              matching_field=matching_value, …).exists():
          setting = value_when_matched
      else:
          setting = value_when_not_matched
    • Get that query parser in here!
  • Move this into a conditional setting:
    INTERCOM_APP_ID = os.environ.get('INTERCOM_APP_ID')
  • Make
    if settings.INTERCOM_APP_ID:
    out['intercom_app_id'] = settings.INTERCOM_APP_ID
    use the new conditional setting
@pmusaraj pmusaraj added the UI & UX User interface problems and improvements label May 31, 2018
@pmusaraj pmusaraj self-assigned this May 31, 2018
@jnm jnm assigned jnm and unassigned pmusaraj May 28, 2019
@jnm jnm reopened this May 28, 2019
@jnm jnm added enhancement Ideas, improvements and features and removed UI & UX User interface problems and improvements labels May 28, 2019
jnm added a commit that referenced this issue May 29, 2019
allowing us to selectively enable Intercom. Closes #1804
@jnm jnm closed this as completed in #2285 May 30, 2019
jnm added a commit to kobotoolbox/kobo-docker that referenced this issue May 30, 2019
…obsolete-intercom-setting

Remove obsolete INTERCOM_APP_ID env. var.
jnm added a commit to kobotoolbox/kobo-install that referenced this issue May 30, 2019
…bsolete-intercom-setting

Remove obsolete INTERCOM_APP_ID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Ideas, improvements and features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants