Commit Graph

289 Commits

Author SHA1 Message Date
Umair Khan 2db1cba9cc i18n: Use language code instead of locale.
We have been assigning locale to language code. Mostly code and locale
are same but for languages like zh-Hans, locale is zh_Hans and code is
zh-hans.

After this commit, compilemessages command should be run.
2017-10-20 11:21:26 -07:00
Vishnu Ks 4b5327b326 form: During realm creation give option to install in root domain.
This presents multiple states for the subdomain input option
depending on the existence of a root domain.

Commit modified heavily by Brock Whittaker <brock@zulipchat.com>.

Fixes #6863.
2017-10-19 16:10:14 -07:00
Brock Whittaker 71d61f93d5 streams: Change button styles on new stream creation form.
This changes the button styles from the old bootstrap buttons to
the new button styles on the stream creation form.
2017-10-11 16:17:36 -07:00
Brock Whittaker 6039687ecd streams: Add "Create Stream" button to right side.
This adds a button to allow a user to more easily discover the
stream creation functionality to the right side of the streams
overlay.
2017-10-11 16:17:36 -07:00
Umair Khan 063268246e 06-settings.js: Disable flaky test.
This commit disables the password change tests. These tests are affected
by the race condition due to which a user's session can be flushed after
a change in password. This happens because in Django 1.7+ session hash
is changed whenever password is changed. Till we can find a better
solution to this problem these tests cannot be enabled.
2017-10-06 12:08:36 -07:00
Harshit Bansal ee6024281a org_settings: Fix dropup menu for notifications stream not opening.
We were having an anchor tag inside a button which is incorrect HTML.
Chrome and safari handle this case but firefox doesn't and hence the
dropup menu wasn't opening on firefox.
2017-09-26 23:04:49 -07:00
Rishi Gupta 88bec16452 hotspots: Only narrow to PMs on first load.
After first load, the browser should set tutorial-status to started,
so this should automatically only happen once.

Fixes #6575.
2017-09-22 05:01:53 -07:00
Brock Whittaker dba09c979c Restructure organization settings and permissions.
This restructures organization settings and permissions to be
more accurately grouped and for the permissions page to not be too
long.

CHANGES:

PROFILE:
    (this was split out)
    organization-profile-admin.handlebars:
        form #1:
            name
            description
            (SUBMIT)
        avatar:
            (UPLOAD)
            (DELETE)

SETTINGS:
    organization-settings-admin.handlebars:
        language (mostly untouched)
        message editing:
            time limit/history/retention
        message feed:
            mandatory-topics
            preview images
            preview websites

PERMISSIONS:
    organization-permissions-admin.handlebars
    (mostly stuff was removed)
    Joining:
        restrict domains
        require invite
    User Identity:
        name changes
        email changes
    Streams/Emoji:
        creating streams:
            waiting period (ADDED)
        adding emojis
    (SUBMIT) for whole panel

The profile group (name, description, avatar) were split into a new
page that did not previously exist, and the permissions was stripped
of message settings (message editing, message feed), but keeping the
"waiting period" input and putting it in the "Streams & custom emoji"
section.

