DEV: Update js linting setup (#25365)

This commit is contained in:
Jarek Radosz
2024-01-24 15:30:03 +01:00
committed by GitHub
parent 8ca2aef556
commit 57c4b6bd50
23 changed files with 500 additions and 238 deletions

View File

@ -1,5 +1,5 @@
export default function () {
this.route("chat", { path: "/chat" }, function () {
this.route("chat", function () {
this.route("channel", { path: "/c/:channelTitle/:channelId" }, function () {
this.route("near-message", { path: "/:messageId" });
this.route("threads", { path: "/t" });
@ -8,24 +8,24 @@ export default function () {
});
});
this.route("direct-messages", { path: "/direct-messages" });
this.route("channels", { path: "/channels" });
this.route("threads", { path: "/threads" });
this.route("direct-messages");
this.route("channels");
this.route("threads");
this.route(
"channel.info",
{ path: "/c/:channelTitle/:channelId/info" },
function () {
this.route("members", { path: "/members" });
this.route("settings", { path: "/settings" });
this.route("members");
this.route("settings");
}
);
this.route("browse", { path: "/browse" }, function () {
this.route("all", { path: "/all" });
this.route("closed", { path: "/closed" });
this.route("open", { path: "/open" });
this.route("archived", { path: "/archived" });
this.route("browse", function () {
this.route("all");
this.route("closed");
this.route("open");
this.route("archived");
});
this.route("message", { path: "/message/:messageId" });
});

View File

@ -1,8 +1,7 @@
import Component from "@glimmer/component";
import ChannelTitle from "discourse/plugins/chat/discourse/components/channel-title";
export default class OldChatChannelTitle extends Component {
<template>
<ChannelTitle @channel={{@channel}} />
</template>
}
const OldChatChannelTitle = <template>
<ChannelTitle @channel={{@channel}} />
</template>;
export default OldChatChannelTitle;

View File

@ -25,21 +25,25 @@ export default class ChatFooter extends Component {
<nav class="c-footer" {{this.updateThreadCount}}>
<DButton
@route="chat.channels"
@class={{concatClass
@icon="comments"
@translatedLabel={{i18n "chat.channel_list.title"}}
aria-label={{i18n "chat.channel_list.aria_label"}}
id="c-footer-channels"
class={{concatClass
"btn-flat"
"c-footer__item"
(if (eq this.router.currentRouteName "chat.channels") "--active")
}}
@icon="comments"
@id="c-footer-channels"
@translatedLabel={{i18n "chat.channel_list.title"}}
aria-label={{i18n "chat.channel_list.aria_label"}}
/>
{{#if this.directMessagesEnabled}}
<DButton
@route="chat.direct-messages"
@class={{concatClass
@icon="users"
@translatedLabel={{i18n "chat.direct_messages.title"}}
aria-label={{i18n "chat.direct_messages.aria_label"}}
id="c-footer-direct-messages"
class={{concatClass
"btn-flat"
"c-footer__item"
(if
@ -47,25 +51,21 @@ export default class ChatFooter extends Component {
"--active"
)
}}
@icon="users"
@id="c-footer-direct-messages"
@translatedLabel={{i18n "chat.direct_messages.title"}}
aria-label={{i18n "chat.direct_messages.aria_label"}}
/>
{{/if}}
{{#if this.threadsEnabled}}
<DButton
@route="chat.threads"
@class={{concatClass
@icon="discourse-threads"
@translatedLabel={{i18n "chat.my_threads.title"}}
aria-label={{i18n "chat.my_threads.aria_label"}}
id="c-footer-threads"
class={{concatClass
"btn-flat"
"c-footer__item"
(if (eq this.router.currentRouteName "chat.threads") "--active")
}}
@icon="discourse-threads"
@id="c-footer-threads"
@translatedLabel={{i18n "chat.my_threads.title"}}
aria-label={{i18n "chat.my_threads.aria_label"}}
/>
{{/if}}
</nav>

View File

@ -61,11 +61,10 @@ export default class ChatMessage extends Component {
@service chatChannelsManager;
@service router;
@service toasts;
@optionalService adminTools;
@tracked isActive = false;
@optionalService adminTools;
toggleCheckIfPossible = modifier((element) => {
let addedListener = false;

View File

@ -73,10 +73,10 @@ export default class ChatDrawerRoutesChannelThread extends Component {
@routeModels={{this.backButton.models}}
/>
<navbar.Title @title={{this.threadTitle}} @icon="discourse-threads" />
<navbar.Actions as |action|>
<action.ToggleDrawerButton />
<action.FullPageButton />
<action.CloseDrawerButton />
<navbar.Actions as |a|>
<a.ToggleDrawerButton />
<a.FullPageButton />
<a.CloseDrawerButton />
</navbar.Actions>
</Navbar>

View File

@ -48,10 +48,10 @@ export default class ChatDrawerRoutesChannelThreads extends Component {
@routeModels={{this.chat.activeChannel.routeModels}}
/>
<navbar.Title @title={{this.title}} @icon="discourse-threads" />
<navbar.Actions as |action|>
<action.ToggleDrawerButton />
<action.FullPageButton />
<action.CloseDrawerButton />
<navbar.Actions as |a|>
<a.ToggleDrawerButton />
<a.FullPageButton />
<a.CloseDrawerButton />
</navbar.Actions>
</Navbar>
{{/if}}

View File

@ -29,11 +29,11 @@ export default class ChatDrawerRoutesChannel extends Component {
<Navbar @onClick={{this.chat.toggleDrawer}} as |navbar|>
<navbar.BackButton />
<navbar.ChannelTitle @channel={{this.chat.activeChannel}} />
<navbar.Actions as |action|>
<action.ThreadsListButton @channel={{this.chat.activeChannel}} />
<action.ToggleDrawerButton />
<action.FullPageButton />
<action.CloseDrawerButton />
<navbar.Actions as |a|>
<a.ThreadsListButton @channel={{this.chat.activeChannel}} />
<a.ToggleDrawerButton />
<a.FullPageButton />
<a.CloseDrawerButton />
</navbar.Actions>
</Navbar>

View File

@ -1,9 +1,7 @@
import Component from "@glimmer/component";
const EmptyState = <template>
<div class="c-list-empty-state" ...attributes>
{{yield}}
</div>
</template>;
export default class EmptyState extends Component {
<template>
<div class="c-list-empty-state" ...attributes>
{{yield}}
</div>
</template>
}
export default EmptyState;

View File

@ -1,7 +1,3 @@
import Component from "@glimmer/component";
const Item = <template>{{yield @item}}</template>;
export default class Item extends Component {
<template>
{{yield @item}}
</template>
}
export default Item;

View File

@ -57,7 +57,7 @@ export default class ChatNavbarThreadTrackingDropdown extends Component {
<ThreadTrackingDropdown
@value={{this.threadNotificationLevel}}
@onChange={{this.updateThreadNotificationLevel}}
@class={{concatClass
class={{concatClass
"c-navbar__thread-tracking-dropdown"
(if this.persistedNotificationLevel "-persisted")
}}

View File

@ -28,7 +28,7 @@ export default class ChatRoutesBrowse extends Component {
get channelsCollection() {
return this.chatApi.channels({
filter: this.filter,
status: this.attrs.status,
status: this.status,
});
}
@ -68,8 +68,8 @@ export default class ChatRoutesBrowse extends Component {
<navbar.BackButton />
<navbar.Title @title={{i18n "chat.browse.title"}} />
<navbar.Actions as |action|>
<action.NewChannelButton />
<navbar.Actions as |a|>
<a.NewChannelButton />
</navbar.Actions>
</Navbar>

View File

@ -1,20 +1,19 @@
import Component from "@glimmer/component";
import { array } from "@ember/helper";
import ThreadHeader from "discourse/plugins/chat/discourse/components/chat/thread/header";
import Thread from "discourse/plugins/chat/discourse/components/chat-thread";
export default class ChatRoutesChannelThread extends Component {
<template>
<div class="c-routes-channel-thread">
{{#each (array @thread) as |thread|}}
<ThreadHeader @thread={{thread}} />
const ChatRoutesChannelThread = <template>
<div class="c-routes-channel-thread">
{{#each (array @thread) as |thread|}}
<ThreadHeader @thread={{thread}} />
<Thread
@thread={{thread}}
@targetMessageId={{@targetMessageId}}
@includeHeader={{true}}
/>
{{/each}}
</div>
</template>
}
<Thread
@thread={{thread}}
@targetMessageId={{@targetMessageId}}
@includeHeader={{true}}
/>
{{/each}}
</div>
</template>;
export default ChatRoutesChannelThread;

View File

@ -1,12 +1,11 @@
import Component from "@glimmer/component";
import ChatThreadListHeader from "discourse/plugins/chat/discourse/components/chat/thread-list/header";
import ChatThreadList from "discourse/plugins/chat/discourse/components/chat-thread-list";
export default class ChatRoutesChannelThreads extends Component {
<template>
<div class="c-routes-channel-threads">
<ChatThreadListHeader @channel={{@channel}} />
<ChatThreadList @channel={{@channel}} @includeHeader={{true}} />
</div>
</template>
}
const ChatRoutesChannelThreads = <template>
<div class="c-routes-channel-threads">
<ChatThreadListHeader @channel={{@channel}} />
<ChatThreadList @channel={{@channel}} @includeHeader={{true}} />
</div>
</template>;
export default ChatRoutesChannelThreads;