Commit Graph

13053 Commits

Author SHA1 Message Date
Steve Howell 7fd74c45d7 Clean up startup code for streams.
The startup code in subs.js used to intermingle data
stuff and UI stuff in a loop inside a called function,
which made the code hard to reason about.

Now there is a clear separation of concerns, with these methods
being called in succession:

    stream_data.initialize_from_page_params();
    stream_list.create_initial_sidebar_rows();

The first method was mostly extracted from subs.js, but I simplified
some things, like not needing to make a copy of the hashes
we were passed in, plus I now garbage collect email_dict.  Also,
the code path that initialize_from_page_params() mostly replaces
used to call create_sub(), which fired a trigger, but now it
just does data stuff.

Once the data structure is built up, it's a very simple matter
to build the initial sidebar rows, and that's what the second
method does.
2016-10-17 19:58:23 -07:00
Steve Howell d26942e72d Extract stream_list.create_sidebar_row().
This replaces add_stream_to_sidebar(), which was kind of a misleading
name, and it also adds a couple lines of code that were always
called right after calling add_stream_to_sidebar().
2016-10-17 19:58:23 -07:00
Steve Howell 869a124d7d Extract stream_data.get_streams_for_settings_page().
This function will make it easier to unit test upcoming
changes related to stream counts.

This was mostly moving code, but one change is that we
don't call create_subs() in subs.js any more (which would
have been kind of circular dependency), since the only thing
that it did besides calling a more appropriate function
in stream_data.js was to generate a trigger that was
subsequently ignored and possibly a UI trap, as we don't
want to be messing with the stream sidebar when we go into
the stream settings page.

We now simply call exports.create_sub_from_server_data() for
newly encountered unsubscribed streams (which don't belong in
the sidebar anyway.)
2016-10-17 19:58:23 -07:00
Steve Howell 965c6047db Move add_admin_options() to stream_data.js.
This function used to live in subs.js.  It's mostly a code move,
but I simplified the logic to determine whether it's subscribed
not to do a lookup into the same data structure that the sub
already came from.

I also added some tests.
2016-10-17 19:58:23 -07:00
Steve Howell cf08f04dbc Move receives_*_notifications() to stream_data.js.
This moves these functions from subs.js to stream_data.js:

    receives_desktop_notifications
    receives_audible_notifications

This makes notifications.js no longer dependent on the
bloated subs.js.
2016-10-17 19:58:23 -07:00
Steve Howell e25b67af26 Remove subs.sub_pinned_or_unpinned(). 2016-10-17 19:58:23 -07:00
Steve Howell 5dd1c2d55f Remove subs.stream_id(). 2016-10-17 19:58:23 -07:00
Steve Howell 2676083b94 Add introduction to docs on node tests.
Also, de-emphasize the process for creating new test modules,
as this is an advanced task that we can further document later
and generally handle as part of code review.
2016-10-17 19:46:17 -07:00
Tim Abbott 63a49be09e event_queue: Import tornado.ioloop correctly.
We actually use tornado.ioloop, not the root tornado module, and while
the current code does work, it causes mypy errors with the incremental
cache.
2016-10-17 17:57:46 -07:00
Sumana Harihareswara 6323494f37 docs: Properly capitalize GitHub. 2016-10-17 19:31:50 -04:00
Christie Koehler 23df7913d5 docs: Add Git and GitHub Guide.
Fixes #783, #1754.
2016-10-17 16:18:16 -07:00
Steve Howell ff6404cb3c Add comment about /json/subscriptions/exists endpoint.
We should remove this endpoint.  For now I'm just adding
the comment to the code explaining why we should do that.
2016-10-17 16:11:04 -07:00
umkay 906a4e3b26 analytics: Add performance and transaction logging to counts.py.
For each database query made by an analytics function, log time spent and
the number of rows changed to var/logs/analytics.log.
In the spirit of write ahead logging, for each (stat, end_time)
update, log the start and end of the "transaction", as well as time
spent.
2016-10-17 16:10:03 -07:00
Tim Abbott 4a4664d268 mypy: Remove a bunch of now-unnecessary type: ignore annotations.
Since mypy and typeshed have advanced a lot over the last several
months, we no longer need these `type: ignore` annotations.
2016-10-17 11:48:34 -07:00
Tim Abbott 3b0b65c2d0 management: Fix recent argument parsing regressions.
Fixes a regression introduced in
fbdf539bf2.
2016-10-16 20:36:33 -07:00
Tim Abbott a5a03c2e0b zulip_ops: Include zulip::apt_repository.
This replaces the old wheezy configuration.
2016-10-16 20:13:35 -07:00
Tim Abbott 8c68c6f09b zulip_ops: Remove wheezy apt repo.
Nobody uses wheezy anymore, and the configuration wasn't even
conditional on the OS version.
2016-10-16 20:13:35 -07:00
Tim Abbott 5210b0a6a4 zulip_ops: Cleanup old redis configuration.
One can now just use the improved configuration we've merged into the
main Zulip repo.
2016-10-16 20:13:35 -07:00
Tim Abbott 869f0724ce zulip_ops: Remove humbughq.com nginx configuration.
The humbughq.com name hasn't been the product's name since 2013, and
it's nice to finish clearing it out of the repository.
2016-10-16 20:13:29 -07:00
Tim Abbott 29448fb47b zulip_ops: Remove old Zulip, Inc. trac configuration.
This isn't useful to anyone.
2016-10-16 19:23:47 -07:00
Tim Abbott 771e03cfa7 zulip_ops: Remove old Zulip, Inc. mediawiki configuration.
This isn't useful to anyone.
2016-10-16 19:23:47 -07:00
Tim Abbott 36e336edc3 puppet: Rename zulip_internal to zulip_ops.
The old "zulip_internal" name was from back when Zulip, Inc. had two
distributions of Zulip, the enterprise distribution in puppet/zulip/
and the "internal" SAAS distribution in puppet/zulip_internal.  I
think the name is a bit confusing in the new fully open-source Zulip
work, so we're replacing it with "zulip_ops".  I don't think the new
name is perfect, but it's better.

