diff --git a/.mention-bot b/.mention-bot index 6508c7e8679..9893b57bb84 100644 --- a/.mention-bot +++ b/.mention-bot @@ -2,7 +2,7 @@ "maxReviewers": 2, "message": "Thanks @pullRequester for your pull request :+1:. By analyzing the blame information on this pull request, I identified @reviewers to be potential reviewers.", "requiredOrgs": ["discourse"], - "skipCollaboratorPR": true, - "delayed": true, - "delayedUntil": "6d" + "skipCollaboratorPR": false, + "delayed": false, + "delayedUntil": "1d" } diff --git a/.travis.yml b/.travis.yml index 0f46f1ebcad..ed1f7d20b12 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,6 +41,7 @@ before_install: - git clone --depth=1 https://github.com/discourse/discourse-backup-uploads-to-s3.git plugins/discourse-backup-uploads-to-s3 - git clone --depth=1 https://github.com/discourse/discourse-spoiler-alert.git plugins/discourse-spoiler-alert - git clone --depth=1 https://github.com/discourse/discourse-cakeday.git plugins/discourse-cakeday + - git clone --depth=1 https://github.com/discourse/discourse-canned-replies.git plugins/discourse-canned-replies - npm i -g eslint babel-eslint - eslint app/assets/javascripts - eslint --ext .es6 app/assets/javascripts @@ -52,7 +53,7 @@ before_script: - bundle exec rake db:create db:migrate install: - - bash -c "if [ '$RAILS_MASTER' == '1' ]; then bundle update --retry=3 --jobs=3 arel rails rails-observers seed-fu; fi" + - bash -c "if [ '$RAILS_MASTER' == '1' ]; then bundle update --retry=3 --jobs=3 arel rails seed-fu; fi" - bash -c "if [ '$RAILS_MASTER' == '0' ]; then bundle install --without development --deployment --retry=3 --jobs=3; fi" script: "bundle exec rspec && bundle exec rake plugin:spec && bundle exec rake qunit:test['200000']" diff --git a/Gemfile b/Gemfile index abf697bb3b9..3d49f0dc3aa 100644 --- a/Gemfile +++ b/Gemfile @@ -9,7 +9,6 @@ end if rails_master? gem 'arel', git: 'https://github.com/rails/arel.git' gem 'rails', git: 'https://github.com/rails/rails.git' - gem 'rails-observers', git: 'https://github.com/rails/rails-observers.git' gem 'seed-fu', git: 'https://github.com/SamSaffron/seed-fu.git', branch: 'discourse' else # Rails 5 is going to ship with Action Cable, we have no use for it as @@ -29,8 +28,6 @@ else # gem 'railties' # gem 'sprockets-rails' gem 'rails', '~> 4.2' - - gem 'rails-observers' gem 'seed-fu', '~> 2.3.5' end @@ -48,7 +45,8 @@ gem 'onebox' gem 'http_accept_language', '~>2.0.5', require: false gem 'ember-rails', '0.18.5' -gem 'ember-source', '2.4.6' +gem 'ember-source', '2.10.0' +gem 'ember-handlebars-template', '0.7.5' gem 'barber' gem 'babel-transpiler' @@ -107,7 +105,6 @@ gem 'sidekiq-statistic' gem 'sinatra', require: false gem 'execjs', require: false gem 'mini_racer' -gem 'thin', require: false gem 'highline', require: false gem 'rack-protection' # security @@ -138,8 +135,6 @@ group :test, :development do gem 'rb-inotify', '~> 0.9', require: RUBY_PLATFORM =~ /linux/i ? 'rb-inotify' : false gem 'rspec-rails', require: false gem 'shoulda', require: false - gem 'simplecov', require: false - gem 'rspec-given' gem 'rspec-html-matchers' gem 'spork-rails' gem 'pry-nav' @@ -168,44 +163,22 @@ gem 'htmlentities', require: false # If you want to amend mini profiler to do the monkey patches in the railties # we are open to it. by deferring require to the initializer we can configure discourse installs without it -gem 'fast_stack', require: false, platform: [:mri_20] gem 'flamegraph', require: false gem 'rack-mini-profiler', require: false gem 'unicorn', require: false gem 'puma', require: false gem 'rbtrace', require: false, platform: :mri +gem 'gc_tracer', require: false, platform: :mri # required for feed importing and embedding # gem 'ruby-readability', require: false - gem 'simple-rss', require: false -gem 'gctools', require: false, platform: :mri_21 - -begin - gem 'stackprof', require: false, platform: [:mri_21, :mri_22, :mri_23] - gem 'memory_profiler', require: false, platform: [:mri_21, :mri_22, :mri_23] -rescue Bundler::GemfileError - begin - STDERR.puts "You are running an old version of bundler, please upgrade bundler ASAP, if you are using Discourse docker, rebuild your container." - gem 'stackprof', require: false, platform: [:mri_21, :mri_22] - gem 'memory_profiler', require: false, platform: [:mri_21, :mri_22] - rescue Bundler::GemfileError - gem 'stackprof', require: false, platform: [:mri_21] - gem 'memory_profiler', require: false, platform: [:mri_21] - end -end +gem 'stackprof', require: false, platform: :mri +gem 'memory_profiler', require: false, platform: :mri gem 'rmmseg-cpp', require: false gem 'logster' - -# perftools only works on 1.9 atm -group :profile do - # travis refuses to install this, instead of fuffing, just avoid it for now - # - # if you need to profile, uncomment out this line - # gem 'rack-perftools_profiler', require: 'rack/perftools_profiler', platform: :mri_19 -end diff --git a/Gemfile.lock b/Gemfile.lock index f48e3ff72eb..76dc704feb6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -52,7 +52,7 @@ GEM babel-transpiler (0.7.0) babel-source (>= 4.0, < 6) execjs (~> 2.0) - barber (0.11.1) + barber (0.11.2) ember-source (>= 1.0, < 3) execjs (>= 1.2, < 3) better_errors (2.1.1) @@ -71,19 +71,17 @@ GEM concurrent-ruby (1.0.2) connection_pool (2.2.0) crass (1.0.2) - daemons (1.2.4) debug_inspector (0.0.2) diff-lcs (1.2.5) discourse-qunit-rails (0.0.9) railties discourse_fastimage (2.0.3) - docile (1.1.5) domain_name (0.5.25) unf (>= 0.0.5, < 1.0.0) email_reply_trimmer (0.1.6) ember-data-source (2.2.1) ember-source (>= 1.8, < 3.0) - ember-handlebars-template (0.7.4) + ember-handlebars-template (0.7.5) barber (>= 0.11.0) sprockets (>= 3.3, < 4) ember-rails (0.18.5) @@ -93,9 +91,8 @@ GEM ember-source (>= 1.1.0) jquery-rails (>= 1.0.17) railties (>= 3.1) - ember-source (2.4.6) + ember-source (2.10.0) erubis (2.7.0) - eventmachine (1.2.0.1) excon (0.53.0) execjs (2.7.0) exifr (1.2.4) @@ -104,23 +101,20 @@ GEM faraday (0.9.2) multipart-post (>= 1.2, < 3) fast_blank (1.0.0) - fast_stack (0.2.0) fast_xor (1.1.3) rake rake-compiler fast_xs (0.8.0) - ffi (1.9.10) + ffi (1.9.17) flamegraph (0.9.5) foreman (0.82.0) thor (~> 0.19.1) fspath (2.1.1) - gctools (0.2.3) - given_core (3.7.1) - sorcerer (>= 0.3.7) + gc_tracer (1.5.1) globalid (0.3.7) activesupport (>= 4.1.0) guess_html_encoding (0.0.11) - hashie (3.4.4) + hashie (3.4.6) highline (1.7.8) hiredis (0.6.1) htmlentities (4.3.4) @@ -141,10 +135,10 @@ GEM rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) - json (1.8.3) + json (1.8.6) jwt (1.5.2) kgio (2.10.0) - libv8 (5.3.332.38.1) + libv8 (5.3.332.38.3) listen (0.7.3) logster (1.2.5) loofah (2.0.3) @@ -152,7 +146,7 @@ GEM lru_redux (1.1.0) mail (2.6.4) mime-types (>= 1.16, < 4) - memory_profiler (0.9.6) + memory_profiler (0.9.7) message_bus (2.0.2) rack (>= 1.1.3) metaclass (0.0.4) @@ -165,8 +159,8 @@ GEM mocha (1.1.0) metaclass (~> 0.0.1) mock_redis (0.15.4) - moneta (0.8.0) - msgpack (0.7.6) + moneta (0.8.1) + msgpack (1.0.2) multi_json (1.12.1) multi_xml (0.5.5) multipart-post (2.0.0) @@ -176,7 +170,7 @@ GEM mini_portile2 (~> 2.1.0) nokogumbo (1.4.7) nokogiri - oauth (0.4.7) + oauth (0.5.1) oauth2 (1.0.0) faraday (>= 0.8, < 0.10) jwt (~> 1.0) @@ -209,15 +203,17 @@ GEM omniauth-openid (1.0.1) omniauth (~> 1.0) rack-openid (~> 1.3.1) - omniauth-twitter (1.2.1) - json (~> 1.3) + omniauth-twitter (1.3.0) omniauth-oauth (~> 1.1) - onebox (1.6.2) + rack + onebox (1.7.7) + fast_blank (>= 1.0.0) htmlentities (~> 4.3.4) moneta (~> 0.8) multi_json (~> 1.11) mustache nokogiri (~> 1.6.6) + sanitize openid-redis-store (0.0.2) redis ruby-openid @@ -233,7 +229,7 @@ GEM pry (>= 0.9.10) puma (3.6.0) r2 (0.2.6) - rack (1.6.4) + rack (1.6.5) rack-mini-profiler (0.10.1) rack (>= 1.2.0) rack-openid (1.3.1) @@ -262,8 +258,6 @@ GEM rails-deprecated_sanitizer (>= 1.0.1) rails-html-sanitizer (1.0.3) loofah (~> 2.0) - rails-observers (0.1.2) - activemodel (~> 4.0) rails_multisite (1.0.6) rails (> 4.2, < 5) railties (4.2.7.1) @@ -300,9 +294,6 @@ GEM rspec-expectations (3.4.0) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.4.0) - rspec-given (3.7.1) - given_core (= 3.7.1) - rspec (>= 2.14.0) rspec-html-matchers (0.7.0) nokogiri (~> 1) rspec (~> 3) @@ -340,7 +331,7 @@ GEM shoulda (3.5.0) shoulda-context (~> 1.0, >= 1.0.1) shoulda-matchers (>= 1.4.1, < 3.0) - shoulda-context (1.2.1) + shoulda-context (1.2.2) shoulda-matchers (2.8.0) activesupport (>= 3.0.0) sidekiq (4.2.4) @@ -351,17 +342,11 @@ GEM sidekiq-statistic (1.2.0) sidekiq (>= 3.3.4, < 5) simple-rss (1.3.1) - simplecov (0.11.1) - docile (~> 1.1.0) - json (~> 1.8) - simplecov-html (~> 0.10.0) - simplecov-html (0.10.0) sinatra (1.4.6) rack (~> 1.4) rack-protection (~> 1.4) tilt (>= 1.3, < 3) slop (3.6.0) - sorcerer (1.0.2) spork (1.0.0rc4) spork-rails (4.0.0) rails (>= 3.0.0, < 5) @@ -374,10 +359,6 @@ GEM activesupport (>= 4.0) sprockets (>= 3.0.0) stackprof (0.2.10) - thin (1.7.0) - daemons (~> 1.0, >= 1.0.9) - eventmachine (~> 1.0, >= 1.0.4) - rack (>= 1, < 3) thor (0.19.1) thread_safe (0.3.5) tilt (2.0.5) @@ -412,19 +393,19 @@ DEPENDENCIES discourse-qunit-rails discourse_fastimage (= 2.0.3) email_reply_trimmer (= 0.1.6) + ember-handlebars-template (= 0.7.5) ember-rails (= 0.18.5) - ember-source (= 2.4.6) + ember-source (= 2.10.0) excon execjs fabrication (= 2.9.8) fakeweb (~> 1.3.0) fast_blank - fast_stack fast_xor fast_xs flamegraph foreman - gctools + gc_tracer highline hiredis htmlentities @@ -463,7 +444,6 @@ DEPENDENCIES rack-mini-profiler rack-protection rails (~> 4.2) - rails-observers rails_multisite rake rb-fsevent @@ -475,7 +455,6 @@ DEPENDENCIES rinku rmmseg-cpp rspec - rspec-given rspec-html-matchers rspec-rails rtlit @@ -488,15 +467,13 @@ DEPENDENCIES sidekiq sidekiq-statistic simple-rss - simplecov sinatra spork-rails stackprof - thin timecop uglifier unf unicorn BUNDLED WITH - 1.13.6 + 1.13.7 diff --git a/README.md b/README.md index 6cdf4c101b8..359c8189f14 100644 --- a/README.md +++ b/README.md @@ -11,11 +11,11 @@ To learn more about the philosophy and goals of the project, [visit **discourse. ## Screenshots - - - + + + - + Browse [lots more notable Discourse instances](http://www.discourse.org/faq/customers/). @@ -84,7 +84,7 @@ The original Discourse code contributors can be found in [**AUTHORS.MD**](docs/A ## Copyright / License -Copyright 2014 - 2016 Civilized Discourse Construction Kit, Inc. +Copyright 2014 - 2017 Civilized Discourse Construction Kit, Inc. Licensed under the GNU General Public License Version 2.0 (or later); you may not use this work except in compliance with the License. diff --git a/app/assets/javascripts/admin/components/ace-editor.js.es6 b/app/assets/javascripts/admin/components/ace-editor.js.es6 index 01773d2cbf8..a03865c40ce 100644 --- a/app/assets/javascripts/admin/components/ace-editor.js.es6 +++ b/app/assets/javascripts/admin/components/ace-editor.js.es6 @@ -36,6 +36,7 @@ export default Ember.Component.extend({ loadScript("/javascripts/ace/ace.js", { scriptTag: true }).then(() => { window.ace.require(['ace/ace'], loadedAce => { + if (!this.element || this.isDestroying || this.isDestroyed) { return; } const editor = loadedAce.edit(this.$('.ace')[0]); editor.setTheme("ace/theme/chrome"); diff --git a/app/assets/javascripts/admin/controllers/admin-badges-show.js.es6 b/app/assets/javascripts/admin/controllers/admin-badges-show.js.es6 index 7d11fc86226..7ddc6f3ac4e 100644 --- a/app/assets/javascripts/admin/controllers/admin-badges-show.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-badges-show.js.es6 @@ -68,7 +68,7 @@ export default Ember.Controller.extend(BufferedContent, { this.get('model').save(data).then(() => { if (newBadge) { const adminBadges = this.get('adminBadges.model'); - if (!adminBadges.contains(model)) { + if (!adminBadges.includes(model)) { adminBadges.pushObject(model); } this.transitionToRoute('adminBadges.show', model.get('id')); diff --git a/app/assets/javascripts/admin/controllers/admin-group.js.es6 b/app/assets/javascripts/admin/controllers/admin-group.js.es6 index 71cb2c70328..6c3da11d7f7 100644 --- a/app/assets/javascripts/admin/controllers/admin-group.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-group.js.es6 @@ -1,5 +1,4 @@ import { popupAjaxError } from 'discourse/lib/ajax-error'; -import { propertyEqual } from 'discourse/lib/computed'; import computed from 'ember-addons/ember-computed-decorators'; export default Ember.Controller.extend({ @@ -7,19 +6,6 @@ export default Ember.Controller.extend({ disableSave: false, savingStatus: '', - currentPage: function() { - if (this.get("model.user_count") === 0) { return 0; } - return Math.floor(this.get("model.offset") / this.get("model.limit")) + 1; - }.property("model.limit", "model.offset", "model.user_count"), - - totalPages: function() { - if (this.get("model.user_count") === 0) { return 0; } - return Math.floor(this.get("model.user_count") / this.get("model.limit")) + 1; - }.property("model.limit", "model.user_count"), - - showingFirst: Em.computed.lte("currentPage", 1), - showingLast: propertyEqual("currentPage", "totalPages"), - aliasLevelOptions: function() { return [ { name: I18n.t("groups.alias_levels.nobody"), value: 0 }, @@ -47,38 +33,6 @@ export default Ember.Controller.extend({ }, actions: { - next() { - if (this.get("showingLast")) { return; } - - const group = this.get("model"), - offset = Math.min(group.get("offset") + group.get("limit"), group.get("user_count")); - - group.set("offset", offset); - - return group.findMembers(); - }, - - previous() { - if (this.get("showingFirst")) { return; } - - const group = this.get("model"), - offset = Math.max(group.get("offset") - group.get("limit"), 0); - - group.set("offset", offset); - - return group.findMembers(); - }, - - removeMember(member) { - const self = this, - message = I18n.t("admin.groups.delete_member_confirm", { username: member.get("username"), group: this.get("model.name") }); - return bootbox.confirm(message, I18n.t("no_value"), I18n.t("yes_value"), function(confirm) { - if (confirm) { - self.get("model").removeMember(member); - } - }); - }, - removeOwner(member) { const self = this, message = I18n.t("admin.groups.delete_owner_confirm", { username: member.get("username"), group: this.get("model.name") }); @@ -95,12 +49,6 @@ export default Ember.Controller.extend({ this.set("model.ownerUsernames", null); }, - addMembers() { - if (Em.isEmpty(this.get("model.usernames"))) { return; } - this.get("model").addMembers(this.get("model.usernames")).catch(popupAjaxError); - this.set("model.usernames", null); - }, - save() { const group = this.get('model'), groupsController = this.get("adminGroupsType"), diff --git a/app/assets/javascripts/admin/controllers/admin-plugins.js.es6 b/app/assets/javascripts/admin/controllers/admin-plugins.js.es6 index 5393a27c8f6..8238b1d5afe 100644 --- a/app/assets/javascripts/admin/controllers/admin-plugins.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-plugins.js.es6 @@ -1,9 +1,16 @@ +import computed from 'ember-addons/ember-computed-decorators'; + export default Ember.Controller.extend({ - adminRoutes: function() { - return this.get('model').map(p => { - if (p.get('enabled')) { - return p.admin_route; + @computed('model.@each.enabled_setting') + adminRoutes() { + let routes = []; + + this.get('model').forEach(p => { + if (this.siteSettings[p.get('enabled_setting')] && p.get('admin_route')) { + routes.push(p.get('admin_route')); } - }).compact(); - }.property() + }); + + return routes; + } }); diff --git a/app/assets/javascripts/admin/controllers/admin-user-index.js.es6 b/app/assets/javascripts/admin/controllers/admin-user-index.js.es6 index 0c1cb7abb37..14bc031c0a3 100644 --- a/app/assets/javascripts/admin/controllers/admin-user-index.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-user-index.js.es6 @@ -31,6 +31,29 @@ export default Ember.Controller.extend(CanCheckEmails, { }.property('model.user_fields.[]'), actions: { + + impersonate() { return this.get("model").impersonate(); }, + logOut() { return this.get("model").logOut(); }, + resetBounceScore() { return this.get("model").resetBounceScore(); }, + refreshBrowsers() { return this.get("model").refreshBrowsers(); }, + approve() { return this.get("model").approve(); }, + deactivate() { return this.get("model").deactivate(); }, + sendActivationEmail() { return this.get("model").sendActivationEmail(); }, + activate() { return this.get("model").activate(); }, + revokeAdmin() { return this.get("model").revokeAdmin(); }, + grantAdmin() { return this.get("model").grantAdmin(); }, + revokeModeration() { return this.get("model").revokeModeration(); }, + grantModeration() { return this.get("model").grantModeration(); }, + saveTrustLevel() { return this.get("model").saveTrustLevel(); }, + restoreTrustLevel() { return this.get("model").restoreTrustLevel(); }, + lockTrustLevel(locked) { return this.get("model").lockTrustLevel(locked); }, + unsuspend() { return this.get("model").unsuspend(); }, + unblock() { return this.get("model").unblock(); }, + block() { return this.get("model").block(); }, + deleteAllPosts() { return this.get("model").deleteAllPosts(); }, + anonymize() { return this.get('model').anonymize(); }, + destroy() { return this.get('model').destroy(); }, + toggleTitleEdit() { this.set('userTitleValue', this.get('model.title')); this.toggleProperty('editingTitle'); @@ -39,7 +62,7 @@ export default Ember.Controller.extend(CanCheckEmails, { saveTitle() { const self = this; - return ajax("/users/" + this.get('model.username').toLowerCase(), { + return ajax(`/users/${this.get('model.username').toLowerCase()}.json`, { data: {title: this.get('userTitleValue')}, type: 'PUT' }).catch(function(e) { @@ -107,14 +130,6 @@ export default Ember.Controller.extend(CanCheckEmails, { if (result) { self.get('model').revokeApiKey(); } } ); - }, - - anonymize() { - this.get('model').anonymize(); - }, - - destroy() { - this.get('model').destroy(); } } diff --git a/app/assets/javascripts/admin/controllers/admin-web-hooks-show.js.es6 b/app/assets/javascripts/admin/controllers/admin-web-hooks-show.js.es6 index 53d8370403b..28f93925127 100644 --- a/app/assets/javascripts/admin/controllers/admin-web-hooks-show.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-web-hooks-show.js.es6 @@ -65,10 +65,16 @@ export default Ember.Controller.extend({ this.set('saved', false); const url = extractDomainFromUrl(this.get('model.payload_url')); const model = this.get('model'); + const isNew = model.get('isNew'); + const saveWebHook = () => { return model.save().then(() => { this.set('saved', true); this.get('adminWebHooks').get('model').addObject(model); + + if (isNew) { + this.transitionToRoute('adminWebHooks.show', model.get('id')); + } }).catch(popupAjaxError); }; diff --git a/app/assets/javascripts/admin/models/admin-user.js.es6 b/app/assets/javascripts/admin/models/admin-user.js.es6 index 411dac89b8a..48764b671d6 100644 --- a/app/assets/javascripts/admin/models/admin-user.js.es6 +++ b/app/assets/javascripts/admin/models/admin-user.js.es6 @@ -257,7 +257,7 @@ const AdminUser = Discourse.User.extend({ }); }, - log_out() { + logOut() { return ajax("/admin/users/" + this.id + "/log_out", { type: 'POST', data: { username_or_email: this.get('username') } diff --git a/app/assets/javascripts/admin/models/email-preview.js.es6 b/app/assets/javascripts/admin/models/email-preview.js.es6 index cfe96c6e0d5..acc7462b925 100644 --- a/app/assets/javascripts/admin/models/email-preview.js.es6 +++ b/app/assets/javascripts/admin/models/email-preview.js.es6 @@ -5,7 +5,7 @@ EmailPreview.reopenClass({ findDigest: function(lastSeenAt, username) { if (Em.isEmpty(lastSeenAt)) { - lastSeenAt = moment().subtract(7, 'days').format('YYYY-MM-DD'); + lastSeenAt = this.oneWeekAgo(); } if (Em.isEmpty(username)) { @@ -21,7 +21,7 @@ EmailPreview.reopenClass({ sendDigest: function(lastSeenAt, username, email) { if (Em.isEmpty(lastSeenAt)) { - lastSeenAt = moment().subtract(7, 'days').format('YYYY-MM-DD'); + lastSeenAt = this.oneWeekAgo(); } if (Em.isEmpty(username)) { @@ -31,6 +31,11 @@ EmailPreview.reopenClass({ return ajax("/admin/email/send-digest.json", { data: { last_seen_at: lastSeenAt, username: username, email: email } }); + }, + + oneWeekAgo() { + const en = moment().locale('en'); + return en.subtract(7, 'days').format('YYYY-MM-DD'); } }); diff --git a/app/assets/javascripts/admin/models/report.js.es6 b/app/assets/javascripts/admin/models/report.js.es6 index 3342323b467..03e3888f97b 100644 --- a/app/assets/javascripts/admin/models/report.js.es6 +++ b/app/assets/javascripts/admin/models/report.js.es6 @@ -81,7 +81,8 @@ const Report = Discourse.Model.extend({ switch (this.get("type")) { case "flags": return "flag"; case "likes": return "heart"; - default: return null; + case "bookmarks": return "bookmark"; + default: return null; } }.property("type"), diff --git a/app/assets/javascripts/admin/models/web-hook.js.es6 b/app/assets/javascripts/admin/models/web-hook.js.es6 index e688a4dd0a1..325d9310452 100644 --- a/app/assets/javascripts/admin/models/web-hook.js.es6 +++ b/app/assets/javascripts/admin/models/web-hook.js.es6 @@ -10,7 +10,6 @@ export default RestModel.extend({ verify_certificate: true, active: false, web_hook_event_types: null, - categoriesFilter: null, groupsFilterInName: null, @computed('wildcard_web_hook') @@ -23,9 +22,9 @@ export default RestModel.extend({ } }, - @observes('category_ids') - updateCategoriesFilter() { - this.set('categoriesFilter', Category.findByIds(this.get('category_ids'))); + @computed('category_ids') + categories(categoryIds) { + return Category.findByIds(categoryIds); }, @observes('group_ids') @@ -55,7 +54,8 @@ export default RestModel.extend({ createProperties() { const types = this.get('web_hook_event_types'); - const categories = this.get('categoriesFilter'); + const categoryIds = this.get('categories').map(c => c.id); + // Hack as {{group-selector}} accepts a comma-separated string as data source, but // we use an array to populate the datasource above. const groupsFilter = this.get('groupsFilterInName'); @@ -69,7 +69,7 @@ export default RestModel.extend({ verify_certificate: this.get('verify_certificate'), active: this.get('active'), web_hook_event_type_ids: Ember.isEmpty(types) ? [null] : types.map(type => type.id), - category_ids: Ember.isEmpty(categories) ? [null] : categories.map(c => c.id), + category_ids: Ember.isEmpty(categoryIds) ? [null] : categoryIds, group_ids: Ember.isEmpty(groupNames) || Ember.isEmpty(groupNames[0]) ? [null] : Discourse.Site.currentProp('groups') .reduce((groupIds, g) => { if (groupNames.includes(g.name)) { groupIds.push(g.id); } diff --git a/app/assets/javascripts/admin/templates/admin.hbs b/app/assets/javascripts/admin/templates/admin.hbs index 77904edc48b..7f34c00b772 100644 --- a/app/assets/javascripts/admin/templates/admin.hbs +++ b/app/assets/javascripts/admin/templates/admin.hbs @@ -23,7 +23,7 @@ {{nav-item route='admin.backups' label='admin.backups.title'}} {{/if}} {{nav-item route='adminPlugins' label='admin.plugins.title'}} - {{plugin-outlet "admin-menu" tagName="li"}} + {{plugin-outlet name="admin-menu" connectorTagName="li"}}
{{i18n 'admin.dashboard.installed_version'}} | diff --git a/app/assets/javascripts/admin/templates/web-hooks-show.hbs b/app/assets/javascripts/admin/templates/web-hooks-show.hbs index b0e0c0c0bfb..458a18c1e22 100644 --- a/app/assets/javascripts/admin/templates/web-hooks-show.hbs +++ b/app/assets/javascripts/admin/templates/web-hooks-show.hbs @@ -50,7 +50,7 @@||
---|---|---|