Commit Graph

232 Commits

Author SHA1 Message Date
Priyank Patel 31abcaafb8 ts: Convert ready module to TypeScript. 2021-06-22 09:14:09 -07:00
Priyank Patel c862c673af ts: Convert blueslip module to TypeScript.
We turn off the eslint no-use-before-define for TypeScript files
because it does not work correctly for types. There is already
a typescript-eslint version of it that is enabled for TS.

We also update the error handler on window to use instanceof check
for ErrorEvent instead of checking the error property.
2021-06-22 09:09:36 -07:00
Priyank Patel f7235912ff ts: Convert ui_report module to TypeScript. 2021-06-22 09:09:36 -07:00
Priyank Patel f1a0a790fe ts: Convert page_params module to TypeScript.
The plan for type annotating the page_params is to set it to
Record<string, unknown> for now and then annotate individual
properties on it as we use it in typescript modules.
2021-06-22 09:09:36 -07:00
Aman Agrawal 182f47b7c6 popover_menus: Extract popovers using tippy in a separate module. 2021-06-18 17:13:20 -07:00
Ganesh Pawar 5e4b1e1867 deprecated_feature_notice: Migrate to handlebars. 2021-06-15 11:59:01 -07:00
Aman Agrawal 88454307cd recent_topics: Split into three modules.
We split recent_topics module into recent_topics_(ui + data + util).

This allows us to reduce cyclical dependencies which were
created due to large list of imports in recent topics. Also, this
refactor on its own makes sense.
2021-06-10 15:53:05 -07:00
Steve Howell 2dd7a8864c node tests: Get 100% coverage on rendered_markdown. 2021-05-25 15:30:40 -07:00
Riken Shah 51e24519b8 refactor: Rename `panels.js` to `navbar_alerts.js` as it better explains it. 2021-05-21 17:49:12 -07:00
Tim Abbott 638ffb36a4 refactor: Move click handlers to compose_closed_ui.js. 2021-05-04 20:55:58 -07:00
pilgrim2308 a74b52db22 UI: Add Zulip version in gear menu.
Currently only enabled in development, since the exact details don't
seem right..

Co-Author-By: Signior-X <b19188@students.iitmandi.ac.in>
Co-Author-By: Aman Agrawal <amanagr@zulip.com>

Implements UI for #8005.
2021-04-30 17:58:08 -07:00
Abhijeet Prasad Bodas 2c4505d322 settings/muted-topic: Move list-create code to designated file.
This code better fits in `settings_muted_topics`.
2021-04-27 17:53:06 -07:00
Abhijeet Prasad Bodas bbbaa109ec settings: Add UI page for managing muted users.
This page is temporarily hidden except in the development environment,
because the "muted users" feature is incomplete.
2021-04-21 10:17:44 -07:00
Sumanth V Rao 0ecf5d0e83 settings_playground: Add UI to list all playgrounds.
Adds a setting UI to list all configured playgrounds
in a realm. The filter functionality can be used to
search playgrounds by its name or language.

Default sort is provided on the 'pygments_language'
field.

Front tests added to maintain server_event_dispatch
coverage. The `settings_playgrounds.js` file is added
to coverage exclusion list since it is majorly UI
based and will be tested using puppeteer tests (in
following commits).
2021-04-19 12:54:59 -07:00
Sumanth V Rao 32390e0c87 playgrounds: Hook up configured playgrounds to be used in code blocks.
To prevent breaking of the hardcoded playgrounds, we resort
to checking if realm_playgrounds is empty and falling back
to the hard-coded list if so. This logic is removed in the
followup commit which introduces the UI to add a playground.
2021-04-19 11:23:10 -07:00
Wesley Aptekar-Cassels da0c616b69 shared: Move PollData into shared. 2021-04-19 06:34:08 -04:00
Aman Agrawal 9c6f5d5946 tippyjs: Add library to be used for showing tooltips.
Our aim is to use this library to remove use of bootstrap-tooltip
for showing popovers and tooltips. This will remove our
dependency on bootstrap for showing tooltips. Thus, bootstrap
can be upgrade more independently.
2021-04-07 01:16:28 -07:00
Aman Agrawal 5e83965e80 giphy: Use GIPHY web SDK to allow inserting GIFs in compose box.
We use GIPHY web SDK to create popover containing GIFs in a
grid format. Simply clicking on the GIFs will insert the GIF in the compose
box.

