Skip to content

A platform for community discussion. Free, open, simple.

DEV: Remove unnecessary `@tracked` from some properties (#37528)

Jarek Radosz85ff130c80ea
diff --git a/frontend/discourse/admin/components/admin-area-settings.gjs b/frontend/discourse/admin/components/admin-area-settings.gjs
index a1bdd1244c4..0cc496de63c 100644
--- a/frontend/discourse/admin/components/admin-area-settings.gjs
+++ b/frontend/discourse/admin/components/admin-area-settings.gjs
@@ -15,13 +15,16 @@ import { i18n } from "discourse-i18n";
export default class AdminAreaSettings extends Component {
@tracked settings = [];
@tracked loading = false;
- @tracked showBreadcrumb = this.args.showBreadcrumb ?? true;
constructor() {
super(...arguments);
this.#loadSettings();
}
+ get showBreadcrumb() {
+ return this.args.showBreadcrumb ?? true;
+ }
+
get showSettings() {
return !this.loading && this.settings.length > 0;
}
diff --git a/frontend/discourse/admin/components/admin-filter-controls.gjs b/frontend/discourse/admin/components/admin-filter-controls.gjs
index dbc5bf17c70..e9ee29bbe56 100644
--- a/frontend/discourse/admin/components/admin-filter-controls.gjs
+++ b/frontend/discourse/admin/components/admin-filter-controls.gjs
@@ -39,9 +39,9 @@ import { and, not } from "discourse/truth-helpers";
export default class AdminFilterControls extends Component {
@tracked textFilter = "";
@tracked dropdownFilter = "all";
- @tracked dropdownFilters = new TrackedObject();
@tracked
showFilterDropdowns = this.args.filterDropdownsExpanded ?? isTesting();
+ dropdownFilters = new TrackedObject();
constructor() {
super(...arguments);
diff --git a/frontend/discourse/admin/components/admin-logo-form.gjs b/frontend/discourse/admin/components/admin-logo-form.gjs
index 395bf7b7920..cb76c15e90d 100644
--- a/frontend/discourse/admin/components/admin-logo-form.gjs
+++ b/frontend/discourse/admin/components/admin-logo-form.gjs
@@ -3,6 +3,7 @@ import { cached, tracked } from "@glimmer/tracking";
import { fn } from "@ember/helper";
import { action } from "@ember/object";
import { service } from "@ember/service";
+import { TrackedObject } from "@ember-compat/tracked-built-ins";
import AdminConfigAreaCardSection from "discourse/admin/components/admin-config-area-card-section";
import SimpleList from "discourse/admin/components/simple-list";
import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";
@@ -17,8 +18,8 @@ export default class AdminLogoForm extends Component {
@service siteSettingChangeTracker;
@service toasts;
- @tracked placeholders = {};
@tracked loading = false;
+ placeholders = new TrackedObject();
constructor() {
super(...arguments);
diff --git a/frontend/discourse/admin/components/admin-report.gjs b/frontend/discourse/admin/components/admin-report.gjs
index eb78c426f3d..20da814fc2b 100644
--- a/frontend/discourse/admin/components/admin-report.gjs
+++ b/frontend/discourse/admin/components/admin-report.gjs
@@ -5,7 +5,6 @@ import EmberObject, { action } from "@ember/object";
import didUpdate from "@ember/render-modifiers/modifiers/did-update";
import { next } from "@ember/runloop";
import { service } from "@ember/service";
-import { htmlSafe } from "@ember/template";
import { isPresent } from "@ember/utils";
import AdminReportChart from "discourse/admin/components/admin-report-chart";
import AdminReportCounters from "discourse/admin/components/admin-report-counters";
@@ -55,12 +54,9 @@ const CHART_OPTIONS = {};
export default class AdminReport extends Component {
@service siteSettings;
- @tracked isEnabled = true;
@tracked isLoading = false;
@tracked rateLimitationString = null;
- @tracked report = null;
@tracked model = null;
- @tracked showTitle = true;
@tracked currentMode = this.args.filters?.mode;
@tracked options = null;
@tracked dateRangeFrom = null;
@@ -103,7 +99,7 @@ export default class AdminReport extends Component {
}
get reportClasses() {
- const builtReportClasses = [];
+ const builtReportClasses = ["is-enabled"];
if (this.isHidden) {
builtReportClasses.push("hidden");
@@ -113,10 +109,6 @@ export default class AdminReport extends Component {
builtReportClasses.push("is-visible");
}
- if (this.isEnabled) {
- builtReportClasses.push("is-enabled");
- }
-
if (this.isLoading) {
builtReportClasses.push("is-loading");
}
@@ -369,9 +361,7 @@ export default class AdminReport extends Component {
@bind
fetchOrRender() {
- if (this.report) {
- this._renderReport(this.report);
- } else if (this.args.dataSourceName) {
+ if (this.args.dataSourceName) {
this._fetchReport();
}
}
@@ -543,254 +533,242 @@ export default class AdminReport extends Component {
{{didUpdate this.fetchOrRender @filters.startDate @filters.endDate}}
>
{{#unless this.isHidden}}
- {{#if this.isEnabled}}
- <ConditionalLoadingSection @isLoading={{this.isLoading}}>
- {{#if
- (and this.siteSettings.reporting_improvements this.model.legacy)
- }}
- <div class="alert alert-info">
- {{icon "triangle-exclamation"}}
- <span>{{i18n "admin.reports.legacy_warning"}}</span>
- </div>
- {{/if}}
- {{#if this.showHeader}}
- <div class="header">
- {{#if this.showTitle}}
- {{#unless this.showNotFoundError}}
- <DPageSubheader
- @titleLabel={{this.model.title}}
- @titleUrl={{this.model.reportUrl}}
- @descriptionLabel={{unless
- this.showDescriptionInTooltip
- this.model.description
- }}
- @learnMoreUrl={{this.model.description_link}}
- />
+ <ConditionalLoadingSection @isLoading={{this.isLoading}}>
+ {{#if
+ (and this.siteSettings.reporting_improvements this.model.legacy)
+ }}
+ <div class="alert alert-info">
+ {{icon "triangle-exclamation"}}
+ <span>{{i18n "admin.reports.legacy_warning"}}</span>
+ </div>
+ {{/if}}
+ {{#if this.showHeader}}
+ <div class="header">
+ {{#unless this.showNotFoundError}}
+ <DPageSubheader
+ @titleLabel={{this.model.title}}
+ @titleUrl={{this.model.reportUrl}}
+ @descriptionLabel={{unless
+ this.showDescriptionInTooltip
+ this.model.description
+ }}
+ @learnMoreUrl={{this.model.description_link}}
+ />
+
+ {{#if this.showDescriptionInTooltip}}
+ {{#if this.model.description}}
+ <DTooltip
+ @interactive={{this.model.description_link.length}}
+ >
+ <:trigger>
+ {{icon "circle-question"}}
+ </:trigger>
+ <:content>
+ {{#if this.model.description_link}}
+ <a
+ target="_blank"
+ rel="noopener noreferrer"
+ href={{this.model.description_link}}
+ class="info"
+ >
+ {{this.model.description}}
+ </a>
+ {{else}}
+ <span>{{this.model.description}}</span>
+ {{/if}}
+ </:content>
+ </DTooltip>
+ {{/if}}
+ {{/if}}
+ {{/unless}}
- {{#if this.showDescriptionInTooltip}}
- {{#if this.model.description}}
- <DTooltip
- @interactive={{this.model.description_link.length}}
- >
- <:trigger>
- {{icon "circle-question"}}
- </:trigger>
- <:content>
- {{#if this.model.description_link}}
- <a
- target="_blank"
- rel="noopener noreferrer"
- href={{this.model.description_link}}
- class="info"
- >
- {{this.model.description}}
- </a>
- {{else}}
- <span>{{this.model.description}}</span>
- {{/if}}
- </:content>
- </DTooltip>
- {{/if}}
+ {{#if this.shouldDisplayTrend}}
+ <div class="trend {{this.model.trend}}">
+ <span class="value" title={{this.model.trendTitle}}>
+ {{#if this.model.average}}
+ {{number this.model.currentAverage}}{{#if
+ this.model.percent
+ }}%{{/if}}
+ {{else}}
+ {{number this.model.currentTotal noTitle="true"}}{{#if
+ this.model.percent
+ }}%{{/if}}
{{/if}}
- {{/unless}}
- {{/if}}
- {{#if this.shouldDisplayTrend}}
- <div class="trend {{this.model.trend}}">
- <span class="value" title={{this.model.trendTitle}}>
- {{#if this.model.average}}
- {{number this.model.currentAverage}}{{#if
- this.model.percent
- }}%{{/if}}
- {{else}}
- {{number this.model.currentTotal noTitle="true"}}{{#if
- this.model.percent
- }}%{{/if}}
- {{/if}}
+ {{#if this.model.trendIcon}}
+ {{icon this.model.trendIcon class="icon"}}
+ {{/if}}
+ </span>
+ </div>
+ {{/if}}
+ </div>
+ {{/if}}
+
+ <div class="body">
+ <div class="main">
+ {{#if this.showError}}
+ {{#if this.showTimeoutError}}
+ <div class="alert alert-error report-alert timeout">
+ {{icon "triangle-exclamation"}}
+ <span>{{i18n "admin.dashboard.timeout_error"}}</span>
+ </div>
+ {{/if}}
- {{#if this.model.trendIcon}}
- {{icon this.model.trendIcon class="icon"}}
- {{/if}}
- </span>
+ {{#if this.showExceptionError}}
+ <div class="alert alert-error report-alert exception">
+ {{icon "triangle-exclamation"}}
+ <span>{{i18n "admin.dashboard.exception_error"}}</span>
</div>
{{/if}}
- </div>
- {{/if}}
- <div class="body">
- <div class="main">
- {{#if this.showError}}
- {{#if this.showTimeoutError}}
- <div class="alert alert-error report-alert timeout">
- {{icon "triangle-exclamation"}}
- <span>{{i18n "admin.dashboard.timeout_error"}}</span>
- </div>
+ {{#if this.showNotFoundError}}
+ <div class="alert alert-error report-alert not-found">
+ {{icon "triangle-exclamation"}}
+ <span>{{i18n "admin.dashboard.not_found_error"}}</span>
+ </div>
+ {{/if}}
+ {{else}}
+ {{#if this.hasData}}
+ {{#if this.currentMode}}
+ {{component
+ this.modeComponent
+ model=this.model
+ options=this.options
+ }}
+
+ {{#if this.model.relatedReport}}
+ <AdminReport
+ @showFilteringUI={{false}}
+ @dataSourceName={{this.model.relatedReport.type}}
+ />
+ {{/if}}
{{/if}}
-
- {{#if this.showExceptionError}}
- <div class="alert alert-error report-alert exception">
- {{icon "triangle-exclamation"}}
- <span>{{i18n "admin.dashboard.exception_error"}}</span>
+ {{else}}
+ {{#if this.rateLimitationString}}
+ <div class="alert alert-error report-alert rate-limited">
+ {{icon "temperature-three-quarters"}}
+ <span>{{this.rateLimitationString}}</span>
</div>
- {{/if}}
-
- {{#if this.showNotFoundError}}
- <div class="alert alert-error report-alert not-found">
- {{icon "triangle-exclamation"}}
- <span>{{i18n "admin.dashboard.not_found_error"}}</span>
+ {{else}}
+ <div class="alert alert-info report-alert no-data">
+ {{icon "chart-pie"}}
+ {{#if this.model.reportUrl}}
+ <a href={{this.model.reportUrl}} class="report-url">
+ <span>
+ {{#if this.model.title}}
+ {{this.model.title}}
+ —
+ {{/if}}
+ {{i18n "admin.dashboard.reports.no_data"}}
+ </span>
+ </a>
+ {{else}}
+ <span>{{i18n "admin.dashboard.reports.no_data"}}</span>
+ {{/if}}
</div>
{{/if}}
- {{else}}
- {{#if this.hasData}}
- {{#if this.currentMode}}
- {{component
- this.modeComponent
- model=this.model
- options=this.options
- }}
+ {{/if}}
+ {{/if}}
+ </div>
- {{#if this.model.relatedReport}}
- <AdminReport
- @showFilteringUI={{false}}
- @dataSourceName={{this.model.relatedReport.type}}
- />
- {{/if}}
- {{/if}}
- {{else}}
- {{#if this.rateLimitationString}}
- <div class="alert alert-error report-alert rate-limited">
- {{icon "temperature-three-quarters"}}
- <span>{{this.rateLimitationString}}</span>
- </div>
- {{else}}
- <div class="alert alert-info report-alert no-data">
- {{icon "chart-pie"}}
- {{#if this.model.reportUrl}}
- <a href={{this.model.reportUrl}} class="report-url">
- <span>
- {{#if this.model.title}}
- {{this.model.title}}
- —
- {{/if}}
- {{i18n "admin.dashboard.reports.no_data"}}
- </span>
- </a>
- {{else}}
- <span>{{i18n
- "admin.dashboard.reports.no_data"
- }}</span>
- {{/if}}
- </div>
- {{/if}}
- {{/if}}
+ {{#if this.showFilteringUI}}
+ <div class="filters">
+ {{#if this.showModes}}
+ <div class="modes">
+ {{#each this.displayedModes as |displayedMode|}}
+ <DButton
+ @action={{fn this.onChangeMode displayedMode.mode}}
+ @icon={{displayedMode.icon}}
+ class={{displayedMode.cssClass}}
+ />
+ {{/each}}
+ </div>
{{/if}}
- </div>
- {{#if this.showFilteringUI}}
- <div class="filters">
- {{#if this.showModes}}
- <div class="modes">
- {{#each this.displayedModes as |displayedMode|}}
- <DButton
- @action={{fn this.onChangeMode displayedMode.mode}}
- @icon={{displayedMode.icon}}
- class={{displayedMode.cssClass}}
- />
- {{/each}}
- </div>
+ {{#if this.isChartMode}}
+ {{#if this.model.average}}
+ <span class="average-chart">
+ {{i18n "admin.dashboard.reports.average_chart_label"}}
+ </span>
{{/if}}
+ <div class="chart-groupings">
+ {{#each this.chartGroupings as |chartGrouping|}}
+ <DButton
+ @label={{chartGrouping.label}}
+ @action={{fn this.changeGrouping chartGrouping.id}}
+ @disabled={{chartGrouping.disabled}}
+ class={{chartGrouping.class}}
+ />
+ {{/each}}
+ </div>
+ {{/if}}
- {{#if this.isChartMode}}
- {{#if this.model.average}}
- <span class="average-chart">
- {{i18n "admin.dashboard.reports.average_chart_label"}}
- </span>
- {{/if}}
- <div class="chart-groupings">
- {{#each this.chartGroupings as |chartGrouping|}}
- <DButton
- @label={{chartGrouping.label}}
- @action={{fn this.changeGrouping chartGrouping.id}}
- @disabled={{chartGrouping.disabled}}
- class={{chartGrouping.class}}
- />
- {{/each}}
- </div>
- {{/if}}
+ {{#if this.showDatesOptions}}
+ <div class="control">
+ <span class="label">
+ {{i18n "admin.dashboard.reports.dates"}}
+ </span>
- {{#if this.showDatesOptions}}
- <div class="control">
- <span class="label">
- {{i18n "admin.dashboard.reports.dates"}}
- </span>
-
- <div class="input">
- <DateTimeInputRange
- @from={{this.startDate}}
- @to={{this.endDate}}
- @onChange={{this.onChangeDateRange}}
- @showFromTime={{false}}
- @showToTime={{false}}
- />
- </div>
+ <div class="input">
+ <DateTimeInputRange
+ @from={{this.startDate}}
+ @to={{this.endDate}}
+ @onChange={{this.onChangeDateRange}}
+ @showFromTime={{false}}
+ @showToTime={{false}}
+ />
</div>
- {{/if}}
+ </div>
+ {{/if}}
- {{#each this.model.available_filters as |filter|}}
- <div class="control">
- <span class="label">
- {{i18n
- (concat
- "admin.dashboard.reports.filters."
- filter.id
- ".label"
- )
- }}
- </span>
-
- <div class="input">
- {{component
- (this.reportFilterComponent filter)
- model=this.model
- filter=filter
- applyFilter=this.applyFilter
- }}
- </div>
+ {{#each this.model.available_filters as |filter|}}
+ <div class="control">
+ <span class="label">
+ {{i18n
+ (concat
+ "admin.dashboard.reports.filters." filter.id ".label"
+ )
+ }}
+ </span>
+
+ <div class="input">
+ {{component
+ (this.reportFilterComponent filter)
+ model=this.model
+ filter=filter
+ applyFilter=this.applyFilter
+ }}
</div>
- {{/each}}
+ </div>
+ {{/each}}
+
+ <div class="control">
+ <div class="input">
+ <DButton
+ @action={{this.exportCsv}}
+ @label="admin.export_csv.button_text"
+ @icon="download"
+ class="btn-default export-csv-btn"
+ />
+ </div>
+ </div>
+ {{#if this.showRefresh}}
<div class="control">
<div class="input">
<DButton
- @action={{this.exportCsv}}
- @label="admin.export_csv.button_text"
- @icon="download"
- class="btn-default export-csv-btn"
+ @action={{this.refreshReport}}
+ @label="admin.dashboard.reports.refresh_report"
+ @icon="arrows-rotate"
+ class="refresh-report-btn btn-primary"
/>
</div>
</div>
-
- {{#if this.showRefresh}}
- <div class="control">
- <div class="input">
- <DButton
- @action={{this.refreshReport}}
- @label="admin.dashboard.reports.refresh_report"
- @icon="arrows-rotate"
- class="refresh-report-btn btn-primary"
- />
- </div>
- </div>
- {{/if}}
- </div>
- {{/if}}
- </div>
- </ConditionalLoadingSection>
- {{else}}
- <div class="alert alert-info">
- {{htmlSafe this.disabledLabel}}
+ {{/if}}
+ </div>
+ {{/if}}
</div>
- {{/if}}
+ </ConditionalLoadingSection>
{{/unless}}
</div>
</template>
diff --git a/frontend/discourse/admin/components/admin-search.gjs b/frontend/discourse/admin/components/admin-search.gjs
index 7dab18e8f05..c14f1c61eb1 100644
--- a/frontend/discourse/admin/components/admin-search.gjs
+++ b/frontend/discourse/admin/components/admin-search.gjs
@@ -20,7 +20,6 @@ export default class AdminSearch extends Component {
@tracked filter = this.args.initialFilter ?? "";
@tracked searchResults = [];
- @tracked showFilters = true;
@tracked loading = false;
@tracked dataReady = false;
diff --git a/frontend/discourse/admin/components/admin-theme-editor.gjs b/frontend/discourse/admin/components/admin-theme-editor.gjs
index c9f94b07f72..6d14ac9f13a 100644
--- a/frontend/discourse/admin/components/admin-theme-editor.gjs
+++ b/frontend/discourse/admin/components/admin-theme-editor.gjs
@@ -38,8 +38,7 @@ export default class AdminThemeEditor extends Component {
@service router;
@tracked showAdvanced;
- @tracked onlyOverridden;
- @tracked currentTargetName;
+ currentTargetName;
warning = null;
@@ -53,17 +52,12 @@ export default class AdminThemeEditor extends Component {
if (!this.showAdvanced && ADVANCED_TARGETS.includes(target.name)) {
return false;
}
- if (!this.onlyOverridden) {
- return true;
- }
+ return true;
});
}
get visibleFields() {
let fields = this.theme.fields[this.currentTargetName];
- if (this.onlyOverridden) {
- fields = fields.filter((field) => field.edited);
- }
if (!this.showAdvanced) {
fields = fields.filter(
(field) => field.edited || !ADVANCED_FIELDS.includes(field.name)
diff --git a/frontend/discourse/admin/components/bulk-user-delete-confirmation.gjs b/frontend/discourse/admin/components/bulk-user-delete-confirmation.gjs
index 2a1741f567f..82df59876de 100644
--- a/frontend/discourse/admin/components/bulk-user-delete-confirmation.gjs
+++ b/frontend/discourse/admin/components/bulk-user-delete-confirmation.gjs
@@ -19,7 +19,7 @@ export default class BulkUserDeleteConfirmation extends Component {
@tracked confirmButtonDisabled = true;
@tracked deleteStarted = false;
- @tracked logs = new TrackedArray();
+ logs = new TrackedArray();
failedUsernames = [];
callAfterBulkDelete = false;
diff --git a/frontend/discourse/admin/templates/admin-config/flags.gjs b/frontend/discourse/admin/templates/admin-config/flags.gjs
index 5ed0d9656e9..2ba08589d4e 100644
--- a/frontend/discourse/admin/templates/admin-config/flags.gjs
+++ b/frontend/discourse/admin/templates/admin-config/flags.gjs
@@ -1,5 +1,4 @@
import Component from "@glimmer/component";
-import { tracked } from "@glimmer/tracking";
import { service } from "@ember/service";
import { SYSTEM_FLAG_IDS } from "discourse/admin/lib/constants";
import DBreadcrumbsItem from "discourse/components/d-breadcrumbs-item";
@@ -11,11 +10,9 @@ class FlagsTemplate extends Component {
@service site;
@service siteSettings;
- @tracked flags = this.site.flagTypes;
-
get addFlagButtonDisabled() {
return (
- this.flags.filter(
+ this.site.flagTypes.filter(
(flag) => !Object.values(SYSTEM_FLAG_IDS).includes(flag.id)
).length >= this.siteSettings.custom_flags_limit
);
diff --git a/frontend/discourse/app/components/avatar-uploader.gjs b/frontend/discourse/app/components/avatar-uploader.gjs
index d7fddf546ef..5598082638b 100644
--- a/frontend/discourse/app/components/avatar-uploader.gjs
+++ b/frontend/discourse/app/components/avatar-uploader.gjs
@@ -57,7 +57,7 @@ export default class AvatarUploader extends Component {
id="custom-profile-upload"
{{didInsert this.uppyUpload.setup}}
class="hidden-upload-field"
- disabled={{this.uploading}}
+ disabled={{this.uppyUpload.uploading}}
type="file"
accept="image/*"
aria-hidden="true"
@@ -65,7 +65,7 @@ export default class AvatarUploader extends Component {
<DButton
@translatedLabel={{this.uploadLabel}}
@icon="far-image"
- @disabled={{this.uploading}}
+ @disabled={{this.uppyUpload.uploading}}
@action={{this.chooseImage}}
@title="user.change_avatar.upload_title"
class="btn-default avatar-uploader__button"
diff --git a/frontend/discourse/app/components/badge-card.gjs b/frontend/discourse/app/components/badge-card.gjs
index a59ef61c9d4..c47405cc01b 100644
--- a/frontend/discourse/app/components/badge-card.gjs
+++ b/frontend/discourse/app/components/badge-card.gjs
@@ -1,5 +1,4 @@
import Component from "@glimmer/component";
-import { tracked } from "@glimmer/tracking";
import { htmlSafe } from "@ember/template";
import { isEmpty } from "@ember/utils";
import DButton from "discourse/components/d-button";
@@ -13,7 +12,9 @@ import { i18n } from "discourse-i18n";
import PluginOutlet from "./plugin-outlet";
export default class BadgeCard extends Component {
- @tracked size = this.args.size || "medium";
+ get size() {
+ return this.args.size || "medium";
+ }
get url() {
const { badge, filterUser, username } = this.args;
@@ -31,9 +32,9 @@ export default class BadgeCard extends Component {
}
get summary() {
- const { size, badge } = this.args;
+ const { badge } = this.args;
- if (size === "large" && !isEmpty(badge.long_description)) {
+ if (this.size === "large" && !isEmpty(badge.long_description)) {
return emojiUnescape(sanitize(badge.long_description));
}
return sanitize(badge.description);
diff --git a/frontend/discourse/app/components/create-topic-button.gjs b/frontend/discourse/app/components/create-topic-button.gjs
index 11ba111adaf..5919a7a868d 100644
--- a/frontend/discourse/app/components/create-topic-button.gjs
+++ b/frontend/discourse/app/components/create-topic-button.gjs
@@ -7,8 +7,13 @@ import { applyValueTransformer } from "discourse/lib/transformer";
export default class CreateTopicButton extends Component {
@service router;
- label = this.args.label ?? "topic.create";
- btnId = this.args.btnId ?? "create-topic";
+ get label() {
+ return this.args.label ?? "topic.create";
+ }
+
+ get btnId() {
+ return this.args.btnId ?? "create-topic";
+ }
get btnTypeClass() {
return this.args.btnTypeClass || "btn-default";
diff --git a/frontend/discourse/app/components/d-navigation.gjs b/frontend/discourse/app/components/d-navigation.gjs
index d8ea1913152..d8fb52a6d47 100644
--- a/frontend/discourse/app/components/d-navigation.gjs
+++ b/frontend/discourse/app/components/d-navigation.gjs
@@ -1,5 +1,4 @@
/* eslint-disable ember/no-classic-components */
-import { tracked } from "@glimmer/tracking";
import Component from "@ember/component";
import { hash } from "@ember/helper";
import { action } from "@ember/object";
@@ -33,8 +32,6 @@ export default class DNavigation extends Component {
@service siteSettings;
@service currentUser;
- @tracked filterMode;
-
@setting("fixed_category_positions") fixedCategoryPositions;
get canEditTags() {
diff --git a/frontend/discourse/app/components/discovery/topics.gjs b/frontend/discourse/app/components/discovery/topics.gjs
index 672ff83f7b9..1a28807a147 100644
--- a/frontend/discourse/app/components/discovery/topics.gjs
+++ b/frontend/discourse/app/components/discovery/topics.gjs
@@ -1,5 +1,4 @@
import Component from "@glimmer/component";
-import { tracked } from "@glimmer/tracking";
import { hash } from "@ember/helper";
import { on } from "@ember/modifier";
import { action } from "@ember/object";
@@ -27,8 +26,6 @@ export default class DiscoveryTopics extends Component {
@service currentUser;
@service topicTrackingState;
- @tracked loadingNew;
-
get redirectedReason() {
return this.currentUser?.user_option.redirected_to_top?.reason;
}
diff --git a/frontend/discourse/app/components/emoji-picker/content.gjs b/frontend/discourse/app/components/emoji-picker/content.gjs
index 45fc0741f82..7f6c00b0dcf 100644
--- a/frontend/discourse/app/components/emoji-picker/content.gjs
+++ b/frontend/discourse/app/components/emoji-picker/content.gjs
@@ -61,13 +61,11 @@ export default class EmojiPicker extends Component {
@tracked filteredEmojis = null;
@tracked scrollObserverEnabled = true;
@tracked scrollDirection = "up";
- @tracked emojis = null;
@tracked visibleSections = DEFAULT_VISIBLE_SECTIONS;
@tracked lastVisibleSection = DEFAULT_LAST_SECTION;
@tracked term = this.args.term;
prevYPosition = 0;
-
scrollableNode;
setupSectionsNavScroll = modifierFn((element) => {
diff --git a/frontend/discourse/app/components/form-template-field/upload.gjs b/frontend/discourse/app/components/form-template-field/upload.gjs
index de86926232a..6a9d70300b4 100644
--- a/frontend/discourse/app/components/form-template-field/upload.gjs
+++ b/frontend/discourse/app/components/form-template-field/upload.gjs
@@ -1,5 +1,4 @@
import Component from "@glimmer/component";
-import { tracked } from "@glimmer/tracking";
import { action } from "@ember/object";
import { getOwner } from "@ember/owner";
import { next, schedule } from "@ember/runloop";
@@ -16,11 +15,9 @@ import UppyUpload from "discourse/lib/uppy/uppy-upload";
export default class FormTemplateFieldUpload extends Component {
@service appEvents;
- @tracked fileInputSelector = `#${this.fileUploadElementId}`;
- @tracked
- fileUploadElementId = `${dasherize(this.args.id.toString())}-uploader`;
@resettableTracked uploadValue = this.args.value || "";
@trackedArray uploadedFiles = [];
+ fileUploadElementId = `${dasherize(this.args.id.toString())}-uploader`;
uppyUpload = new UppyUpload(getOwner(this), {
id: this.args.id,
diff --git a/frontend/discourse/app/components/header.gjs b/frontend/discourse/app/components/header.gjs
index ce05e01fb52..6cb5072c73a 100644
--- a/frontend/discourse/app/components/header.gjs
+++ b/frontend/discourse/app/components/header.gjs
@@ -1,5 +1,4 @@
import Component from "@glimmer/component";
-import { tracked } from "@glimmer/tracking";
import { hash } from "@ember/helper";
import { action } from "@ember/object";
import { service } from "@ember/service";
@@ -49,8 +48,6 @@ export default class GlimmerHeader extends Component {
@service appEvents;
@service header;
- @tracked skipSearchContext = this.site.mobileView;
-
appEventsListeners = modifierFn(() => {
this.appEvents.on(
"header:keyboard-trigger",
@@ -163,7 +160,7 @@ export default class GlimmerHeader extends Component {
const context = this.search.searchContext;
let params = "";
if (context) {
- params = `?context=${context.type}&context_id=${context.id}&skip_context=${this.skipSearchContext}`;
+ params = `?context=${context.type}&context_id=${context.id}&skip_context=${this.site.mobileView}`;
}
if (this.router.currentRouteName === "full-page-search") {
diff --git a/frontend/discourse/app/components/modal/avatar-selector.gjs b/frontend/discourse/app/components/modal/avatar-selector.gjs
index 1c6f66d19f5..365cc825a40 100644
--- a/frontend/discourse/app/components/modal/avatar-selector.gjs
+++ b/frontend/discourse/app/components/modal/avatar-selector.gjs
@@ -23,7 +23,6 @@ export default class AvatarSelectorModal extends Component {
@tracked gravatarRefreshDisabled = false;
@tracked gravatarFailed = false;
- @tracked uploading = false;
@tracked _selected = null;
get user() {
@@ -39,7 +38,7 @@ export default class AvatarSelectorModal extends Component {
}
get submitDisabled() {
- return this.selected === "logo" || this.uploading;
+ return this.selected === "logo";
}
get selectableAvatars() {
@@ -299,7 +298,6 @@ export default class AvatarSelectorModal extends Component {
@user_id={{this.user.id}}
@uploadedAvatarTemplate={{this.user.custom_avatar_template}}
@uploadedAvatarId={{this.user.custom_avatar_upload_id}}
- @uploading={{this.uploading}}
@id="avatar-uploader"
@done={{this.uploadComplete}}
class="avatar-uploader"
diff --git a/frontend/discourse/app/components/modal/bookmark.gjs b/frontend/discourse/app/components/modal/bookmark.gjs
index 7e0f914cf9a..47f5d4dbcb9 100644
--- a/frontend/discourse/app/components/modal/bookmark.gjs
+++ b/frontend/discourse/app/components/modal/bookmark.gjs
@@ -48,7 +48,6 @@ export default class BookmarkModal extends Component {
@tracked postDetectedLocalTimezone = null;
@tracked prefilledDatetime = null;
@tracked flash = null;
- @tracked userTimezone = this.currentUser.user_option.timezone;
@tracked showOptions = this.args.model.bookmark.id ? true : false;
@notEmpty("userTimezone") userHasTimezoneSet;
@@ -73,6 +72,10 @@ export default class BookmarkModal extends Component {
this.keyboardShortcuts.unpause();
}
+ get userTimezone() {
+ return this.currentUser.user_option.timezone;
+ }
+
get bookmark() {
return this.args.model.bookmark;
}
diff --git a/frontend/discourse/app/components/modal/edit-user-directory-columns.gjs b/frontend/discourse/app/components/modal/edit-user-directory-columns.gjs
index 77f41bdb5b0..7a39d77929c 100644
--- a/frontend/discourse/app/components/modal/edit-user-directory-columns.gjs
+++ b/frontend/discourse/app/components/modal/edit-user-directory-columns.gjs
@@ -20,7 +20,6 @@ const DOWN = "down";
export default class EditUserDirectoryColumns extends Component {
@tracked loading = true;
@tracked columns;
- @tracked labelKey;
@tracked flash;
constructor() {
@@ -133,7 +132,6 @@ export default class EditUserDirectoryColumns extends Component {
{{#if (directoryColumnIsAutomatic column=column)}}
{{directoryTableHeaderTitle
field=column.name
- labelKey=this.labelKey
icon=column.icon
}}
{{else if (directoryColumnIsUserField column=column)}}
diff --git a/frontend/discourse/app/components/modal/flag.gjs b/frontend/discourse/app/components/modal/flag.gjs
index aa477e11788..4b8d6188ef7 100644
--- a/frontend/discourse/app/components/modal/flag.gjs
+++ b/frontend/discourse/app/components/modal/flag.gjs
@@ -27,11 +27,9 @@ export default class Flag extends Component {
// eslint-disable-next-line discourse/no-unused-services
@service site; // FIXME: used by flag-target objects
- @tracked userDetails;
@tracked selected;
@tracked message;
@tracked isConfirmed = false;
- @tracked isWarning = false;
@tracked spammerDetails;
constructor() {
@@ -255,7 +253,6 @@ export default class Flag extends Component {
@flag={{f}}
@message={{this.message}}
@isConfirmed={{this.isConfirmed}}
- @isWarning={{this.isWarning}}
@selectedFlag={{this.selected}}
@username={{@model.flagModel.username}}
@staffFlagsAvailable={{this.staffFlagsAvailable}}
diff --git a/frontend/discourse/app/components/modal/second-factor-backup-edit.gjs b/frontend/discourse/app/components/modal/second-factor-backup-edit.gjs
index a5854d13c52..61ec88a2631 100644
--- a/frontend/discourse/app/components/modal/second-factor-backup-edit.gjs
+++ b/frontend/discourse/app/components/modal/second-factor-backup-edit.gjs
@@ -8,7 +8,6 @@ import ConditionalLoadingSection from "discourse/components/conditional-loading-
import DButton from "discourse/components/d-button";
import DModal from "discourse/components/d-modal";
import { debounce } from "discourse/lib/decorators";
-import { SECOND_FACTOR_METHODS } from "discourse/models/user";
import { i18n } from "discourse-i18n";
export default class SecondFactorBackupEdit extends Component {
@@ -21,7 +20,6 @@ export default class SecondFactorBackupEdit extends Component {
remainingCodes =
this.args.model.secondFactor.second_factor_remaining_backup_codes;
@tracked backupCodes;
- @tracked secondFactorMethod = SECOND_FACTOR_METHODS.TOTP;
@action
copyBackupCode(successful) {
diff --git a/frontend/discourse/app/components/navigation-item.gjs b/frontend/discourse/app/components/navigation-item.gjs
index 2e3b0d56d40..ed87706c14c 100644
--- a/frontend/discourse/app/components/navigation-item.gjs
+++ b/frontend/discourse/app/components/navigation-item.gjs
@@ -1,5 +1,4 @@
/* eslint-disable ember/no-classic-components */
-import { tracked } from "@glimmer/tracking";
import Component from "@ember/component";
import { dependentKeyCompat } from "@ember/object/compat";
import { tagName } from "@ember-decorators/component";
@@ -9,8 +8,7 @@ import { filterTypeForMode } from "discourse/lib/filter-mode";
@tagName("")
export default class NavigationItem extends Component {
- @tracked filterMode;
-
+ filterMode;
hidden = false;
activeClass = "";
hrefLink = null;
diff --git a/frontend/discourse/app/components/post-list/index.gjs b/frontend/discourse/app/components/post-list/index.gjs
index 35f43e84c0a..c514081f24a 100644
--- a/frontend/discourse/app/components/post-list/index.gjs
+++ b/frontend/discourse/app/components/post-list/index.gjs
@@ -48,7 +48,10 @@ import { addUniqueValuesToArray } from "../../lib/array-tools";
export default class PostList extends Component {
@tracked loading = false;
@tracked canLoadMore = true;
- @tracked emptyText = this.args.emptyText || i18n("post_list.empty");
+
+ get emptyText() {
+ return this.args.emptyText || i18n("post_list.empty");
+ }
get isLoadingContent() {
return this.loading || this.args.isLoading;
diff --git a/frontend/discourse/app/components/post.gjs b/frontend/discourse/app/components/post.gjs
index 2ebbeb6313b..e928dbab44a 100644
--- a/frontend/discourse/app/components/post.gjs
+++ b/frontend/discourse/app/components/post.gjs
@@ -52,14 +52,10 @@ export default class Post extends Component {
@tracked expandedFirstPost;
@tracked repliesAbove;
- @tracked repliesBelow = new TrackedArray();
-
- /**
- * @type {boolean}
- */
@tracked isTogglingReplies = false;
@tracked isLoadingMoreReplies = false;
+ repliesBelow = new TrackedArray();
decoratorState = new TrackedMap();
addEventListeners = modifier((element, [listeners]) => {
diff --git a/frontend/discourse/app/components/post/menu/buttons/add-translation.gjs b/frontend/discourse/app/components/post/menu/buttons/add-translation.gjs
index e08e58f99b5..e354f7fac05 100644
--- a/frontend/discourse/app/components/post/menu/buttons/add-translation.gjs
+++ b/frontend/discourse/app/components/post/menu/buttons/add-translation.gjs
@@ -1,5 +1,4 @@
import Component from "@glimmer/component";
-import { tracked } from "@glimmer/tracking";
import { action } from "@ember/object";
import { service } from "@ember/service";
import DButton from "discourse/components/d-button";
@@ -17,8 +16,6 @@ export default class PostMenuAddTranslationButton extends Component {
@service composer;
@service modal;
- @tracked showComposer = false;
-
get showTranslationButton() {
return this.args.post.can_localize_post;
}
diff --git a/frontend/discourse/app/components/sidebar/common/custom-section.gjs b/frontend/discourse/app/components/sidebar/common/custom-section.gjs
index 7814252fbab..95621f1be7d 100644
--- a/frontend/discourse/app/components/sidebar/common/custom-section.gjs
+++ b/frontend/discourse/app/components/sidebar/common/custom-section.gjs
@@ -1,5 +1,4 @@
import Component from "@glimmer/component";
-import { tracked } from "@glimmer/tracking";
import { getOwner } from "@ember/owner";
import { service } from "@ember/service";
import replaceEmoji from "discourse/helpers/replace-emoji";
@@ -18,7 +17,7 @@ export default class SidebarCustomSection extends Component {
@service navigationMenu;
@service router;
- @tracked section = this.initialSection;
+ section = this.initialSection;
willDestroy() {
super.willDestroy();
diff --git a/frontend/discourse/app/components/software-update-prompt.gjs b/frontend/discourse/app/components/software-update-prompt.gjs
index cc7e49f2e1c..c873c71e444 100644
--- a/frontend/discourse/app/components/software-update-prompt.gjs
+++ b/frontend/discourse/app/components/software-update-prompt.gjs
@@ -47,31 +47,21 @@ export default class SoftwareUpdatePrompt extends Component {
if (!this.timeoutHandler && this.session.requiresRefresh) {
if (isTesting()) {
- this.updatePromptState(true);
+ this.addMessage();
} else {
// Since we can do this transparently for people browsing the forum
// hold back the message 24 hours.
this.timeoutHandler = discourseLater(
- () => this.updatePromptState(true),
+ () => this.addMessage(),
1000 * 60 * 24 * 60
);
}
}
}
- updatePromptState(value) {
- // when adding the message, we inject the HTML then add the animation
- // when dismissing, things need to happen in the opposite order
- const firstProp = value ? "showPrompt" : "animatePrompt";
- const secondProp = value ? "animatePrompt" : "showPrompt";
-
- this[firstProp] = value;
-
- if (isTesting()) {
- this[secondProp] = value;
- } else {
- discourseLater(() => (this[secondProp] = value), 500);
- }
+ addMessage() {
+ this.showPrompt = true;
+ discourseLater(() => (this.animatePrompt = true), 500);
}
@action
@@ -81,7 +71,8 @@ export default class SoftwareUpdatePrompt extends Component {
@action
dismiss() {
- this.updatePromptState(false);
+ this.animatePrompt = false;
+ discourseLater(() => (this.showPrompt = false), 500);
}
<template>
diff --git a/frontend/discourse/app/components/tag-groups-form.gjs b/frontend/discourse/app/components/tag-groups-form.gjs
index 0b5799fdcba..fc1dda40935 100644
--- a/frontend/discourse/app/components/tag-groups-form.gjs
+++ b/frontend/discourse/app/components/tag-groups-form.gjs
@@ -1,5 +1,5 @@
/* eslint-disable ember/no-classic-components */
-import { cached, tracked } from "@glimmer/tracking";
+import { cached } from "@glimmer/tracking";
import Component, { Input } from "@ember/component";
import { hash } from "@ember/helper";
import { action } from "@ember/object";
@@ -23,8 +23,6 @@ export default class TagGroupsForm extends Component {
@service dialog;
@service site;
- @tracked model;
-
// All but the "everyone" group
allGroups = this.site.groups.filter(
({ id }) => id !== AUTO_GROUPS.everyone.id
diff --git a/frontend/discourse/app/form-kit/components/fk/field-data.gjs b/frontend/discourse/app/form-kit/components/fk/field-data.gjs
index 5b4543e6304..e42c4dd7052 100644
--- a/frontend/discourse/app/form-kit/components/fk/field-data.gjs
+++ b/frontend/discourse/app/form-kit/components/fk/field-data.gjs
@@ -1,5 +1,4 @@
import Component from "@glimmer/component";
-import { tracked } from "@glimmer/tracking";
import { action } from "@ember/object";
import ValidationParser from "discourse/form-kit/lib/validation-parser";
import Validator from "discourse/form-kit/lib/validator";
@@ -9,12 +8,6 @@ import uniqueId from "discourse/helpers/unique-id";
* Represents a field in a form with validation, registration, and field data management capabilities.
*/
export default class FKFieldData extends Component {
- /**
- * Type of the field.
- * @type {string}
- */
- @tracked type;
-
/**
* Unique identifier for the field.
* @type {string}
diff --git a/frontend/discourse/app/helpers/directory-table-header-title.js b/frontend/discourse/app/helpers/directory-table-header-title.js
index 60bb984f75d..6eaf86fa3ab 100644
--- a/frontend/discourse/app/helpers/directory-table-header-title.js
+++ b/frontend/discourse/app/helpers/directory-table-header-title.js
@@ -3,16 +3,16 @@ import { iconHTML } from "discourse/lib/icon-library";
import { i18n } from "discourse-i18n";
export default function directoryTableHeaderTitle(args) {
- // Args should include key/values { field, labelKey, icon, translated }
+ // Args should include key/values { field, icon, translated }
let html = "";
if (args.icon) {
html += iconHTML(args.icon);
}
- let labelKey = args.labelKey || `directory.${args.field}`;
+ const labelKey = `directory.${args.field}`;
html += args.translated
? args.field
- : i18n(labelKey + "_long", { defaultValue: i18n(labelKey) });
+ : i18n(`${labelKey}_long`, { defaultValue: i18n(labelKey) });
return htmlSafe(html);
}
diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-channel-row.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-channel-row.gjs
index d3bff0a302a..8ca9953e6ea 100644
--- a/plugins/chat/assets/javascripts/discourse/components/chat-channel-row.gjs
+++ b/plugins/chat/assets/javascripts/discourse/components/chat-channel-row.gjs
@@ -34,7 +34,6 @@ export default class ChatChannelRow extends Component {
@tracked shouldReset = false;
@tracked diff = 0;
@tracked rowStyle = null;
- @tracked canSwipe = true;
registerSwipableRow = modifierFn((element) => {
this.swipableRow = element;
diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-channel.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-channel.gjs
index a130fc7bded..878d958ec98 100644
--- a/plugins/chat/assets/javascripts/discourse/components/chat-channel.gjs
+++ b/plugins/chat/assets/javascripts/discourse/components/chat-channel.gjs
@@ -59,9 +59,6 @@ export default class ChatChannel extends Component {
@service dialog;
@service siteSettings;
- @tracked sending = false;
- @tracked showChatQuoteSuccess = false;
- @tracked includeHeader = true;
@tracked atBottom = true;
@tracked uploadDropZone;
@tracked isScrolling = false;
diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-composer.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-composer.gjs
index 79578b78d1a..1414ed33dc0 100644
--- a/plugins/chat/assets/javascripts/discourse/components/chat-composer.gjs
+++ b/plugins/chat/assets/javascripts/discourse/components/chat-composer.gjs
@@ -75,7 +75,6 @@ export default class ChatComposer extends Component {
@tracked isFocused = false;
@tracked inProgressUploadsCount = 0;
- @tracked presenceChannelName;
get shouldRenderMessageDetails() {
return (
diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/drawer-routes/channel-threads.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/drawer-routes/channel-threads.gjs
index d265037eb54..440fe73dbb8 100644
--- a/plugins/chat/assets/javascripts/discourse/components/chat/drawer-routes/channel-threads.gjs
+++ b/plugins/chat/assets/javascripts/discourse/components/chat/drawer-routes/channel-threads.gjs
@@ -39,10 +39,7 @@ export default class ChatDrawerRoutesChannelThreads extends Component {
{{#if this.chatStateManager.isDrawerExpanded}}
<div class="chat-drawer-content">
- <ChatThreadList
- @channel={{@model.channel}}
- @includeHeader={{false}}
- />
+ <ChatThreadList @channel={{@model.channel}} />
</div>
{{/if}}
{{/if}}
diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/search.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/search.gjs
index 68c82a593f4..b872e003436 100644
--- a/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/search.gjs
+++ b/plugins/chat/assets/javascripts/discourse/components/chat/message-creator/search.gjs
@@ -23,15 +23,10 @@ export default class ChatMessageCreatorSearch extends Component {
@tracked chatables = [];
@tracked highlightedChatable;
@tracked term;
- @tracked loading = false;
get items() {
const items = [];
- if (this.loading) {
- return items;
- }
-
if (!this.term?.length && this.chatGuardian.canUseGroupChat()) {
items.push({
identifier: "new-group",
diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/routes/channel-thread.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/routes/channel-thread.gjs
index c24548937ba..fc5b940a823 100644
--- a/plugins/chat/assets/javascripts/discourse/components/chat/routes/channel-thread.gjs
+++ b/plugins/chat/assets/javascripts/discourse/components/chat/routes/channel-thread.gjs
@@ -24,7 +24,6 @@ export default class ChatRoutesChannelThread extends Component {
<Thread
@thread={{thread}}
@targetMessageId={{@targetMessageId}}
- @includeHeader={{true}}
@setFullTitle={{this.setFullTitle}}
/>
{{/each}}
diff --git a/plugins/chat/assets/javascripts/discourse/components/chat/routes/channel-threads.gjs b/plugins/chat/assets/javascripts/discourse/components/chat/routes/channel-threads.gjs
index 2ab2671645a..969692035e8 100644
--- a/plugins/chat/assets/javascripts/discourse/components/chat/routes/channel-threads.gjs
+++ b/plugins/chat/assets/javascripts/discourse/components/chat/routes/channel-threads.gjs
@@ -4,7 +4,7 @@ import ChatThreadList from "discourse/plugins/chat/discourse/components/chat-thr
const ChatRoutesChannelThreads = <template>
<div class="c-routes --channel-threads">
<ChatThreadListHeader @channel={{@channel}} />
- <ChatThreadList @channel={{@channel}} @includeHeader={{true}} />
+ <ChatThreadList @channel={{@channel}} />
</div>
</template>;
diff --git a/plugins/discourse-ai/admin/assets/javascripts/discourse/components/ai-spam.gjs b/plugins/discourse-ai/admin/assets/javascripts/discourse/components/ai-spam.gjs
index bd112bfd9e9..c4ca4dc37ca 100644
--- a/plugins/discourse-ai/admin/assets/javascripts/discourse/components/ai-spam.gjs
+++ b/plugins/discourse-ai/admin/assets/javascripts/discourse/components/ai-spam.gjs
@@ -16,6 +16,7 @@ import withEventValue from "discourse/helpers/with-event-value";
import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error";
import getURL from "discourse/lib/get-url";
+import { trackedArray } from "discourse/lib/tracked-tools";
import ComboBox from "discourse/select-kit/components/combo-box";
import { i18n } from "discourse-i18n";
import SpamTestModal from "./modal/spam-test-modal";
@@ -36,7 +37,7 @@ export default class AiSpam extends Component {
@tracked selectedLLM = null;
@tracked selectedPersonaId = null;
@tracked customInstructions = "";
- @tracked errors = [];
+ @trackedArray errors;
constructor() {
super(...arguments);
diff --git a/plugins/discourse-ai/admin/assets/javascripts/discourse/components/doughnut-chart.gjs b/plugins/discourse-ai/admin/assets/javascripts/discourse/components/doughnut-chart.gjs
index 7ae620c554e..a3dd9138f20 100644
--- a/plugins/discourse-ai/admin/assets/javascripts/discourse/components/doughnut-chart.gjs
+++ b/plugins/discourse-ai/admin/assets/javascripts/discourse/components/doughnut-chart.gjs
@@ -1,10 +1,7 @@
import Component from "@glimmer/component";
-import { tracked } from "@glimmer/tracking";
import Chart from "discourse/admin/components/chart";
export default class DoughnutChart extends Component {
- @tracked canvasSize = null;
-
get config() {
const totalScore = this.args.totalScore || "";
diff --git a/plugins/discourse-ai/assets/javascripts/discourse/components/ai-composer-helper-menu.gjs b/plugins/discourse-ai/assets/javascripts/discourse/components/ai-composer-helper-menu.gjs
index ed1f36307fe..e98bc830d5e 100644
--- a/plugins/discourse-ai/assets/javascripts/discourse/components/ai-composer-helper-menu.gjs
+++ b/plugins/discourse-ai/assets/javascripts/discourse/components/ai-composer-helper-menu.gjs
@@ -17,19 +17,12 @@ export default class AiComposerHelperMenu extends Component {
@service currentUser;
@service site;
- @tracked newSelectedText;
- @tracked diff;
@tracked customPromptValue = "";
- @tracked noContentError = false;
prompts = [];
promptTypes = {};
- constructor() {
- super(...arguments);
-
- if (this.args.data.toolbarEvent.getText().length === 0) {
- this.noContentError = true;
- }
+ get noContentError() {
+ return this.args.data.toolbarEvent.getText().length === 0;
}
get helperOptions() {
diff --git a/plugins/discourse-ai/assets/javascripts/discourse/components/ai-post-helper-menu.gjs b/plugins/discourse-ai/assets/javascripts/discourse/components/ai-post-helper-menu.gjs
index 5c9b46564c2..7d3754727fd 100644
--- a/plugins/discourse-ai/assets/javascripts/discourse/components/ai-post-helper-menu.gjs
+++ b/plugins/discourse-ai/assets/javascripts/discourse/components/ai-post-helper-menu.gjs
@@ -44,7 +44,6 @@ export default class AiPostHelperMenu extends Component {
@tracked streaming = false;
@tracked lastSelectedOption = null;
@tracked isSavingFootnote = false;
- @tracked
smoothStreamer = new SmoothStreamer(
() => this.suggestion,
(newValue) => (this.suggestion = newValue)
diff --git a/plugins/discourse-ai/assets/javascripts/discourse/components/ai-search-discoveries.gjs b/plugins/discourse-ai/assets/javascripts/discourse/components/ai-search-discoveries.gjs
index 227e2c79806..31a6fc06e75 100644
--- a/plugins/discourse-ai/assets/javascripts/discourse/components/ai-search-discoveries.gjs
+++ b/plugins/discourse-ai/assets/javascripts/discourse/components/ai-search-discoveries.gjs
@@ -30,7 +30,6 @@ export default class AiSearchDiscoveries extends Component {
@tracked loadingConversationTopic = false;
@tracked fullDiscoveryToggled = false;
- @tracked discoveryPreviewLength = this.args.discoveryPreviewLength || 150;
constructor() {
super(...arguments);
@@ -73,6 +72,10 @@ export default class AiSearchDiscoveries extends Component {
);
}
+ get discoveryPreviewLength() {
+ return this.args.discoveryPreviewLength || 150;
+ }
+
get query() {
return this.args?.searchTerm || this.search.activeGlobalSearchTerm;
}
diff --git a/plugins/discourse-ai/assets/javascripts/discourse/components/ai-split-topic-suggester.gjs b/plugins/discourse-ai/assets/javascripts/discourse/components/ai-split-topic-suggester.gjs
index 184d0c85eef..ab86e91f6da 100644
--- a/plugins/discourse-ai/assets/javascripts/discourse/components/ai-split-topic-suggester.gjs
+++ b/plugins/discourse-ai/assets/javascripts/discourse/components/ai-split-topic-suggester.gjs
@@ -17,7 +17,6 @@ export default class AiSplitTopicSuggester extends Component {
@tracked suggestions = [];
@tracked loading = false;
- @tracked icon = "discourse-sparkles";
SUGGESTION_TYPES = {
title: "suggest_title",
diff --git a/plugins/discourse-ai/assets/javascripts/discourse/components/modal/ai-summary-modal.gjs b/plugins/discourse-ai/assets/javascripts/discourse/components/modal/ai-summary-modal.gjs
index 2f8beee80df..cb9aaec9e85 100644
--- a/plugins/discourse-ai/assets/javascripts/discourse/components/modal/ai-summary-modal.gjs
+++ b/plugins/discourse-ai/assets/javascripts/discourse/components/modal/ai-summary-modal.gjs
@@ -38,7 +38,6 @@ export default class AiSummaryModal extends Component {
@tracked canRegenerate = false;
@tracked loading = false;
@tracked currentIndex = 0;
- @tracked
smoothStreamer = new SmoothStreamer(
() => this.text,
(newValue) => (this.text = newValue)
diff --git a/plugins/discourse-ai/assets/javascripts/discourse/components/modal/diff-modal.gjs b/plugins/discourse-ai/assets/javascripts/discourse/components/modal/diff-modal.gjs
index 70e4a2ae51d..3baa91f0e84 100644
--- a/plugins/discourse-ai/assets/javascripts/discourse/components/modal/diff-modal.gjs
+++ b/plugins/discourse-ai/assets/javascripts/discourse/components/modal/diff-modal.gjs
@@ -28,10 +28,9 @@ export default class ModalDiffModal extends Component {
@tracked loading = false;
@tracked finalResult = "";
- @tracked escapedSelectedText = escapeExpression(this.args.model.selectedText);
- @tracked diffStreamer = new DiffStreamer(this.args.model.selectedText);
@tracked suggestion = "";
- @tracked
+ escapedSelectedText = escapeExpression(this.args.model.selectedText);
+ diffStreamer = new DiffStreamer(this.args.model.selectedText);
smoothStreamer = new SmoothStreamer(
() => this.suggestion,
(newValue) => (this.suggestion = newValue)
diff --git a/plugins/discourse-ai/assets/javascripts/discourse/components/rag-uploader.gjs b/plugins/discourse-ai/assets/javascripts/discourse/components/rag-uploader.gjs
index 0aae2368e72..06819ff2549 100644
--- a/plugins/discourse-ai/assets/javascripts/discourse/components/rag-uploader.gjs
+++ b/plugins/discourse-ai/assets/javascripts/discourse/components/rag-uploader.gjs
@@ -67,7 +67,7 @@ export default class RagUploader extends Component {
ajax(
`/admin/plugins/discourse-ai/rag-document-fragments/files/status.json?target_type=${targetName}&target_id=${this.target.id}`
).then((statuses) => {
- this.set("ragIndexingStatuses", statuses);
+ this.ragIndexingStatuses = statuses;
});
}
diff --git a/plugins/discourse-ai/assets/javascripts/discourse/connectors/post-text-buttons/ai-post-helper-trigger.gjs b/plugins/discourse-ai/assets/javascripts/discourse/connectors/post-text-buttons/ai-post-helper-trigger.gjs
index 54d2c0d3577..2aa689a816f 100644
--- a/plugins/discourse-ai/assets/javascripts/discourse/connectors/post-text-buttons/ai-post-helper-trigger.gjs
+++ b/plugins/discourse-ai/assets/javascripts/discourse/connectors/post-text-buttons/ai-post-helper-trigger.gjs
@@ -15,9 +15,7 @@ export default class AiPostHelperTrigger extends Component {
@service menu;
@tracked postHighlighted = false;
- @tracked currentMenu = this.menu.getByIdentifier(
- "post-text-selection-toolbar"
- );
+ currentMenu = this.menu.getByIdentifier("post-text-selection-toolbar");
// capture the state at the moment the toolbar is rendered
// so we ensure change of state (selection change for example)
diff --git a/plugins/discourse-assign/assets/javascripts/discourse/components/modal/edit-topic-assignments.gjs b/plugins/discourse-assign/assets/javascripts/discourse/components/modal/edit-topic-assignments.gjs
index fe9302690e9..08650095321 100644
--- a/plugins/discourse-assign/assets/javascripts/discourse/components/modal/edit-topic-assignments.gjs
+++ b/plugins/discourse-assign/assets/javascripts/discourse/components/modal/edit-topic-assignments.gjs
@@ -1,5 +1,4 @@
import Component from "@glimmer/component";
-import { tracked } from "@glimmer/tracking";
import { action } from "@ember/object";
import { service } from "@ember/service";
import DButton from "discourse/components/d-button";
@@ -12,7 +11,7 @@ import TopicAssignments from "../topic-assignments";
export default class EditTopicAssignments extends Component {
@service taskActions;
- @tracked assignments = this.topic.assignments();
+ assignments = this.topic.assignments();
get title() {
if (this.topic.isAssigned() || this.topic.hasAssignedPosts()) {
diff --git a/plugins/discourse-gamification/admin/assets/javascripts/admin/components/admin-create-leaderboard.gjs b/plugins/discourse-gamification/admin/assets/javascripts/admin/components/admin-create-leaderboard.gjs
index 8c7206a179c..db307065615 100644
--- a/plugins/discourse-gamification/admin/assets/javascripts/admin/components/admin-create-leaderboard.gjs
+++ b/plugins/discourse-gamification/admin/assets/javascripts/admin/components/admin-create-leaderboard.gjs
@@ -1,7 +1,6 @@
import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking";
import { action } from "@ember/object";
-import { readOnly } from "@ember/object/computed";
import { service } from "@ember/service";
import Form from "discourse/components/form";
import { ajax } from "discourse/lib/ajax";
@@ -13,11 +12,8 @@ export default class AdminCreateLeaderboard extends Component {
@service router;
@service toasts;
- @tracked newLeaderboardName = "";
@tracked loading = false;
- @readOnly("newLeaderboardName") nameValid;
-
get formData() {
return { name: "", created_by_id: this.currentUser.id };
}
diff --git a/plugins/discourse-gamification/assets/javascripts/discourse/components/modal/recalculate-scores-form.gjs b/plugins/discourse-gamification/assets/javascripts/discourse/components/modal/recalculate-scores-form.gjs
index 6c21b210d3e..a4b4d70a4cd 100644
--- a/plugins/discourse-gamification/assets/javascripts/discourse/components/modal/recalculate-scores-form.gjs
+++ b/plugins/discourse-gamification/assets/javascripts/discourse/components/modal/recalculate-scores-form.gjs
@@ -20,7 +20,6 @@ export default class RecalculateScoresForm extends Component {
@tracked updateRangeValue = 0;
@tracked recalculateFromDate = "";
- @tracked haveAvailability = this.args.model.recalculate_scores_remaining > 0;
@tracked remaining = this.args.model.recalculate_scores_remaining;
@tracked status = "initial";
@@ -75,16 +74,15 @@ export default class RecalculateScoresForm extends Component {
}
get applyDisabled() {
- if (!this.haveAvailability || this.status !== "initial") {
+ const haveAvailability = this.args.model.recalculate_scores_remaining > 0;
+ if (!haveAvailability || this.status !== "initial") {
return true;
- } else if (
+ }
+
+ return (
this.updateRangeValue === 5 &&
this.recalculateFromDate <= moment().locale("en").utc().endOf("day")
- ) {
- return true;
- } else {
- return false;
- }
+ );
}
get dateRange() {
diff --git a/plugins/discourse-hcaptcha/assets/javascripts/discourse/components/h-captcha.gjs b/plugins/discourse-hcaptcha/assets/javascripts/discourse/components/h-captcha.gjs
index 5498434b43a..f3a72531e1e 100644
--- a/plugins/discourse-hcaptcha/assets/javascripts/discourse/components/h-captcha.gjs
+++ b/plugins/discourse-hcaptcha/assets/javascripts/discourse/components/h-captcha.gjs
@@ -12,7 +12,6 @@ export default class HCaptcha extends Component {
@service hCaptchaService;
@tracked widgetId;
- @tracked invalid = true;
@tracked hCaptchaConfigError = "";
hCaptcha;
diff --git a/plugins/discourse-post-voting/assets/javascripts/discourse/components/post-voting-comment.gjs b/plugins/discourse-post-voting/assets/javascripts/discourse/components/post-voting-comment.gjs
index 7efc3614dca..059f4be4b33 100644
--- a/plugins/discourse-post-voting/assets/javascripts/discourse/components/post-voting-comment.gjs
+++ b/plugins/discourse-post-voting/assets/javascripts/discourse/components/post-voting-comment.gjs
@@ -23,7 +23,6 @@ export default class PostVotingComment extends Component {
@tracked isEditing = false;
@tracked isVoting = false;
- @tracked hidden = false;
get anchorId() {
return buildAnchorId(this.args.comment.id);
diff --git a/plugins/discourse-topic-voting/assets/javascripts/discourse/components/vote-box.gjs b/plugins/discourse-topic-voting/assets/javascripts/discourse/components/vote-box.gjs
index 71d1b1123f5..475b7f05f9d 100644
--- a/plugins/discourse-topic-voting/assets/javascripts/discourse/components/vote-box.gjs
+++ b/plugins/discourse-topic-voting/assets/javascripts/discourse/components/vote-box.gjs
@@ -15,7 +15,6 @@ export default class VoteBox extends Component {
@tracked votesAlert;
@tracked allowClick = true;
- @tracked initialVote = false;
@action
addVote() {
diff --git a/plugins/styleguide/assets/javascripts/discourse/components/sections/molecules/dialog.gjs b/plugins/styleguide/assets/javascripts/discourse/components/sections/molecules/dialog.gjs
index 51e3dbbefff..58b6b634b58 100644
--- a/plugins/styleguide/assets/javascripts/discourse/components/sections/molecules/dialog.gjs
+++ b/plugins/styleguide/assets/javascripts/discourse/components/sections/molecules/dialog.gjs
@@ -1,5 +1,4 @@
import Component from "@glimmer/component";
-import { tracked } from "@glimmer/tracking";
import { fn, hash } from "@ember/helper";
import { action } from "@ember/object";
import { service } from "@ember/service";
@@ -10,11 +9,11 @@ import StyleguideExample from "discourse/plugins/styleguide/discourse/components
export default class Dialogs extends Component {
@service dialog;
- @tracked alertOutput = "";
- @tracked deleteConfirmOutput = "";
- @tracked noticeOutput = "";
- @tracked confirmOutput = "";
- @tracked yesNoConfirmOutput = "";
+ alertOutput = "";
+ deleteConfirmOutput = "";
+ noticeOutput = "";
+ confirmOutput = "";
+ yesNoConfirmOutput = "";
@action
async openDialog(dialog = {}) {
diff --git a/plugins/styleguide/assets/javascripts/discourse/components/styleguide/calendar-date-time-input.gjs b/plugins/styleguide/assets/javascripts/discourse/components/styleguide/calendar-date-time-input.gjs
index 06dad984920..def9617826b 100644
--- a/plugins/styleguide/assets/javascripts/discourse/components/styleguide/calendar-date-time-input.gjs
+++ b/plugins/styleguide/assets/javascripts/discourse/components/styleguide/calendar-date-time-input.gjs
@@ -10,11 +10,11 @@ import Row from "discourse/plugins/styleguide/discourse/components/styleguide/co
import StyleguideExample from "discourse/plugins/styleguide/discourse/components/styleguide-example";
export default class StyleguideCalendarDateTimeInput extends Component {
- @tracked dateFormat = "YYYY-MM-DD";
- @tracked timeFormat = "HH:mm:ss";
@tracked date = null;
@tracked time = null;
@tracked minDate = null;
+ dateFormat = "YYYY-MM-DD";
+ timeFormat = "HH:mm:ss";
@action
changeDate(date) {