Fixes: #5844.
2017-08-28 17:20:13 -07:00
Tim Abbott 0148338a05 casper: Always use REALMS_HAVE_SUBDOMAINS.
This is preparation for setting REALMS_HAVE_SUBDOMAINS to be
permanently True.
2017-08-24 20:44:37 -07:00
Umair Khan d59e381131 casper: Make sure account-settings-status is invisible. 2017-08-22 23:37:20 -07:00
Tim Abbott f8b1916781 stream_sidebar_row: Rename data-name to data-stream-name.
This is for greater consistency with the rest of the codebase.
2017-08-16 18:03:44 -07:00
Tim Abbott 1e5aee054b settings: Migrate main settings-change code to API.
This was one of the few major remaining endpoints that were still on
the old-style legacy API.
2017-07-31 13:08:06 -07:00
Harshit Bansal eeb25b6b4b populate_db: Add a test realm emoji while populating databases.
Add `green_tick` realm emoji which can be used while performing tests.
2017-07-27 18:57:06 +00:00
Rishi Gupta ad47d3b651 settings: Update wording in organization-permissions-admin.handlebars. 2017-07-24 17:33:14 -07:00
Cory Lynch 02c6672499 drafts: Fix casper timing bug in jQuery 3. 2017-07-24 10:54:47 -07:00
Steve Howell 0e25055c1d Add explicit message field for locally_echoed.
We now set locally_echoed to true for messages that are
locally echoed, and we change some of our code to look
for this flag.
2017-07-21 11:38:25 -07:00
Brock Whittaker e5e73f364b settings: Change [Change] button styles. 2017-07-17 16:18:46 -07:00
Brock Whittaker 330a3bd144 setttings: Indent display settings checkboxes and fix header styles.
Aside from the indentation of checkboxes, the headers are added and
changed to become more unified with other page styling.
2017-07-17 16:15:04 -07:00
Tim Abbott 32af1ed7b4 casper: Fix nondeterministic failures in realm creation tests.
This was previously failing because we didn't wait for a particular
state after logging in, and the title changes at least once during the
process after the URL changes to the Zulip homepage.
2017-07-10 16:18:17 -07:00
Tim Abbott 9657c4c176 casper: Fix flaky realm creation test.
This test was failing nondeterministically, because depending on when
the check was done, the unread message may or may not have been read.
2017-07-07 21:16:01 -07:00
Cory Lynch 25be3a402d message_fetch: Move initialization to ui_init.js.
This involves modifying a casper test, because now
upon registration, there is one unread message.
2017-07-04 13:54:33 -07:00
vaibhav f003a4c916 settings: Move api_key_button click in casper tests.
api_key_button element has been moved from "your-bots" settings page
to "account-settings" page. This click statement was left by mistake.
2017-07-03 11:09:40 -04:00
Sampriti Panda b2a1754f8a drafts: Re-narrow on restoring draft.
Fixes #4587
2017-06-25 12:26:42 -04:00
Sampriti Panda 7ac90ad925 casper: Fix flake in drafts tests.
On some developer machines, casper was having trouble clicking on
a hidden button. Added a step to make sure the button was visible
before being clicked on.

Also removed an unnecessary log line.
2017-06-25 11:21:35 -04:00
vaibhav d9bc3932ec settings: Move "download personal API key" from "your-bots" to "your account"
Fixes: #5355.
2017-06-20 15:46:23 -04:00
vaibhav 9a6e326305 Add support for generating and downloading flaskbotrc.
Flaskbotrc is a file containing config of all active
outgoing webhook bots. It is used to provide configuration
of all active outgoing webhook bots to zulip-bot-server.
2017-06-20 09:43:45 -04:00
Abhijeet Kaur af7e08acb0 bots: Add UI to view bot types of existing bots in "Your bots".
Tweaked by tabbott for more standard internationalization.
2017-06-15 10:08:31 -07:00
Akhil 1bcc0dbd81 org-settings: Add UI for changing the notifications stream.
Added a dropdown in the organization settings page with a search-box and
required styles. Also added an element to disable it. Added a method to
populate the dropdown using list_rendering.js. Also altered response to
the event of deletion of the notifications stream on the frontend. On
selection of a new stream or on clicking 'Disable', a patch request is
made with stream-id to /json/realm.

Fixes: #3708.
2017-06-15 04:08:29 -07:00
Cory Lynch 89b8d07420 Make search suggestion messages more concise.
This involves updating filter.js, mostly. The
tests were updated appropriately for this change,
which also involved changing a caspar test for
narrowing.
2017-06-14 22:34:46 -07:00
Harshit Bansal 0e8f1f4e5d alert_words: Fix the UI to not allow users to create duplicate alert words. 2017-06-13 16:37:49 -07:00
Harshit Bansal 947f6e9190 casper_tests: Fix the broken alert words casper tests.
This commit fixes the broken alert word casper tests that were
commented out earlier due to flakes(see issue #1244).

Fixes: #1269.
2017-06-13 16:36:11 -07:00
Umair Khan 520d1de052 12-toggle-message-editing.js: Remove waitForText. 2017-06-07 13:41:59 -07:00
Umair Khan 591098cd27 11-mention.js: Remove waitForText. 2017-06-07 13:41:59 -07:00
Umair Khan 33e46af898 08-edit.js: Remove waitForText. 2017-06-07 13:41:59 -07:00
Umair Khan 5ae822fc54 07-stars.js: Remove waitForText. 2017-06-07 13:41:59 -07:00
Umair Khan fe8204f1f0 05-subscriptions.js: Remove waitForText. 2017-06-07 13:41:59 -07:00
Umair Khan 0c952dca73 04-compose.js: Remove waitForText. 2017-06-07 13:41:59 -07:00
Umair Khan 6ee08e0602 casper: Fix waiting condition in message deletion tests.
We now specifically wait for the length to decrease by one. This seems
like a more deterministic condition to wait on.

Previously we were waiting till the id of the deleted message remained
visible; intuitively, this should have worked but it seems that there
is some race condition that was causing the test to fail sporadically.
2017-05-30 22:49:59 -07:00
K.Kanakhin 2434f2d96c messages: Add support for admins deleting messages.
This makes it possible for Zulip administrators to delete messages.
This is primarily intended for use in deleting early test messages,
but it can solve other problems as well.

Later we'll want to play with the permissions model for this, but for
now, the goal is just to integrate the feature.

Note that it saves the deleted messages for some time using the same
approach as Zulip's message retention policy feature.

Fixes #135.
2017-05-29 21:59:38 -07:00
Sarah e304c47970 settings_org: Split out separate forms for orgs settings/permissions/auth.
Steve Howell also contributed to this PR.
2017-05-25 14:18:04 -07:00
Steve Howell e00f9f3dcb Split out Organization Permissions page. 2017-05-18 12:37:03 -07:00
Cory Lynch 68e5898a07 emoji.py: Add restriction that realm emoji must be lowercase.
Raises error if emoji name has an uppercase letter in it.
2017-05-11 19:10:21 -07:00
Steve Howell 3c0ef6295f Enforce that only one modal can be open at any time. 2017-05-08 22:04:56 -07:00
Brock Whittaker 3ff55034fe admin: Restyle administration checkboxes to match new style.
This restyles the administration checkboxes to look similar to those
that are currently present in the settings section.
2017-05-01 16:01:36 -07:00
K.Kanakhin f13d6a18eb realm-emoji: Add realm emoji uploading instead url providing.
- Add file_name field to `RealmEmoji` model and migration.
- Add emoji upload supporting to Upload backends.
- Add uploaded file processing to emoji views.
- Use emoji source url as based for display url.
- Change emoji form for image uploading.
- Fix back-end tests.
- Fix front-end tests.
- Add tests for emoji uploading.

Fixes #1134
2017-05-01 14:50:20 -07:00
Cory Lynch ba7b7a9a36 Change edit_message_content to have unique IDs for different messages.
Fixes bugs of when multiple messages are being edited simultaneously.
Specifically, typeahead is no longer broken, copying messages to clipboard
is less buggy, and resizing is no longer
broken when multiple messages are being edited.
2017-04-28 12:15:34 -07:00
digi0ps 8fb9d2bff3 settings: Redesign settings/administration panel buttons.
This redesigns all the ugly bold-colored buttons in the settings and
administration pages.
2017-04-25 16:33:59 -07:00
Raghav Jajodia d4e1f0a9a8 stream_filter: Add clear-search button to Search stream input field. 2017-04-17 11:12:01 -07:00
Abhijeet Kaur 8f88b045a4 Rename "Administration" to "Organization" in the settings UI.
This better sets expectatations for the fact that in Zulip, the
Organization settings UI is available read-only to non-administrator
users.

Tweaked by tabbott to update some additional references.
2017-04-07 17:32:56 -07:00
Steve Howell 153c24d071 Remove dead code related to bot/stream settings.
We had never-enabled code to allow users to set default
streams for their bots (for event registration, default sending, etc.).

This commit removes the code.
2017-04-07 15:20:12 -07:00
Tim Abbott e16b082b70 casper: Attempt to fix flakiness in new reload test. 2017-03-23 13:56:59 -07:00
Tim Abbott 5d030e9173 casper: Add test for the reload hashchange logic. 2017-03-22 23:06:08 -07:00
Tim Abbott 32b77d970b casper: Fix missing casper.then in subscriptions tests. 2017-03-20 23:21:38 -07:00
Tim Abbott 931630abae casper: Clean up wait logic in drafts tests. 2017-03-17 20:01:47 -07:00
Tim Abbott 1b2cbb0b85 casper: Fix incorrect wait condition for realm icons.
This wait condition was correct for uploading, but not for deleting.
2017-03-14 14:40:52 -07:00
Tim Abbott 900891b072 settings: Rename settings-status to account-settings-status. 2017-03-10 10:53:06 -08:00
Raghav Jajodia 05f0d1953b account-settings: Removed 'Updated settings' message from admin.
The 'Updated Settings' message we get at the bottom
of admin-page when we change the name is removed.
Fixes #3815.
2017-03-10 10:53:06 -08:00
Umair Khan 2894924ffb capitalization: Fix Only Admins may now create new streams. 2017-03-08 23:40:15 -08:00
Tim Abbott 3b59e6c3cc subs: Rename /#subscriptions to /#streams.
Fixes #3653.
2017-03-08 16:57:58 -08:00
Rishi Gupta 3797fa657e Change bot domains to string_id.EXTERNAL_HOST.
Change applies to both subdomains and non-subdomains case, though we use
just the EXTERNAL_HOST in the non-subdomains case if there is only 1 realm.

Fixes #3903.
2017-03-08 16:26:13 -08:00
Tim Abbott 13e82f1a16 casper: Fix test failure due to recent capitalization change. 2017-03-08 14:10:51 -08:00
Umair Khan 935cacfc86 capitalization: Fix View Source. 2017-03-08 12:33:37 -08:00
Steve Howell 8c61bb69cc casper: Fix flakiness with uploading realm icon. 2017-03-05 11:42:43 -08:00
K.Kanakhin 132534b3bb realm-icon: Add realm icon frontend tests. 2017-02-26 19:55:02 -08:00
Sampriti Panda 1929cc5190 Implement persistent drafts functionality
* Created a drafts modal to display/restore/delete drafts
* Created a Draft model to support storing draft data in localstorage
* Removed existing restore-draft functionality
* Added casper and node tests for drafts functionality

Fixes #1717.
2017-02-23 02:58:23 -08:00
Tim Abbott b05145d9d7 casper: Fix flaky 13-user-deactivation casper test.
This block of code:

casper.click('a[href^="#"]');

actually tried to click basically every link on the page, producing
highly undefined behavior.
2017-02-21 15:02:11 -08:00
Steve Howell d406d34fe0 Use user_id in admin_user_list.handlebars.
For our user administration, we now primarily work with user ids
that get put into data-user-id attributes.  We still put emails in the
tags to make our Casper tests easy to maintain.

This requires a minor change to the back end to pass down user ids
for the /users endpoint (in get_members_backend).
2017-02-14 23:07:44 -08:00
Igor Tokarev 55cffa1e69 Added keyboard shortcut to edit the last message.
Tweaked significantly by tabbott to update Casper tests, document the
new feature, and fix hotkeys.

Fixes #1147.
2017-02-12 00:29:28 -08:00
Tim Abbott 4060a97656 messages: Strip trailing whitespace in message contents.
I dug into why we never did this before, and it turns out we did, but
using `$.trim()` (which removes leading whitespace as well!).  When
removing the `$.trim()` usage.

Fixes #3294.
2017-02-11 23:01:22 -08:00
Tim Abbott d88c339cc4 casper: Use waitUntilVisible in toggle message editing tests. 2017-02-09 23:35:11 -08:00
Tim Abbott ed4f2452f2 casper: Use waitUntilVisible in realm creation tests. 2017-02-09 23:35:11 -08:00
Tim Abbott 89c515f8a5 casper: Use waitUntilVisible in narrow tests. 2017-02-09 23:35:11 -08:00
Tim Abbott 5b56fffc3c casper: Use waitUntilVisible in mention tests. 2017-02-09 23:35:11 -08:00
Tim Abbott 8ef3e7cde8 casper: Use waitUntilVisible in editing tests. 2017-02-09 23:35:11 -08:00
Tim Abbott 54883cafcc casper: Use waitUntilVisible in subscriptions tests. 2017-02-09 23:35:11 -08:00
Tim Abbott 2e290d3802 casper: Use waitUntilVisible in navigation tests. 2017-02-09 23:35:11 -08:00
Tim Abbott 532cfab846 casper: Use waitUntilVisible in settings tests. 2017-02-09 23:35:11 -08:00
Tim Abbott 1aac52d685 casper: Use waitUntilVisible in user deactivation tests. 2017-02-09 23:35:10 -08:00
Brock Whittaker 29dbb9e0b4 casper: Use waitUntilVisible and waitWhileVisible in admin tests.
This fixes a potential class of flakiness in the tests where they
interact with parts of the admin UI that aren't actually visible at
the moment via selectors, which probably doesn't test what we intend
to test properly.
2017-02-09 23:35:10 -08:00
Brock Whittaker 1143ed7219 redesign: Change /#settings and /#administration to an overlay.
This also adds a box-shadow to the #deactivate_self_modal so that it
looks similar to the old backdrop.
2017-02-09 23:35:10 -08:00
Tim Abbott 708c034d93 casper: Extract 13-user-deactivation.js from 10-admin.js.
For some reason, this section of tests basically totally breaks
whatever test runs after it.  To minimize the impact of that problem,
we move it to a separate file.
2017-02-09 23:32:37 -08:00
Tim Abbott d69c40eb75 casper: Clean up some admin casper tests.
This adds missing casper.then(), some waits for relevant selectors,
and tightens some of the selectors to be more precise.
2017-02-09 23:32:26 -08:00
Tim Abbott 699257c3bf casper: Extract extended editing tests out of 10-admin.js.
The casper test file 10-admin.js had gotten to be super huge, so a
split is a good idea regardless, but this should also make quaranteen
for tests broken by the settings redesign more manageable.
2017-02-09 00:53:24 -08:00
Tim Abbott 4857f3c2d2 casper: Use casper.then consistently in realm filters tests. 2017-02-09 00:34:56 -08:00
Tim Abbott 26ae2a69a9 casper: Clean up default stream tests a bit more.
This users casper.then in a more reasonable way, and also moves the
stream_name definition to the section where it's used.
2017-02-09 00:34:04 -08:00
Tim Abbott c4ba971247 casper: Fix test failures in 06-settings due to new translations. 2017-02-03 14:32:05 -08:00
Tim Abbott a889346c9f Remove zh_CN old Django name for Chinese. 2017-02-03 14:29:03 -08:00
brockwhittaker 59743a8508 Fix for TravisCI + casper.js race condition.
This changes the markdown preview test to use the
waitForSelectorTextChange method rather than waitWhileVisible
because it was not being generated fast enough in some cases
to show correctly with waitWhileVisible.
2017-01-31 17:53:20 -08:00
Steve Howell 8cfb9e427f Simplify the "Copy from Stream" feature.
I moved the UI element for "Copy from Stream" to be above
the list of users, including the filter box and check/uncheck
links, which no longer get applied to the list of streams.

The reason I no longer apply the filter to streams is...

    * It's kind of confusing to have filters apply to both
      streams and users.  There should be separate filters for
      them, and I will try to resuscitate that feature later.
    * The code to filter the streams was doing a sketchy
      regex operation against user-inputted data. (`match()`)
    * We want to use the same stream filtering code as the
      right sidebar uses.
    * It improves performance for the common case that you
      are filtering users.

The reason I no longer apply the check-all/uncheck-all actions
to streams is that it would be crazy to select all your streams
to copy users from, and it would be expensive/slow for large
realms, and it would likely be done by accident if somebody was
trying to manage individual users.

Finally, the check-all/uncheck-all actions have been scoped
to the users filtered by the text box, so I moved the links
under the text box to make that hopefully more clear to users.
2017-01-26 10:24:15 -08:00
Steve Howell 8c6dab9750 Use data-user-id for mention buttons in local echo.
The local echo code now marks up mention buttons with user ids
instead of email.  Our code in message_list_view.js deals with
either the old style or the new style of markup now to determine
which mention buttons need to be highlighted.

As part of this commit we extract mention_button_refers_to_me().
2017-01-21 21:45:12 -08:00
Tim Abbott 450ce61e6c Fix internationalization in streams page buttons/labels. 2017-01-16 18:00:10 -08:00
Tim Abbott e1e7788e67 Fix capitalization in 'Deactivated users'. 2017-01-16 18:00:10 -08:00
Tim Abbott 56bc421a6f Rename 'Filter Streams' to 'Filter streams'. 2017-01-16 18:00:10 -08:00
polypmer 2c58af9305 Check and Uncheck All only on visible (filtered) users.
When filtering users in the new stream form, check all
and uncheck all will only effect those users who are filtered,
visible in the dom.

Includes a Casper test for the new condition.
2017-01-12 13:58:54 -08:00
Tim Abbott 998dff9e50 lint: Add dangling commas in JavaScript objects. 2017-01-11 15:23:42 -08:00
Tim Abbott 7ca2d21d97 casper: Clean up some line-wrapping.
This feels a bit more readable than the original version; noticed it
while playing with the comma-dangle linter.
2017-01-11 15:23:42 -08:00
Bojidar Marinov 786dd0fca4 auth: Make min password length and strength configurable.
This adds some configuration options to settings.py, namely
PASSWORD_MIN_LENGTH and PASSWORD_MIN_QUALITY, which control
when the frontend validator invalidates the password.

Closes #2628
2017-01-10 04:55:41 -08:00
Tim Abbott 9f1fca30df subs: Access streams to copy from by ID in new stream creation. 2017-01-06 23:19:45 -08:00
Tim Abbott 9ff8c9e358 subs: Access users by ID in new stream creation. 2017-01-06 23:18:53 -08:00
Harshit Bansal 9931ad1324 Loosen realm filter pattern validator to support Git commit IDs.
Specify, we no longer require a prefix.

Also improves the clarity of the examples in the documentation.

Fixes: #2696.
2016-12-27 20:31:08 -08:00
Sanskar Modi e6beaa2711 Improve @all warnings user interface significantly.
* Doesn't pop up the warning until you actually try to send the message
* Eliminates the red warning.
* Changes confirm text to "Yes, send".
* Adds a stream size threshhold of 15 people; smaller streams don't
  prompt about this.

Fixes #2257.
2016-12-21 11:40:47 -08:00
Akhil 06615bee00 streams: Implement copy-subscribers feature.
In the new stream creation modal, added checkboxes for each stream
and a toggle to see or hide the checkboxes. Altered filtering to
filter streams and users. Added corresponding casper tests.

When a stream is checked/unchecked, it does not affect the state
of any user checkbox. This may be visually unclear as users can be
added even if their checkboxes are empty.

Fixes #2448
2016-12-17 11:20:47 -08:00
Umair Khan ab25cd7401 casper: Redirect to english url. 2016-12-15 13:44:13 -08:00
Rafid Aslam 45f39be37f lint: Fix many no-unused-vars eslint rule violations.
These have been carefully audited by tabbott to ensure they are
unlikely to cause regressions.
2016-12-14 21:34:51 -08:00
Brock Whittaker 1886f0a015 redesign: Convert subscriptions page to overlay.
This is a major change to the /#subscriptions page, converting it to
by a side-by-side list of streams and their settings in an overlay.
There are no new features added/removed, but it's a huge changeset,
because it replaces the old navigation logic and moves the stream
creation modal to appear in the right side of this overlay.
2016-12-09 11:08:08 -08:00
Tommy Ip fe4a0e72fc Add new button to download ~/.zuliprc from settings page.
Added new option to download .zuliprc file directly from settings
page.  This should help reduce friction when setting up new
bots/integrations. This new feature is available in the bot cards and
the 'show your API key' section. One caveat is that the filename is
automatically set to 'zuliprc' instead of '.zuliprc', since as most
browsers do not allow filenames to start with a dot.

Fixes #2327.
2016-12-07 21:28:41 -08:00
Robert Hönig ce2671c5cf eslint: Apply no-useless-escape rule to casper tests. 2016-12-06 18:06:57 -08:00
Rafid Aslam 0290aeb6ab lint: Fix several no-unused-vars eslint rule violations.
These changes were extracted by tabbott from the original commit
to merge now because they have been reviewed as safe.
2016-12-03 18:43:47 -08:00
Tim Abbott 2447f4a5b4 eslint: Update most casper tests to use new comma-dangle rules.
* In most cases, eslint --fix with the right comma-dangle settings was
  able to update the code correctly.

* The exceptions were cases where the parser incorrectly treated the
arguments to functions as lists/objects and added commas; these are
detectable with linters, and we fixed manually.  Since this is test
code, we can be reasonably confident that just fixing the failures
suffices to correct any bugs introduced by making changes
automatically.
2016-12-03 15:00:24 -08:00
AZtheAsian 5e9918135b eslint: change quote-props from off to error and fix violations. 2016-12-02 18:35:53 -08:00
Tommy Ip b3f4feb996 eslint: change max-len from warning to error and fix violations. 2016-12-02 14:16:33 +00:00
Tim Abbott 07565c4a3e Revert "Fix race conditions in Admin casper tests."
This reverts commit aa5a7bc659.
2016-11-29 09:50:56 -08:00
Umair Khan aa5a7bc659 Fix race conditions in Admin casper tests. 2016-11-29 08:53:27 -08:00
Calvin Lee 5c262d3557 tests: Add tests for creating a new stream with a description
Modify backend test of create_streams_if_needed so that the newly
created streams have descriptions.

Modify casperjs test of filling out stream_creation_form so that
the newly created stream has a description.

Fixes: #2428.
2016-11-27 09:45:38 -08:00
Umair Khan 92869940c6 Fix race conditions in user settings casper tests. 2016-11-26 14:56:15 -08:00
Vladislav Manchev d7e1e4a2c0 Add initial implementation of custom realm filters.
This PR was abandoned by Vladislav and then substantially modified by
Igor Tokarev and Tim Abbott to complete it and fix a number of bugs.

Fixes #544.
2016-11-17 17:11:25 -08:00
Tim Abbott 9c3d448fe4 compose: Clarify @-all errors are about mentions.
Every message to that stream goes to that number of users :).
2016-11-17 12:35:35 -08:00
umkay f4c621ffe3 admin: Enable admins to toggle supported auth methods via UI.
Add a table to the administration page that will allow realm admins to
activate and deactivate the supported authentication methods for that
realm.
2016-11-06 16:29:35 -08:00
Tim Abbott 368b585980 subs: Redesign the rows of the #subscriptions table. 2016-11-03 17:33:33 -07:00
Rishi Gupta 9ef8536cc6 models.Realm: Require Realm.string_id to be non-NULL.
Adds a database migration, adds a new string_id argument to the management
realm creation command, and adds a short name field to the web realm
creation form when REALMS_HAVE_SUBDOMAINS is False.
2016-11-02 22:46:34 -07:00
Tim Abbott 56c9be75ee subs: Add data-stream-name for stream settings. 2016-10-28 16:07:02 -07:00
Tim Abbott 66e2632809 subs: Rename .subscription_name to .stream-name. 2016-10-28 14:47:22 -07:00
Tim Abbott f18d53d46a subs: Rename .subscription_row to .stream_row.
The new name is clearer, since we show these rows for streams whether
or not you're subscribed.
2016-10-28 14:25:00 -07:00
hackerkid b5816bf99e Don't use zulipdev.com when subdomain support is disabled. 2016-10-25 13:52:13 -07:00
Rishi Gupta 49b23ea84a frontend: Allow users to see the source of messages they can't edit.
Previously we showed an "Edit" item in the actions popover menu when a user
could edit the content or topic of a message, and nothing otherwise. We now
show "Edit", "Edit Topic", or "View Source" in the popover menu for every
message, depending on the editability of the message, and present an
appropriate version of message_edit_form when the menu item is clicked.

