Commit Graph

9479 Commits

Author SHA1 Message Date
YashRE42 a27e6aa673 message_edit: Show inline topic edit spinner only via save handler.
This commit delegates the responsibility of displaying a spinner to
the "save_inline_topic_edit" function.
2020-04-22 16:25:38 -07:00
YashRE42 ee68ac9957 message_edit: Show error message if error edit fails.
Message_edit.js had a bug where if the inline topic_edit failed, it
would not show an error because it attempted to make a look up for
the message_id as though it were a message row edit, which would not
work. That was changed in a refactor, which made it apparent that
there was no error being rendered at all. This commit corrects it by
rendering the error, it also adds some styling to ensure the error
message is displayed inline and it makes a change to the template so
the error is rendered before the spinner.
2020-04-22 16:25:37 -07:00
YashRE42 ba40d68522 message_edit: Add Escape as hotkey to close the inline topic edit. 2020-04-22 16:25:37 -07:00
YashRE42 aa4adce4a4 message_edit: Refactor handle_edit_keydown to separate inline topic edits.
This commit cleans up the dirty if/else structure of
handle_edit_keydown by switching to switch case statements, and also
separates the handler for inline_topic_edits and that for message
row edits.
2020-04-22 16:25:37 -07:00
YashRE42 f18ef0469a message_edit: Refactor .save and .end to separate inline topic edits.
This commit makes it so that inline (recipient bar) topic edits follow
a different path from full message row edits in `message_edit.js`.
This commit:
- deletes `.save()` endpoint and replaces all calls to it with
 `.save_message_row_edit()` and  `.save_inline_topic_edit()`
- deletes `.end()` endpoint and replaces all calls to it with calls to
  either ".end_message_row_edit()" and ".end_inline_topic_edit()".
2020-04-22 16:25:37 -07:00
YashRE42 53dde9af68 message_edit: Refactor handle_edit_keydown to use switch case style. 2020-04-22 16:25:37 -07:00
YashRE42 bad60ca7be navbar: Append space at the end of filter for search convenience.
As long as the current narrow isn't already a search narrow or empty,
we add a single space at the end of the current filter so that the
user can just press the right arrow key and begin typing their search
term, instead of having to add a space themselves.
2020-04-22 15:11:30 -07:00
Ryan Rehman c81240547e muting: Fix real time sync of muted topics. 2020-04-22 15:07:15 -07:00
Ryan Rehman 3bc818b9f7 muting ui: Update the muted topics table in settings.
The set_up_muted_topics_ui and templates have been
refactored to use list_render.
This is done to support filtering and sorting of
the muted stream topics.

This also includes the addition of a new Date muted header.
2020-04-22 15:07:15 -07:00
Anders Kaseorg c00f626f8e styles: Fix code block white-space for Python-Markdown upgrade.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-04-22 15:03:24 -07:00
Siddharth Varshney 00091c34c0 user-popover: Replace bullhorn icon with paper-plane. 2020-04-22 10:19:06 -07:00
YashRE42 f25aacdf66 navbar: Reset searchbox text on calling ".exit_search()".
This commit makes sure that we replace the text in the search box
every time a user calls `exit_search()` eg via the escape hotkey or by
clicking the `x` icon, so that the search box discards any input and
always starts at the current narrow.
2020-04-22 09:40:47 -07:00
vaibhavrajsingh2001 2c0c936e40 stream settings: Correct alignment of filter streams div.
The div containing options for filtering streams was placed in the
centre. Aligned it towards the right. Had to pass a special check
variable in subs.js:540 to add the specific class for this purpose.
This was a specific scenario where this sort of CSS was to be added,
hence had to make a specific case.

Also, fixed the bottom border color of the search streams bar for night
mode.
2020-04-21 16:59:41 -07:00
Rohitt Vashishtha e94b151ff6 composebox_typeahead: Properly populate stream topic data for message edits.
Previously, we would always pick up the stream and topic name from
compose_state. This would work for message edits as well when the
composebox was open.