We add GIPHY logo to compose box action icons which opens the GIPHY
picker popover containing GIFs with "Powered by GIPHY"
attribution.
2021-04-05 15:04:49 -07:00
YashRE42 e05935a292 narrow_banner: Add test for empty_narrow_multi_private_message case.
This commit also marks narrow_banner.js as having 100% node test
coverage.
2021-04-01 07:38:39 -07:00
YashRE42 b56ad453b3 message_flags: Add coverage for unstar_all_messages call.
This commit also marks message_flags.js to have 100% coverage.
2021-03-30 14:40:13 -07:00
Anders Kaseorg d43ac7357a js: Move current_msg_list, home_msg_list to ES6 module message_lists.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-03-29 18:23:47 -07:00
Steve Howell c67f82b073 refactor: Extract narrow_banner module.
This is a mostly verbatim extraction.

I re-phrased one line of code to work around a lint
false alarm. (Look for `preamble` in the diff.)

There are about 8 lines missing coverage here, so
the new module might be a good candidate to get
100% line coverage on.

Before this change, you would need to remove 74
edges from our dependency graph to make it
acyclic. Now it's 72.
2021-03-28 15:55:55 -07:00
Anders Kaseorg 38ffd47b90 js: Convert static/js/page_params.js to ES6 module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-03-26 10:17:56 -07:00
PIG208 36e90195e0 static: Move click handlers for alert-box to a separate module.
ui_init is also modified to ensure that the click handlers will still
be correctly initialized.
2021-03-26 09:24:41 -07:00
Abhijeet Prasad Bodas 423770f189 refactor: Extract starred_messages_ui.js module.
This is a direct code move which will allow us
to enforce 100% coverage on the data handling
parts of starred_messages.js.
2021-03-25 02:26:44 -07:00
YashRE42 5b0db2e7ed templates.js: Remove unused "plural" helper.
This helper was added in eac6463031 and
used by the "message.handlebars" file. This is no current call for
this helper in the codebase, hence it is removed to improve coverage.

This commit also marks template.js to have 100% test coverage.
2021-03-23 10:46:04 -07:00
Abhijeet Prasad Bodas f17a52b2f3 refactor: Use confirm_dialog for unstar-all-messages.
This replaces the separate modal shown on clicking
"Unstar all messages" from the left sidebar to use
the confirm_dialog widget instead.
2021-03-23 00:17:15 -07:00
Steve Howell 1cee29c2d1 refactor: Extract stream_bar.decorate.
This makes input_pill no longer depend on
stream_data and stream_color, and it
probably reduces some other dependencies.
2021-03-22 13:21:56 -07:00
YashRE42 0b6b5f421f reload_state: Add 100% test coverage.
This commit adds a new reload_state.js file to node_tests/ which
completes the missing coverage from reload_state.
2021-03-21 17:14:28 -07:00
Tim Abbott 6d506ed40a node tests: Mark starred_messages as fully covered. 2021-03-18 16:32:12 -07:00
YashRE42 2b03a74d97 channel: Add while_reloading test cases for 100% coverage.
The branches that depended on reload_state were introduced after a
refactor in 'presence' and never had relevant test cases added.
2021-03-18 10:09:22 -07:00
m-e-l-u-h-a-n 911c5f19f1 tools: Rename force argument to skip-provision-check
This commit renames --force argument used with various tests to
--skip-provision-check. As a consequence of this name change all other
files that set --force option for the test commands have been updated.

This change is done in order to provide more clarity for using this
option for runnning tests.

