Skip to content
This repository was archived by the owner on Jul 14, 2025. It is now read-only.

Commit bcbbd31

Browse files
authored
DEV: Update linting config and run gjs-codemod (#122)
1 parent 5389dbd commit bcbbd31

File tree

7 files changed

+532
-526
lines changed

7 files changed

+532
-526
lines changed

.discourse-compatibility

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
< 3.5.0.beta5-dev: e9e5eaf547376028c62b7bb15c3dbc7b0033e79b
12
< 3.5.0.beta1-dev: 0d24cfa4aeedc224cb35749341b6188095701c5f
23
< 3.4.0.beta1-dev: 61680042bd47918964bc70c879936c69241950d8
34
< 3.3.0.beta1-dev: 9d107d791aaad17f3d99eea98a170efe5e23fe22

Gemfile.lock

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,42 +14,44 @@ GEM
1414
securerandom (>= 0.3)
1515
tzinfo (~> 2.0, >= 2.0.5)
1616
uri (>= 0.13.1)
17-
ast (2.4.2)
18-
base64 (0.2.0)
19-
benchmark (0.4.0)
20-
bigdecimal (3.1.9)
17+
ast (2.4.3)
18+
base64 (0.3.0)
19+
benchmark (0.4.1)
20+
bigdecimal (3.2.0)
2121
concurrent-ruby (1.3.5)
22-
connection_pool (2.5.0)
23-
drb (2.2.1)
22+
connection_pool (2.5.3)
23+
drb (2.2.3)
2424
i18n (1.14.7)
2525
concurrent-ruby (~> 1.0)
26-
json (2.10.2)
27-
language_server-protocol (3.17.0.4)
26+
json (2.12.2)
27+
language_server-protocol (3.17.0.5)
2828
lint_roller (1.1.0)
29-
logger (1.6.6)
29+
logger (1.7.0)
3030
minitest (5.25.5)
31-
parallel (1.26.3)
32-
parser (3.3.7.1)
31+
parallel (1.27.0)
32+
parser (3.3.8.0)
3333
ast (~> 2.4.1)
3434
racc
3535
prettier_print (1.2.1)
36+
prism (1.4.0)
3637
racc (1.8.1)
37-
rack (3.1.12)
38+
rack (3.1.15)
3839
rainbow (3.1.1)
3940
regexp_parser (2.10.0)
40-
rubocop (1.74.0)
41+
rubocop (1.75.8)
4142
json (~> 2.3)
4243
language_server-protocol (~> 3.17.0.2)
4344
lint_roller (~> 1.1.0)
4445
parallel (~> 1.10)
4546
parser (>= 3.3.0.2)
4647
rainbow (>= 2.2.2, < 4.0)
4748
regexp_parser (>= 2.9.3, < 3.0)
48-
rubocop-ast (>= 1.38.0, < 2.0)
49+
rubocop-ast (>= 1.44.0, < 2.0)
4950
ruby-progressbar (~> 1.7)
5051
unicode-display_width (>= 2.4.0, < 4.0)
51-
rubocop-ast (1.38.1)
52-
parser (>= 3.3.1.0)
52+
rubocop-ast (1.44.1)
53+
parser (>= 3.3.7.2)
54+
prism (~> 1.4)
5355
rubocop-capybara (2.22.1)
5456
lint_roller (~> 1.1)
5557
rubocop (~> 1.72, >= 1.72.1)
@@ -65,13 +67,13 @@ GEM
6567
rubocop-factory_bot (2.27.1)
6668
lint_roller (~> 1.1)
6769
rubocop (~> 1.72, >= 1.72.1)
68-
rubocop-rails (2.30.3)
70+
rubocop-rails (2.32.0)
6971
activesupport (>= 4.2.0)
7072
lint_roller (~> 1.1)
7173
rack (>= 1.1)
72-
rubocop (>= 1.72.1, < 2.0)
73-
rubocop-ast (>= 1.38.0, < 2.0)
74-
rubocop-rspec (3.5.0)
74+
rubocop (>= 1.75.0, < 2.0)
75+
rubocop-ast (>= 1.44.0, < 2.0)
76+
rubocop-rspec (3.6.0)
7577
lint_roller (~> 1.1)
7678
rubocop (~> 1.72, >= 1.72.1)
7779
rubocop-rspec_rails (2.31.0)
@@ -97,4 +99,4 @@ DEPENDENCIES
9799
syntax_tree
98100

99101
BUNDLED WITH
100-
2.6.6
102+
2.6.9
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import Component from "@ember/component";
2+
import { action } from "@ember/object";
3+
import { classNames, tagName } from "@ember-decorators/component";
4+
import DButton from "discourse/components/d-button";
5+
import { ajax } from "discourse/lib/ajax";
6+
import { i18n } from "discourse-i18n";
7+
8+
@tagName("span")
9+
@classNames("after-topic-footer-buttons-outlet", "zendesk-topic-actions")
10+
export default class ZendeskTopicActions extends Component {
11+
init() {
12+
super.init(...arguments);
13+
const zendesk_id = this.topic.get("discourse_zendesk_plugin_zendesk_id");
14+
if (zendesk_id && zendesk_id !== "") {
15+
this.set("zendesk_id", zendesk_id);
16+
}
17+
this.setProperties({
18+
zendesk_url: this.topic.get("discourse_zendesk_plugin_zendesk_url"),
19+
valid_zendesk_credential: this.get(
20+
"currentUser.discourse_zendesk_plugin_status"
21+
),
22+
});
23+
}
24+
25+
@action
26+
createZendeskIssue() {
27+
let self = this;
28+
self.set("dirty", true);
29+
ajax("/zendesk-plugin/issues", {
30+
type: "POST",
31+
data: {
32+
topic_id: this.get("topic").get("id"),
33+
},
34+
}).then((topic) => {
35+
self.setProperties({
36+
zendesk_id: topic.discourse_zendesk_plugin_zendesk_id,
37+
zendesk_url: topic.discourse_zendesk_plugin_zendesk_url,
38+
});
39+
});
40+
}
41+
42+
<template>
43+
{{#if this.currentUser.staff}}
44+
{{#if this.valid_zendesk_credential}}
45+
{{#if this.zendesk_id}}
46+
<a
47+
href={{this.zendesk_url}}
48+
target="_blank"
49+
class="btn-primary btn"
50+
rel="noopener noreferrer"
51+
>
52+
<i class="fa fa-clone"></i>
53+
{{i18n "topic.view_zendesk_issue"}}
54+
</a>
55+
{{else}}
56+
<DButton
57+
class="btn-primary"
58+
@action={{action "createZendeskIssue"}}
59+
@label="topic.create_zendesk_issue"
60+
@disabled={{this.dirty}}
61+
/>
62+
{{/if}}
63+
{{else}}
64+
<p>{{i18n "zendesk.credentials_not_setup"}}</p>
65+
{{/if}}
66+
{{/if}}
67+
</template>
68+
}

assets/javascripts/discourse-zendesk-plugin/connectors/after-topic-footer-buttons/zendesk-topic-actions.hbs

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

assets/javascripts/discourse-zendesk-plugin/connectors/after-topic-footer-buttons/zendesk-topic-actions.js

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

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"private": true,
33
"devDependencies": {
4-
"@discourse/lint-configs": "2.11.1",
5-
"ember-template-lint": "7.0.1",
6-
"eslint": "9.22.0",
4+
"@discourse/lint-configs": "2.23.0",
5+
"ember-template-lint": "7.7.0",
6+
"eslint": "9.28.0",
77
"prettier": "3.5.3",
8-
"stylelint": "16.16.0"
8+
"stylelint": "16.20.0"
99
},
1010
"engines": {
1111
"node": ">= 22",

0 commit comments

Comments
 (0)