Added {{enable-developer-experiments}} helper
no issue - removes the need to have component backing classes with the `config` service injected
This commit is contained in:
parent
508b7734fe
commit
235d5f1b8b
@ -140,7 +140,7 @@
|
||||
{{/if}}
|
||||
</section>
|
||||
|
||||
{{#if (or this.config.enableDeveloperExperiments this.config.portal)}}
|
||||
{{#if (or enable-developer-experiments this.config.portal)}}
|
||||
<section class="bb b--whitegrey pa5">
|
||||
<div class="flex justify-between">
|
||||
<div>
|
||||
|
@ -64,7 +64,7 @@
|
||||
<GhErrorMessage @errors={{this.webhook.errors}} @property="targetUrl" data-test-error="webhook-targetUrl" />
|
||||
</GhFormGroup>
|
||||
</fieldset>
|
||||
{{#if this.config.enableDeveloperExperiments}}
|
||||
{{#if enable-developer-experiments}}
|
||||
<fieldset>
|
||||
<GhFormGroup @errors={{this.webhook.errors}} @hasValidated={{this.webhook.hasValidated}} @property="secret">
|
||||
<label for="webhook-secret" class="fw6">Secret</label>
|
||||
|
@ -7,7 +7,6 @@ import {inject as service} from '@ember/service';
|
||||
import {task} from 'ember-concurrency';
|
||||
|
||||
export default ModalComponent.extend({
|
||||
config: service(),
|
||||
router: service(),
|
||||
|
||||
availableEvents: null,
|
||||
|
10
ghost/admin/app/helpers/enable-developer-experiments.js
Normal file
10
ghost/admin/app/helpers/enable-developer-experiments.js
Normal file
@ -0,0 +1,10 @@
|
||||
import Helper from '@ember/component/helper';
|
||||
import {inject as service} from '@ember/service';
|
||||
|
||||
export default Helper.extend({
|
||||
config: service(),
|
||||
|
||||
compute() {
|
||||
return this.config.get('enableDeveloperExperiments');
|
||||
}
|
||||
});
|
@ -3,7 +3,7 @@
|
||||
{{section.title}}
|
||||
</div>
|
||||
{{#each section.items as |item|}}
|
||||
{{#if (or (not item.developerExperiment) (and item.developerExperiment config.enableDeveloperExperiments))}}
|
||||
{{#if (or (not item.developerExperiment) (and item.developerExperiment enable-developer-experiments))}}
|
||||
<div class="{{if item.selected "kg-cardmenu-card-selected"}} {{kg-style "cardmenu-card"}}" onclick={{action itemClicked item}} data-kg="cardmenu-card" role="menuitem">
|
||||
<div class="{{kg-style "cardmenu-icon"}} {{item.iconClass}}" aria-hidden="true">{{svg-jar item.icon class="w8 h8"}}</div>
|
||||
<div class="{{kg-style "cardmenu-label"}}">{{item.label}}</div>
|
||||
|
@ -1,9 +1,6 @@
|
||||
import Component from '@ember/component';
|
||||
import {inject as service} from '@ember/service';
|
||||
|
||||
export default Component.extend({
|
||||
config: service(),
|
||||
|
||||
tagName: '',
|
||||
|
||||
itemSections: null,
|
||||
|
Loading…
Reference in New Issue
Block a user