Commit Graph

5438 Commits

Author SHA1 Message Date
Yashashvi Dave
02e82ef10c static/js/stream_events: Deduplicate notification settings updates. 2019-06-24 14:46:45 -07:00
Yashashvi Dave
5c88475378 static/js/stream_data: Deduplicate notification setting updates.
Commit also add `stream_data.js` to full test covered
enforced files for `test-js-with-node` tests.
2019-06-24 14:46:45 -07:00
Yashashvi Dave
e0a78af494 static/js/stream_data: Extract function receives_notifications. 2019-06-24 14:46:45 -07:00
Yashashvi Dave
88f3325970 stream settings: Deduplicate stream settings click handlers. 2019-06-24 14:46:45 -07:00
Yashashvi Dave
1b9c1a7898 stream settings: Deduplicate template rendering. 2019-06-24 14:46:45 -07:00
Yashashvi Dave
30821dbcbb handlebars: Register if_equal handlebar helper.
`if_equal` execute conditional code if both
conditions are equal in templates.
2019-06-24 14:46:45 -07:00
Yashashvi Dave
1f5720d1b8 stream settings: Add name attr to settings elements.
Add `name` attribute to stream settings `input` elements
and change `id` attribute corresponding to name.
`name` attribute stores value of settings name which is
stored in frontend data sets.
2019-06-24 14:46:45 -07:00
Yashashvi Dave
de1f4066ba stream settings: Change settings element-id to match with pattern.
Change element ids of `is_muted` and `pin_to_top` settings,
to macth with the pattern of other stream settings.

This is preparatory refactor to support removing code duplication in
the stream settings templates.
2019-06-24 14:46:22 -07:00
Yashashvi Dave
02e7655c4e display settings: Deduplicate display settings click handlers. 2019-06-24 14:41:53 -07:00
Yashashvi Dave
47f9cbf824 display settings: Deduplicate template rendering. 2019-06-24 14:41:53 -07:00
Yashashvi Dave
c667e16a29 keyborad shortcuts: Document message formatting keyboard shortcuts.
Fixes #12246
2019-06-24 14:08:50 -07:00
Yashashvi Dave
fed64cc59d static/js/common: Extract function adjust_mac_shortcuts. 2019-06-24 14:04:42 -07:00
Yashashvi Dave
251ed94bfc static/js/common: Use platform navigator to detect MacOS.
Replace `userAgent` navigator with `platform` navigator
to detect user's OS.
2019-06-24 14:04:42 -07:00
Yashashvi Dave
371343709b static/js/common: Extract function has_mac_keyboard. 2019-06-24 14:04:42 -07:00
YashRE42
50d43902fb narrows: Show invalid banner for invalid narrows.
Some search queries always return empty because of how we handle search,
this adds text that ensures users trying bad searches realize that they
are doing so.
2019-06-24 13:14:10 -07:00
YashRE42
02413f9a1b search: Show stopwords in multi-operator search.
Fixes #10592.
2019-06-24 13:08:08 -07:00
YashRE42
8fe86e5e24 tooltips: Fix alignment with keyboard-icon. 2019-06-24 12:57:52 -07:00
YashRE42
ae6e99ae34 tooltips: Fix doubling of keyboard-icon.
This fixes a bug where the default fade-in animation of bootstrap tool
tips caused the tool tip over the keyboard-icon to change shape slightly
while fading away.

Fixes #11766.
2019-06-24 12:57:48 -07:00
Hemanth V. Alluri
720c866e06 devtools: Tweak the integrations tool to use http headers fixtures.
Now that we store HTTP headers in a way that is easy to retreive
by specifying the integration name and fixture name, we should
use it to pre-load the "Custom HTTP Headers" field in the
integrations dev panel.
2019-06-20 16:40:42 -07:00
Yashashvi Dave
25dbda1e53 stream settings: Fix bug in deactivate stream modal appearance.
Stream deactivation modal should be append to main
unique id, stream overlay element.
This commit also add `new-style` class to modal.

