Fixed linter error

This commit is contained in:
Sanne de Vries 2022-03-09 12:24:36 +00:00
parent 00a6645a00
commit 7671ca4364
7 changed files with 19 additions and 16 deletions

View File

@ -1189,3 +1189,4 @@ add|ember-template-lint|no-passed-in-event-handlers|39|24|39|24|2692530760cb1f71
add|ember-template-lint|no-passed-in-event-handlers|58|24|58|24|ce0d7e2e732b22ce3643fb9b1ac6ecef07c275ff|1646697600000|1649286000000|1651878000000|app/templates/setup.hbs
add|ember-template-lint|no-passed-in-event-handlers|77|24|77|24|80681fcec2258c3d81a231bbd635aa1f03ff1452|1646697600000|1649286000000|1651878000000|app/templates/setup.hbs
add|ember-template-lint|no-duplicate-landmark-elements|16|16|16|16|1661d2edb187b634c8187e5ecb0db15a4c7262fc|1646697600000|1649286000000|1651878000000|app/templates/signin.hbs
remove|ember-template-lint|style-concatenation|90|20|90|20|95c5634b86fb8d9deffe53d77bd746f8b62571a3|1646611200000|1649199600000|1651791600000|app/templates/signin.hbs

View File

@ -3,7 +3,7 @@ module.exports = {
rules: {
'no-forbidden-elements': ['meta', 'html', 'script'],
'no-implicit-this': {allow: ['now', 'site-icon-style']},
'no-implicit-this': {allow: ['now', 'site-icon-style', 'accent-color-background']},
'no-inline-styles': false
}
};

View File

@ -5,7 +5,7 @@ import $ from 'jquery';
import Controller, {inject as controller} from '@ember/controller';
import ValidationEngine from 'ghost-admin/mixins/validation-engine';
import classic from 'ember-classic-decorator';
import {action, computed} from '@ember/object';
import {action} from '@ember/object';
import {alias} from '@ember/object/computed';
import {htmlSafe} from '@ember/template';
import {isArray as isEmberArray} from '@ember/array';
@ -42,12 +42,6 @@ export default class SigninController extends Controller.extend(ValidationEngine
@alias('model')
signin;
@computed('config.accent_color')
get accentColor() {
let color = this.get('config.accent_color');
return color;
}
@action
authenticate() {
return this.validateAndAuthenticate.perform();

View File

@ -1,6 +1,5 @@
import Controller from '@ember/controller';
import {alias} from '@ember/object/computed';
import {computed} from '@ember/object';
import {get} from '@ember/object';
import {isArray as isEmberArray} from '@ember/array';
import {
@ -22,11 +21,6 @@ export default Controller.extend({
signupDetails: alias('model'),
accentColor: computed('config.accent_color', function () {
let color = this.get('config.accent_color');
return color;
}),
actions: {
validate(property) {
return this.signupDetails.validate({property});

View File

@ -0,0 +1,14 @@
import Helper from '@ember/component/helper';
import classic from 'ember-classic-decorator';
import {htmlSafe} from '@ember/template';
import {inject as service} from '@ember/service';
@classic
export default class AccentColorBackgroundHelper extends Helper {
@service config;
compute() {
const color = this.get('config.accent_color');
return htmlSafe(`background: ${color};`);
}
}

View File

@ -80,7 +80,7 @@
@class="login gh-btn gh-btn-login gh-btn-block gh-btn-icon js-login-button"
@type="submit"
@tabindex="3"
style="background: {{this.accentColor}};" />
style={{accent-color-background}} />
</form>
<p class="main-error">{{if this.flowErrors this.flowErrors}}&nbsp;</p>

View File

@ -69,7 +69,7 @@
</GhFormGroup>
<GhTaskButton @buttonText="Create Account &rarr;" @type="submit" @form="signup" @defaultClick={{true}} @runningText="Creating"
@task={{this.signup}} @data-test-button="signup" @class="gh-btn gh-btn-signup gh-btn-block gh-btn-icon" @tabindex="3" style="background: {{this.accentColor}};" />
@task={{this.signup}} @data-test-button="signup" @class="gh-btn gh-btn-signup gh-btn-block gh-btn-icon" @tabindex="3" style={{accent-color-background}} />
</form>
{{#if this.flowErrors}}
<p class="main-error">{{this.flowErrors}}&nbsp;</p>