Commit Graph

202 Commits

Author SHA1 Message Date
Anders Kaseorg d17b577d0c js: Purge useless IIFEs.
With webpack, variables declared in each file are already file-local
(Global variables need to be explicitly exported), so these IIFEs are
no longer needed.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2019-10-25 13:51:21 -07:00
Pragati Agrawal 5b324e50ca users: Apply email_address_visibility policy on the users list.
In the emails-hidden case, for non-admins, we should remove the email
field from "Users" list in the organization settings page.

Tweaked by tabbott to correctly handle the bots and deactivated users pages.
2019-08-02 15:28:36 -07:00
Anders Kaseorg db0b33842c templates: Replace templates.render with require calls.
This removes an unnecessary layer of indirection and allows webpack to
catch filename mistakes.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-12 21:11:14 -07:00
Yashashvi Dave d7ee2aced1 models: Add `external_account` in custom profile field types.
Add new custom profile field type, External account.
External account field links user's social media
profile with account. e.g. GitHub, Twitter, etc.

Fixes part of #12302
2019-07-09 17:21:54 -07:00
Hemanth V. Alluri 52a5474000 realm_plan_type: Restrict uploading organization logos by plan type.
Using the page_param variable "plan_includes_wide_organization_logo"
disallow users in a realm with a "LIMITED" plan type from uploading
their own wide organization logos and instead suggest that they
upgrade their plan using the page_param variable
"upgrade_text_for_wide_organization_logo" for the suggestion message.

Backend validation for this feature already exists.
2019-06-14 16:21:12 -07:00
David Wood 5e53e3d960 org settings: Remove hanging references.
`realm_invite_to_stream_by_admins_only` doesn't appear elsewhere in our
codebase. Introduced in 272ed90, so I'm guessing this is the intended
value.

Co-Authored-By: Rishi Gupta <rishig@zulipchat.com>
2019-05-21 17:36:47 -07:00
David Wood 34d810aac3 settings: Migrate to create_stream_policy structure.
This commit replaces the `create_stream_by_admins_only` setting with a
new `create_stream_policy` setting, which mirroring the structure of
the existing `invite_to_stream_policy`.

This is important preparation for migrating the waiting period feature
to be its own independent setting.

Fixes #12236.
2019-05-06 16:27:55 -07:00
Shubham Padia 4994a6c2c9 realm: Add setting to disable avatar changes.
This is useful when syncing avatars from an integrated LDAP/active
directory.

The upload avatar and delete avatar buttons are hidden if avatar
changes are disabled and the user is a non-admin.
If the user has a gravatar set, then the user will not be able to
upload an image as their avatar if avatar changes are disabled.

Part of #12132.
2019-05-03 12:52:43 -07:00
David Wood 272ed90685 settings: Create an explicit invite_to_stream_policy setting.
This commit creates a new organization setting that determines whether
a user can invite other users to streams. Previously this was linked
to the waiting period threshold, but this was both not documented and
overly limiting.

With significant tweaks by tabbott to change the database model to not
involve two threshhold fields, edit the tests, etc.

This requires follow-up work to make the create stream policy setting
work how this code implies it should.

Fixes #12042.
2019-04-29 17:11:28 -07:00
Puneeth Chaganti a98341c79f digest: Add an organisation setting to choose the digest weekday.
Closes #549.
2019-04-28 18:40:07 -07:00
Puneeth Chaganti b0f485e95f org settings: Allow admins to enable or disable digest emails. 2019-04-27 15:20:41 -07:00
Tim Abbott 4df8a2ac0f settings: Fix handling of day logo without night logo.
In this case, we should just use the day logo for both themes.
2019-02-20 17:55:48 -08:00
sahil839 7157edf4af settings: Add support for uploading logo for night mode.
This adds a new field named realm_night_logo which is used for
displaying the organization logo when the user is in night mode.

Fixes #11176.
2019-02-18 15:15:57 -08:00
Pragati Agrawal 1e811b42ec org settings: Add realm level setting for missed message content in email.
This adds a setting under "Notification" section of
"Organization settings" tab, which enables Organization administrator to
control whether the missed message emails include the message content or
not.

Fixes: #11123.
2019-01-25 14:34:10 -08:00
Joshua Pan ad1df0ebeb settings: Add support for customizing the top-left logo.
This adds a new realm_logo field, which is a horizontal-format logo to
be displayed in the top-left corner of the webapp, and any other
places where we might want a wide-format branding of the organization.

Tweaked significantly by tabbott to rebase, fix styling, etc.

