Commit Graph

6782 Commits

Author SHA1 Message Date
Yashashvi Dave 9a09513b4d user settings: Add link to user profile popover.
Add button to view current user's profile popover
from user settings page.
2018-08-27 17:26:07 -07:00
Yashashvi Dave 4049a08b88 user popover: Display text as link for URL custom field.
In user profile popover, for URL type custom field
display text as link in popover, so user can easily
click on link directly.
2018-08-27 17:26:07 -07:00
Yashashvi Dave 1c14e0166c user profile popover: Enhance popover style.
This commit make changes in style of exit-sign of modal,
and also remove spacing between fields in modal.
2018-08-27 17:26:07 -07:00
Yashashvi Dave 1d7164225f custom field: Rename field type List to List of options in UI. 2018-08-27 17:26:07 -07:00
Marco Burstein 6f57cd4d23 upload: Use a placeholder when uploading.
Use the placeholder `[uploading file]()` when uploading before the
upload has completed. This behavior prevents an image from being
improperly placed when typing after starting an upload. This is based
on GitHub's handling of image uploading.

Also, add tests to the `upload` Node tests and update existing tests to
account for the new behavior.

Fix #10305.
2018-08-26 23:33:24 -07:00
Marco Burstein fa22cf18f6 compose_ui: Create the `compose_ui.replace_syntax` function.
`replace_syntax` will replace text inside of a compose textbox. Also,
add tests to the `compose_ui` Node tests for this function.
2018-08-26 23:33:24 -07:00
Marco Burstein 76511aeed6 settings: Add a minimum width to "person picker" custom fields.
Empty "person picker" fields appear with a much smaller width than all
other custom fields. Increase the `min-width` of the field that it
matches the widths of other text boxes.

Fix #10414.
2018-08-26 23:05:10 -07:00
Steve Howell bb3ecb178a Fix bugs related to batching message events.
This is general fix that makes sure that we
apply all message-modifying events after we
apply the events for the initial incoming
messages.

The particular scenario that was reported here
was when you would have two tabs for Zulip,
with one of them open and in a PM view, and
with the open tab being at the bottom of the
feed, such that incoming messages would be
immediately visible.

Now suppose the other person in that PM
conversation sent you a message.

The open tab would properly immediately
mark the message as read, and notify
the server.  The problem was that the closed
tab would not process the main message event
until it "woke up", by which time the flag-update
event was bundled into the same event batch
as the main message event.  We'd then process
the flag-update first, which essentially was
a noop, since the actual message wasn't in
the message store yet.  The user would then
see unread counts increment in the closed tab,
while the open tab didn't increment.  This
was confusing.

Now `server_events.js` processes the actual
message first and does the flag-update as part of a
`post_message_events` loop.

We include events for updating message flags,
deleting messages, and attaching submessages
to messages in the `post_message_events` array.

This bug was a bit difficult to simulate in a dev
environment, since you needed your "open" tab
to be in focus to simulate the race, but as
soon as you tab to another place to deliver
a message (whether from the browser or otherwise),
the open tab is no longer in focus.

I did this in the console of my "open"
tab to work around it:

    unread_ops.process_visible = unread_ops.mark_current_list_as_read;

This problem was easy to reproduce, but it wasn't
entirely consistent.  I often needed to send
several messages in succession to trigger event
batching and force the race condition.  (This wasn't
precisely a "race", as events actually arrive in the
correct order; it was having them arrive in the same
batch that triggered the bug.)
2018-08-26 22:26:28 -07:00
Steve Howell 5d98879922 minor: Rename var to update_message_events. 2018-08-26 22:26:28 -07:00
Steve Howell ffb6f5099c minor: Alphabetize cases for event dispatching. 2018-08-26 22:26:28 -07:00
Harshit Bansal ec2ebd1cc9 build_emoji: Change sprite CSS files to use hyphens in names.
This is more consistent with our other names in emoji infra.
2018-08-26 22:16:23 -07:00
Harshit Bansal 9bd56d0ce4 build_emoji: Change emoji sprite sheets to use hyphens in names.
Use of hyphens is more consistent with our other emoji infra names.
2018-08-26 22:16:23 -07:00
Yashashvi Dave d72280f1c7 invite user: Fix click handler called multiple time on submit.
This commit fixes multiple invite-user-email sent to user.

In invite-user-form, submit-form click handler is getting
called multiple times on submit-invite-user-form event, which
results in multiple invitation mail to user.
Because, we registered same submit click handler multiple times.
Submit form click handler is registered when user opens invite-user
modal. If user opens modal multiple times, click handler get
registered multiple times.

