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.
This commit is contained in:
Akhil
2017-06-10 05:03:53 +00:00
committed by Tim Abbott
parent d8310724b6
commit 1bcc0dbd81
8 changed files with 187 additions and 0 deletions

View File

@@ -119,6 +119,28 @@ function render(template_name, args) {
global.write_handlebars_output("admin-realm-domains-list", html);
}());
(function admin_realm_dropdown_stream_list() {
var html = "<ul>";
var args = {
stream: {
name: "Italy",
subscriber_count: 9,
stream_id: 18,
},
};
html += render("admin-realm-dropdown-stream-list", args);
html += "</ul>";
var link = $(html).find("a");
var list_item = $(html).find("li");
assert.equal(link.text().trim(), "Italy");
assert(list_item.hasClass("stream_name"));
assert.equal(list_item.attr("data-stream-id"), "18");
global.write_handlebars_output("admin-realm-dropdown-stream-list", html);
}());
(function admin_default_streams_list() {
var html = '<table>';
var streams = ['devel', 'trac', 'zulip'];