discourse/app/assets/javascripts/admin/addon/routes/admin-site-text-index.js
Renato Atilio 55da8a7701
FEATURE: add Untranslated filter to admin text customization (#27555)
Adds a checkbox to filter untranslated text strings in the admin UI, behind a hidden and default `false` site setting `admin_allow_filter_untranslated_text`.
2024-06-24 06:24:06 -03:00

28 lines
778 B
JavaScript

import Route from "@ember/routing/route";
import { service } from "@ember/service";
import { disableImplicitInjections } from "discourse/lib/implicit-injections";
@disableImplicitInjections
export default class AdminSiteTextIndexRoute extends Route {
@service siteSettings;
@service store;
queryParams = {
q: { replace: true },
overridden: { replace: true },
outdated: { replace: true },
untranslated: { replace: true },
locale: { replace: true },
};
model(params) {
return this.store.find("site-text", {
q: params.q,
overridden: params.overridden ?? false,
outdated: params.outdated ?? false,
untranslated: params.untranslated ?? false,
locale: params.locale ?? this.siteSettings.default_locale,
});
}
}