mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 05:30:06 +08:00
DEV: Update linting setup and fix issues (#17345)
Re-lands #16119 and #17298 * Update eslint-config-discourse * Update linting workflow * Prettier-ignore stuff * Update template-lint config * Auto-fix template issues * Fix various template issues Mostly incorrect attributes and unused templates * Prettier js files * Fix template auto-fix regressions * Small css tweak Co-authored-by: Peter Wagenet <peter.wagenet@gmail.com>
This commit is contained in:
@ -26,7 +26,7 @@
|
||||
<div class="poll-options">
|
||||
{{#if this.showAdvanced}}
|
||||
<label class="input-group-label">{{i18n "poll.ui_builder.poll_options.label"}}</label>
|
||||
<Textarea @value={{this.pollOptionsText}} @input={{action "onOptionsTextChange"}} />
|
||||
<Textarea @value={{this.pollOptionsText}} {{on "input" (action "onOptionsTextChange")}} />
|
||||
{{#if this.showMinNumOfOptionsValidation}}
|
||||
{{#unless this.minNumOfOptionsValidation.ok}}
|
||||
<InputTip @validation={{this.minNumOfOptionsValidation}} />
|
||||
@ -56,18 +56,18 @@
|
||||
<div class="options">
|
||||
<div class="input-group poll-number">
|
||||
<label class="input-group-label">{{i18n "poll.ui_builder.poll_config.min"}}</label>
|
||||
<Input @type="number" @value={{this.pollMin}} @valueProperty="value" class="poll-options-min" @min={{1}} />
|
||||
<Input @type="number" @value={{this.pollMin}} class="poll-options-min" min="1" />
|
||||
</div>
|
||||
|
||||
<div class="input-group poll-number">
|
||||
<label class="input-group-label">{{i18n "poll.ui_builder.poll_config.max"}}</label>
|
||||
<Input @type="number" @value={{this.pollMax}} @valueProperty="value" class="poll-options-max" @min={{1}} />
|
||||
<Input @type="number" @value={{this.pollMax}} class="poll-options-max" min="1" />
|
||||
</div>
|
||||
|
||||
{{#if this.isNumber}}
|
||||
<div class="input-group poll-number">
|
||||
<label class="input-group-label">{{i18n "poll.ui_builder.poll_config.step"}}</label>
|
||||
<Input @type="number" @value={{this.pollStep}} @valueProperty="value" @min="1" class="poll-options-step" />
|
||||
<Input @type="number" @value={{this.pollStep}} min="1" class="poll-options-step" />
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
@ -24,8 +24,8 @@ function cleanUpPolls() {
|
||||
|
||||
function initializePolls(api) {
|
||||
const register = getRegister(api),
|
||||
pollGroupableUserFields = api.container.lookup("site-settings:main")
|
||||
.poll_groupable_user_fields;
|
||||
pollGroupableUserFields =
|
||||
api.container.lookup("site-settings:main").poll_groupable_user_fields;
|
||||
cleanUpPolls();
|
||||
|
||||
api.modifyClass("controller:topic", {
|
||||
|
@ -47,8 +47,7 @@ acceptance("Poll quote", function (needs) {
|
||||
title_is_group: false,
|
||||
bookmarked: false,
|
||||
bookmarks: [],
|
||||
raw:
|
||||
"[poll name=poll1 type=regular results=always chartType=bar]\n* Alpha\n* Beta\n[/poll]\n\n[poll name=poll2 type=regular results=always chartType=bar]\n* First\n* Second\n[/poll]",
|
||||
raw: "[poll name=poll1 type=regular results=always chartType=bar]\n* Alpha\n* Beta\n[/poll]\n\n[poll name=poll2 type=regular results=always chartType=bar]\n* First\n* Second\n[/poll]",
|
||||
actions_summary: [
|
||||
{
|
||||
id: 3,
|
||||
|
@ -51,8 +51,7 @@ acceptance("Poll results", function (needs) {
|
||||
title_is_group: false,
|
||||
bookmarked: false,
|
||||
bookmarks: [],
|
||||
raw:
|
||||
"[poll type=regular results=always public=true chartType=bar]\n* Option #1\n* Option #2\n[/poll]",
|
||||
raw: "[poll type=regular results=always public=true chartType=bar]\n* Option #1\n* Option #2\n[/poll]",
|
||||
actions_summary: [
|
||||
{ id: 3, can_act: true },
|
||||
{ id: 4, can_act: true },
|
||||
@ -87,14 +86,12 @@ acceptance("Poll results", function (needs) {
|
||||
options: [
|
||||
{
|
||||
id: "db753fe0bc4e72869ac1ad8765341764",
|
||||
html:
|
||||
'Option \u003cspan class="hashtag"\u003e#1\u003c/span\u003e',
|
||||
html: 'Option \u003cspan class="hashtag"\u003e#1\u003c/span\u003e',
|
||||
votes: 1,
|
||||
},
|
||||
{
|
||||
id: "d8c22ff912e03740d9bc19e133e581e0",
|
||||
html:
|
||||
'Option \u003cspan class="hashtag"\u003e#2\u003c/span\u003e',
|
||||
html: 'Option \u003cspan class="hashtag"\u003e#2\u003c/span\u003e',
|
||||
votes: 0,
|
||||
},
|
||||
],
|
||||
@ -192,14 +189,12 @@ acceptance("Poll results", function (needs) {
|
||||
options: [
|
||||
{
|
||||
id: "db753fe0bc4e72869ac1ad8765341764",
|
||||
html:
|
||||
'Option \u003cspan class="hashtag"\u003e#1\u003c/span\u003e',
|
||||
html: 'Option \u003cspan class="hashtag"\u003e#1\u003c/span\u003e',
|
||||
votes: 1,
|
||||
},
|
||||
{
|
||||
id: "d8c22ff912e03740d9bc19e133e581e0",
|
||||
html:
|
||||
'Option \u003cspan class="hashtag"\u003e#2\u003c/span\u003e',
|
||||
html: 'Option \u003cspan class="hashtag"\u003e#2\u003c/span\u003e',
|
||||
votes: 0,
|
||||
},
|
||||
],
|
||||
@ -705,8 +700,7 @@ acceptance("Poll results - no voters", function (needs) {
|
||||
title_is_group: false,
|
||||
bookmarked: false,
|
||||
bookmarks: [],
|
||||
raw:
|
||||
"[poll type=regular results=always public=true chartType=bar]\n* Option #1\n* Option #2\n[/poll]",
|
||||
raw: "[poll type=regular results=always public=true chartType=bar]\n* Option #1\n* Option #2\n[/poll]",
|
||||
actions_summary: [
|
||||
{ id: 3, can_act: true },
|
||||
{ id: 4, can_act: true },
|
||||
@ -741,14 +735,12 @@ acceptance("Poll results - no voters", function (needs) {
|
||||
options: [
|
||||
{
|
||||
id: "db753fe0bc4e72869ac1ad8765341764",
|
||||
html:
|
||||
'Option \u003cspan class="hashtag"\u003e#1\u003c/span\u003e',
|
||||
html: 'Option \u003cspan class="hashtag"\u003e#1\u003c/span\u003e',
|
||||
votes: 0,
|
||||
},
|
||||
{
|
||||
id: "d8c22ff912e03740d9bc19e133e581e0",
|
||||
html:
|
||||
'Option \u003cspan class="hashtag"\u003e#2\u003c/span\u003e',
|
||||
html: 'Option \u003cspan class="hashtag"\u003e#2\u003c/span\u003e',
|
||||
votes: 0,
|
||||
},
|
||||
],
|
||||
@ -835,14 +827,12 @@ acceptance("Poll results - no voters", function (needs) {
|
||||
options: [
|
||||
{
|
||||
id: "db753fe0bc4e72869ac1ad8765341764",
|
||||
html:
|
||||
'Option \u003cspan class="hashtag"\u003e#1\u003c/span\u003e',
|
||||
html: 'Option \u003cspan class="hashtag"\u003e#1\u003c/span\u003e',
|
||||
votes: 0,
|
||||
},
|
||||
{
|
||||
id: "d8c22ff912e03740d9bc19e133e581e0",
|
||||
html:
|
||||
'Option \u003cspan class="hashtag"\u003e#2\u003c/span\u003e',
|
||||
html: 'Option \u003cspan class="hashtag"\u003e#2\u003c/span\u003e',
|
||||
votes: 0,
|
||||
},
|
||||
],
|
||||
|
Reference in New Issue
Block a user