This commit addresses issue #17455.
2021-03-03 09:17:49 -08:00
m-e-l-u-h-a-n ca515e5583 tools: Move registration of --force to test-scripts.py.
This commit moves --force option used with various tests to
test-scripts.py to have it alongside the logic that does provisioning
status assertion.
This is a step towards providing more clarity over use of this
argument with tests as asked in issue #17455.
2021-03-03 09:17:49 -08:00
Anders Kaseorg 79ac5c25b5 zulip_test: Re-export internal functions used by Puppeteer tests.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-03-02 17:06:35 -08:00
Anders Kaseorg 6e4c3e41dc python: Normalize quotes with Black.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-12 13:11:19 -08:00
Anders Kaseorg 11741543da python: Reformat with Black, except quotes.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-12 13:11:19 -08:00
Anders Kaseorg fc2900c004 js: Convert static/js/settings_config.js to ES6 module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-10 10:27:14 -08:00
Aman Agrawal 599b86241f postcss-simple-vars: Add media query breakpoint variables. 2021-01-25 14:49:32 -08:00
Tim Abbott 90354c4e5f tools: Fix running test-js-with-node from arbitrary paths. 2020-12-15 12:18:23 -08:00
Anders Kaseorg bfd9999cf8 desktop_integration: Handle logout et al. events from desktop app.
I added these hooks in Zulip Desktop 5.5.0; handling these events in
the frontend will let us remove the janky desktop-side fallback code
that uses fake click events on menu items with specific indexes.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-12-08 16:39:17 -08:00
YashRE42 967efc32d2 widgets: Remove tictactoe example widget.
Steve asked me to remove this, since the tictactoe game was always
intended as a proof of concept. Now that we have poll and todo
widgets, the sample code for tictactoe has much less value.

We replace the content and type in test_widgets.py to maintain
coverage.
2020-11-03 14:46:39 -08:00
Aman Agrawal d9814e5e1d recent_topics: Test deleting messages not stored locally.
This commits adds test coverage for
5142bdd317.
2020-09-15 17:03:27 -07:00
Anders Kaseorg b4597a8ca8 python: Elide default for store_{true,false} argparse arguments.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-09-03 16:17:14 -07:00
Steve Howell 81b6583d28 node tests: Show coverage link when we regress coverage.
In 6653e19e3a we added
the convenient line to tell folks about the coverage
report.  But if we failed coverage checks, we didn't
show the link.

Arguably we should just always show this, even if
tests fail, but that can also be potentially confusing.
2020-09-03 07:57:58 -04:00
Steve Howell dc1795a3da node tests: Find files in Python.
The code to run single files was added
in c15695e514,
and it's just kinda strange code.

We already do a lot of file logic in Python
to check for line-coverage, so it's easier
to just have all the logic in Python.

This adds a new feature--you can now specify
the actual file:

    ./tools/test-js-with-node frontend_tests/node_tests/people.js

(This is helpful if you just want to use
shell autocomplete.)

Another minor change is that if you specify
individual files, we won't sort them.  This is
important when you're trying to hunt down test
leaks.

Finally, we have a nicer message if we can't find
the file.
2020-09-03 07:57:58 -04:00
Steve Howell e9bbfbc624 node tests: Clean up nyc arguments.
nyc was added in 29f04511c0

All the stuff after "&&" was actually passed to
node, because we didn't use shell=True, so the
"nyc report" command didn't run, and the ugly
finder.js code just skipped over all the final tokens.
2020-09-03 07:57:58 -04:00
Anders Kaseorg a5dbab8fb0 python: Remove redundant dest for argparse arguments.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-09-02 11:04:10 -07:00
Ryan Rehman b4f315698f node tests: Create file for `stream_edit.js`.
This fixes the regression introduced in the pervious
commit to regain the 100% line coverage in `user_pill.js`
as well as `stream_pill.js`.

The new `stream_edit.js` mainly tests for:

* The stream related queries of the typeahead in `user_pill.js`
* The "Add subscribers" event handlers.
* The event handler which displays the settings for a stream.
2020-08-31 16:57:32 -07:00
Ryan Rehman c6d9a87d6f streams: Allow creating stream pills to submit Add subscriber form.
We update the pills typeahead logic to also include
stream results and pass the "stream" key in `opts`
to enable this option for the Add subscriber form.

This commit implements the feature of adding all the
subscribers of another stream in the "Add subscribers"
UI, with the help of a new "stream_pill.js` file.

We temporarily add `user_pill.js` to the EXEMPT_FILES
list as typeahead will be set up in `stream_edit.js`
file which does not have any dedicated tests file.

Work towards #15186.
2020-08-31 16:57:32 -07:00
Anders Kaseorg 61d0417e75 python: Replace ujson with orjson.
Fixes #6507.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-08-11 10:55:12 -07:00