We should register this click handler on `exports.initialize`
function instead of `exports.launch` function. This modal is unlike
other modal, where we append html when user opens modal. In this
case, we append modal on initialization. We only show modal when
user opens. So on initialization, modal element already exists,
register click handler on submit-btn element, on intialization
not when user open modal.

Fixes #10354.
2018-08-26 22:15:50 -07:00
Yashashvi Dave f4067bb38b static/js/invite.js: Extract func `submit_invitation_form`.
Extract function `submit_invitation_form` and relocate
some functions to make it easy to review diff.
2018-08-26 22:15:50 -07:00
Steve Howell 0b548b6b6e minor: Avoid code duplication in input_pill. 2018-08-24 10:00:04 -07:00
Steve Howell eb7f7fae55 list_cursor: Promote error handling code.
If a caller passes undefined to go_to, it is
almost certainly a programming error, so we
shouldn't silently ignore it just because
the current key is undefined.

We also avoid setting curr_key until we
validate the incoming key.
2018-08-24 10:00:04 -07:00
Marco Burstein 87e2231902 settings: Fix an error for non-admins on the custom profile fields page.
When non-admin users visit the custom profile fields settings page,
the `Sortable` error

    Uncaught Sortable: `el` must be HTMLElement, and not
    [object Undefined]

is thrown, with `undefined: undefined | No stacktrace available` being
shown in the browser. Fix this by only using `Sortable` if the user is
an admin.

Fix #10403.
2018-08-23 23:03:59 -07:00
Shubham Dhama c8a8dbb86a org settings: Remove redundant lines for disabling non-existent checkbox.
In commit c293bb82c4 we changed
id_realm_invite_by_admins_only and realm_invite_required checkboxes to a
single dropdown so these lines are redundant now.
2018-08-23 11:52:59 -07:00
Akash Nimare 44fd3f124c topic_edit_form: Update styling of topic edit form.
Updated the CSS a bit so that it matches with other inputs.
2018-08-23 11:51:20 -07:00
Yashashvi Dave b5fb110166 static/js/settings_account.js: Handle null custom fields values. 2018-08-22 22:45:08 -07:00
Yashashvi Dave d5153bd136 events: Convert custom user field value to json object on update event.
In user type custom field, field value is list of user ids. We weren't
converting list to json object in update event payload. This throws
error in frontend, cause we store stringify representation of custom
field value. Therefore, after update event is recieved field-value-
type gets updated to array from string which throws json parsing error.
2018-08-22 22:45:08 -07:00
Joshua Pan eca4266cde drafts: Don't save drafts with 2 or less characters.
Fixes #10357.
2018-08-22 16:52:18 -07:00
Marco Burstein 21d537d3bd styles: Fix the oversized search bar on mobile.
On mobile devices, the search bar appears as too tall for the rest of
the top header. Fix this by setting `#search_query`'s height and
vertical alignment properties.

Fix #10373.
2018-08-22 13:15:08 -07:00
Tim Abbott 1768fd2f60 Revert "left-sidebar: Add max-height to private message container."
This caused ugly scrollbar problems on Linux.

This reverts commit 321b705591.
2018-08-21 14:03:15 -07:00
Joshua Pan 3ec34eda11 display settings: Implement UI for starred_message_counts. 2018-08-21 13:42:23 -07:00
Joshua Pan 2aeabf24a6 frontend: Create data structure for starred messages. 2018-08-21 13:42:23 -07:00
Marco Burstein fa95ba9812 style: Fix the stream and user list buttons on mobile in night mode.
These buttons are displayed with a lighter background than other
buttons. Update their borders and background colors (along with the
border on the search box) so that they match the night theme.

Fix #10301.
2018-08-21 12:42:06 -07:00
Yashashvi Dave 6031ccff5c user pills: Every pills-container must include div-input element.
Expect div-input element in every pill-container even though pills are
not editable.  This is correct, because `input_pill.js` appends pills
before the div-input element.
2018-08-21 12:10:36 -07:00
Yashashvi Dave 4f9ca03c13 user profile popover: Display user pills in custom user field.
Display user pills instead of user names in custom user field
on user profile popover.
2018-08-21 12:10:35 -07:00
Yashashvi Dave 9812b81a1e user pills: Rename class `notmem` to `not-editable` for generalization. 2018-08-21 11:50:01 -07:00
Tim Abbott 5f10fa1692 user_profile_modal: Remove profile_data conditional.
It's no longer possible for profile_data to be empty, and the
conditional was in the wrong place anyway.
2018-08-21 11:49:36 -07:00
Yashashvi Dave 92782e2f89 static/js/popovers.js: Modify structure of user popover template data.
Modify structure of template data used to render
`user_profile_modal.handlebars`.

