Skip to content
This repository was archived by the owner on Jul 14, 2025. It is now read-only.
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
1 change: 1 addition & 0 deletions .discourse-compatibility
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
< 3.5.0.beta5-dev: d9103b11fcaa7ac201829dac824c6ea23f0495dd
< 3.5.0.beta1-dev: 29ad813cd04812786780e1706cbc043810dea7d8
< 3.4.0.beta2-dev: 5b8d8343329e1cd9668189b6cb6fdfd676f4a28d
< 3.4.0.beta1-dev: e19808d4ad3f7d16cd9b93f315ca586f694e6288
Expand Down
44 changes: 23 additions & 21 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20,42 +20,44 @@ GEM
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
uri (>= 0.13.1)
ast (2.4.2)
base64 (0.2.0)
benchmark (0.4.0)
bigdecimal (3.1.9)
ast (2.4.3)
base64 (0.3.0)
benchmark (0.4.1)
bigdecimal (3.2.0)
concurrent-ruby (1.3.5)
connection_pool (2.5.0)
drb (2.2.1)
connection_pool (2.5.3)
drb (2.2.3)
i18n (1.14.7)
concurrent-ruby (~> 1.0)
json (2.10.2)
language_server-protocol (3.17.0.4)
json (2.12.2)
language_server-protocol (3.17.0.5)
lint_roller (1.1.0)
logger (1.6.6)
logger (1.7.0)
minitest (5.25.5)
parallel (1.26.3)
parser (3.3.7.1)
parallel (1.27.0)
parser (3.3.8.0)
ast (~> 2.4.1)
racc
prettier_print (1.2.1)
prism (1.4.0)
racc (1.8.1)
rack (3.1.12)
rack (3.1.15)
rainbow (3.1.1)
regexp_parser (2.10.0)
rubocop (1.74.0)
rubocop (1.75.8)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.38.0, < 2.0)
rubocop-ast (>= 1.44.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.38.1)
parser (>= 3.3.1.0)
rubocop-ast (1.44.1)
parser (>= 3.3.7.2)
prism (~> 1.4)
rubocop-capybara (2.22.1)
lint_roller (~> 1.1)
rubocop (~> 1.72, >= 1.72.1)
Expand All @@ -71,13 +73,13 @@ GEM
rubocop-factory_bot (2.27.1)
lint_roller (~> 1.1)
rubocop (~> 1.72, >= 1.72.1)
rubocop-rails (2.30.3)
rubocop-rails (2.32.0)
activesupport (>= 4.2.0)
lint_roller (~> 1.1)
rack (>= 1.1)
rubocop (>= 1.72.1, < 2.0)
rubocop-ast (>= 1.38.0, < 2.0)
rubocop-rspec (3.5.0)
rubocop (>= 1.75.0, < 2.0)
rubocop-ast (>= 1.44.0, < 2.0)
rubocop-rspec (3.6.0)
lint_roller (~> 1.1)
rubocop (~> 1.72, >= 1.72.1)
rubocop-rspec_rails (2.31.0)
Expand All @@ -104,4 +106,4 @@ DEPENDENCIES
translations-manager!

BUNDLED WITH
2.6.6
2.6.9
26 changes: 26 additions & 0 deletions admin/assets/javascripts/admin/components/channel-data.gjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { concat, get } from "@ember/helper";
import { i18n } from "discourse-i18n";

const ChannelData = <template>
{{#each @provider.channel_parameters as |param|}}
{{#unless param.hidden}}
<div class="channel-info">
<span class="field-name">
{{i18n
(concat
"chat_integration.provider."
@channel.provider
".param."
param.key
".title"
)
}}:
</span>
<span class="field-value">{{get @channel.data param.key}}</span>
<br />
</div>
{{/unless}}
{{/each}}
</template>;

export default ChannelData;
19 changes: 0 additions & 19 deletions admin/assets/javascripts/admin/components/channel-data.hbs

This file was deleted.

107 changes: 107 additions & 0 deletions admin/assets/javascripts/admin/components/channel-details.gjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
import Component from "@glimmer/component";
import { fn } from "@ember/helper";
import { action } from "@ember/object";
import { service } from "@ember/service";
import DButton from "discourse/components/d-button";
import { popupAjaxError } from "discourse/lib/ajax-error";
import { i18n } from "discourse-i18n";
import ChannelData from "./channel-data";
import RuleRow from "./rule-row";

export default class ChannelDetails extends Component {
@service dialog;
@service siteSettings;

@action
deleteChannel(channel) {
this.dialog.deleteConfirm({
message: i18n("chat_integration.channel_delete_confirm"),
didConfirm: () => {
return channel
.destroyRecord()
.then(() => this.args.refresh())
.catch(popupAjaxError);
},
});
}

<template>
<div class="channel-details">
<div class="channel-header">
<div class="pull-right">
<DButton
@icon="pencil"
@title="chat_integration.edit_channel"
@label="chat_integration.edit_channel"
@action={{fn @editChannel @channel}}
/>

<DButton
@icon="rocket"
@title="chat_integration.test_channel"
@label="chat_integration.test_channel"
@action={{fn @test @channel}}
class="btn-chat-test"
/>

<DButton
@icon="trash-can"
@title="chat_integration.delete_channel"
@label="chat_integration.delete_channel"
@action={{fn this.deleteChannel @channel}}
class="cancel delete-channel"
/>
</div>

<span class="channel-title">
{{#if @channel.error_key}}
<DButton
@icon="triangle-exclamation"
@action={{fn @showError @channel}}
class="delete btn-danger"
/>
{{/if}}

<ChannelData @provider={{@provider}} @channel={{@channel}} />
</span>
</div>
<div class="channel-body">
<table>
<thead>
<tr>
<th>{{i18n "chat_integration.rule_table.filter"}}</th>
<th>{{i18n "chat_integration.rule_table.category"}}</th>

{{#if this.siteSettings.tagging_enabled}}
<th>{{i18n "chat_integration.rule_table.tags"}}</th>
{{/if}}

<th></th>
</tr>
</thead>

<tbody>
{{#each @channel.rules as |rule|}}
<RuleRow
@rule={{rule}}
@edit={{fn @editRuleWithChannel rule @channel}}
@refresh={{@refresh}}
/>
{{/each}}
</tbody>
</table>
</div>

<div class="channel-footer">
<div class="pull-right">
<DButton
@icon="plus"
@title="chat_integration.create_rule"
@label="chat_integration.create_rule"
@action={{fn @createRule @channel}}
/>
</div>
</div>
</div>
</template>
}
77 changes: 0 additions & 77 deletions admin/assets/javascripts/admin/components/channel-details.hbs

This file was deleted.

23 changes: 0 additions & 23 deletions admin/assets/javascripts/admin/components/channel-details.js

This file was deleted.

Loading