Skip to content

Commit 04d210b

Browse files
FIX: Related setting toggle on what's new page for admins (#36646)
Followup d4ac43e A regression was introduced in the above commit where an `enabled` param was added to `UpcomingChanges::Toggle`, which is also used by the what's new feature feed items. When using the toggle, admins would get this message: > An error occurred: Enabled is not included in the list This regression was not caught because there was no system spec coverage for this toggle in the what's new feed. This commit fixes the issue and adds coverage.
1 parent 5db480d commit 04d210b

File tree

4 files changed

+299
-214
lines changed

4 files changed

+299
-214
lines changed

frontend/discourse/admin/components/dashboard-new-feature-item.gjs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { tracked } from "@glimmer/tracking";
33
import { on } from "@ember/modifier";
44
import { action } from "@ember/object";
55
import { service } from "@ember/service";
6+
import { dasherize } from "@ember/string";
67
import { htmlSafe } from "@ember/template";
78
import CookText from "discourse/components/cook-text";
89
import DToggleSwitch from "discourse/components/d-toggle-switch";
@@ -20,6 +21,10 @@ export default class DiscourseNewFeatureItem extends Component {
2021
@tracked toggleSettingDisabled = false;
2122
@tracked isExperiment = this.args.item.experiment;
2223

24+
get identifier() {
25+
return dasherize(this.args.item.title);
26+
}
27+
2328
@action
2429
async toggleExperiment() {
2530
if (this.toggleSettingDisabled) {
@@ -42,6 +47,7 @@ export default class DiscourseNewFeatureItem extends Component {
4247
type: "POST",
4348
data: {
4449
setting_name: this.args.item.related_site_setting,
50+
enabled: this.settingEnabled,
4551
},
4652
});
4753

@@ -101,7 +107,10 @@ export default class DiscourseNewFeatureItem extends Component {
101107
}
102108

103109
<template>
104-
<div class="admin-new-feature-item">
110+
<div
111+
class="admin-new-feature-item"
112+
data-new-feature-identifier={{this.identifier}}
113+
>
105114
<div class="admin-new-feature-item__content">
106115
<div class="admin-new-feature-item__header">
107116
{{#if (and @item.emoji (not @item.screenshot_url))}}

spec/system/admin_dashboard_new_features_spec.rb

Lines changed: 0 additions & 204 deletions
This file was deleted.

0 commit comments

Comments
 (0)