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

Commit 9d7ecf4

Browse files
DEV: Update linting (#354)
1 parent 1d49fec commit 9d7ecf4

File tree

6 files changed

+273
-289
lines changed

6 files changed

+273
-289
lines changed

assets/javascripts/discourse/connectors/composer-action-after/encrypt.hbs

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
{{#if showEncryptControls}}
1+
{{#if this.showEncryptControls}}
22
<div class="encrypt-controls">
3-
{{#if isEncryptActive}}
3+
{{#if this.isEncryptActive}}
44
<a
55
href
66
{{action "clicked"}}
7-
title={{title}}
7+
title={{this.title}}
88
class="btn btn-default btn-icon no-text encrypt-toggle
9-
{{if model.isEncrypted 'enabled'}}
10-
{{if disabled 'disabled'}}"
9+
{{if this.model.isEncrypted 'enabled'}}
10+
{{if this.disabled 'disabled'}}"
1111
>
12-
{{d-icon (if model.isEncrypted "lock" "unlock")}}
12+
{{d-icon (if this.model.isEncrypted "lock" "unlock")}}
1313
</a>
1414

15-
{{~#if model.isEncrypted}}
16-
{{~#unless model.editingPost~}}
15+
{{~#if this.model.isEncrypted}}
16+
{{~#unless this.model.editingPost~}}
1717
<div
1818
class="composer-action-divider"
1919
></div>{{! inline to avoid whitespace}}<EncryptedPostTimerDropdown
@@ -34,10 +34,10 @@
3434
{{/unless}}
3535
{{/if}}
3636

37-
{{#if model.showEncryptError}}
38-
<span class="error">{{model.encryptError}}</span>
37+
{{#if this.model.showEncryptError}}
38+
<span class="error">{{this.model.encryptError}}</span>
3939
{{/if}}
40-
{{else if isEncryptEnabled}}
40+
{{else if this.isEncryptEnabled}}
4141
<span title={{i18n "encrypt.preferences.status_enabled_but_inactive"}}>
4242
{{d-icon "unlock" class="disabled"}}
4343
</span>

assets/javascripts/discourse/connectors/user-preferences-security/encrypt.hbs

+24-24
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
{{#if canEnableEncrypt}}
1+
{{#if this.canEnableEncrypt}}
22
<div class="control-group pref-title">
33
<label class="control-label">{{i18n "encrypt.title"}}</label>
44

5-
{{#if capabilities.isIE11}}
5+
{{#if this.capabilities.isIE11}}
66
<div class="alert alert-error">
77
<p>{{i18n "encrypt.preferences.ie11"}}</p>
88
</div>
9-
{{else if isInsecureContext}}
9+
{{else if this.isInsecureContext}}
1010
<div class="alert alert-error">
1111
<p>{{i18n "encrypt.preferences.insecure_context"}}</p>
1212
</div>
1313
{{else}}
1414
<div class="controls">
15-
{{#if isCurrentUser}}
16-
{{#if isEncryptEnabled}}
17-
{{#if isEncryptActive}}
15+
{{#if this.isCurrentUser}}
16+
{{#if this.isEncryptEnabled}}
17+
{{#if this.isEncryptActive}}
1818
<p>{{i18n "encrypt.preferences.status_enabled"}}</p>
1919
<fieldset class="control-group">
2020
<DButton
@@ -42,26 +42,26 @@
4242
</fieldset>
4343
<PreferenceCheckbox
4444
@labelKey="encrypt.preferences.encrypt_pms_default"
45-
@checked={{model.user_option.encrypt_pms_default}}
45+
@checked={{this.model.user_option.encrypt_pms_default}}
4646
/>
4747
<SaveControls
4848
@id="encrypt_preference_save"
49-
@model={{model}}
49+
@model={{this.model}}
5050
@action={{action "savePreference"}}
51-
@saved={{saved}}
51+
@saved={{this.saved}}
5252
/>
5353
{{else}}
5454
<form>
5555
<p>
5656
{{i18n "encrypt.preferences.status_enabled_but_inactive"}}
5757
</p>
5858

59-
{{#if importIdentity}}
59+
{{#if this.importIdentity}}
6060
{{html-safe (i18n "encrypt.preferences.notice_import")}}
6161
<Textarea
6262
class="imported-key-pair"
63-
@value={{identity}}
64-
placeholder={{identityPlaceholder}}
63+
@value={{this.identity}}
64+
placeholder={{this.identityPlaceholder}}
6565
/>
6666
{{else}}
6767
{{html-safe (i18n "encrypt.preferences.notice_active")}}
@@ -72,13 +72,13 @@
7272

7373
<Input
7474
@type="password"
75-
@value={{passphrase}}
75+
@value={{this.passphrase}}
7676
placeholder={{i18n
7777
"encrypt.preferences.paper_key_placeholder"
7878
}}
7979
id="passphrase"
8080
autocomplete="current-password"
81-
disabled={{inProgress}}
81+
disabled={{this.inProgress}}
8282
/>
8383
</p>
8484
{{/if}}
@@ -90,25 +90,25 @@
9090
@icon="unlock"
9191
@action={{action "activateEncrypt"}}
9292
@type="submit"
93-
@disabled={{inProgress}}
93+
@disabled={{this.inProgress}}
9494
@label="encrypt.preferences.activate"
9595
/>
9696
<EncryptEnableDropdown
97-
@isEncryptEnabled={{isEncryptEnabled}}
98-
@importIdentity={{importIdentity}}
97+
@isEncryptEnabled={{this.isEncryptEnabled}}
98+
@importIdentity={{this.importIdentity}}
9999
@onChange={{action "selectEncryptEnableDropdownAction"}}
100100
/>
101101
</p>
102102
</form>
103103
{{/if}}
104104
{{else}}
105105
<p>{{i18n "encrypt.preferences.status_disabled"}}</p>
106-
{{#if importIdentity}}
106+
{{#if this.importIdentity}}
107107
{{html-safe (i18n "encrypt.preferences.notice_import")}}
108108
<Textarea
109109
class="imported-key-pair"
110-
@value={{identity}}
111-
placeholder={{identityPlaceholder}}
110+
@value={{this.identity}}
111+
placeholder={{this.identityPlaceholder}}
112112
/>
113113
{{/if}}
114114

@@ -117,17 +117,17 @@
117117
id="enable-encrypted-messages"
118118
@icon="lock"
119119
@action={{action "enableEncrypt"}}
120-
@disabled={{inProgress}}
120+
@disabled={{this.inProgress}}
121121
@label="encrypt.preferences.enable"
122122
/>
123123
<EncryptEnableDropdown
124-
@isEncryptEnabled={{isEncryptEnabled}}
125-
@importIdentity={{importIdentity}}
124+
@isEncryptEnabled={{this.isEncryptEnabled}}
125+
@importIdentity={{this.importIdentity}}
126126
@onChange={{action "selectEncryptEnableDropdownAction"}}
127127
/>
128128
{{/if}}
129129
{{else}}
130-
{{#if isEncryptEnabled}}
130+
{{#if this.isEncryptEnabled}}
131131
<p>{{i18n "encrypt.preferences.status_enabled_other"}}</p>
132132
<p>
133133
<a

assets/javascripts/discourse/initializers/encrypt-drafts.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,8 @@ export default {
4848
// TODO: https://github.com/emberjs/ember.js/issues/15291
4949
let { _super } = this;
5050

51-
const controller = getOwnerWithFallback(this).lookup(
52-
"controller:composer"
53-
);
51+
const controller =
52+
getOwnerWithFallback(this).lookup("service:composer");
5453
let encrypted = !!controller.get("model.isEncrypted");
5554
if (draftKey.indexOf("topic_") === 0) {
5655
const topicId = draftKey.substr("topic_".length);

assets/javascripts/discourse/initializers/encrypt-posts.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ export default {
216216
return Promise.all([getTopicKey(attrs.topic_id), getIdentity()])
217217
.then(([key, identity]) => {
218218
const metadata = addMetadata(
219-
getOwner(this).lookup("controller:composer"),
219+
getOwner(this).lookup("service:composer"),
220220
{
221221
raw: attrs.raw,
222222
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"devDependencies": {
4-
"@discourse/lint-configs": "2.0.1",
4+
"@discourse/lint-configs": "2.2.0",
55
"ember-template-lint": "6.0.0",
66
"eslint": "9.14.0",
77
"prettier": "2.8.8"

0 commit comments

Comments
 (0)