Skip to content

Commit

Permalink
DEV: Bump dependencies and fix linting (#232)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaylorhq authored Feb 6, 2025
1 parent 8525495 commit 0ce7b57
Show file tree
Hide file tree
Showing 12 changed files with 797 additions and 641 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { service } from "@ember/service";
import FlagModal from "discourse/components/modal/flag";
import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error";
import I18n from "I18n";
import { i18n } from "discourse-i18n";
import PostVotingFlag from "../lib/post-voting-flag";

export default class PostVotingCommentActions extends Component {
Expand Down Expand Up @@ -39,7 +39,7 @@ export default class PostVotingCommentActions extends Component {
@action
deleteConfirm() {
this.dialog.deleteConfirm({
message: I18n.t("post_voting.post.post_voting_comment.delete.confirm"),
message: i18n("post_voting.post.post_voting_comment.delete.confirm"),
didConfirm: () => {
const data = { comment_id: this.args.id };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking";
import { action } from "@ember/object";
import { service } from "@ember/service";
import I18n from "I18n";
import { i18n } from "discourse-i18n";

export default class PostVotingCommentComposer extends Component {
@service siteSettings;
Expand All @@ -17,15 +17,15 @@ export default class PostVotingCommentComposer extends Component {

get errorMessage() {
if (this.value.length < this.siteSettings.min_post_length) {
return I18n.t("post_voting.post.post_voting_comment.composer.too_short", {
return i18n("post_voting.post.post_voting_comment.composer.too_short", {
count: this.siteSettings.min_post_length,
});
}

if (
this.value.length > this.siteSettings.post_voting_comment_max_raw_length
) {
return I18n.t("post_voting.post.post_voting_comment.composer.too_long", {
return i18n("post_voting.post.post_voting_comment.composer.too_long", {
count: this.siteSettings.post_voting_comment_max_raw_length,
});
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { observes } from "discourse/lib/decorators";
import { withPluginApi } from "discourse/lib/plugin-api";
import { CREATE_TOPIC } from "discourse/models/composer";
import { observes } from "discourse-common/utils/decorators";
import I18n from "I18n";
import { i18n } from "discourse-i18n";

export default {
name: "extend-composer-actions",
Expand All @@ -23,9 +23,9 @@ export default {
api.customizeComposerText({
actionTitle(model) {
if (model.createAsPostVoting || model.onlyPostVotingInThisCategory) {
return I18n.t("composer.create_post_voting.label");
return i18n("composer.create_post_voting.label");
} else if (model.topic?.is_post_voting) {
return I18n.t("post_voting.topic.answer.label");
return i18n("post_voting.topic.answer.label");
} else {
return null;
}
Expand Down Expand Up @@ -60,10 +60,10 @@ export default {
) {
return [
{
name: I18n.t(
name: i18n(
"composer.composer_actions.remove_as_post_voting.label"
),
description: I18n.t(
description: i18n(
"composer.composer_actions.remove_as_post_voting.desc"
),
icon: "plus",
Expand All @@ -75,10 +75,10 @@ export default {
} else {
return [
{
name: I18n.t(
name: i18n(
"composer.composer_actions.create_as_post_voting.label"
),
description: I18n.t(
description: i18n(
"composer.composer_actions.create_as_post_voting.desc"
),
icon: "plus",
Expand Down
12 changes: 6 additions & 6 deletions assets/javascripts/discourse/initializers/post-voting-edits.gjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Component from "@glimmer/component";
import { withSilencedDeprecations } from "discourse/lib/deprecated";
import { withPluginApi } from "discourse/lib/plugin-api";
import { withSilencedDeprecations } from "discourse-common/lib/deprecated";
import I18n from "I18n";
import { i18n } from "discourse-i18n";
import PostVotingAnswerButton from "../components/post-voting-answer-button";
import PostVotingComments from "../components/post-voting-comments";

Expand Down Expand Up @@ -106,13 +106,13 @@ function initPlugin(api, container) {
helper.h("div.post-voting-answers-header.small-action", [
helper.h(
"span.post-voting-answers-headers-count",
I18n.t("post_voting.topic.answer_count", { count: answersCount })
i18n("post_voting.topic.answer_count", { count: answersCount })
),
helper.h("span.post-voting-answers-headers-sort", [
helper.h("span", I18n.t("post_voting.topic.sort_by")),
helper.h("span", i18n("post_voting.topic.sort_by")),
helper.attach("button", {
action: "orderByVotes",
contents: I18n.t("post_voting.topic.votes"),
contents: i18n("post_voting.topic.votes"),
disabled: topicController.filter !== ORDER_BY_ACTIVITY_FILTER,
className: `post-voting-answers-headers-sort-votes ${
topicController.filter === ORDER_BY_ACTIVITY_FILTER
Expand All @@ -122,7 +122,7 @@ function initPlugin(api, container) {
}),
helper.attach("button", {
action: "orderByActivity",
contents: I18n.t("post_voting.topic.activity"),
contents: i18n("post_voting.topic.activity"),
disabled: topicController.filter === ORDER_BY_ACTIVITY_FILTER,
className: `post-voting-answers-headers-sort-activity ${
topicController.filter === ORDER_BY_ACTIVITY_FILTER
Expand Down
4 changes: 2 additions & 2 deletions assets/javascripts/discourse/initializers/post-voting-icon.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { withPluginApi } from "discourse/lib/plugin-api";
import { postUrl } from "discourse/lib/utilities";
import I18n from "I18n";
import { i18n } from "discourse-i18n";
import { buildAnchorId } from "../components/post-voting-comment";

export default {
Expand All @@ -18,7 +18,7 @@ export default {
(NotificationTypeBase) => {
return class extends NotificationTypeBase {
get linkTitle() {
return I18n.t(
return i18n(
"notifications.titles.question_answer_user_commented"
);
}
Expand Down
2 changes: 1 addition & 1 deletion assets/javascripts/discourse/widgets/post-voting-post.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { h } from "virtual-dom";
import { popupAjaxError } from "discourse/lib/ajax-error";
import { iconNode } from "discourse/lib/icon-library";
import { userPath } from "discourse/lib/url";
import { createWidget } from "discourse/widgets/widget";
import { iconNode } from "discourse-common/lib/icon-library";
import { castVote, removeVote, whoVoted } from "../lib/post-voting-utilities";

function smallUserAtts(user) {
Expand Down
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
{
"private": true,
"devDependencies": {
"@discourse/lint-configs": "2.2.2",
"ember-template-lint": "6.0.0",
"eslint": "9.15.0",
"@discourse/lint-configs": "2.4.0",
"ember-template-lint": "6.1.0",
"eslint": "9.19.0",
"prettier": "2.8.8"
},
"engines": {
"node": ">= 18",
"node": ">= 22",
"npm": "please-use-pnpm",
"yarn": "please-use-pnpm",
"pnpm": ">= 9"
}
"pnpm": "9.x"
},
"packageManager": "pnpm@9.15.5"
}
Loading

0 comments on commit 0ce7b57

Please sign in to comment.