Finishes #1604 and #1761.
2016-10-22 18:53:59 -07:00
Tim Abbott 258dd28fcc 03-narrow: Test the 'topic:' narrowing syntax.
This being a very old test, it had previously only really tested the
(deprecated) 'subject:' syntax.
2016-10-16 14:10:18 -07:00
trueskawka aa7fd9a07c stream_creation: Add a clear error message for duplicate streams.
User is now unable to create a stream with duplicate or empty name
through the create stream modal. An appropriate error message appears
on attempt.
2016-10-16 12:59:41 -07:00
trueskawka 9c8f4d9a1e stream_filtering: Filter streams on subscriptions page.
Filter behaves similarly to filter in left sidebar, see PR #684. Added
stream input field to the stream creation modal along with other settings,
for clarity.

Fixes #455, #563.
2016-10-16 12:59:41 -07:00
Rishi Gupta d75731f988 Realm creation flow: Remove invite page.
Previously, we sent users to an "invite your friends" page after they
created an organization. This commit removes that step in the flow and sends
users directly to the home page. We also remove the now-unused
initial_invite_page.html template, initial_invite.js (which pre-filled the
invite emails with characters from literature), and the /invite URL route.
2016-10-11 15:54:05 -07:00
Tim Abbott d5f28abac7 casper: Use zulipdev.com rather than localhost consistently.
This fixes a problem where any absolute redirects in the routes
visited by the Casper tests will cause failures due to switching the
users to a "different" server where the cookies they'd received are no
longer valid.

Now, we at least consistently use the same hostname in the Casper
tests as EXTERNAL_HOST.
2016-10-11 15:54:05 -07:00
Steve Howell 4400cb3735 casper: Prepare 11-mention.js for upgrade.
Use common.turn_off_press_enter_to_send() and look at the
correct element for visibility.
2016-10-07 13:30:11 -07:00
Steve Howell b5fed72dd7 casper: Use better messages in 10-admin.js. 2016-10-07 13:30:11 -07:00
Steve Howell 384dd23058 casper: Rewrite 09-navigation.js. 2016-10-07 13:30:11 -07:00
Steve Howell 52659ccae4 casper: Improve 06-settings.js.
Use higher level selectors to detect visibility of key components.

Also click through the menu more explicitly.
2016-10-07 13:30:11 -07:00
Steve Howell a8821b3057 casper: Click through menu in 05-subscriptions.js. 2016-10-07 13:30:11 -07:00
Steve Howell 49724d1ac3 casper: Use better selectors in 04-compose.js. 2016-10-07 13:30:11 -07:00
Steve Howell 0ded74e9de casper: Use then_log_out() in 01-login.js 2016-10-07 13:30:11 -07:00
Steve Howell 69694b77fb casper: Improve common.js.
These changes prepare us for the casperjs upgrade:

    Extract init_viewport().
    Have then_log_out() do more explicit waiting.
    Add turn_off_press_enter_to_send().