In the following commits, we'll delete a bunch of pieces of Zulip,
Inc.'s infrastructure that don't exist anymore and thus are no longer
useful (e.g. the old Trac configuration), with the goal of cleaning
the repository of as much unnecessary content as possible.
2016-10-16 19:23:27 -07:00
Laura Hampton fbdf539bf2 Replace optparse with argparse in the several management commands.
Specifically:
* fill_memcached_caches.py
* initialize_voyager_db.py
* logout_all_users.py
2016-10-16 17:08:35 -07:00
Brock Whittaker 7984c5af68 Add data-name groups to templates.
The data-name attribute in this case allows for a particular settings
section element to show up when the appropriate sidebar category is
clicked (which will have the same value in the data-section key).
2016-10-16 16:37:21 -07:00
reyha 537c9755bf search: Fix searching for URLs.
Previously, URLs were being incorrectly treated as unknown search
operators (since they had exactly one ":" in them, just like foo:bar
for an invalid choice of foo).

Fixes #1743.
2016-10-16 15:25:46 -07:00
Steve Howell 241b03e427 Add --force option to run-casper. 2016-10-16 14:52:15 -07:00
Steve Howell 6e628e23aa Add --force option to test-backend. 2016-10-16 14:52:14 -07:00
Steve Howell f48c5e55dc Check provisioning status in run-casper. 2016-10-16 14:52:14 -07:00
Steve Howell 10667b3cdb Check provisioning status in tools/test-backend. 2016-10-16 14:52:14 -07:00
Steve Howell 8bc027e71b Add tools/lib/test_script.py w/get_provisioning_status(). 2016-10-16 14:52:13 -07:00
Steve Howell 37842d5d15 Have provision.py write to var/provision_version. 2016-10-16 14:44:45 -07:00
Steve Howell e25f93fa8a Add PROVISION_VERSION to version.py. 2016-10-16 14:44:45 -07:00
Steve Howell f0b8f741b9 contrib_bots: Simulate a file system with a bot. 2016-10-16 14:41:24 -07:00
Steve Howell ff5a2b21d0 Add StateHandler to contrib_bots/run.py.
This allows bots to be stateful.  It doesn't handle persistence
after the bot shuts down, but it does store state between
invocations of handle_message.
2016-10-16 14:41:24 -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
Tim Abbott 8f71d3702b filter: Add missing canonicalization to operator_to_prefix.
This makes it possible to reuse this function for validating whether a
given search operator is valid.
2016-10-16 14:06:55 -07:00
Tim Abbott a28a5bb977 docs: Update roadmap HTML with now-completed issues. 2016-10-16 13:09:28 -07:00
Tim Abbott df617225fd lint-all: Check for untranslated placeholders in handlebars templates. 2016-10-16 12:59:41 -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
deekshaarul 357fbfcaa3 Zocial buttons: Fix overflow of text when internationalized.
Previously, the text in the Google/GitHub auth buttons would overflow
in languages like German where text is longer than in English.

Fixes #1876.
2016-10-16 12:35:43 -07:00
Sumana Harihareswara a4ac09cb8f Clarify comment on empty json_rules list.
Fixes: #2030.
2016-10-16 12:28:16 -07:00
Sumana Harihareswara bef73be824 lint: Improve documentation lint check for JavaScript capitalization.
Move JavaScript capitalization rule to new ruleset for HTML and
Markdown checkers to run, and add exclusion to avoid catching
URLs and divs/hrefs. Also fix affected HTML pages, and remove
now-obsolete exclusion for doc that no longer exists.

For exhaustive thought-process on this change see:
https://zulip.tabbott.net/#narrow/stream/test.20suites/topic/watch.20over.20my.20shoulder.20as.20I.20improve.20the.20linter
2016-10-16 12:28:16 -07:00
Tim Abbott 2bea0c46fe HomeTest: Add a basic test for desktop_home. 2016-10-16 11:39:08 -07:00
Tim Abbott 3ee9e2c45f tests: Add some basic i18n public URL tests. 2016-10-16 11:26:01 -07:00
Tim Abbott 122164fffb DocPageTest: add test for /about/ page. 2016-10-16 11:19:27 -07:00
Mohsen Ibrahim ca1789892d api: Fix broken link to zulip-js github page. 2016-10-16 01:42:30 -07:00
Tim Abbott fc20c86d8d install: Move apt-get update into setup-apt-repo. 2016-10-16 01:13:50 -07:00
Tim Abbott cf6feac65f provision: Remove unnecessary second apt-get update.
Since we do this slightly later (after setting up our apt repository,
where it's actually required), there's no need to do this here.
2016-10-16 01:13:50 -07:00
Tim Abbott e91f227c0b requirements: Update python-social dependency.
Also, fix the use of `>=` in the version declarations; we want to be
precise about what versions we're installing.
2016-10-16 01:13:50 -07:00