mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Move preload-store to discourse/lib/preload-store
It's only used inside Discourse so it needn't be its own module
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import EmberObject from "@ember/object";
|
import EmberObject from "@ember/object";
|
||||||
import Route from "@ember/routing/route";
|
import Route from "@ember/routing/route";
|
||||||
import PreloadStore from "preload-store";
|
import PreloadStore from "discourse/lib/preload-store";
|
||||||
|
|
||||||
export default Route.extend({
|
export default Route.extend({
|
||||||
// since the logs are pushed via the message bus
|
// since the logs are pushed via the message bus
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { ajax } from "discourse/lib/ajax";
|
|||||||
import showModal from "discourse/lib/show-modal";
|
import showModal from "discourse/lib/show-modal";
|
||||||
import BackupStatus from "admin/models/backup-status";
|
import BackupStatus from "admin/models/backup-status";
|
||||||
import Backup from "admin/models/backup";
|
import Backup from "admin/models/backup";
|
||||||
import PreloadStore from "preload-store";
|
import PreloadStore from "discourse/lib/preload-store";
|
||||||
import User from "discourse/models/user";
|
import User from "discourse/models/user";
|
||||||
|
|
||||||
const LOG_CHANNEL = "/admin/backups/logs";
|
const LOG_CHANNEL = "/admin/backups/logs";
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ var define, requirejs;
|
|||||||
var ALIASES = {
|
var ALIASES = {
|
||||||
"ember-addons/ember-computed-decorators":
|
"ember-addons/ember-computed-decorators":
|
||||||
"discourse-common/utils/decorators",
|
"discourse-common/utils/decorators",
|
||||||
"discourse/lib/raw-templates": "discourse-common/lib/raw-templates"
|
"discourse/lib/raw-templates": "discourse-common/lib/raw-templates",
|
||||||
|
"preload-store": "discourse/lib/preload-store"
|
||||||
};
|
};
|
||||||
if (typeof Ember !== "undefined") {
|
if (typeof Ember !== "undefined") {
|
||||||
EMBER_MODULES = {
|
EMBER_MODULES = {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
import RestAdapter from "discourse/adapters/rest";
|
import RestAdapter from "discourse/adapters/rest";
|
||||||
import PreloadStore from "preload-store";
|
import PreloadStore from "discourse/lib/preload-store";
|
||||||
|
|
||||||
export function finderFor(filter, params) {
|
export function finderFor(filter, params) {
|
||||||
return function() {
|
return function() {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import PreloadStore from "preload-store";
|
import PreloadStore from "discourse/lib/preload-store";
|
||||||
import { htmlSafe } from "@ember/template";
|
import { htmlSafe } from "@ember/template";
|
||||||
|
|
||||||
let _customizations = {};
|
let _customizations = {};
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import EmberObject from "@ember/object";
|
import EmberObject from "@ember/object";
|
||||||
import PreloadStore from "preload-store";
|
import PreloadStore from "discourse/lib/preload-store";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "banner",
|
name: "banner",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { withPluginApi } from "discourse/lib/plugin-api";
|
import { withPluginApi } from "discourse/lib/plugin-api";
|
||||||
import { registerEmoji } from "pretty-text/emoji";
|
import { registerEmoji } from "pretty-text/emoji";
|
||||||
import PreloadStore from "preload-store";
|
import PreloadStore from "discourse/lib/preload-store";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "enable-emoji",
|
name: "enable-emoji",
|
||||||
|
|||||||
@@ -1,9 +1,5 @@
|
|||||||
/**
|
// We can insert data into the PreloadStore when the document is loaded.
|
||||||
We can insert data into the PreloadStore when the document is loaded.
|
// The data can be accessed once by a key, after which it is removed
|
||||||
The data can be accessed once by a key, after which it is removed
|
|
||||||
|
|
||||||
@class PreloadStore
|
|
||||||
**/
|
|
||||||
import { Promise } from "rsvp";
|
import { Promise } from "rsvp";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import ArrayProxy from "@ember/array/proxy";
|
import ArrayProxy from "@ember/array/proxy";
|
||||||
import PreloadStore from "preload-store";
|
import PreloadStore from "discourse/lib/preload-store";
|
||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
import Topic from "discourse/models/topic";
|
import Topic from "discourse/models/topic";
|
||||||
import Category from "discourse/models/category";
|
import Category from "discourse/models/category";
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import PostActionType from "discourse/models/post-action-type";
|
|||||||
import Singleton from "discourse/mixins/singleton";
|
import Singleton from "discourse/mixins/singleton";
|
||||||
import RestModel from "discourse/models/rest";
|
import RestModel from "discourse/models/rest";
|
||||||
import TrustLevel from "discourse/models/trust-level";
|
import TrustLevel from "discourse/models/trust-level";
|
||||||
import PreloadStore from "preload-store";
|
import PreloadStore from "discourse/lib/preload-store";
|
||||||
import deprecated from "discourse-common/lib/deprecated";
|
import deprecated from "discourse-common/lib/deprecated";
|
||||||
|
|
||||||
const Site = RestModel.extend({
|
const Site = RestModel.extend({
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import EmberObject, { get } from "@ember/object";
|
|||||||
import { isEmpty } from "@ember/utils";
|
import { isEmpty } from "@ember/utils";
|
||||||
import { NotificationLevels } from "discourse/lib/notification-levels";
|
import { NotificationLevels } from "discourse/lib/notification-levels";
|
||||||
import discourseComputed, { on } from "discourse-common/utils/decorators";
|
import discourseComputed, { on } from "discourse-common/utils/decorators";
|
||||||
import PreloadStore from "preload-store";
|
import PreloadStore from "discourse/lib/preload-store";
|
||||||
import Category from "discourse/models/category";
|
import Category from "discourse/models/category";
|
||||||
import User from "discourse/models/user";
|
import User from "discourse/models/user";
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import ActionSummary from "discourse/models/action-summary";
|
|||||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||||
import { censor } from "pretty-text/censored-words";
|
import { censor } from "pretty-text/censored-words";
|
||||||
import { emojiUnescape } from "discourse/lib/text";
|
import { emojiUnescape } from "discourse/lib/text";
|
||||||
import PreloadStore from "preload-store";
|
import PreloadStore from "discourse/lib/preload-store";
|
||||||
import { userPath } from "discourse/lib/url";
|
import { userPath } from "discourse/lib/url";
|
||||||
import discourseComputed, {
|
import discourseComputed, {
|
||||||
observes,
|
observes,
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import UserAction from "discourse/models/user-action";
|
|||||||
import UserDraftsStream from "discourse/models/user-drafts-stream";
|
import UserDraftsStream from "discourse/models/user-drafts-stream";
|
||||||
import Group from "discourse/models/group";
|
import Group from "discourse/models/group";
|
||||||
import { emojiUnescape } from "discourse/lib/text";
|
import { emojiUnescape } from "discourse/lib/text";
|
||||||
import PreloadStore from "preload-store";
|
import PreloadStore from "discourse/lib/preload-store";
|
||||||
import { defaultHomepage } from "discourse/lib/utilities";
|
import { defaultHomepage } from "discourse/lib/utilities";
|
||||||
import { userPath } from "discourse/lib/url";
|
import { userPath } from "discourse/lib/url";
|
||||||
import Category from "discourse/models/category";
|
import Category from "discourse/models/category";
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import Route from "@ember/routing/route";
|
import Route from "@ember/routing/route";
|
||||||
import PreloadStore from "preload-store";
|
import PreloadStore from "discourse/lib/preload-store";
|
||||||
|
|
||||||
export default Route.extend({
|
export default Route.extend({
|
||||||
setupController(controller) {
|
setupController(controller) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import DiscourseRoute from "discourse/routes/discourse";
|
import DiscourseRoute from "discourse/routes/discourse";
|
||||||
import Badge from "discourse/models/badge";
|
import Badge from "discourse/models/badge";
|
||||||
import PreloadStore from "preload-store";
|
import PreloadStore from "discourse/lib/preload-store";
|
||||||
|
|
||||||
export default DiscourseRoute.extend({
|
export default DiscourseRoute.extend({
|
||||||
model() {
|
model() {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import DiscourseRoute from "discourse/routes/discourse";
|
import DiscourseRoute from "discourse/routes/discourse";
|
||||||
import UserBadge from "discourse/models/user-badge";
|
import UserBadge from "discourse/models/user-badge";
|
||||||
import Badge from "discourse/models/badge";
|
import Badge from "discourse/models/badge";
|
||||||
import PreloadStore from "preload-store";
|
import PreloadStore from "discourse/lib/preload-store";
|
||||||
import { hash } from "rsvp";
|
import { hash } from "rsvp";
|
||||||
|
|
||||||
export default DiscourseRoute.extend({
|
export default DiscourseRoute.extend({
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import CategoryList from "discourse/models/category-list";
|
|||||||
import { defaultHomepage } from "discourse/lib/utilities";
|
import { defaultHomepage } from "discourse/lib/utilities";
|
||||||
import TopicList from "discourse/models/topic-list";
|
import TopicList from "discourse/models/topic-list";
|
||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
import PreloadStore from "preload-store";
|
import PreloadStore from "discourse/lib/preload-store";
|
||||||
import { searchPriorities } from "discourse/components/concerns/category-search-priorities";
|
import { searchPriorities } from "discourse/components/concerns/category-search-priorities";
|
||||||
import { hash } from "rsvp";
|
import { hash } from "rsvp";
|
||||||
import Site from "discourse/models/site";
|
import Site from "discourse/models/site";
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {
|
|||||||
getSearchKey,
|
getSearchKey,
|
||||||
isValidSearchTerm
|
isValidSearchTerm
|
||||||
} from "discourse/lib/search";
|
} from "discourse/lib/search";
|
||||||
import PreloadStore from "preload-store";
|
import PreloadStore from "discourse/lib/preload-store";
|
||||||
import { getTransient, setTransient } from "discourse/lib/page-tracker";
|
import { getTransient, setTransient } from "discourse/lib/page-tracker";
|
||||||
import { escapeExpression } from "discourse/lib/utilities";
|
import { escapeExpression } from "discourse/lib/utilities";
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import DiscourseRoute from "discourse/routes/discourse";
|
import DiscourseRoute from "discourse/routes/discourse";
|
||||||
import PreloadStore from "preload-store";
|
import PreloadStore from "discourse/lib/preload-store";
|
||||||
|
|
||||||
export default DiscourseRoute.extend({
|
export default DiscourseRoute.extend({
|
||||||
titleToken() {
|
titleToken() {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import DiscourseRoute from "discourse/routes/discourse";
|
import DiscourseRoute from "discourse/routes/discourse";
|
||||||
import PreloadStore from "preload-store";
|
import PreloadStore from "discourse/lib/preload-store";
|
||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
import { userPath } from "discourse/lib/url";
|
import { userPath } from "discourse/lib/url";
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// discourse-skip-module
|
// discourse-skip-module
|
||||||
(function() {
|
(function() {
|
||||||
const ps = require("preload-store").default;
|
const ps = require("discourse/lib/preload-store").default;
|
||||||
const preloadedDataElement = document.getElementById("data-preloaded");
|
const preloadedDataElement = document.getElementById("data-preloaded");
|
||||||
const setupData = document.getElementById("data-discourse-setup").dataset;
|
const setupData = document.getElementById("data-discourse-setup").dataset;
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,6 @@ class DiscourseJsProcessor
|
|||||||
return false if relative_path.start_with?("#{js_root}/plugins/")
|
return false if relative_path.start_with?("#{js_root}/plugins/")
|
||||||
|
|
||||||
return true if %w(
|
return true if %w(
|
||||||
preload-store
|
|
||||||
preload-application-data
|
preload-application-data
|
||||||
wizard-start
|
wizard-start
|
||||||
onpopstate-handler
|
onpopstate-handler
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { acceptance } from "helpers/qunit-helpers";
|
import { acceptance } from "helpers/qunit-helpers";
|
||||||
import PreloadStore from "preload-store";
|
import PreloadStore from "discourse/lib/preload-store";
|
||||||
|
|
||||||
acceptance("Account Created");
|
acceptance("Account Created");
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { acceptance } from "helpers/qunit-helpers";
|
import { acceptance } from "helpers/qunit-helpers";
|
||||||
import { setCustomHTML } from "discourse/helpers/custom-html";
|
import { setCustomHTML } from "discourse/helpers/custom-html";
|
||||||
import PreloadStore from "preload-store";
|
import PreloadStore from "discourse/lib/preload-store";
|
||||||
|
|
||||||
acceptance("CustomHTML set");
|
acceptance("CustomHTML set");
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { acceptance } from "helpers/qunit-helpers";
|
import { acceptance } from "helpers/qunit-helpers";
|
||||||
import PreloadStore from "preload-store";
|
import PreloadStore from "discourse/lib/preload-store";
|
||||||
|
|
||||||
acceptance("Invite Accept", {
|
acceptance("Invite Accept", {
|
||||||
settings: {
|
settings: {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { acceptance } from "helpers/qunit-helpers";
|
import { acceptance } from "helpers/qunit-helpers";
|
||||||
import PreloadStore from "preload-store";
|
import PreloadStore from "discourse/lib/preload-store";
|
||||||
import { parsePostData } from "helpers/create-pretender";
|
import { parsePostData } from "helpers/create-pretender";
|
||||||
|
|
||||||
acceptance("Password Reset", {
|
acceptance("Password Reset", {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import PreloadStore from "preload-store";
|
import PreloadStore from "discourse/lib/preload-store";
|
||||||
|
|
||||||
/*jshint maxlen:10000000 */
|
/*jshint maxlen:10000000 */
|
||||||
PreloadStore.store("site", {
|
PreloadStore.store("site", {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import PreloadStore from "preload-store";
|
import PreloadStore from "discourse/lib/preload-store";
|
||||||
import { Promise } from "rsvp";
|
import { Promise } from "rsvp";
|
||||||
|
|
||||||
QUnit.module("preload-store", {
|
QUnit.module("preload-store", {
|
||||||
|
|||||||
Reference in New Issue
Block a user