2016-10-07 13:30:11 -07:00
Rishi Gupta 777fcaa6a0 Add new organization type field to Realm objects.
Adds a new field org_type to Realm.  Defaults for restricted_to_domain
and invite_required are now controlled by org_type at time of realm
creation (see zerver.lib.actions.do_create_realm), rather than at the
database level.  Note that the backend defaults are all
org_type=corporate, since that matches the current assumptions in the
codebase, whereas the frontend default is org_type=community, since if
a user isn't sure they probably want community.

Since we will likely in the future enable/disable various
administrative features based on whether an organization is corporate
or community, we discuss those issues in the realm creation form.
Before we actually implement any such features, we'll want to make
sure users understand what type of organization they are a member of.

Choice of org_type (via radio button) has been added to the realm
creation flow and the realm creation management command, and the
open-realm option removed.

The database defaults have not been changed, which allows our testing code
to work unchanged.

[includes some HTML/CSS work by Brock Whittaker to make it look nice]
2016-10-05 17:01:46 -07:00
Umair Khan 06b8c76bda casper: Use local_id check to ensure messages are actually sent.
Previously, we only used this approach of waiting until the local echo
ID was cleared in the message edit tests.
2016-10-03 09:27:22 -07:00
Umair Khan 81174fa580 Change message contents to differentiate messages.
I have a hunch that the messages sent from different files
are interfering with each other as well. This commit will make
it clear if indeed this is the case.
2016-09-30 17:34:02 +05:00
Umair Khan de905457ac Remove race condition while sending messages in casper.
Fixes: #1455
2016-09-30 16:49:29 +05:00
hackerkid ea39fb2556 Add option for hosting each realm on its own subdomain.
This adds support for running a Zulip production server with each
realm on its own unique subdomain, e.g. https://realm_name.example.com.