Now, if we are in a message edit, we get the stream and topic of the
message being edited before falling back on trying to populate using
the composebox state.

Fixes #14545.
2020-04-21 16:15:28 -07:00
jagansivam28 0de77cabb0 settings UI: Add brighness on hover effect for "X" icon in upload avatar.
Increase brightness on hover effect for "X" icon in upload
avatar area is added and change the text to "delete profile picture"
while hovering over "X" icon in the avatar upload area.
2020-04-21 13:27:55 -07:00
sahil839 578ccea220 typeahead: Update for email_address_visibility settings.
This commit changes the code to show user according to emails based
on email_address_visibilty_values and the type of user.

1. email_address_visibility = admins,members and guests

   Typeaheads are shown according to original emails.

2. email_address_visibility = admins only

   Typeaheads are shown according to original email to admins which
   were previously shown according to system-generated email of
   form "user10@zulipdev.com".

   For non-admins, typeaheads are not shown according to emails as
   they are not visible in the typeahead itself to non-admins.

3. email_address_visibility = nobody

   Typeaheads are not shown according to emails for all type of users.
2020-04-20 20:53:39 -07:00
sahil839 821059814e typeahead: Fix broken email address handling in typeahead.
Previously, when email_address_visibility was set to admins only, the
non-admin users were not shown emails in typeaheads, while admins were
shown emails of the form 'user11@zulipdev.com'.

This commit corrects it to show the original emails in typeaheads and
input box of adding subscribers to admins and the behaviour is same
for non-admins.
2020-04-20 20:49:47 -07:00
sahil839 6657cddd7a refractor: Move get_visible_email from popovers.js to people.js.
This commit moves the get_visible_email function to people.js
as this function will be used in other places and people.js seems
relevant file for this.

Tests are added to get full coverage.
2020-04-20 20:48:47 -07:00
vaibhavrajsingh2001 6ddc4827fe design: Make copy text button clickable again.
Due to added opacity of 0.5 through the readonly property, the button
for copy and close was not clickable. Increasing z-index of the button
solves it.
2020-04-20 16:01:14 -07:00
Siddharth Varshney 2d11d58c9a ui: Fix deleted msg color in Message edit history modal.
New colors are introduced in msg edit history modal for better readability
These color will have better constrat with their background colors

Fixes #13622
2020-04-20 15:42:24 -07:00
Roland Crosby ac7ec426b0 Add stream sorting widget to subscriptions page
This change adds a toggle widget to the "add streams" page that
lets the user change the sort order of the streams list. So far,
this supports sorting by stream name, by number of subscribers,
or by estimated weekly traffic.
2020-04-19 15:07:37 -04:00
jiviteshjain 3da483487a manage streams: Move stream filter to next line.
Previously, in narrow viewports, the "filter"
option would disappear, which was very confusing.

This commit moves the filter streams input to the
next line, making it visible at all viewport widths.

@showell modified the commit message and got Casper
tests passing.

Fixes #12898.
2020-04-19 09:59:11 -04:00
Pranav 3f47c0f8bc click_handlers: Refactor select_message_function.
This uses the early-return pattern to make the main click handler for
opening the compose box more readable.
2020-04-18 22:32:51 -07:00
Pranav ce9f21545a message_list: Use document.getSelection to identify drags.
This removes the messy click-or-drag detection algorithm originally
added in fe8f63c389, which fixed a messy
bug in an earlier algorithm from ~2013, whose sole purpose as to check
whether we're doing a selection and if so, not trigger the
click-on-message-body click handler.

The right fix is of course to do that check correctly.
2020-04-18 22:30:18 -07:00
Pranav d2cf2ba93f drafts: getSelection to differentiate clicks from drags.
We can use getSelection to distinguish between clicks and drags while
accessing the body of a saved draft.  Previously, the draft would be
restored when trying to select draft text to copy/paste.

