Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEV: Resolve deprecated use of registerConnectorClass #262

Merged
merged 1 commit into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<LinkTo @route="userActivity.solved">
{{d-icon "check-square"}}
{{i18n "solved.title"}}
</LinkTo>
{{#if this.siteSettings.solved_enabled}}
<li class="user-activity-bottom-outlet solved-list">
<LinkTo @route="userActivity.solved">
{{d-icon "check-square"}}
{{i18n "solved.title"}}
</LinkTo>
</li>
{{/if}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import Component from "@glimmer/component";
import { inject as service } from "@ember/service";

export default class SolvedList extends Component {
@service siteSettings;
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<LinkTo @route="userActivity.solved">
<UserStat
@value={{model.solved_count}}
@label="solved.solution_summary"
@icon="check-square"
/>
</LinkTo>
{{#if (and this.siteSettings.solved_enabled @outletArgs.solved_count)}}
<li class="user-summary-stat-outlet solved-count">
<LinkTo @route="userActivity.solved">
<UserStat
@value={{@outletArgs.model.solved_count}}
@label="solved.solution_summary"
@icon="check-square"
/>
</LinkTo>
</li>
{{/if}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import Component from "@glimmer/component";
import { inject as service } from "@ember/service";

export default class SolvedCount extends Component {
@service siteSettings;
}
Original file line number Diff line number Diff line change
Expand Up @@ -188,24 +188,6 @@ function initializeWithApi(api) {
this.appEvents.trigger("post-stream:refresh", { id: p.id });
});
});

if (api.registerConnectorClass) {
api.registerConnectorClass("user-activity-bottom", "solved-list", {
shouldRender(args, component) {
return component.siteSettings.solved_enabled;
},
});
api.registerConnectorClass("user-summary-stat", "solved-count", {
shouldRender(args, component) {
return (
component.siteSettings.solved_enabled && args.model.solved_count > 0
);
},
setupComponent() {
this.set("classNames", ["linked-stat"]);
},
});
}
}

export default {
Expand Down