This patch includes a ton of important features:
* Configuring the Zulip sesion middleware to issue cookier correctly
  for the subdomains case.
* Throwing an error if the user tries to visit an invalid subdomain.
* Runs a portion of the Casper tests with REALMS_HAVE_SUBDOMAINS
  enabled to test the subdomain signup process.
* Updating our integrations documentation to refer to the current subdomain.
* Enforces that users can only login to the subdomain of their realm
  (but does not restrict the API; that will be tightened in a future commit).

Note that toggling settings.REALMS_HAVE_SUBDOMAINS on a live server is
not supported without manual intervention (the main problem will be
adding "subdomain" values for all the existing realms).

[substantially modified by tabbott as part of merging]
2016-09-27 23:24:14 -07:00
hackerkid 9a2e24a458 Use spinner as message preview loader. 2016-09-26 21:00:28 -07:00
hackerkid 0412e1e20b Add support for markdown preview in compose area.
This doesn't currently use the backend markdown processor, so the
previews are not completely faithful.

Fixes #217.
2016-09-21 22:33:35 -07:00
Umair Khan 94e0bb5abb Fix race conditions in 03-narrow casper tests.
Re-arranges code so that two waitFor functions that can have
a race condition are separated by a then function.

Fixes: #1455
2016-09-21 17:54:42 +05:00
Brock Whittaker 706f422c3a Massively refactor settings page templates and styling.
This restructures the styling for the Zulip settings and
administration pages to minimize use of Bootstrap and use a consistent
styling library for similar elements.

While it is basically a wash in terms of the page's visuals, it will
make our life a lot easier for future work on improving the settings
pages section of the site.
2016-09-19 21:55:06 -07:00
Umair Khan d171e2c8d9 Remove race conditions in casper tests.
Chaining together `wait*` functions can create race conditions in the
frontend tests. To avoid race condition, we need to insert `then`
function between two `wait*` functions.
2016-09-11 17:10:15 -07:00
Brock Whittaker 5de33c94be Add padding to checkboxes and fix HTML.
The ‘for’ attribute is not valid HTML in the case of this because the
emails are invalid character sets and the input has no ID with the
email.

This changes it to a data-name which is still searchable but doesn’t
interfere with typical input behavior.

The checkboxes no longer float-left, fixing an issue with the
subscribe buttons leaning right in narrow windows.

Fixes: #1491.
2016-08-26 15:03:45 -07:00
Brock Whittaker d8aed0227a Put register template into centering containers.
This centers the content of the register container by putting it in
some flex box elements.
2016-08-25 20:55:55 -07:00