Fixes #14447.
2020-04-18 22:19:48 -07:00
Pranav 04d55f04ab stream_edit: Replace $this with e.currentTarget.
Replace the '$this' by e.currentTarget to make code clean.
2020-04-18 22:05:39 -07:00
Pranav 3b71e0dbfb stream settings: Fix UI feedback on clicking checkbox to subscribe.
Before this change, on clicking a checkbox to toggle subscription to a
stream no UI feedback was shown and users could toggle the checkbox
multiple times to send multiple requests causing bugs. This commit
initializes a spinner on clicking the checkbox, to provide a UI feedback
to the user. This commit also disables the checkbox once a request for
subscription has been sent and re-enables the checkbox only after a
response.

This change has been accomplished by introducing a div to display the
spinner in subscription.hbs. The corresponding styles for the spinner
have been added in subscriptions.scss. The ajaxSubscribe &
ajaxUnsubscribe functions in subs.js have been updated to show & hide
the spinners for the time the request is in process. An additional
parameter, the concerned stream object is passed to these functions(
through the sub_or_unsub function) to get the location where the spinner
is to be displayed. Finally, the checkbox click handler is updated to
support these changes.

The testing for this has been done by adding a wait of 2 secs in
actions.py for the response. This gives sufficient time to test the
working manually. Also, for error cases an error has been sent from
action.py and the behaviour has been manually observed.

Fixes #14481.
2020-04-18 22:00:02 -07:00
Divyanshu Agrawal a076bcb9f4 file uploads: Internationalize upload status text.
Use i18n to ensure that the status text 'Uploading filename...' is
properly localized.
2020-04-18 21:22:47 -07:00
Divyanshu Agrawal b30da07fd3 file uploads: Remove status text for user cancelled uploads.
Remove the 'Uploading file...' message from the compose box when
the user manually cancels a file upload.
2020-04-18 21:22:47 -07:00
Divyanshu Agrawal 4215386ae3 file uploads: Remove status text for failed server uploads.
Remove the 'Uploading file...' message from the compose box when
file upload fails due to a server side error.
2020-04-18 21:22:47 -07:00
Divyanshu Agrawal 6d7e91b6c7 file uploads: Remove status text for failed frontend uploads.
Some uploads can be rejected in the frontend, like when the file
size is too big, without sending the file to the server. Remove the
'Uploading file...' message from the compose box in such cases.
2020-04-18 21:22:47 -07:00
Anders Kaseorg 43ac901ad9 styles: Fix code block styling for Python-Markdown upgrade.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-04-18 20:39:21 -07:00
Abhishek-Balaji b3ce150aac alert settings: Relocate alert_word_settings_item.hbs
Relocating alert_word_settings_item.hbs from templates/ to
templates/settings.
2020-04-18 15:50:04 -07:00
Abhishek-Balaji 2ea8dfb178 alert settings: Move alert words addition form separately.
Now, the system uses word='' and an editing=True for rendering an
form for addition of alert words. This is a very vulnerable
way to implement said feature and this commit fixes that.
The addition form has been moved to alert_word_settings.hbs
thereby rendering it only once but always. Now, we do not have
to manually add an empty word and editing for the form to be
rendered.
As part of refactoring, the editing parameter has also been
removed as there is no purpose left.
2020-04-18 15:50:04 -07:00
YashRE42 ad4097342b navbar: Use flex-grow to align search_icon to right.
This change allows us to align the search icon to the right end of the
navbar, without having to rely on the `margin-left: auto` trick. This
is better because it's more convenient to let flex handle the
positioning and will, hopefully, be more resilient to breakages.
2020-04-18 13:40:54 -07:00
YashRE42 593e3ba2fb navbar: Remove unnecessary "search_icon" styles.
This change corrects a bug that caused firefox to render the width
(and hence margin and position) of search_closed differently.
2020-04-18 13:40:54 -07:00
YashRE42 faf48d974f navbar: Shift "search_icon" styles to be before tab_bar and search_box.
The motivation behind this change is that it is more sensible to have
search_icon styles appear first and then be overridden by
search_closed or search_open styles which appear afterwards. This is a
prep commit to correcting a bug that caused some browsers to
render the width (and hence margin and position) of search_closed
incorrectly.
2020-04-18 13:40:54 -07:00
Anders Kaseorg 6f55a8b7e5 templates: Fix invalid self-closing tags.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-04-18 13:13:14 -07:00
Anders Kaseorg 8e93175822 requirements: Upgrade Python-Markdown from 3.1.1 to 3.2.1.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-04-18 13:09:51 -07:00
Anders Kaseorg ddcb828349 markdown: Match Python-Markdown code whitespace more closely in JS.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-04-18 13:09:51 -07:00
YashRE42 87ba6cb4c9 tab_bar: Fix colors stream_count and description in nightmode.
This fixes a bug which caused by removing an <li> based structure on
the navbar. We forgot to update these styles.
2020-04-17 14:49:39 -07:00
YashRE42 bbdc66a214 typeahead: Close/open typeahead with searchbox.
The todo here is to ensure that we open and close the typeahead as
soon as the navbar search is opened/closed.
2020-04-17 13:37:04 -07:00
YashRE42 eb4a2b9d4e navbar: Improve structure & styling for top navbar.
This updates the logged-in top navbar to display the stream/message
name, number of users, and description. It also replaces the search
bar with a search icon that expands into a full-width search bar.