Fixes #12394
2019-06-20 11:09:52 -07:00
Tim Abbott
09e57389ca Revert "settings_profile_fields: Refactor read_field_data_from_form."
This seems to have made our Casper tests fail.

This reverts commit e3237cdee2.
2019-06-17 16:35:57 -07:00
Yashashvi Dave
e3237cdee2 settings_profile_fields: Refactor read_field_data_from_form.
This is important setup for supporting external account type fields.
2019-06-17 15:02:36 -07:00
Thomas Ip
0253ef12c6 popovers: Encode brackets in URI to avoid conflict with markdown links.
This fixes an issue where one could end up with a `(` in the markdown
syntax for a link after copy-pasting this, which doesn't work in
markdown.

Fixes #12579.
2019-06-16 15:18:33 -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
Yashashvi Dave
981433d13c notification settings: Deduplicate template rendering. 2019-06-14 14:14:03 -07:00
Yashashvi Dave
31bb0439f9 notification settings: Reorder notification settings labels.
This is pre-refactoring commit for notification settings template
deduplication using a loop. This commit refactors notifications
section and reorder labels to match the ordering in the templates.
2019-06-14 14:13:29 -07:00
Vishnu Ks
44d16d76c1 activity: Extract most js from realm_summary_table to activity.js. 2019-06-14 10:20:59 -07:00
Vishnu Ks
14e582fb59 support: Add functionality to copy admin emails.
Also renamed a bunch of functions in test_views for better
readability.
2019-06-14 10:19:50 -07:00
Alexandra Ciobica
13d78e9da7 integrations: Make header of integrations/docs on mobile look good.
Change the display from `block` to `flex` in order to be able to
arrange the elements as wanted. Reset the css of the header elements
only for the description view. Add `font-size: 1.2em` because the font
doesn't need resizing in this case, it needs resizing only when the
title is in the box.

Removed the `padding-bottom` from the `nav` on mobile because it
overlaps the new header and you cannot click the back button from the
integrations.

Fixes: #12365.
2019-06-12 17:33:53 -07:00
Rishi Gupta
799d6b9203 org settings: Standardize strings in Other permissions section.
Also, options are now ordered from most restrictive to least restrictive.
A standard style here will be easier to understand and maintain as we add
more settings here.
2019-06-12 17:02:04 -07:00
Yashashvi Dave
ee072da47a static/js/settings_notifications: Deduplicate code. 2019-06-12 16:24:51 -07:00
Yashashvi Dave
8e269b4651 models: Rename notification to enable_stream_audible_notifications.
Rename notification property `enable_stream_sounds` to
`enable_stream_audible_notifications` to match with other
notification property patterns.

Fixes part of #12304
2019-06-12 16:24:51 -07:00
Seth Nickell
93696729c6 notifications: Disable default permission pop up.
Prior to this commit, we'd put up the green "Enable desktop
notifications" bar on page load AND the first time a desktop
notification worthy message was received, it would attempt to notify,
automatically triggering a browser permission popup (the same one as
clicking the green bar results in).

Now, desktop notifications are not attempted at all until the green
bar is clicked. Additionally Firefox and Webkit browser-specific
checks are made more uniform and done at the same point.

Tested written by YashRE42.

