mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 03:06:53 +08:00
DEV: Convert truth-helpers to a v2 addon and simplify imports (#26029)
No need for a build step here, since the helpers are all simple js.
This commit is contained in:
@ -4,11 +4,11 @@ import { on } from "@ember/modifier";
|
||||
import { action } from "@ember/object";
|
||||
import { LinkTo } from "@ember/routing";
|
||||
import { inject as service } from "@ember/service";
|
||||
import { and } from "truth-helpers";
|
||||
import PluginOutlet from "discourse/components/plugin-outlet";
|
||||
import concatClass from "discourse/helpers/concat-class";
|
||||
import dIcon from "discourse-common/helpers/d-icon";
|
||||
import i18n from "discourse-common/helpers/i18n";
|
||||
import and from "truth-helpers/helpers/and";
|
||||
import ChatChannelRow from "./chat-channel-row";
|
||||
|
||||
export default class ChannelsListPublic extends Component {
|
||||
|
@ -2,12 +2,12 @@ import Component from "@glimmer/component";
|
||||
import { hash } from "@ember/helper";
|
||||
import { LinkTo } from "@ember/routing";
|
||||
import { inject as service } from "@ember/service";
|
||||
import { gt } from "truth-helpers";
|
||||
import borderColor from "discourse/helpers/border-color";
|
||||
import concatClass from "discourse/helpers/concat-class";
|
||||
import replaceEmoji from "discourse/helpers/replace-emoji";
|
||||
import dIcon from "discourse-common/helpers/d-icon";
|
||||
import i18n from "discourse-common/helpers/i18n";
|
||||
import gt from "truth-helpers/helpers/gt";
|
||||
import ToggleChannelMembershipButton from "./toggle-channel-membership-button";
|
||||
|
||||
export default class ChatChannelCard extends Component {
|
||||
|
@ -8,14 +8,13 @@ import { LinkTo } from "@ember/routing";
|
||||
import { inject as service } from "@ember/service";
|
||||
import { htmlSafe } from "@ember/template";
|
||||
import { modifier } from "ember-modifier";
|
||||
import { and, eq } from "truth-helpers";
|
||||
import concatClass from "discourse/helpers/concat-class";
|
||||
import replaceEmoji from "discourse/helpers/replace-emoji";
|
||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||
import icon from "discourse-common/helpers/d-icon";
|
||||
import { bind } from "discourse-common/utils/decorators";
|
||||
import I18n from "discourse-i18n";
|
||||
import and from "truth-helpers/helpers/and";
|
||||
import eq from "truth-helpers/helpers/eq";
|
||||
import ChannelIcon from "discourse/plugins/chat/discourse/components/channel-icon";
|
||||
import ChannelName from "discourse/plugins/chat/discourse/components/channel-name";
|
||||
import ChatChannelMetadata from "discourse/plugins/chat/discourse/components/chat-channel-metadata";
|
||||
|
@ -8,6 +8,7 @@ import didUpdate from "@ember/render-modifiers/modifiers/did-update";
|
||||
import willDestroy from "@ember/render-modifiers/modifiers/will-destroy";
|
||||
import { cancel, next, schedule } from "@ember/runloop";
|
||||
import { inject as service } from "@ember/service";
|
||||
import { and, not } from "truth-helpers";
|
||||
import concatClass from "discourse/helpers/concat-class";
|
||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||
import { resetIdle } from "discourse/lib/desktop-notifications";
|
||||
@ -19,8 +20,6 @@ import {
|
||||
import i18n from "discourse-common/helpers/i18n";
|
||||
import discourseDebounce from "discourse-common/lib/debounce";
|
||||
import { bind } from "discourse-common/utils/decorators";
|
||||
import and from "truth-helpers/helpers/and";
|
||||
import not from "truth-helpers/helpers/not";
|
||||
import ChatChannelStatus from "discourse/plugins/chat/discourse/components/chat-channel-status";
|
||||
import ChatChannelSubscriptionManager from "discourse/plugins/chat/discourse/lib/chat-channel-subscription-manager";
|
||||
import {
|
||||
|
@ -1,9 +1,9 @@
|
||||
import Component from "@glimmer/component";
|
||||
import { inject as service } from "@ember/service";
|
||||
import { eq } from "truth-helpers";
|
||||
import DButton from "discourse/components/d-button";
|
||||
import concatClass from "discourse/helpers/concat-class";
|
||||
import i18n from "discourse-common/helpers/i18n";
|
||||
import eq from "truth-helpers/helpers/eq";
|
||||
import {
|
||||
UnreadChannelsIndicator,
|
||||
UnreadDirectMessagesIndicator,
|
||||
|
@ -10,11 +10,11 @@ import willDestroy from "@ember/render-modifiers/modifiers/will-destroy";
|
||||
import { schedule } from "@ember/runloop";
|
||||
import { inject as service } from "@ember/service";
|
||||
import { createPopper } from "@popperjs/core";
|
||||
import { and } from "truth-helpers";
|
||||
import BookmarkIcon from "discourse/components/bookmark-icon";
|
||||
import DButton from "discourse/components/d-button";
|
||||
import concatClass from "discourse/helpers/concat-class";
|
||||
import DropdownSelectBox from "select-kit/components/dropdown-select-box";
|
||||
import and from "truth-helpers/helpers/and";
|
||||
import ChatMessageReaction from "discourse/plugins/chat/discourse/components/chat-message-reaction";
|
||||
import chatMessageContainer from "discourse/plugins/chat/discourse/lib/chat-message-container";
|
||||
import ChatMessageInteractor from "discourse/plugins/chat/discourse/lib/chat-message-interactor";
|
||||
|
@ -6,12 +6,11 @@ import { on } from "@ember/modifier";
|
||||
import { action } from "@ember/object";
|
||||
import didInsert from "@ember/render-modifiers/modifiers/did-insert";
|
||||
import { inject as service } from "@ember/service";
|
||||
import { and, or } from "truth-helpers";
|
||||
import BookmarkIcon from "discourse/components/bookmark-icon";
|
||||
import DButton from "discourse/components/d-button";
|
||||
import concatClass from "discourse/helpers/concat-class";
|
||||
import discourseLater from "discourse-common/lib/later";
|
||||
import and from "truth-helpers/helpers/and";
|
||||
import or from "truth-helpers/helpers/or";
|
||||
import ChatMessageReaction from "discourse/plugins/chat/discourse/components/chat-message-reaction";
|
||||
import ChatUserAvatar from "discourse/plugins/chat/discourse/components/chat-user-avatar";
|
||||
import ChatMessageInteractor from "discourse/plugins/chat/discourse/lib/chat-message-interactor";
|
||||
|
@ -5,9 +5,9 @@ import { action } from "@ember/object";
|
||||
import { inject as service } from "@ember/service";
|
||||
import { htmlSafe } from "@ember/template";
|
||||
import { modifier } from "ember-modifier";
|
||||
import { and } from "truth-helpers";
|
||||
import concatClass from "discourse/helpers/concat-class";
|
||||
import { emojiUnescape, emojiUrlFor } from "discourse/lib/text";
|
||||
import and from "truth-helpers/helpers/and";
|
||||
import { getReactionText } from "discourse/plugins/chat/discourse/lib/get-reaction-text";
|
||||
|
||||
export default class ChatMessageReaction extends Component {
|
||||
|
@ -11,6 +11,7 @@ import willDestroy from "@ember/render-modifiers/modifiers/will-destroy";
|
||||
import { cancel, schedule } from "@ember/runloop";
|
||||
import { inject as service } from "@ember/service";
|
||||
import { modifier } from "ember-modifier";
|
||||
import { eq, not } from "truth-helpers";
|
||||
import DButton from "discourse/components/d-button";
|
||||
import concatClass from "discourse/helpers/concat-class";
|
||||
import optionalService from "discourse/lib/optional-service";
|
||||
@ -19,8 +20,6 @@ import discourseDebounce from "discourse-common/lib/debounce";
|
||||
import discourseLater from "discourse-common/lib/later";
|
||||
import { bind } from "discourse-common/utils/decorators";
|
||||
import I18n from "discourse-i18n";
|
||||
import eq from "truth-helpers/helpers/eq";
|
||||
import not from "truth-helpers/helpers/not";
|
||||
import ChatMessageAvatar from "discourse/plugins/chat/discourse/components/chat/message/avatar";
|
||||
import ChatMessageError from "discourse/plugins/chat/discourse/components/chat/message/error";
|
||||
import ChatMessageInfo from "discourse/plugins/chat/discourse/components/chat/message/info";
|
||||
|
@ -5,7 +5,7 @@ import { action } from "@ember/object";
|
||||
import didInsert from "@ember/render-modifiers/modifiers/did-insert";
|
||||
import { inject as service } from "@ember/service";
|
||||
import { htmlSafe } from "@ember/template";
|
||||
import and from "truth-helpers/helpers/and";
|
||||
import { and } from "truth-helpers";
|
||||
import resizableNode from "../modifiers/chat/resizable-node";
|
||||
import ChatSidePanelResizer from "./chat-side-panel-resizer";
|
||||
|
||||
|
@ -2,11 +2,11 @@ import Component from "@glimmer/component";
|
||||
import { cached } from "@glimmer/tracking";
|
||||
import { inject as service } from "@ember/service";
|
||||
import { modifier } from "ember-modifier";
|
||||
import { eq } from "truth-helpers";
|
||||
import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";
|
||||
import isElementInViewport from "discourse/lib/is-element-in-viewport";
|
||||
import { bind } from "discourse-common/utils/decorators";
|
||||
import I18n from "discourse-i18n";
|
||||
import eq from "truth-helpers/helpers/eq";
|
||||
import ChatThreadListItem from "discourse/plugins/chat/discourse/components/chat/thread-list/item";
|
||||
import ChatTrackMessage from "discourse/plugins/chat/discourse/modifiers/chat/track-message";
|
||||
|
||||
|
@ -4,8 +4,8 @@ import { on } from "@ember/modifier";
|
||||
import { action } from "@ember/object";
|
||||
import { inject as service } from "@ember/service";
|
||||
import { htmlSafe } from "@ember/template";
|
||||
import { eq } from "truth-helpers";
|
||||
import { isAudio, isImage, isVideo } from "discourse/lib/uploads";
|
||||
import eq from "truth-helpers/helpers/eq";
|
||||
|
||||
export default class ChatUpload extends Component {
|
||||
@service siteSettings;
|
||||
|
@ -1,10 +1,10 @@
|
||||
import Component from "@glimmer/component";
|
||||
import { action } from "@ember/object";
|
||||
import { inject as service } from "@ember/service";
|
||||
import { gte } from "truth-helpers";
|
||||
import DButton from "discourse/components/d-button";
|
||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||
import I18n from "discourse-i18n";
|
||||
import gte from "truth-helpers/helpers/gte";
|
||||
import MembersCount from "./members-count";
|
||||
import MembersSelector from "./members-selector";
|
||||
|
||||
|
@ -1,8 +1,7 @@
|
||||
import Component from "@glimmer/component";
|
||||
import { inject as service } from "@ember/service";
|
||||
import { gt, not } from "truth-helpers";
|
||||
import concatClass from "discourse/helpers/concat-class";
|
||||
import gt from "truth-helpers/helpers/gt";
|
||||
import not from "truth-helpers/helpers/not";
|
||||
import ChannelTitle from "discourse/plugins/chat/discourse/components/channel-title";
|
||||
|
||||
export default class Channel extends Component {
|
||||
|
@ -2,9 +2,9 @@ import Component from "@glimmer/component";
|
||||
import { fn } from "@ember/helper";
|
||||
import { on } from "@ember/modifier";
|
||||
import { action } from "@ember/object";
|
||||
import { eq } from "truth-helpers";
|
||||
import concatClass from "discourse/helpers/concat-class";
|
||||
import I18n from "discourse-i18n";
|
||||
import eq from "truth-helpers/helpers/eq";
|
||||
import Channel from "./channel";
|
||||
import Group from "./group";
|
||||
import ListAction from "./list-action";
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { fn } from "@ember/helper";
|
||||
import { eq } from "truth-helpers";
|
||||
import DButton from "discourse/components/d-button";
|
||||
import concatClass from "discourse/helpers/concat-class";
|
||||
import icon from "discourse-common/helpers/d-icon";
|
||||
import eq from "truth-helpers/helpers/eq";
|
||||
import ChatUserAvatar from "discourse/plugins/chat/discourse/components/chat-user-avatar";
|
||||
|
||||
const Member = <template>
|
||||
|
@ -1,7 +1,7 @@
|
||||
import Component from "@glimmer/component";
|
||||
import { gte } from "truth-helpers";
|
||||
import concatClass from "discourse/helpers/concat-class";
|
||||
import I18n from "discourse-i18n";
|
||||
import gte from "truth-helpers/helpers/gte";
|
||||
|
||||
export default class MembersCount extends Component {
|
||||
get countLabel() {
|
||||
|
@ -3,9 +3,9 @@ import { Input } from "@ember/component";
|
||||
import { on } from "@ember/modifier";
|
||||
import { action } from "@ember/object";
|
||||
import didInsert from "@ember/render-modifiers/modifiers/did-insert";
|
||||
import { eq } from "truth-helpers";
|
||||
import icon from "discourse-common/helpers/d-icon";
|
||||
import I18n from "discourse-i18n";
|
||||
import eq from "truth-helpers/helpers/eq";
|
||||
import { getNext, getPrevious } from "./lib/iterate-list";
|
||||
import Member from "./member";
|
||||
|
||||
|
@ -3,10 +3,10 @@ import { tracked } from "@glimmer/tracking";
|
||||
import { Input } from "@ember/component";
|
||||
import { action } from "@ember/object";
|
||||
import { inject as service } from "@ember/service";
|
||||
import { gte } from "truth-helpers";
|
||||
import DButton from "discourse/components/d-button";
|
||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||
import I18n from "discourse-i18n";
|
||||
import gte from "truth-helpers/helpers/gte";
|
||||
import MembersCount from "./members-count";
|
||||
import MembersSelector from "./members-selector";
|
||||
|
||||
|
@ -1,11 +1,10 @@
|
||||
import Component from "@glimmer/component";
|
||||
import { inject as service } from "@ember/service";
|
||||
import { modifier } from "ember-modifier";
|
||||
import { gt, not } from "truth-helpers";
|
||||
import UserStatusMessage from "discourse/components/user-status-message";
|
||||
import userStatus from "discourse/helpers/user-status";
|
||||
import I18n from "discourse-i18n";
|
||||
import gt from "truth-helpers/helpers/gt";
|
||||
import not from "truth-helpers/helpers/not";
|
||||
import ChatUserAvatar from "discourse/plugins/chat/discourse/components/chat-user-avatar";
|
||||
import ChatUserDisplayName from "discourse/plugins/chat/discourse/components/chat-user-display-name";
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { fn } from "@ember/helper";
|
||||
import { eq } from "truth-helpers";
|
||||
import DButton from "discourse/components/d-button";
|
||||
import i18n from "discourse-common/helpers/i18n";
|
||||
import eq from "truth-helpers/helpers/eq";
|
||||
|
||||
const Error = <template>
|
||||
{{#if @message.error}}
|
||||
|
@ -3,6 +3,7 @@ import didInsert from "@ember/render-modifiers/modifiers/did-insert";
|
||||
import willDestroy from "@ember/render-modifiers/modifiers/will-destroy";
|
||||
import { LinkTo } from "@ember/routing";
|
||||
import { inject as service } from "@ember/service";
|
||||
import { and } from "truth-helpers";
|
||||
import BookmarkIcon from "discourse/components/bookmark-icon";
|
||||
import UserStatusMessage from "discourse/components/user-status-message";
|
||||
import concatClass from "discourse/helpers/concat-class";
|
||||
@ -10,7 +11,6 @@ import { prioritizeNameInUx } from "discourse/lib/settings";
|
||||
import dIcon from "discourse-common/helpers/d-icon";
|
||||
import i18n from "discourse-common/helpers/i18n";
|
||||
import { bind } from "discourse-common/utils/decorators";
|
||||
import and from "truth-helpers/helpers/and";
|
||||
import ChannelTitle from "discourse/plugins/chat/discourse/components/channel-title";
|
||||
import formatChatDate from "../../../helpers/format-chat-date";
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
import Component from "@glimmer/component";
|
||||
import { LinkTo } from "@ember/routing";
|
||||
import { inject as service } from "@ember/service";
|
||||
import { eq } from "truth-helpers";
|
||||
import BookmarkIcon from "discourse/components/bookmark-icon";
|
||||
import dIcon from "discourse-common/helpers/d-icon";
|
||||
import eq from "truth-helpers/helpers/eq";
|
||||
import formatChatDate from "../../../helpers/format-chat-date";
|
||||
|
||||
export default class ChatMessageLeftGutter extends Component {
|
||||
|
@ -2,13 +2,13 @@ import Component from "@glimmer/component";
|
||||
import { getOwner } from "@ember/application";
|
||||
import { action } from "@ember/object";
|
||||
import { inject as service } from "@ember/service";
|
||||
import { not } from "truth-helpers";
|
||||
import DButton from "discourse/components/d-button";
|
||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||
import { clipboardCopyAsync } from "discourse/lib/utilities";
|
||||
import { isTesting } from "discourse-common/config/environment";
|
||||
import { bind } from "discourse-common/utils/decorators";
|
||||
import I18n from "discourse-i18n";
|
||||
import not from "truth-helpers/helpers/not";
|
||||
import ChatModalMoveMessageToChannel from "discourse/plugins/chat/discourse/components/chat/modal/move-message-to-channel";
|
||||
|
||||
export default class ChatSelectionManager extends Component {
|
||||
|
@ -3,11 +3,11 @@ import { fn } from "@ember/helper";
|
||||
import { on } from "@ember/modifier";
|
||||
import { action } from "@ember/object";
|
||||
import { inject as service } from "@ember/service";
|
||||
import { gt } from "truth-helpers";
|
||||
import concatClass from "discourse/helpers/concat-class";
|
||||
import formatDate from "discourse/helpers/format-date";
|
||||
import replaceEmoji from "discourse/helpers/replace-emoji";
|
||||
import i18n from "discourse-common/helpers/i18n";
|
||||
import gt from "truth-helpers/helpers/gt";
|
||||
import ThreadUnreadIndicator from "discourse/plugins/chat/discourse/components/thread-unread-indicator";
|
||||
import ChatThreadParticipants from "../../chat-thread-participants";
|
||||
import ChatUserAvatar from "../../chat-user-avatar";
|
||||
|
@ -3,11 +3,11 @@ import { cached } from "@glimmer/tracking";
|
||||
import { array } from "@ember/helper";
|
||||
import { LinkTo } from "@ember/routing";
|
||||
import { inject as service } from "@ember/service";
|
||||
import { or } from "truth-helpers";
|
||||
import ReviewableCreatedBy from "discourse/components/reviewable-created-by";
|
||||
import ReviewablePostHeader from "discourse/components/reviewable-post-header";
|
||||
import htmlSafe from "discourse-common/helpers/html-safe";
|
||||
import i18n from "discourse-common/helpers/i18n";
|
||||
import or from "truth-helpers/helpers/or";
|
||||
import ChannelTitle from "discourse/plugins/chat/discourse/components/channel-title";
|
||||
import ChatChannel from "discourse/plugins/chat/discourse/models/chat-channel";
|
||||
|
||||
|
Reference in New Issue
Block a user