DEV: Resolve deprecated use of `registerConnectorClass` (#262)
This commit is contained in:
parent
82b219699d
commit
8352a79145
|
@ -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}}
|
|
@ -0,0 +1,6 @@
|
|||
import Component from "@glimmer/component";
|
||||
import { inject as service } from "@ember/service";
|
||||
|
||||
export default class SolvedList extends Component {
|
||||
@service siteSettings;
|
||||
}
|
|
@ -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}}
|
|
@ -0,0 +1,6 @@
|
|||
import Component from "@glimmer/component";
|
||||
import { inject as service } from "@ember/service";
|
||||
|
||||
export default class SolvedCount extends Component {
|
||||
@service siteSettings;
|
||||
}
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue