mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 09:42:07 +08:00
a60d7a2bc7
- Switch to `@tracked` and native getters - Remove queryParam defaults which are awkward to work with. Instead, add `resolvedBlah` getters - Add 'no results found' text - Use standard 'model' key instead of a custom `setupController` method - Remove use of `route-action` - Remove `{{action` helper Default queryParams in ember controllers are tricky to work with, especially when combined with the new router service. Instead, we can handle defaults ourselves
26 lines
701 B
JavaScript
26 lines
701 B
JavaScript
import Route from "@ember/routing/route";
|
|
import { disableImplicitInjections } from "discourse/lib/implicit-injections";
|
|
import { inject as service } from "@ember/service";
|
|
|
|
@disableImplicitInjections
|
|
export default class AdminSiteTextIndexRoute extends Route {
|
|
@service siteSettings;
|
|
@service store;
|
|
|
|
queryParams = {
|
|
q: { replace: true },
|
|
overridden: { replace: true },
|
|
outdated: { replace: true },
|
|
locale: { replace: true },
|
|
};
|
|
|
|
model(params) {
|
|
return this.store.find("site-text", {
|
|
q: params.q,
|
|
overridden: params.overridden ?? false,
|
|
outdated: params.outdated ?? false,
|
|
locale: params.locale ?? this.siteSettings.default_locale,
|
|
});
|
|
}
|
|
}
|