Co-authored-by: Max Nussenbaum <max@maxnuss.com>

Fixes: #164.
Fixes: #5198.
2020-04-17 13:35:44 -07:00
YashRE42 5fdb8989e5 filter: Use ', ' to separate names in PM title.
This is a prep commit for the navbar redesign.
2020-04-17 13:13:31 -07:00
Tim Abbott 497383cc12 stream_topic_history: Fix incorrectly migrated field name.
In ee0d4541b4, we renamed the topic_date
-> stream_topic_history, and in the process renamed some local object
properties from .name => .topic_name, and accidentally change the
type for the data from the server as well.

The test fixtures were incorrectly migrated in the same way, so we fix
that as well.
2020-04-17 13:11:27 -07:00
Jagan e5d6e2e44f settings UI: Fix hovering bug in "Uploaded files" settings.
While Hovering over some cell of the tables in settings Tab
increase the cell width since we are using the pseudo-Element `:: after`
the bug is fixed by adding `position: absolute;`.
fixes #14559
2020-04-17 11:35:31 -07:00
vaibhavrajsingh2001 f0c5b1a8d7 design: Use CSS instead of disabled property for non-editable text.
The disabled property actually prevented text selection, so it seems
better to use CSS through the `readonly="readonly"` property.
For this, swapped .prop() with .attr() since .prop() was setting it as
`readonly=""`.
2020-04-17 08:36:21 -07:00
Hashir Sarwar ee0d4541b4 topic_data: Rename `topic_data` module to `stream_topic_history`.
`stream_topic_history` is a more appropriate name as this
module will contain information about last message of a
stream in upcoming commits. Function and variable names
are changed accordingly like:

* topic_history() -> per_stream_history()
* get_recent_names() -> get_recent_topic_names()
* name -> topic_name
2020-04-16 20:11:04 -07:00
Vishnu KS c5eddcb1ca upload: Don't hide upload status if there are errors. 2020-04-16 20:09:19 -07:00
Vishnu KS c06d29d0aa upload: Don't add remaining files if adding a file fails.
If a file cannot be added for upload because of restrictions in frontend
we call cancelAll immediately in 'info-visible' callback. This would
prevent files that are already added to be cancelled but does not cancel
files that are yet to be added. So we use break to prevent any more files
from being added.
2020-04-16 20:09:19 -07:00