From 5b590b96373a8c2f1f211aef63bc8317f1cb776a Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Wed, 26 Jul 2017 16:33:17 -0400 Subject: [PATCH] REFACTOR: Replace some `fa-*` uses with helpers --- .../admin/components/resumable-upload.js.es6 | 3 +- .../admin/helpers/check-icon.js.es6 | 7 ++++ .../admin/models/admin-user.js.es6 | 11 ++--- .../admin/models/flagged-post.js.es6 | 13 +++--- .../javascripts/admin/templates/api-keys.hbs | 2 +- .../admin/templates/customize-colors-show.hbs | 6 +-- .../admin/templates/customize-themes-edit.hbs | 2 +- .../admin/templates/flags-list.hbs | 19 +++++---- .../templates/modal/admin-agree-flag.hbs | 8 ++-- .../templates/modal/admin-badge-preview.hbs | 2 +- .../templates/modal/admin-delete-flag.hbs | 6 +-- .../templates/modal/admin-suspend-user.hbs | 2 +- .../admin/templates/user-badges.hbs | 2 +- .../admin/templates/user-index.hbs | 6 ++- .../admin/templates/user-tl3-requirements.hbs | 40 +++++++++---------- .../components/combo-box.js.es6 | 3 +- .../discourse-common/lib/icon-library.js.es6 | 5 ++- .../auto-update-input-selector.js.es6 | 5 +-- .../categories-admin-dropdown.js.es6 | 4 +- .../discourse/components/category-drop.js.es6 | 10 +++-- .../components/dropdown-button.js.es6 | 13 +++++- .../components/notifications-button.js.es6 | 3 +- .../components/period-chooser.js.es6 | 2 +- .../discourse/components/pinned-button.js.es6 | 23 +++++++---- .../discourse/components/tag-drop.js.es6 | 5 +-- .../components/tags-admin-dropdown.js.es6 | 2 +- .../discourse/components/topic-status.js.es6 | 2 +- .../components/topic-timer-info.js.es6 | 3 +- .../discourse/controllers/flag.js.es6 | 5 ++- .../controllers/preferences/account.js.es6 | 3 +- .../discourse/controllers/topic.js.es6 | 3 +- .../discourse/helpers/icon-or-image.js.es6 | 3 +- .../initializers/sharing-sources.js.es6 | 8 ++-- .../discourse/lib/autocomplete.js.es6 | 3 +- .../javascripts/discourse/lib/sharing.js.es6 | 12 ++++-- .../discourse/models/composer.js.es6 | 11 ++--- .../discourse/models/user-action.js.es6 | 8 ++-- .../raw-views/topic-list-header-column.js.es6 | 4 +- .../templates/components/category-drop.hbs | 4 +- .../templates/components/discourse-banner.hbs | 4 +- .../templates/components/queued-post.hbs | 2 +- .../templates/components/share-source.hbs | 4 +- .../templates/components/stream-item.hbs | 2 +- .../templates/components/tag-drop.hbs | 4 +- .../discourse/templates/composer.hbs | 4 +- .../discourse/templates/discovery/topics.hbs | 5 ++- .../discourse/templates/exception.hbs | 2 +- .../discourse/templates/invites/show.hbs | 3 +- .../templates/list/action-list.raw.hbs | 2 +- .../templates/list/topic-list-item.raw.hbs | 4 +- .../mobile/components/mobile-nav.hbs | 4 +- .../mobile/components/navigation-bar.hbs | 2 +- .../templates/mobile/discovery/topics.hbs | 4 +- .../templates/mobile/modal/login.hbs | 2 +- .../templates/modal/create-account.hbs | 3 +- .../templates/modal/dismiss-read.hbs | 3 +- .../discourse/templates/modal/flag.hbs | 6 +-- .../discourse/templates/modal/login.hbs | 4 +- .../templates/navigation/default.hbs | 3 +- .../discourse/templates/password-reset.hbs | 3 +- .../templates/preferences/account.hbs | 3 +- .../templates/preferences/categories.hbs | 8 ++-- .../templates/preferences/notifications.hbs | 2 +- .../discourse/templates/preferences/tags.hbs | 8 ++-- .../discourse/templates/tag-groups-show.hbs | 4 +- .../discourse/templates/tag-groups.hbs | 4 +- .../discourse/templates/tags/show.hbs | 2 +- .../topic-list-header-column.raw.hbs | 2 +- .../discourse/templates/topic-status.raw.hbs | 4 +- .../user-selector-autocomplete.raw.hbs | 2 +- .../discourse/templates/user/activity.hbs | 6 +-- .../discourse/templates/user/messages.hbs | 4 +- .../templates/user/notifications.hbs | 8 ++-- .../discourse/widgets/post-cooked.js.es6 | 5 ++- .../discourse/widgets/post-menu.js.es6 | 2 +- .../javascripts/discourse/widgets/post.js.es6 | 2 +- .../widgets/topic-notifications-button.js.es6 | 3 +- .../acceptance/details-button-test.js.es6 | 8 ++-- .../widgets/discourse-poll-option-test.js.es6 | 8 ++-- .../acceptance/composer-test.js.es6 | 6 +-- test/javascripts/acceptance/topic-test.js.es6 | 8 ++-- .../widgets/actions-summary-test.js.es6 | 2 +- .../javascripts/widgets/home-logo-test.js.es6 | 2 +- test/javascripts/widgets/post-test.js.es6 | 6 +-- .../widgets/poster-name-test.js.es6 | 2 +- 85 files changed, 262 insertions(+), 192 deletions(-) create mode 100644 app/assets/javascripts/admin/helpers/check-icon.js.es6 diff --git a/app/assets/javascripts/admin/components/resumable-upload.js.es6 b/app/assets/javascripts/admin/components/resumable-upload.js.es6 index 73a46eded3c..36f420d1009 100644 --- a/app/assets/javascripts/admin/components/resumable-upload.js.es6 +++ b/app/assets/javascripts/admin/components/resumable-upload.js.es6 @@ -1,3 +1,4 @@ +import { iconHTML } from 'discourse-common/lib/icon-library'; import { bufferedRender } from 'discourse-common/lib/buffered-render'; /*global Resumable:true */ @@ -40,7 +41,7 @@ export default Ember.Component.extend(bufferedRender({ buildBuffer(buffer) { const icon = this.get("isUploading") ? "times" : "upload"; - buffer.push(``); + buffer.push(iconHTML(icon)); buffer.push("" + this.get("text") + ""); buffer.push(""); }, diff --git a/app/assets/javascripts/admin/helpers/check-icon.js.es6 b/app/assets/javascripts/admin/helpers/check-icon.js.es6 new file mode 100644 index 00000000000..0a68c0be0b3 --- /dev/null +++ b/app/assets/javascripts/admin/helpers/check-icon.js.es6 @@ -0,0 +1,7 @@ +import { registerUnbound } from 'discourse-common/lib/helpers'; +import { renderIcon } from 'discourse-common/lib/icon-library'; + +registerUnbound('check-icon', function(value) { + let icon = value ? "check" : "times"; + return new Handlebars.SafeString(renderIcon('string', icon)); +}); diff --git a/app/assets/javascripts/admin/models/admin-user.js.es6 b/app/assets/javascripts/admin/models/admin-user.js.es6 index 0720976e69b..662f0b046ca 100644 --- a/app/assets/javascripts/admin/models/admin-user.js.es6 +++ b/app/assets/javascripts/admin/models/admin-user.js.es6 @@ -1,3 +1,4 @@ +import { iconHTML } from 'discourse-common/lib/icon-library'; import { ajax } from 'discourse/lib/ajax'; import computed from 'ember-addons/ember-computed-decorators'; import { propertyNotEqual } from 'discourse/lib/computed'; @@ -108,7 +109,7 @@ const AdminUser = Discourse.User.extend({ "class": "cancel-inline", "link": true }, { - "label": ' ' + I18n.t("admin.user.delete_all_posts"), + "label": `${iconHTML('exclamation-triangle')} ` + I18n.t("admin.user.delete_all_posts"), "class": "btn btn-danger", "callback": function() { ajax("/admin/users/" + user.get('id') + "/delete_all_posts", { @@ -337,7 +338,7 @@ const AdminUser = Discourse.User.extend({ "class": "cancel", "link": true }, { - "label": '' + I18n.t('admin.user.block_accept'), + "label": `${iconHTML('exclamation-triangle')} ` + I18n.t('admin.user.block_accept'), "class": "btn btn-danger", "callback": function() { performBlock(); } }]; @@ -386,7 +387,7 @@ const AdminUser = Discourse.User.extend({ "class": "cancel", "link": true }, { - "label": '' + I18n.t('admin.user.anonymize_yes'), + "label": `${iconHTML('exclamation-triangle')} ` + I18n.t('admin.user.anonymize_yes'), "class": "btn btn-danger", "callback": function() { performAnonymize(); } }]; @@ -450,7 +451,7 @@ const AdminUser = Discourse.User.extend({ "class": "btn", "link": true }, { - "label": '' + I18n.t('admin.user.delete_and_block'), + "label": `${iconHTML('exclamation-triangle')} ` + I18n.t('admin.user.delete_and_block'), "class": "btn btn-danger", "callback": function(){ performDestroy(true); } }, { @@ -479,7 +480,7 @@ const AdminUser = Discourse.User.extend({ "class": "cancel-inline", "link": true }, { - "label": ' ' + I18n.t("flagging.yes_delete_spammer"), + "label": `${iconHTML('exclamation-triangle')} ` + I18n.t("flagging.yes_delete_spammer"), "class": "btn btn-danger", "callback": function() { return ajax("/admin/users/" + user.get('id') + '.json', { diff --git a/app/assets/javascripts/admin/models/flagged-post.js.es6 b/app/assets/javascripts/admin/models/flagged-post.js.es6 index c7a654608f8..7a627f1569b 100644 --- a/app/assets/javascripts/admin/models/flagged-post.js.es6 +++ b/app/assets/javascripts/admin/models/flagged-post.js.es6 @@ -2,7 +2,7 @@ import { ajax } from 'discourse/lib/ajax'; import AdminUser from 'admin/models/admin-user'; import Topic from 'discourse/models/topic'; import Post from 'discourse/models/post'; - +import { iconHTML } from 'discourse-common/lib/icon-library'; const FlaggedPost = Post.extend({ @@ -35,13 +35,14 @@ const FlaggedPost = Post.extend({ dispositionIcon: function (disposition) { if (!disposition) { return null; } - var icon, title = I18n.t('admin.flags.dispositions.' + disposition); + let icon; + let title = 'admin.flags.dispositions.' + disposition; switch (disposition) { - case "deferred": { icon = "fa-external-link"; break; } - case "agreed": { icon = "fa-thumbs-o-up"; break; } - case "disagreed": { icon = "fa-thumbs-o-down"; break; } + case "deferred": { icon = "external-link"; break; } + case "agreed": { icon = "thumbs-o-up"; break; } + case "disagreed": { icon = "thumbs-o-down"; break; } } - return ""; + return iconHTML(icon, { title }); }, wasEdited: function () { diff --git a/app/assets/javascripts/admin/templates/api-keys.hbs b/app/assets/javascripts/admin/templates/api-keys.hbs index 60449052bb9..b25eebd69a6 100644 --- a/app/assets/javascripts/admin/templates/api-keys.hbs +++ b/app/assets/javascripts/admin/templates/api-keys.hbs @@ -29,5 +29,5 @@ {{/if}} {{#unless hasMasterKey}} - + {{/unless}} diff --git a/app/assets/javascripts/admin/templates/customize-colors-show.hbs b/app/assets/javascripts/admin/templates/customize-colors-show.hbs index 6b3c8a3e91c..e688e133166 100644 --- a/app/assets/javascripts/admin/templates/customize-colors-show.hbs +++ b/app/assets/javascripts/admin/templates/customize-colors-show.hbs @@ -5,13 +5,13 @@ {{#unless model.theme_id}} {{/unless}} - - + + {{#if model.theme_id}} {{i18n "admin.customize.theme_owner"}} {{#link-to "adminCustomizeThemes.show" model.theme_id}}{{model.theme_name}}{{/link-to}} {{else}} - + {{/if}} {{model.savingStatus}} diff --git a/app/assets/javascripts/admin/templates/customize-themes-edit.hbs b/app/assets/javascripts/admin/templates/customize-themes-edit.hbs index ba65a6d33fd..83eebb83d08 100644 --- a/app/assets/javascripts/admin/templates/customize-themes-edit.hbs +++ b/app/assets/javascripts/admin/templates/customize-themes-edit.hbs @@ -53,7 +53,7 @@ {{/each}}
  • - + {{d-icon maximizeIcon}}
  • diff --git a/app/assets/javascripts/admin/templates/flags-list.hbs b/app/assets/javascripts/admin/templates/flags-list.hbs index 796552d4d2f..f7a6ef19e18 100644 --- a/app/assets/javascripts/admin/templates/flags-list.hbs +++ b/app/assets/javascripts/admin/templates/flags-list.hbs @@ -19,7 +19,9 @@ {{#if flaggedPost.postAuthorFlagged}} {{#if flaggedPost.user}} {{#link-to 'adminUser' flaggedPost.user}}{{avatar flaggedPost.user imageSize="large"}}{{/link-to}} - {{#if flaggedPost.wasEdited}}{{/if}} + {{#if flaggedPost.wasEdited}} + {{d-icon "pencil" title="admin.flags.was_edited"}} + {{/if}} {{/if}} {{/if}} {{#if adminActiveFlagsView}} @@ -90,7 +92,7 @@ {{format-age flagger.disposedAt}} {{{flagger.dispositionIcon}}} {{#if flagger.tookAction}} - + {{d-icon "gavel" title="admin.flags.took_action"}} {{/if}} @@ -129,7 +131,8 @@

    {{/if}} - + + {{/if}} @@ -141,14 +144,14 @@ {{#if adminActiveFlagsView}} - + {{#if flaggedPost.postHidden}} - + {{else}} - + {{/if}} - - + + {{/if}} diff --git a/app/assets/javascripts/admin/templates/modal/admin-agree-flag.hbs b/app/assets/javascripts/admin/templates/modal/admin-agree-flag.hbs index 6f845b22c80..63ce16601bd 100644 --- a/app/assets/javascripts/admin/templates/modal/admin-agree-flag.hbs +++ b/app/assets/javascripts/admin/templates/modal/admin-agree-flag.hbs @@ -1,13 +1,13 @@ {{#d-modal-body title="admin.flags.agree_flag_modal_title"}} {{#if model.user_deleted}} - + {{else}} {{#unless model.postHidden}} - + {{/unless}} {{/if}} - + {{#if model.canDeleteAsSpammer}} - + {{/if}} {{/d-modal-body}} diff --git a/app/assets/javascripts/admin/templates/modal/admin-badge-preview.hbs b/app/assets/javascripts/admin/templates/modal/admin-badge-preview.hbs index c22bd9d99d2..70b0c1c3fc2 100644 --- a/app/assets/javascripts/admin/templates/modal/admin-badge-preview.hbs +++ b/app/assets/javascripts/admin/templates/modal/admin-badge-preview.hbs @@ -24,7 +24,7 @@ {{#if count_warning}}
    -

    {{i18n 'admin.badges.preview.bad_count_warning.header'}}

    +

    {{d-icon "warning"}} {{i18n 'admin.badges.preview.bad_count_warning.header'}}

    {{i18n 'admin.badges.preview.bad_count_warning.text'}}

    {{/if}} diff --git a/app/assets/javascripts/admin/templates/modal/admin-delete-flag.hbs b/app/assets/javascripts/admin/templates/modal/admin-delete-flag.hbs index c2abeae36d7..89cf7452a4c 100644 --- a/app/assets/javascripts/admin/templates/modal/admin-delete-flag.hbs +++ b/app/assets/javascripts/admin/templates/modal/admin-delete-flag.hbs @@ -1,7 +1,7 @@ {{#d-modal-body title="admin.flags.delete_flag_modal_title"}} - - + + {{#if model.canDeleteAsSpammer}} - + {{/if}} {{/d-modal-body}} diff --git a/app/assets/javascripts/admin/templates/modal/admin-suspend-user.hbs b/app/assets/javascripts/admin/templates/modal/admin-suspend-user.hbs index 9d9326ad3ee..afb7525fb59 100644 --- a/app/assets/javascripts/admin/templates/modal/admin-suspend-user.hbs +++ b/app/assets/javascripts/admin/templates/modal/admin-suspend-user.hbs @@ -11,6 +11,6 @@ {{/d-modal-body}} diff --git a/app/assets/javascripts/admin/templates/user-badges.hbs b/app/assets/javascripts/admin/templates/user-badges.hbs index 393695e8422..9977aca39d2 100644 --- a/app/assets/javascripts/admin/templates/user-badges.hbs +++ b/app/assets/javascripts/admin/templates/user-badges.hbs @@ -1,7 +1,7 @@
    diff --git a/app/assets/javascripts/admin/templates/user-index.hbs b/app/assets/javascripts/admin/templates/user-index.hbs index eecc669e6cc..7a016f150f1 100644 --- a/app/assets/javascripts/admin/templates/user-index.hbs +++ b/app/assets/javascripts/admin/templates/user-index.hbs @@ -281,9 +281,11 @@
    {{#if model.canLockTrustLevel}} {{#if model.trust_level_locked}} - {{d-button action="lockTrustLevel" actionParam=false label="admin.user.unlock_trust_level"}} + {{d-icon "lock" title="admin.user.trust_level_locked_tip"}} + {{d-button action="lockTrustLevel" actionParam=false label="admin.user.unlock_trust_level"}} {{else}} - {{d-button action="lockTrustLevel" actionParam=true label="admin.user.lock_trust_level"}} + {{d-icon "unlock" title="admin.user.trust_level_unlocked_tip"}} + {{d-button action="lockTrustLevel" actionParam=true label="admin.user.lock_trust_level"}} {{/if}} {{/if}} {{#if model.tl3Requirements}} diff --git a/app/assets/javascripts/admin/templates/user-tl3-requirements.hbs b/app/assets/javascripts/admin/templates/user-tl3-requirements.hbs index e0536ddd087..1561a95670b 100644 --- a/app/assets/javascripts/admin/templates/user-tl3-requirements.hbs +++ b/app/assets/javascripts/admin/templates/user-tl3-requirements.hbs @@ -1,7 +1,7 @@
    @@ -24,7 +24,7 @@ {{i18n 'admin.user.tl3_requirements.visits'}} - + {{check-icon model.tl3Requirements.met.days_visited}} {{model.tl3Requirements.days_visited_percent}}% ({{model.tl3Requirements.days_visited}} / {{model.tl3Requirements.time_period}} {{i18n 'admin.user.tl3_requirements.days'}}) @@ -32,67 +32,67 @@ {{i18n 'admin.user.tl3_requirements.topics_replied_to'}} - + {{check-icon model.tl3Requirements.met.topics_replied_to}} {{model.tl3Requirements.num_topics_replied_to}} {{model.tl3Requirements.min_topics_replied_to}} {{i18n 'admin.user.tl3_requirements.topics_viewed'}} - + {{check-icon model.tl3Requirements.met.topics_viewed}} {{model.tl3Requirements.topics_viewed}} {{model.tl3Requirements.min_topics_viewed}} {{i18n 'admin.user.tl3_requirements.topics_viewed_all_time'}} - + {{check-icon model.tl3Requirements.met.topics_viewed_all_time}} {{model.tl3Requirements.topics_viewed_all_time}} {{model.tl3Requirements.min_topics_viewed_all_time}} {{i18n 'admin.user.tl3_requirements.posts_read'}} - + {{check-icon model.tl3Requirements.met.posts_read}} {{model.tl3Requirements.posts_read}} {{model.tl3Requirements.min_posts_read}} {{i18n 'admin.user.tl3_requirements.posts_read_all_time'}} - + {{check-icon model.tl3Requirements.met.posts_read_all_time}} {{model.tl3Requirements.posts_read_all_time}} {{model.tl3Requirements.min_posts_read_all_time}} {{i18n 'admin.user.tl3_requirements.flagged_posts'}} - + {{check-icon model.tl3Requirements.met.flagged_posts}} {{model.tl3Requirements.num_flagged_posts}} {{i18n 'max_of_count' count=model.tl3Requirements.max_flagged_posts}} {{i18n 'admin.user.tl3_requirements.flagged_by_users'}} - + {{check-icon model.tl3Requirements.met.flagged_by_users}} {{model.tl3Requirements.num_flagged_by_users}} {{i18n 'max_of_count' count=model.tl3Requirements.max_flagged_by_users}} {{i18n 'admin.user.tl3_requirements.likes_given'}} - + {{check-icon model.tl3Requirements.met.likes_given}} {{model.tl3Requirements.num_likes_given}} {{model.tl3Requirements.min_likes_given}} {{i18n 'admin.user.tl3_requirements.likes_received'}} - + {{check-icon model.tl3Requirements.met.likes_received}} {{model.tl3Requirements.num_likes_received}} {{model.tl3Requirements.min_likes_received}} {{i18n 'admin.user.tl3_requirements.likes_received_days'}} - + {{check-icon model.tl3Requirements.met.likes_received_days}} {{model.tl3Requirements.num_likes_received_days}} {{model.tl3Requirements.min_likes_received_days}} {{i18n 'admin.user.tl3_requirements.likes_received_users'}} - + {{check-icon model.tl3Requirements.met.likes_received_users}} {{model.tl3Requirements.num_likes_received_users}} {{model.tl3Requirements.min_likes_received_users}} @@ -105,16 +105,16 @@ {{#if model.tl3Requirements.requirements_lost}} {{! tl implicitly not locked }} {{#if model.tl3Requirements.on_grace_period}} - {{i18n 'admin.user.tl3_requirements.on_grace_period'}} + {{d-icon "times"}} {{i18n 'admin.user.tl3_requirements.on_grace_period'}} {{else}} {{! not on grace period }} - {{i18n 'admin.user.tl3_requirements.does_not_qualify'}} + {{d-icon "times"}} {{i18n 'admin.user.tl3_requirements.does_not_qualify'}} {{i18n 'admin.user.tl3_requirements.will_be_demoted'}} {{/if}} {{else}} {{! requirements not lost - remains tl3 }} {{#if model.tl3Requirements.trust_level_locked}} - {{i18n 'admin.user.tl3_requirements.locked_will_not_be_demoted'}} + {{d-icon "lock"}} {{i18n 'admin.user.tl3_requirements.locked_will_not_be_demoted'}} {{else}} {{! tl not locked }} - {{i18n 'admin.user.tl3_requirements.qualifies'}} + {{d-icon "check"}} {{i18n 'admin.user.tl3_requirements.qualifies'}} {{#if model.tl3Requirements.on_grace_period}} {{i18n 'admin.user.tl3_requirements.on_grace_period'}} {{/if}} @@ -123,13 +123,13 @@ {{else}} {{! is not tl3 }} {{#if model.tl3Requirements.requirements_met}} {{! met & not tl3 - will be promoted}} - {{i18n 'admin.user.tl3_requirements.qualifies'}} + {{d-icon "check"}} {{i18n 'admin.user.tl3_requirements.qualifies'}} {{i18n 'admin.user.tl3_requirements.will_be_promoted'}} {{else}} {{! requirements not met - remains regular }} {{#if model.tl3Requirements.trust_level_locked}} - {{i18n 'admin.user.tl3_requirements.locked_will_not_be_promoted'}} + {{d-icon "lock"}} {{i18n 'admin.user.tl3_requirements.locked_will_not_be_promoted'}} {{else}} - {{i18n 'admin.user.tl3_requirements.does_not_qualify'}} + {{d-icon "times"}} {{i18n 'admin.user.tl3_requirements.does_not_qualify'}} {{/if}} {{/if}} {{/if}} diff --git a/app/assets/javascripts/discourse-common/components/combo-box.js.es6 b/app/assets/javascripts/discourse-common/components/combo-box.js.es6 index e5828e8fc72..0d8cd538b8a 100644 --- a/app/assets/javascripts/discourse-common/components/combo-box.js.es6 +++ b/app/assets/javascripts/discourse-common/components/combo-box.js.es6 @@ -1,5 +1,6 @@ import { bufferedRender } from 'discourse-common/lib/buffered-render'; import { on, observes } from 'ember-addons/ember-computed-decorators'; +import { iconHTML } from 'discourse-common/lib/icon-library'; export default Ember.Component.extend(bufferedRender({ tagName: 'select', @@ -97,7 +98,7 @@ export default Ember.Component.extend(bufferedRender({ this.selectionTemplate = (item) => { let name = Em.get(item, 'text'); name = Handlebars.escapeExpression(name); - return `${name}`; + return iconHTML(this.get('selectionIcon')) + name; }; } diff --git a/app/assets/javascripts/discourse-common/lib/icon-library.js.es6 b/app/assets/javascripts/discourse-common/lib/icon-library.js.es6 index eac3ea194b5..be4f0040551 100644 --- a/app/assets/javascripts/discourse-common/lib/icon-library.js.es6 +++ b/app/assets/javascripts/discourse-common/lib/icon-library.js.es6 @@ -42,10 +42,11 @@ registerIconRenderer({ name: 'font-awesome', string(id, params) { - let html = ``; if (params.label) { html += "" + I18n.t(params.label) + ""; } diff --git a/app/assets/javascripts/discourse/components/auto-update-input-selector.js.es6 b/app/assets/javascripts/discourse/components/auto-update-input-selector.js.es6 index 60978f39592..0ad58a506cc 100644 --- a/app/assets/javascripts/discourse/components/auto-update-input-selector.js.es6 +++ b/app/assets/javascripts/discourse/components/auto-update-input-selector.js.es6 @@ -1,3 +1,4 @@ +import { iconHTML } from 'discourse-common/lib/icon-library'; import { default as computed, observes } from "ember-addons/ember-computed-decorators"; import Combobox from 'discourse-common/components/combo-box'; import { CLOSE_STATUS_TYPE } from 'discourse/controllers/edit-topic-timer'; @@ -111,9 +112,7 @@ export default Combobox.extend({ let icons; if (icon) { - icons = icon.split(',').map(i => { - return ``; - }).join(" "); + icons = icon.split(',').map(i => iconHTML(i)).join(" "); } if (time) { diff --git a/app/assets/javascripts/discourse/components/categories-admin-dropdown.js.es6 b/app/assets/javascripts/discourse/components/categories-admin-dropdown.js.es6 index 52eca3fce33..6a6c1a33532 100644 --- a/app/assets/javascripts/discourse/components/categories-admin-dropdown.js.es6 +++ b/app/assets/javascripts/discourse/components/categories-admin-dropdown.js.es6 @@ -15,14 +15,14 @@ export default DropdownButton.extend({ { id: 'create', title: I18n.t('category.create'), description: I18n.t('category.create_long'), - styleClasses: 'fa fa-plus' } + icon: 'plus' } ]; if (includeReorder) { items.push({ id: 'reorder', title: I18n.t('categories.reorder.title'), description: I18n.t('categories.reorder.title_long'), - styleClasses: 'fa fa-random' + icon: 'random' }); } return items; diff --git a/app/assets/javascripts/discourse/components/category-drop.js.es6 b/app/assets/javascripts/discourse/components/category-drop.js.es6 index e9f05c33fe2..3e4c218b51c 100644 --- a/app/assets/javascripts/discourse/components/category-drop.js.es6 +++ b/app/assets/javascripts/discourse/components/category-drop.js.es6 @@ -1,4 +1,6 @@ import { setting } from 'discourse/lib/computed'; +import computed from 'ember-addons/ember-computed-decorators'; + var get = Ember.get; export default Ember.Component.extend({ @@ -8,10 +10,10 @@ export default Ember.Component.extend({ tagName: 'li', - iconClass: function() { - if (this.get('expanded')) { return "fa fa-caret-down"; } - return "fa fa-caret-right"; - }.property('expanded'), + @computed('expanded') + expandIcon(expanded) { + return expanded ? 'caret-down' : 'caret-right'; + }, allCategoriesUrl: function() { if (this.get('subCategory')) { diff --git a/app/assets/javascripts/discourse/components/dropdown-button.js.es6 b/app/assets/javascripts/discourse/components/dropdown-button.js.es6 index 032c80e2aff..bffeaa6cdc2 100644 --- a/app/assets/javascripts/discourse/components/dropdown-button.js.es6 +++ b/app/assets/javascripts/discourse/components/dropdown-button.js.es6 @@ -1,3 +1,4 @@ +import { iconHTML } from 'discourse-common/lib/icon-library'; import { bufferedRender } from 'discourse-common/lib/buffered-render'; export default Ember.Component.extend(bufferedRender({ @@ -29,7 +30,7 @@ export default Ember.Component.extend(bufferedRender({ buffer.push("

    " + title + "

    "); } - buffer.push(``); + buffer.push(``); buffer.push("
    -
    {{i18n 'login.caps_lock_warning'}}
    +
    + {{d-icon "exclamation-triangle"}} {{i18n 'login.caps_lock_warning'}}
    diff --git a/app/assets/javascripts/discourse/templates/preferences/account.hbs b/app/assets/javascripts/discourse/templates/preferences/account.hbs index a1fd8b1d3d4..239c8d0ecfa 100644 --- a/app/assets/javascripts/discourse/templates/preferences/account.hbs +++ b/app/assets/javascripts/discourse/templates/preferences/account.hbs @@ -3,7 +3,8 @@
    {{model.username}} {{#if model.can_edit_username}} - {{#link-to "preferences.username" class="btn btn-small pad-left no-text"}}{{/link-to}} + {{#link-to "preferences.username" class="btn btn-small pad-left no-text"}} + {{d-icon "pencil"}} {{/link-to}} {{/if}}
    diff --git a/app/assets/javascripts/discourse/templates/preferences/categories.hbs b/app/assets/javascripts/discourse/templates/preferences/categories.hbs index d9be7335240..856feedcf7d 100644 --- a/app/assets/javascripts/discourse/templates/preferences/categories.hbs +++ b/app/assets/javascripts/discourse/templates/preferences/categories.hbs @@ -3,7 +3,7 @@
    - + {{category-selector categories=model.watchedCategories blacklist=selectedCategories}}
    {{i18n 'user.watched_categories_instructions'}}
    @@ -12,7 +12,7 @@
    - + {{category-selector categories=model.trackedCategories blacklist=selectedCategories}}
    {{i18n 'user.tracked_categories_instructions'}}
    @@ -21,13 +21,13 @@
    - + {{category-selector categories=model.watchedFirstPostCategories}}
    {{i18n 'user.watched_first_post_categories_instructions'}}
    - + {{category-selector categories=model.mutedCategories blacklist=selectedCategories}}
    {{i18n 'user.muted_categories_instructions'}}
    diff --git a/app/assets/javascripts/discourse/templates/preferences/notifications.hbs b/app/assets/javascripts/discourse/templates/preferences/notifications.hbs index 6c81046e279..c9cf37ac4d1 100644 --- a/app/assets/javascripts/discourse/templates/preferences/notifications.hbs +++ b/app/assets/javascripts/discourse/templates/preferences/notifications.hbs @@ -29,7 +29,7 @@
    - + {{user-selector excludeCurrentUser=true usernames=model.muted_usernames class="user-selector"}}
    {{i18n 'user.muted_users_instructions'}}
    diff --git a/app/assets/javascripts/discourse/templates/preferences/tags.hbs b/app/assets/javascripts/discourse/templates/preferences/tags.hbs index e2e9507b5bd..390429833ff 100644 --- a/app/assets/javascripts/discourse/templates/preferences/tags.hbs +++ b/app/assets/javascripts/discourse/templates/preferences/tags.hbs @@ -4,25 +4,25 @@
    - + {{tag-chooser tags=model.watched_tags blacklist=selectedTags allowCreate=false placeholder="" everyTag="true" unlimitedTagCount="true"}}
    {{i18n 'user.watched_tags_instructions'}}
    - + {{tag-chooser tags=model.tracked_tags blacklist=selectedTags allowCreate=false placeholder="" everyTag="true" unlimitedTagCount="true"}}
    {{i18n 'user.tracked_tags_instructions'}}
    - + {{tag-chooser tags=model.watching_first_post_tags blacklist=selectedTags allowCreate=false placeholder="" everyTag="true" unlimitedTagCount="true"}}
    {{i18n 'user.watched_first_post_tags_instructions'}}
    - + {{tag-chooser tags=model.muted_tags blacklist=selectedTags allowCreate=false placeholder="" everyTag="true" unlimitedTagCount="true"}}
    {{i18n 'user.muted_tags_instructions'}}
    diff --git a/app/assets/javascripts/discourse/templates/tag-groups-show.hbs b/app/assets/javascripts/discourse/templates/tag-groups-show.hbs index 58b80d565e2..26fde8830f4 100644 --- a/app/assets/javascripts/discourse/templates/tag-groups-show.hbs +++ b/app/assets/javascripts/discourse/templates/tag-groups-show.hbs @@ -20,6 +20,6 @@ - + {{model.savingStatus}} -
    \ No newline at end of file + diff --git a/app/assets/javascripts/discourse/templates/tag-groups.hbs b/app/assets/javascripts/discourse/templates/tag-groups.hbs index 139874e75d0..a4c0ec21de7 100644 --- a/app/assets/javascripts/discourse/templates/tag-groups.hbs +++ b/app/assets/javascripts/discourse/templates/tag-groups.hbs @@ -7,10 +7,10 @@
  • {{tagGroup.name}}
  • {{/each}} - + {{outlet}}
    -
    \ No newline at end of file + diff --git a/app/assets/javascripts/discourse/templates/tags/show.hbs b/app/assets/javascripts/discourse/templates/tags/show.hbs index 9a7e54844a0..18659601d17 100644 --- a/app/assets/javascripts/discourse/templates/tags/show.hbs +++ b/app/assets/javascripts/discourse/templates/tags/show.hbs @@ -16,7 +16,7 @@ {{d-button action="renameTag" actionParam=tag icon="pencil" class="admin-tag"}} {{else}} {{#if canCreateTopic}} - + {{/if}} {{/if}} diff --git a/app/assets/javascripts/discourse/templates/topic-list-header-column.raw.hbs b/app/assets/javascripts/discourse/templates/topic-list-header-column.raw.hbs index 7d7b6b62bb3..762ed1e9968 100644 --- a/app/assets/javascripts/discourse/templates/topic-list-header-column.raw.hbs +++ b/app/assets/javascripts/discourse/templates/topic-list-header-column.raw.hbs @@ -12,6 +12,6 @@ {{/if ~}} {{view.localizedName}} {{~#if view.isSorting}} - + {{d-icon sortIcon}} {{/if ~}} diff --git a/app/assets/javascripts/discourse/templates/topic-status.raw.hbs b/app/assets/javascripts/discourse/templates/topic-status.raw.hbs index 621415dfa16..cfcbe836cfb 100644 --- a/app/assets/javascripts/discourse/templates/topic-status.raw.hbs +++ b/app/assets/javascripts/discourse/templates/topic-status.raw.hbs @@ -3,9 +3,9 @@ {{/if ~}} {{~#each view.statuses as |status|~}} {{~#if status.href ~}} - +{{d-icon status.icon}} {{~else ~}} -<{{status.openTag}} title='{{status.title}}' class='topic-status'> +<{{status.openTag}} title='{{status.title}}' class='topic-status'>{{d-icon status.icon}} {{~/if ~}} {{~/each}} {{~#if view.renderDiv ~}} diff --git a/app/assets/javascripts/discourse/templates/user-selector-autocomplete.raw.hbs b/app/assets/javascripts/discourse/templates/user-selector-autocomplete.raw.hbs index 02a8b005dd5..4c353fbd065 100644 --- a/app/assets/javascripts/discourse/templates/user-selector-autocomplete.raw.hbs +++ b/app/assets/javascripts/discourse/templates/user-selector-autocomplete.raw.hbs @@ -13,7 +13,7 @@ {{#each options.groups as |group|}}
  • - + {{d-icon "users"}} {{group.name}} {{group.full_name}} diff --git a/app/assets/javascripts/discourse/templates/user/activity.hbs b/app/assets/javascripts/discourse/templates/user/activity.hbs index b0fa84ba144..165e0cfbcfd 100644 --- a/app/assets/javascripts/discourse/templates/user/activity.hbs +++ b/app/assets/javascripts/discourse/templates/user/activity.hbs @@ -8,18 +8,18 @@
  • {{#link-to 'userActivity.replies'}} - {{i18n 'user_action_groups.5'}} + {{d-icon "reply" class="glyph"}}{{i18n 'user_action_groups.5'}} {{/link-to}}
  • {{#link-to 'userActivity.likesGiven'}} - {{i18n 'user_action_groups.1'}} + {{d-icon "heart" class="glyph"}}{{i18n 'user_action_groups.1'}} {{/link-to}}
  • {{#if showBookmarks}}
  • {{#link-to 'userActivity.bookmarks'}} - {{i18n 'user_action_groups.3'}} + {{d-icon "bookmark" class="glyph"}}{{i18n 'user_action_groups.3'}} {{/link-to}}
  • {{/if}} diff --git a/app/assets/javascripts/discourse/templates/user/messages.hbs b/app/assets/javascripts/discourse/templates/user/messages.hbs index ece0c407b7f..3e19ee722a1 100644 --- a/app/assets/javascripts/discourse/templates/user/messages.hbs +++ b/app/assets/javascripts/discourse/templates/user/messages.hbs @@ -26,7 +26,7 @@ {{#if group.has_messages}}
  • {{#link-to 'userPrivateMessages.group' group.name}} - + {{d-icon "group" class="glyph"}} {{capitalize-string group.name}} {{/link-to}}
  • @@ -44,7 +44,7 @@
    {{#if site.mobileView}} diff --git a/app/assets/javascripts/discourse/templates/user/notifications.hbs b/app/assets/javascripts/discourse/templates/user/notifications.hbs index ce0128519f4..19e549d6c16 100644 --- a/app/assets/javascripts/discourse/templates/user/notifications.hbs +++ b/app/assets/javascripts/discourse/templates/user/notifications.hbs @@ -5,17 +5,17 @@
  • {{#link-to 'userNotifications.responses'}} - + {{d-icon "reply" class="glyph"}} {{i18n 'user_action_groups.6'}} {{/link-to}}
  • {{#link-to 'userNotifications.likesReceived'}} - {{i18n 'user_action_groups.2'}} + {{d-icon "heart" class="glyph"}}{{i18n 'user_action_groups.2'}} {{/link-to}}
  • -
  • {{#link-to 'userNotifications.mentions'}}{{i18n 'user_action_groups.7'}}{{/link-to}}
  • -
  • {{#link-to 'userNotifications.edits'}}{{i18n 'user_action_groups.11'}}{{/link-to}}
  • +
  • {{#link-to 'userNotifications.mentions'}}{{d-icon "at" class="glyph"}}{{i18n 'user_action_groups.7'}}{{/link-to}}
  • +
  • {{#link-to 'userNotifications.edits'}}{{d-icon "pencil" class="glyph"}}{{i18n 'user_action_groups.11'}}{{/link-to}}
  • {{/mobile-nav}} {{#if model}} diff --git a/app/assets/javascripts/discourse/widgets/post-cooked.js.es6 b/app/assets/javascripts/discourse/widgets/post-cooked.js.es6 index 2786f7df734..11eaf277dc8 100644 --- a/app/assets/javascripts/discourse/widgets/post-cooked.js.es6 +++ b/app/assets/javascripts/discourse/widgets/post-cooked.js.es6 @@ -1,3 +1,4 @@ +import { iconHTML } from 'discourse-common/lib/icon-library'; import { ajax } from 'discourse/lib/ajax'; import { isValidLink } from 'discourse/lib/click-track'; import { number } from 'discourse/lib/formatter'; @@ -140,7 +141,7 @@ export default class PostCooked { $blockQuote.showHtml(div, 'fast', finished); }).catch((e) => { if (e.jqXHR.status === 404) { - $blockQuote.showHtml($("
    "), 'fast', finished); + $blockQuote.showHtml($(`
    ${iconHTML('trash-o')}
    `), 'fast', finished); } }); } else { @@ -178,7 +179,7 @@ export default class PostCooked { // Only add the expand/contract control if it's not a full post let expandContract = ""; if (!$aside.data('full')) { - expandContract = ``; + expandContract = iconHTML(desc, { title: "post.expand_collapse" }); $('.title', $aside).css('cursor', 'pointer'); } $('.quote-controls', $aside).html(expandContract + navLink); diff --git a/app/assets/javascripts/discourse/widgets/post-menu.js.es6 b/app/assets/javascripts/discourse/widgets/post-menu.js.es6 index 7f542a5d0cc..b7f97b697e0 100644 --- a/app/assets/javascripts/discourse/widgets/post-menu.js.es6 +++ b/app/assets/javascripts/discourse/widgets/post-menu.js.es6 @@ -360,7 +360,7 @@ export default createWidget('post-menu', { return this.sendWidgetAction('toggleLike'); } - const $heart = $(`[data-post-id=${attrs.id}] .fa-heart`); + const $heart = $(`[data-post-id=${attrs.id}] .d-icon-heart`); $heart.closest('button').addClass('has-like'); if (!Ember.testing) { diff --git a/app/assets/javascripts/discourse/widgets/post.js.es6 b/app/assets/javascripts/discourse/widgets/post.js.es6 index 2652b4954af..016a2c4030e 100644 --- a/app/assets/javascripts/discourse/widgets/post.js.es6 +++ b/app/assets/javascripts/discourse/widgets/post.js.es6 @@ -88,7 +88,7 @@ createWidget('post-avatar', { html(attrs) { let body; if (!attrs.user_id) { - body = h('i', { className: 'fa fa-trash-o deleted-user-avatar' }); + body = iconNode('trash-o', { class: 'deleted-user-avatar' }); } else { body = avatarFor.call(this, this.settings.size, { template: attrs.avatar_template, diff --git a/app/assets/javascripts/discourse/widgets/topic-notifications-button.js.es6 b/app/assets/javascripts/discourse/widgets/topic-notifications-button.js.es6 index bd37c8b4d8a..74ae08c4957 100644 --- a/app/assets/javascripts/discourse/widgets/topic-notifications-button.js.es6 +++ b/app/assets/javascripts/discourse/widgets/topic-notifications-button.js.es6 @@ -2,6 +2,7 @@ import { createWidget } from 'discourse/widgets/widget'; import { topicLevels, buttonDetails } from 'discourse/lib/notification-levels'; import { h } from 'virtual-dom'; import RawHTML from 'discourse/widgets/raw-html'; +import { iconNode } from 'discourse-common/lib/icon-library'; createWidget('notification-option', { buildKey: attrs => `topic-notifications-button-${attrs.id}`, @@ -9,7 +10,7 @@ createWidget('notification-option', { html(attrs) { return h('a', [ - h('span.icon', { className: `fa fa-${attrs.icon} ${attrs.key}`}), + iconNode(attrs.icon, { class: attrs.key }), h('div', [ h('span.title', I18n.t(`topic.notifications.${attrs.key}.title`)), h('span.desc', I18n.t(`topic.notifications.${attrs.key}.description`)), diff --git a/plugins/discourse-details/test/javascripts/acceptance/details-button-test.js.es6 b/plugins/discourse-details/test/javascripts/acceptance/details-button-test.js.es6 index 61ffac21528..cbb30b82e64 100644 --- a/plugins/discourse-details/test/javascripts/acceptance/details-button-test.js.es6 +++ b/plugins/discourse-details/test/javascripts/acceptance/details-button-test.js.es6 @@ -11,7 +11,7 @@ test('details button', (assert) => { click('#create-topic'); click('button.options'); - click('.popup-menu .fa-caret-right'); + click('.popup-menu .d-icon-caret-right'); andThen(() => { assert.equal( @@ -30,7 +30,7 @@ test('details button', (assert) => { }); click('button.options'); - click('.popup-menu .fa-caret-right'); + click('.popup-menu .d-icon-caret-right'); andThen(() => { assert.equal( @@ -53,7 +53,7 @@ test('details button', (assert) => { }); click('button.options'); - click('.popup-menu .fa-caret-right'); + click('.popup-menu .d-icon-caret-right'); andThen(() => { assert.equal( @@ -76,7 +76,7 @@ test('details button', (assert) => { }); click('button.options'); - click('.popup-menu .fa-caret-right'); + click('.popup-menu .d-icon-caret-right'); andThen(() => { assert.equal( diff --git a/plugins/poll/test/javascripts/widgets/discourse-poll-option-test.js.es6 b/plugins/poll/test/javascripts/widgets/discourse-poll-option-test.js.es6 index 0d646199c7a..75035b6651c 100644 --- a/plugins/poll/test/javascripts/widgets/discourse-poll-option-test.js.es6 +++ b/plugins/poll/test/javascripts/widgets/discourse-poll-option-test.js.es6 @@ -14,7 +14,7 @@ widgetTest('single, not selected', { }, test(assert) { - assert.ok(find('li .fa-circle-o:eq(0)').length === 1); + assert.ok(find('li .d-icon-circle-o:eq(0)').length === 1); } }); @@ -27,7 +27,7 @@ widgetTest('single, selected', { }, test(assert) { - assert.ok(find('li .fa-dot-circle-o:eq(0)').length === 1); + assert.ok(find('li .d-icon-dot-circle-o:eq(0)').length === 1); } }); @@ -43,7 +43,7 @@ widgetTest('multi, not selected', { }, test(assert) { - assert.ok(find('li .fa-square-o:eq(0)').length === 1); + assert.ok(find('li .d-icon-square-o:eq(0)').length === 1); } }); @@ -59,6 +59,6 @@ widgetTest('multi, selected', { }, test(assert) { - assert.ok(find('li .fa-check-square-o:eq(0)').length === 1); + assert.ok(find('li .d-icon-check-square-o:eq(0)').length === 1); } }); diff --git a/test/javascripts/acceptance/composer-test.js.es6 b/test/javascripts/acceptance/composer-test.js.es6 index b155418b78e..fcbd971f230 100644 --- a/test/javascripts/acceptance/composer-test.js.es6 +++ b/test/javascripts/acceptance/composer-test.js.es6 @@ -264,7 +264,7 @@ QUnit.test("Composer can toggle between reply and createTopic", assert => { click('.topic-post:eq(0) button.reply'); click('button.options'); - click('.popup-menu .fa-eye-slash'); + click('.popup-menu .d-icon-eye-slash'); andThen(() => { assert.ok( find('.composer-fields .whisper').text().indexOf(I18n.t("composer.whisper")) > 0, @@ -286,7 +286,7 @@ QUnit.test("Composer can toggle between reply and createTopic", assert => { }); click('button.options'); - click('.popup-menu .fa-eye-slash'); + click('.popup-menu .d-icon-eye-slash'); andThen(() => { assert.ok( find('.composer-fields .whisper').text().indexOf(I18n.t("composer.unlist")) > 0, @@ -334,4 +334,4 @@ QUnit.test("Composer draft with dirty reply can toggle to edit", assert => { andThen(() => { assert.equal(find('.d-editor-input').val().indexOf('This is the first post.'), 0, 'it populates the input with the post text'); }); -}); \ No newline at end of file +}); diff --git a/test/javascripts/acceptance/topic-test.js.es6 b/test/javascripts/acceptance/topic-test.js.es6 index 08b54bfd519..581ef00cd38 100644 --- a/test/javascripts/acceptance/topic-test.js.es6 +++ b/test/javascripts/acceptance/topic-test.js.es6 @@ -33,7 +33,7 @@ QUnit.test("Share Popup", assert => { QUnit.test("Showing and hiding the edit controls", assert => { visit("/t/internationalization-localization/280"); - click('#topic-title .fa-pencil'); + click('#topic-title .d-icon-pencil'); andThen(() => { assert.ok(exists('#edit-title'), 'it shows the editing controls'); @@ -48,7 +48,7 @@ QUnit.test("Showing and hiding the edit controls", assert => { QUnit.test("Updating the topic title and category", assert => { visit("/t/internationalization-localization/280"); - click('#topic-title .fa-pencil'); + click('#topic-title .d-icon-pencil'); fillIn('#edit-title', 'this is the new title'); selectDropdown('.category-combobox', 4); @@ -140,7 +140,7 @@ QUnit.test("Reply as new message", assert => { QUnit.test("Updating the topic title with emojis", assert => { visit("/t/internationalization-localization/280"); - click('#topic-title .fa-pencil'); + click('#topic-title .d-icon-pencil'); fillIn('#edit-title', 'emojis title :bike: :blonde_woman:t6:'); @@ -149,4 +149,4 @@ QUnit.test("Updating the topic title with emojis", assert => { andThen(() => { assert.equal(find('.fancy-title').html().trim(), 'emojis title \"bike\" \"blonde_woman:t6\"', 'it displays the new title with emojis'); }); -}); \ No newline at end of file +}); diff --git a/test/javascripts/widgets/actions-summary-test.js.es6 b/test/javascripts/widgets/actions-summary-test.js.es6 index 4e900f14741..f4eb8b78821 100644 --- a/test/javascripts/widgets/actions-summary-test.js.es6 +++ b/test/javascripts/widgets/actions-summary-test.js.es6 @@ -74,7 +74,7 @@ widgetTest('post deleted', { }); }, test(assert) { - assert.ok(this.$('.post-action .fa-trash-o').length === 1, 'it has the deleted icon'); + assert.ok(this.$('.post-action .d-icon-trash-o').length === 1, 'it has the deleted icon'); assert.ok(this.$('.avatar[title=eviltrout]').length === 1, 'it has the deleted by avatar'); } }); diff --git a/test/javascripts/widgets/home-logo-test.js.es6 b/test/javascripts/widgets/home-logo-test.js.es6 index ddc032391ed..96bd889f50f 100644 --- a/test/javascripts/widgets/home-logo-test.js.es6 +++ b/test/javascripts/widgets/home-logo-test.js.es6 @@ -66,7 +66,7 @@ widgetTest('no logo - minimized', { }, test(assert) { - assert.ok(this.$('i.fa-home').length === 1); + assert.ok(this.$('.d-icon-home').length === 1); } }); diff --git a/test/javascripts/widgets/post-test.js.es6 b/test/javascripts/widgets/post-test.js.es6 index c7702f68c9d..0296c9dcf3d 100644 --- a/test/javascripts/widgets/post-test.js.es6 +++ b/test/javascripts/widgets/post-test.js.es6 @@ -436,7 +436,7 @@ widgetTest("reply directly above", { click('a.reply-to-tab'); andThen(() => { assert.equal(this.$('section.embedded-posts.top .cooked').length, 1); - assert.equal(this.$('section.embedded-posts i.fa-arrow-up').length, 1); + assert.equal(this.$('section.embedded-posts .d-icon-arrow-up').length, 1); }); } }); @@ -673,7 +673,7 @@ widgetTest("replies - one below, not suppressed", { click('button.show-replies'); andThen(() => { assert.equal(this.$('section.embedded-posts.bottom .cooked').length, 1); - assert.equal(this.$('section.embedded-posts i.fa-arrow-down').length, 1); + assert.equal(this.$('section.embedded-posts .d-icon-arrow-down').length, 1); }); } }); @@ -760,7 +760,7 @@ widgetTest("topic map - links", { click('nav.buttons button'); andThen(() => { assert.equal(this.$('.map.map-collapsed').length, 0); - assert.equal(this.$('.topic-map i.fa-chevron-up').length, 1); + assert.equal(this.$('.topic-map .d-icon-chevron-up').length, 1); assert.equal(this.$('.topic-map-expanded').length, 1); assert.equal(this.$('.topic-map-expanded .topic-link').length, 5, 'it limits the links displayed'); }); diff --git a/test/javascripts/widgets/poster-name-test.js.es6 b/test/javascripts/widgets/poster-name-test.js.es6 index d399e91fef2..c8ab8391d7a 100644 --- a/test/javascripts/widgets/poster-name-test.js.es6 +++ b/test/javascripts/widgets/poster-name-test.js.es6 @@ -38,7 +38,7 @@ widgetTest('extra classes and glyphs', { assert.ok(this.$('span.staff').length); assert.ok(this.$('span.admin').length); assert.ok(this.$('span.moderator').length); - assert.ok(this.$('i.fa-shield').length); + assert.ok(this.$('.d-icon-shield').length); assert.ok(this.$('span.new-user').length); assert.ok(this.$('span.fish').length); }