FIX: use allowlist and blocklist terminology (#10209)

FIX: use allowlist and blocklist terminology (#10209)

This is a PR of the renaming whitelist to allowlist and blacklist to the blocklist.

diff --git a/Gemfile.lock b/Gemfile.lock
index c4126f8..7f65dcb 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -240,7 +240,7 @@ GEM
     omniauth-twitter (1.4.0)
       omniauth-oauth (~> 1.1)
       rack
-    onebox (1.9.30)
+    onebox (2.0.0)
       addressable (~> 2.7.0)
       htmlentities (~> 4.3)
       multi_json (~> 1.11)
diff --git a/app/assets/javascripts/admin/components/embeddable-host.js b/app/assets/javascripts/admin/components/embeddable-host.js
index cc96741..d67a236 100644
--- a/app/assets/javascripts/admin/components/embeddable-host.js
+++ b/app/assets/javascripts/admin/components/embeddable-host.js
@@ -42,7 +42,7 @@ export default Component.extend(bufferedProperty("host"), {
 
       const props = this.buffered.getProperties(
         "host",
-        "path_whitelist",
+        "allowed_paths",
         "class_name"
       );
       props.category_id = this.categoryId;
diff --git a/app/assets/javascripts/admin/components/screened-ip-address-form.js b/app/assets/javascripts/admin/components/screened-ip-address-form.js
index 9bd2323..ca535d0 100644
--- a/app/assets/javascripts/admin/components/screened-ip-address-form.js
+++ b/app/assets/javascripts/admin/components/screened-ip-address-form.js
@@ -3,7 +3,7 @@ import discourseComputed from "discourse-common/utils/decorators";
 import { schedule } from "@ember/runloop";
 import Component from "@ember/component";
 /**
-  A form to create an IP address that will be blocked or whitelisted.
+  A form to create an IP address that will be blocked or allowed.
   Example usage:
 
     {{screened-ip-address-form action=(action "recordAdded")}}
@@ -21,9 +21,9 @@ export default Component.extend({
   formSubmitted: false,
   actionName: "block",
 
-  @discourseComputed("siteSettings.use_admin_ip_whitelist")
-  actionNames(adminWhitelistEnabled) {
-    if (adminWhitelistEnabled) {
+  @discourseComputed("siteSettings.use_admin_ip_allowlist")
+  actionNames(adminAllowlistEnabled) {
+    if (adminAllowlistEnabled) {
       return [
         { id: "block", name: I18n.t("admin.logs.screened_ips.actions.block") },
         {
diff --git a/app/assets/javascripts/admin/templates/components/embeddable-host.hbs b/app/assets/javascripts/admin/templates/components/embeddable-host.hbs
index 9c418be..7d73d93 100644
--- a/app/assets/javascripts/admin/templates/components/embeddable-host.hbs
+++ b/app/assets/javascripts/admin/templates/components/embeddable-host.hbs
@@ -8,8 +8,8 @@
     {{input value=buffered.class_name placeholder="class" enter=(action "save") class="class-name"}}
   </td>
   <td class="editing-input">
-    <div class="label">{{i18n "admin.embedding.path_whitelist"}}</div>
-    {{input value=buffered.path_whitelist placeholder="/blog/.*" enter=(action "save") class="path-whitelist"}}
+    <div class="label">{{i18n "admin.embedding.allowed_paths"}}</div>
+    {{input value=buffered.allowed_paths placeholder="/blog/.*" enter=(action "save") class="path-allowlist"}}
   </td>
   <td class="editing-input">
     <div class="label">{{i18n "admin.embedding.category"}}</div>
@@ -26,7 +26,7 @@
 {{else}}
   <td><div class="label">{{i18n "admin.embedding.host"}}</div>{{host.host}}</td>
   <td><div class="label">{{i18n "admin.embedding.class_name"}}</div>{{host.class_name}}</td>
-  <td><div class="label">{{i18n "admin.embedding.path_whitelist"}}</div>{{host.path_whitelist}}</td>
+  <td><div class="label">{{i18n "admin.embedding.allowed_paths"}}</div>{{host.allowed_paths}}</td>
   <td><div class="label">{{i18n "admin.embedding.category"}}</div>{{category-badge host.category}}</td>
   <td class="controls">
     {{d-button icon="pencil-alt" action=(action "edit")}}
diff --git a/app/assets/javascripts/admin/templates/embedding.hbs b/app/assets/javascripts/admin/templates/embedding.hbs
index b70a9be..fc07050 100644
--- a/app/assets/javascripts/admin/templates/embedding.hbs
+++ b/app/assets/javascripts/admin/templates/embedding.hbs
@@ -4,7 +4,7 @@
       <thead>
         <th style="width: 25%">{{i18n "admin.embedding.host"}}</th>
         <th style="width: 15%">{{i18n "admin.embedding.class_name"}}</th>
-        <th style="width: 25%">{{i18n "admin.embedding.path_whitelist"}}</th>
+        <th style="width: 25%">{{i18n "admin.embedding.allowed_paths"}}</th>
         <th style="width: 25%">{{i18n "admin.embedding.category"}}</th>
         <th style="width: 10%">&nbsp;</th>
       </thead>
@@ -45,16 +45,16 @@
     <h3>{{i18n "admin.embedding.crawling_settings"}}</h3>
     <p class="description">{{i18n "admin.embedding.crawling_description"}}</p>
 
-    {{embedding-setting field="embed_whitelist_selector"
-                        value=embedding.embed_whitelist_selector
+    {{embedding-setting field="allowed_embed_selectors"
+                        value=embedding.allowed_embed_selectors
                         placeholder="article, #story, .post"}}
 
-    {{embedding-setting field="embed_blacklist_selector"
-                        value=embedding.embed_blacklist_selector
+    {{embedding-setting field="blocked_embed_selectors"
+                        value=embedding.blocked_embed_selectors
                         placeholder=".ad-unit, header"}}
 
-    {{embedding-setting field="embed_classname_whitelist"
-                        value=embedding.embed_classname_whitelist
+    {{embedding-setting field="allowed_embed_classnames"
+                        value=embedding.allowed_embed_classnames
                         placeholder="emoji, classname"}}
   </div>
 
diff --git a/app/assets/javascripts/discourse/app/lib/to-markdown.js b/app/assets/javascripts/discourse/app/lib/to-markdown.js
index 25e49bf..43f9765 100644
--- a/app/assets/javascripts/discourse/app/lib/to-markdown.js
+++ b/app/assets/javascripts/discourse/app/lib/to-markdown.js
@@ -102,7 +102,7 @@ export class Tag {
     ];
   }
 
-  static whitelists() {
+  static allowedTags() {
     return ["ins", "del", "small", "big", "kbd", "ruby", "rt", "rb", "rp"];
   }
 
@@ -192,7 +192,7 @@ export class Tag {
     };
   }
 
-  static whitelist(name) {
+  static allowedTag(name) {
     return class extends Tag {
       constructor() {
         super(name, `<${name}>`, `</${name}>`);
@@ -526,7 +526,7 @@ function tags() {
     ...Tag.headings().map((h, i) => Tag.heading(h, i + 1)),
     ...Tag.slices().map(s => Tag.slice(s, "\n")),
     ...Tag.emphases().map(e => Tag.emphasis(e[0], e[1])),
-    ...Tag.whitelists().map(t => Tag.whitelist(t)),
+    ...Tag.allowedTags().map(t => Tag.allowedTag(t)),
     Tag.aside(),
     Tag.cell("td"),
     Tag.cell("th"),
diff --git a/app/assets/javascripts/discourse/app/templates/preferences/categories.hbs b/app/assets/javascripts/discourse/app/templates/preferences/categories.hbs
index cd907dc..7b36d0f 100644
--- a/app/assets/javascripts/discourse/app/templates/preferences/categories.hbs
+++ b/app/assets/javascripts/discourse/app/templates/preferences/categories.hbs
@@ -8,7 +8,7 @@
     {{/if}}
     {{category-selector
       categories=model.watchedCategories
-      blacklist=selectedCategories
+      blocklist=selectedCategories
       onChange=(action (mut model.watchedCategories))
     }}
   </div>
@@ -21,7 +21,7 @@
     {{/if}}
     {{category-selector
       categories=model.trackedCategories
-      blacklist=selectedCategories
+      blocklist=selectedCategories
       onChange=(action (mut model.trackedCategories))
     }}
   </div>
@@ -31,7 +31,7 @@
     <label>{{d-icon "d-watching-first"}} {{i18n "user.watched_first_post_categories"}}</label>
     {{category-selector
       categories=model.watchedFirstPostCategories
-      blacklist=selectedCategories
+      blocklist=selectedCategories
       onChange=(action (mut model.watchedFirstPostCategories))
     }}
   </div>
@@ -45,7 +45,7 @@
       {{/if}}
       {{category-selector
         categories=model.mutedCategories
-        blacklist=selectedCategories
+        blocklist=selectedCategories
         onChange=(action (mut model.mutedCategories))
       }}

[... diff too long, it was truncated ...]

GitHub sha: e0d92322

1 Like

This commit appears in #10209 which was merged by lis2.