Fixes #11504.
2019-06-12 16:12:13 -07:00
Yashashvi Dave
ac0d60f577 settings_profile_fields: Extract func set_up_choices_field_edit_form. 2019-06-06 22:36:16 -07:00
Yashashvi Dave
1fef813914 static/js/settings_account: Clean function append_custom_profile_fields. 2019-06-06 22:36:16 -07:00
Priyank Patel
b70bd6be30 tests: Add tests for the logic of typing_status.handle_text_input.
This tests was added to make sure we catch subtle bug related to
comparing new_recipient and current_recipient. When we changed the
recipient to use arrays instead of string to use new user IDs based
api we encoured this bug and out testing suite couldn't detect this.
2019-06-06 19:56:24 -07:00
Priyank Patel
b8250fc61e typing: Use user IDs instead of user ids string. 2019-06-06 19:56:24 -07:00
Priyank Patel
5228403eb5 people: Refactor out user id string to array function. 2019-06-06 19:56:24 -07:00
Tim Abbott
3b502fa235 settings: Fix getting API key when using social auth.
Long-term, we want this flow to do a full re-authentication, but this
makes the frontend consistent with the backend and fixes a confusing
bug where submitting the form ended up adding a weird `?password=`
thing to the URL, in addition to not working.

Fixes #12200.
2019-06-06 17:05:34 -07:00
Thomas Ip
5b94e1dfad jQuery: Remove unnecessary :first selectors.
See example here: https://jsbin.com/relewizita/edit?html,js,output
Basically the original statement get the first of each input, button
and select element, and then select the first of these in the next
line. We can simply query the first one in one step. The settings
menu have at most 20 of these input elements so performance should
have no impact.
2019-06-06 15:21:26 -07:00
Thomas Ip
b72f30bd06 jQuery: Replace positional selectors at the end of multiple selectors.
A selector like `$('.elem1 .elem2:first')` selects the first descendant
with class name `.elem2` under `.elem1`. This is the same as saying
`$('.elem1 .elem2').first()`. See example here:
https://jsbin.com/bohehesari/edit?html,js,output
2019-06-06 15:21:26 -07:00
Thomas Ip
6cad1988a9 jQuery: Use positional methods on single selectors.
For selectors like `$('.element:first')`, we can simply write
`$('.element').first()`.
2019-06-06 15:21:26 -07:00
YashRE42
869aaba6a7 overlays: Fix stream edit click-through bug.
Fixes #12369.
2019-06-06 14:57:16 -07:00
Vaibhav
25b063ad95 css: Setup .tab-switcher.allow-overflow for informational overlays.
This changes the information-overlay tab-switcher to have the class
`.allow-overflow` too.

Fixes a regression introduced in 30da8bdf9b.
2019-06-04 00:43:51 -07:00
sahil839
5a130097bf settings: Add display setting for demoting inactive streams.
This adds a setting to control Zulip's default behavior of sorting to
bottom and graying out inactive streams.  The previous logic is still
the default "automatic", but this gives users more control.  See the
models.py comment for details.

Fixes #11524.
2019-06-03 23:07:56 -07:00
YashRE42
1ab4eaf819 stream_list: Pinned streams are never grayed out as inactive.
We have had a longtime bug where the state of pinned streams would not
update properly from the greyed out/inactive state to the active state
when a first message arrived to them.

After some discussion, we determined that likely the right fix for
this is to simply configure pinned streams to never be marked as
inactive; that's more in line with the intended user experience.

Fixes #8201.
2019-06-03 17:23:01 -07:00
Thomas Ip
537014ee47 dependencies: Upgrade typescript to 3.5.1. 2019-06-03 12:24:00 -07:00
Thomas Ip
1268616ca2 dependencies: Upgrade @typescript-eslint/eslint-plugin to 1.9.0.
Updated .eslintrc with new rules.
2019-06-03 12:24:00 -07:00
vinitS101
ed3e9be142 org_settings: Add collapse/show settings button for users and guests.
For non-admins some organisation settings tabs are 'collapsed' by default.
A button at the bottom of these settings can be used to toggle
show/collapse for these settings tabs.

Resolves #12313.
2019-05-31 22:42:02 -07:00
Puneeth Chaganti
9aa5a2b369 url preview: Use oEmbed html for videos.
Ensure that the html is safe, before using it. The html is considered if it is
in an iframe with a http/https src, based on the recommendations here:
https://oembed.com/#section3

We directly embed the `iframe` html into the lightbox overlay.
2019-05-31 15:59:03 -07:00