Fixing the styling of this feature's loading indicator caused me to
notice the loading indicator for the realm_icon feature was also ugly,
so I fixed that too.

Fixes #7995.
2018-12-18 12:44:52 -08:00
Tim Abbott bdb3da4504 eslint: Add key-spacing linter rule.
Apparently, we didn't have one of these, and thus had a moderate
number of generally very old violations in the codebase.  Fix this and
clear the ones that exist..
2018-12-18 10:41:06 -08:00
Steve Howell 7a44d99b96 settings: Eliminate admin_sections module.
We move all of its logic into settings_sections.

Note that this is slightly more than a refactor.
We are slightly more aggressive about resetting
sections.  For example, if you go into Settings,
then exit the overlay, then go into Manage
Organization, we will now reset sections for both
groups.
2018-12-17 10:13:20 -08:00
Steve Howell 2a1a55af8a settings: Streamline how we launch settings.
We can eliminate the janky `setup_page` methods
and just pass in section from `hashchanged`.

This sets us up to handle browser history more
nicely when you load '#settings' and we could essentially
redirect you to '#settings/your-account' (or similar
things).  A future commit will address that.

We also use `launch` as the new entry point, which
is more consistent with other modules.
2018-12-07 11:40:56 -08:00
Steve Howell 3acc6fe080 settings: Extract admin.build_page(). 2018-12-07 11:40:54 -08:00
Steve Howell fcf31cedbc settings: Extract gear_menu.update_org_settings_menu_item().
The prior name of this was a bit inaccurate, as we no
longer ever hide the menu item for non-admins.  Also,
it belongs more naturally in `gear_menu.js` at this point.

Also, we remove one call to this, which was in a place
where it was no longer necessary.
2018-12-07 11:40:40 -08:00
Steve Howell 1d07d0a532 settings: Extract admin_sections.maybe_disable_widgets().
We now run the code to disable widgets every time
we reload a section, which was the original intention
of the code, but the call to it only happened when
you first launched the page.

We also continue to run this logic for live updates
of is_admin, although it's worth noting that the
code still only handles the "demotion" case of going
from admin to non-admin. (If somebody makes you an
admin, you continue to need to reload to get
widgets enabled.)
2018-12-07 11:40:37 -08:00
Steve Howell b5645848d6 minor: Move line of code to set default language.
There was no reason for this code to be separated
from similar lines of code.
2018-12-07 08:04:09 -08:00
Joshua Pan 67f0b1bbca admin: Add UI for editing realm_email_address_visibility.
This new setting is still hidden in the UI when not in the development
environment, because the feature isn't ready for production, but
merging this will help simplify future work on the feature.
2018-12-06 16:01:09 -08:00
Steve Howell c8cbf39a16 Avoid fake clicks when launching settings pages.
Fake clicks sometimes require more code, and they're
brittle to selectors changing, and it's harder to
debug.
2018-12-02 19:07:24 -08:00
Cynthia Lin ecbc58c586 settings: Fix color styling for nested inputs to work in night mode. 2018-08-08 11:29:48 -07:00
Armaan Ahluwalia 6d255efe4c app: Prepare JS files for consumption by webpack.
This commit prepares the frontend code to be consumed by webpack.

It is a hack: In theory, modules should be declaring and importing the
modules they depend on and the globals they expose directly.

However, that requires significant per-module work, which we don't
really want to block moving our toolchain to webpack on.

So we expose the modules by setting window.varName = varName; as
needed in the js files.
2018-07-05 10:53:36 +02:00
Shubham Dhama d40c2bb166 emoji: Make uploading new realm emoji inaccessible for guest users. 2018-06-16 06:33:14 -07:00
Shubham Dhama 596ce5b60f invite: Make inviting new users inaccessible for guest users. 2018-06-16 06:33:13 -07:00
Steve Howell a5f0163a67 Keep track of which settings sections are open.
If you toggle between Settings and Organization now, it
will remember where you were the last time (not counting
reload).  Likewise if you go in and out of settings.

The old code always put you in the first section, which I
think was an accident of implementation.  Of course, we'll
continue to default to the first row if you haven't gone
anywhere else.
2018-06-06 09:42:33 -07:00
Steve Howell db514002ec settings: Use separate lists for the two sidebar panels.
The list with the options for normal settings now has
the class normal-settings-list.

The list with the options for org settings now has
the class org-settings-list.

The new markup helps us avoid code like this:

    $(".settings-list li:not(.admin)")

We also have funny hacks in our key handlers related
to the old combined-list approach, which we can
eventually eliminate.
2018-06-06 09:42:33 -07:00
Shubham Dhama d6c2160a3d admin: Move 'admin_settings_label' to top-level. 2018-05-30 23:28:21 +05:30
Tim Abbott f67d0d3f91 admin: Remove now-unnecessary ensure_i18n. 2018-05-30 09:01:56 -07:00
Shubham Dhama 4c28a79815 org settings: Clean up the context for admin pages.
This is a minor clean up of some contexts for admin pages
which we don't need anymore.
2018-05-02 11:42:28 -07:00
Shubham Dhama c293bb82c4 org settings: Change user joining invitation setting to dropdown. 2018-05-02 11:42:26 -07:00
Shubham Dhama 7f9cfab15a org settings: Add frontend for allow_community_topic_editing. 2018-04-28 13:00:29 -07:00
Shubham Dhama ccd5581bcd org settings: Handle floating point durations better for time limits.
Fixes: #9253.
2018-04-28 09:33:31 -07:00
YJDave 6bef44a9fa org setting: Add time limits for message deleting.
Add realm setting to set time limit for message deleitng.
Set default value of message_content_delete_limit_seconds
to 600 seconds(10 min).

Thanks to Shubham Dhama for rebasing and reworking this.  Some final
edits also done by Tim Abbott.

Fixes #7344.
2018-04-27 19:22:28 -07:00
Shubham Dhama f19b0b3254 org settings: Change message_edit settings to dropdown.
This coverts the "checkbox" for `realm_allow_message_editing`  and
"input" for `realm_message_content_edit_limit_seconds` into a
dropdown with the option for custom time limit option.
2018-04-23 18:22:35 -07:00
Vishnu Ks c9e932a7ce settings: Add support for Hangouts as the video chat provider.
The only thing that's annoying about this feature is that you need to
be a paying G Suite customer to use it.
2018-04-23 09:39:47 -07:00
Steve Howell f73bfd2a5c refactor: Extract settings_toggle.js.
This mostly moves code, and we also abandon the lookup mechanism
for finding our toggler.
2018-04-20 13:45:58 -07:00
Tim Abbott c90fbff703 settings: Clarify variable names for tab template rendering. 2018-04-12 09:48:02 -07:00
Shubham Dhama e317cd2c17 org settings: Add labels as a context to admin templates.
(It is a preliminary change for deduplication of org settings template.)
This adds org settings labels as a context to admin templates so that
they can be used as a context variables in admin templates.
The reason we did this in JS code because of translation issue when
passed (as a context in `partial` handlebars helper) directly within
template.
2018-04-01 14:52:12 +05:30
Shubham Dhama b7aae89029 org settings: Add realm level default time format setting. 2018-03-31 16:23:26 -07:00
Tim Abbott 5c1dd162be settings: Eliminate remaining NEW_USER_BOT code.
I somehow missed this when removing the rest of the custom
NEW_USER_BOT logic.

This may fix a Casper test that has been failing.
2018-03-30 09:16:22 -07:00
Umair Khan c14cefc24c settings: Add support for adding/removing custom profile fields.
Now that we have support for displaying custom profile fields, this
adds administrator-level support for creating them.

Tweaked by tabbott to fix a few small bugs and clean up the commit message.

Fixes #1760.
2018-03-29 13:59:16 -07:00
Vishnu Ks 3da2a1e18d admin: Add a realm setting to disallow signups using disposable emails.
Fixes #2955
2018-03-11 22:05:58 -07:00
Shubham Dhama 777b6de689 org settings: Add setting to prevent users from adding bots.
Fixes: #7908.
2018-03-09 13:21:55 -08:00
Aastha Gupta d124597f4b org-settings: Add setting to turn off welcome emails.
This adds an organization-level setting to provide an option to turn
off the welcome emails.

Fixes #8000.
2018-02-28 12:39:01 -08:00
YJDave 15dd94035c org settings: Handle NEW_USER_BOT not being set.
If NEW_USER_BOT is not configured in organization, then disable setting
for selecting stream for new user notification.
2018-01-23 15:23:25 -05:00
Alena Volkova 45f0c76c44 settings: Limit the creation of generic bots.
This commit adds a setting to limit creation of generic bots
to admins for realms that want that restriction.  (Generic
bots, apart from being considered spammy on some realms,
have less locked down permissions than webhook bots).

Fixes #7066.
2018-01-02 18:12:22 -05:00