Skip to content

Commit a47382b

Browse files
authored
DEV: Update linting config and run gjs-codemod (#258)
1 parent 464400f commit a47382b

30 files changed

+1297
-1188
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: d9103b11fcaa7ac201829dac824c6ea23f0495dd
12
< 3.5.0.beta1-dev: 29ad813cd04812786780e1706cbc043810dea7d8
23
< 3.4.0.beta2-dev: 5b8d8343329e1cd9668189b6cb6fdfd676f4a28d
34
< 3.4.0.beta1-dev: e19808d4ad3f7d16cd9b93f315ca586f694e6288

Gemfile.lock

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,42 +20,44 @@ GEM
2020
securerandom (>= 0.3)
2121
tzinfo (~> 2.0, >= 2.0.5)
2222
uri (>= 0.13.1)
23-
ast (2.4.2)
24-
base64 (0.2.0)
25-
benchmark (0.4.0)
26-
bigdecimal (3.1.9)
23+
ast (2.4.3)
24+
base64 (0.3.0)
25+
benchmark (0.4.1)
26+
bigdecimal (3.2.0)
2727
concurrent-ruby (1.3.5)
28-
connection_pool (2.5.0)
29-
drb (2.2.1)
28+
connection_pool (2.5.3)
29+
drb (2.2.3)
3030
i18n (1.14.7)
3131
concurrent-ruby (~> 1.0)
32-
json (2.10.2)
33-
language_server-protocol (3.17.0.4)
32+
json (2.12.2)
33+
language_server-protocol (3.17.0.5)
3434
lint_roller (1.1.0)
35-
logger (1.6.6)
35+
logger (1.7.0)
3636
minitest (5.25.5)
37-
parallel (1.26.3)
38-
parser (3.3.7.1)
37+
parallel (1.27.0)
38+
parser (3.3.8.0)
3939
ast (~> 2.4.1)
4040
racc
4141
prettier_print (1.2.1)
42+
prism (1.4.0)
4243
racc (1.8.1)
43-
rack (3.1.12)
44+
rack (3.1.15)
4445
rainbow (3.1.1)
4546
regexp_parser (2.10.0)
46-
rubocop (1.74.0)
47+
rubocop (1.75.8)
4748
json (~> 2.3)
4849
language_server-protocol (~> 3.17.0.2)
4950
lint_roller (~> 1.1.0)
5051
parallel (~> 1.10)
5152
parser (>= 3.3.0.2)
5253
rainbow (>= 2.2.2, < 4.0)
5354
regexp_parser (>= 2.9.3, < 3.0)
54-
rubocop-ast (>= 1.38.0, < 2.0)
55+
rubocop-ast (>= 1.44.0, < 2.0)
5556
ruby-progressbar (~> 1.7)
5657
unicode-display_width (>= 2.4.0, < 4.0)
57-
rubocop-ast (1.38.1)
58-
parser (>= 3.3.1.0)
58+
rubocop-ast (1.44.1)
59+
parser (>= 3.3.7.2)
60+
prism (~> 1.4)
5961
rubocop-capybara (2.22.1)
6062
lint_roller (~> 1.1)
6163
rubocop (~> 1.72, >= 1.72.1)
@@ -71,13 +73,13 @@ GEM
7173
rubocop-factory_bot (2.27.1)
7274
lint_roller (~> 1.1)
7375
rubocop (~> 1.72, >= 1.72.1)
74-
rubocop-rails (2.30.3)
76+
rubocop-rails (2.32.0)
7577
activesupport (>= 4.2.0)
7678
lint_roller (~> 1.1)
7779
rack (>= 1.1)
78-
rubocop (>= 1.72.1, < 2.0)
79-
rubocop-ast (>= 1.38.0, < 2.0)
80-
rubocop-rspec (3.5.0)
80+
rubocop (>= 1.75.0, < 2.0)
81+
rubocop-ast (>= 1.44.0, < 2.0)
82+
rubocop-rspec (3.6.0)
8183
lint_roller (~> 1.1)
8284
rubocop (~> 1.72, >= 1.72.1)
8385
rubocop-rspec_rails (2.31.0)
@@ -104,4 +106,4 @@ DEPENDENCIES
104106
translations-manager!
105107

106108
BUNDLED WITH
107-
2.6.6
109+
2.6.9
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { concat, get } from "@ember/helper";
2+
import { i18n } from "discourse-i18n";
3+
4+
const ChannelData = <template>
5+
{{#each @provider.channel_parameters as |param|}}
6+
{{#unless param.hidden}}
7+
<div class="channel-info">
8+
<span class="field-name">
9+
{{i18n
10+
(concat
11+
"chat_integration.provider."
12+
@channel.provider
13+
".param."
14+
param.key
15+
".title"
16+
)
17+
}}:
18+
</span>
19+
<span class="field-value">{{get @channel.data param.key}}</span>
20+
<br />
21+
</div>
22+
{{/unless}}
23+
{{/each}}
24+
</template>;
25+
26+
export default ChannelData;

admin/assets/javascripts/admin/components/channel-data.hbs

Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
import Component from "@glimmer/component";
2+
import { fn } from "@ember/helper";
3+
import { action } from "@ember/object";
4+
import { service } from "@ember/service";
5+
import DButton from "discourse/components/d-button";
6+
import { popupAjaxError } from "discourse/lib/ajax-error";
7+
import { i18n } from "discourse-i18n";
8+
import ChannelData from "./channel-data";
9+
import RuleRow from "./rule-row";
10+
11+
export default class ChannelDetails extends Component {
12+
@service dialog;
13+
@service siteSettings;
14+
15+
@action
16+
deleteChannel(channel) {
17+
this.dialog.deleteConfirm({
18+
message: i18n("chat_integration.channel_delete_confirm"),
19+
didConfirm: () => {
20+
return channel
21+
.destroyRecord()
22+
.then(() => this.args.refresh())
23+
.catch(popupAjaxError);
24+
},
25+
});
26+
}
27+
28+
<template>
29+
<div class="channel-details">
30+
<div class="channel-header">
31+
<div class="pull-right">
32+
<DButton
33+
@icon="pencil"
34+
@title="chat_integration.edit_channel"
35+
@label="chat_integration.edit_channel"
36+
@action={{fn @editChannel @channel}}
37+
/>
38+
39+
<DButton
40+
@icon="rocket"
41+
@title="chat_integration.test_channel"
42+
@label="chat_integration.test_channel"
43+
@action={{fn @test @channel}}
44+
class="btn-chat-test"
45+
/>
46+
47+
<DButton
48+
@icon="trash-can"
49+
@title="chat_integration.delete_channel"
50+
@label="chat_integration.delete_channel"
51+
@action={{fn this.deleteChannel @channel}}
52+
class="cancel delete-channel"
53+
/>
54+
</div>
55+
56+
<span class="channel-title">
57+
{{#if @channel.error_key}}
58+
<DButton
59+
@icon="triangle-exclamation"
60+
@action={{fn @showError @channel}}
61+
class="delete btn-danger"
62+
/>
63+
{{/if}}
64+
65+
<ChannelData @provider={{@provider}} @channel={{@channel}} />
66+
</span>
67+
</div>
68+
<div class="channel-body">
69+
<table>
70+
<thead>
71+
<tr>
72+
<th>{{i18n "chat_integration.rule_table.filter"}}</th>
73+
<th>{{i18n "chat_integration.rule_table.category"}}</th>
74+
75+
{{#if this.siteSettings.tagging_enabled}}
76+
<th>{{i18n "chat_integration.rule_table.tags"}}</th>
77+
{{/if}}
78+
79+
<th></th>
80+
</tr>
81+
</thead>
82+
83+
<tbody>
84+
{{#each @channel.rules as |rule|}}
85+
<RuleRow
86+
@rule={{rule}}
87+
@edit={{fn @editRuleWithChannel rule @channel}}
88+
@refresh={{@refresh}}
89+
/>
90+
{{/each}}
91+
</tbody>
92+
</table>
93+
</div>
94+
95+
<div class="channel-footer">
96+
<div class="pull-right">
97+
<DButton
98+
@icon="plus"
99+
@title="chat_integration.create_rule"
100+
@label="chat_integration.create_rule"
101+
@action={{fn @createRule @channel}}
102+
/>
103+
</div>
104+
</div>
105+
</div>
106+
</template>
107+
}

admin/assets/javascripts/admin/components/channel-details.hbs

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

admin/assets/javascripts/admin/components/channel-details.js

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

0 commit comments

Comments
 (0)