This is preparatory commit to display user pills in user profile
popover instead of user names in user type custom fields.
2018-08-21 11:42:59 -07:00
Yashashvi Dave 9e9bb18244 user profile popover: Use long local date format in custom-date-field.
Use long local date format `MMMM DD, YYYY` instead of short `MM/DD/YY`
in custom profile date field.
2018-08-21 11:42:59 -07:00
Yashashvi Dave 6622f995b0 user profile popover: Rename user last seen.
Rename "Last seen just now" to "Just now",
and "Unknown" to "More than 2 weeks ago"
in user profile popover.
2018-08-21 11:42:59 -07:00
Yashashvi Dave 150ea61271 custom profile field: Improve style of user pills in user type field.
Improve style of user pills in user-type-custom-field on
account settings page.
2018-08-21 11:42:59 -07:00
Yashashvi Dave 1e27cb18eb user profile popover: Hide popover when user clicks on edit-profile-btn. 2018-08-21 11:42:59 -07:00
Yashashvi Dave 583fde4311 custom profile field: Set default values in create-field form on load.
Add call of reset function, on load of admin settings page.
This function reset values in create-new-field form, i.e.
field type.
2018-08-21 11:42:59 -07:00
Yashashvi Dave 03f5422ce8 custom profile field: Minor tweaks in field-table in admin settings.
This commit add minor changes in profile field table in
admin settings:
 - Hide table header if there is no field
 - Fix width of table column
2018-08-21 11:42:59 -07:00
Yashashvi Dave 66c2b6d2a6 custom profile field: Remove unnecessary table header from edit form.
Remove unnecessary table header in edit-choice-field form.
2018-08-21 11:42:58 -07:00
Yashashvi Dave d5f3c9b3bc custom profile field: Rename field types in UI. 2018-08-21 11:37:51 -07:00
Yashashvi Dave 463fb622b6 custom profile field: Remove all static use of field-type name or id.
This commit removes all static use of field-type's name or id in
frontend.
2018-08-21 11:37:51 -07:00
Yashashvi Dave 6e65235a6d zerver/lib/events.py: Add FIELD_TYPE_CHOICES_DICT to page_params.
This commit add FIELD_TYPE_CHOICES_DICT to page_params and replace
FIELD_TYPE_CHOICES.

FIELD_TYPE_CHOICES_DICT includes all field types with keyword, id
and display name. Using this field-type-dict, we can access field
type information by it's keyword, and remove all static use of
field-type'a name or id in frontend.
This commit also modifies functions in js where this page_params
field-types is used.
2018-08-21 11:37:51 -07:00
Max Nussenbaum eaefa31969 portico: Fix mis-sized bullets.
This fixes the mis-sized text in the bulleted lists on /for/
working-groups-and-communities (and some other pages), by ensuring
p tags inside li tags don't get font-size styling applied to them
twice.
2018-08-21 11:34:39 -07:00
Yago González 6949ce1bad templates: Replace   with normal spaces.
This line full of non-breaking spaces dates back to before Zulip being
open sourced (ca4e6a0ff), so we can assume it was a fix that we don't
need anymore.
2018-08-21 11:13:47 -07:00
Rishi Gupta 9a759060cd user docs: Remove outdated app guides. 2018-08-20 18:52:04 -07:00
Rohitt Vashishtha 8a61ac3500 typeahead: Move displaced comment to correct location. 2018-08-20 12:44:24 -07:00
Akash Nimare dab75e4990 help: Fix styling of emoticons on help pages. 2018-08-17 11:37:29 -07:00
Rishi Gupta fa50f68ec5 settings: Rename emoji settings. 2018-08-17 08:49:48 -07:00
Yashashvi Dave 8ef0c6d99a custom profile field: Add length validation on field name and hint.
Add max length validation for custom field name and hint
on create-field and update-field backend views and
frontend forms.

Fixes #10284.
2018-08-17 08:37:27 -07:00
Harshit Bansal 44694653ae emoji: Remove `display_url` from the context of `admin_emoji_list`.
This attribute seem to be artifact of some refactoring that we did
but forgot to remove it. Just a minor cleanup.
2018-08-14 12:07:56 -07:00