Collapsed @service injection definitions to single-line style

no issue

- find+replace to make service injection style consistent and take up much less space at the top of files that used multi-line syntax
This commit is contained in:
Kevin Ansfield 2022-02-01 17:03:45 +00:00
parent 075aae9e3b
commit f07940f0e7
56 changed files with 158 additions and 411 deletions

View File

@ -9,8 +9,7 @@ import {inject as service} from '@ember/service';
@classNames('gh-alert')
@tagName('article')
export default class GhAlert extends Component {
@service
notifications;
@service notifications;
@computed('message.type')
get typeClass() {

View File

@ -8,8 +8,7 @@ import {inject as service} from '@ember/service';
@classNames('gh-alerts')
@tagName('aside')
export default class GhAlerts extends Component {
@service
notifications;
@service notifications;
@alias('notifications.alerts')
messages;

View File

@ -5,20 +5,11 @@ import {inject as service} from '@ember/service';
@classic
export default class GhBillingIframe extends Component {
@service
billing;
@service
config;
@service
ghostPaths;
@service
ajax;
@service
notifications;
@service billing;
@service config;
@service ghostPaths;
@service ajax;
@service notifications;
isOwner = null;
fetchingSubscription = false;

View File

@ -5,8 +5,7 @@ import {inject as service} from '@ember/service';
@classic
export default class GhBillingModal extends Component {
@service
billing;
@service billing;
@computed('billingWindowOpen')
get visibilityClass() {

View File

@ -6,20 +6,11 @@ import {inject as service} from '@ember/service';
@classic
export default class GhBillingUpdateButton extends Component {
@service
router;
@service
config;
@service
ghostPaths;
@service
ajax;
@service
billing;
@service router;
@service config;
@service ghostPaths;
@service ajax;
@service billing;
subscription = null;

View File

@ -6,6 +6,5 @@ import {tagName} from '@ember-decorators/component';
@classic
@tagName('')
export default class GhBlogUrl extends Component {
@service
config;
@service config;
}

View File

@ -12,8 +12,7 @@ import {task} from 'ember-concurrency';
@classic
@classNameBindings('isFocused:focus')
class CmEditorComponent extends Component {
@service
lazyLoader;
@service lazyLoader;
textareaClass = '';
isFocused = false;

View File

@ -18,8 +18,7 @@ import Component from '@ember/component';
@classic
@classNames('content-cover')
export default class GhContentCover extends Component {
@service
ui;
@service ui;
click() {
this.ui.closeMenus();

View File

@ -12,8 +12,7 @@ const DATE_FORMAT = 'YYYY-MM-DD';
@classic
@tagName('')
export default class GhDateTimePicker extends Component {
@service
settings;
@service settings;
date = '';
dateFormat = DATE_FORMAT;

View File

@ -9,8 +9,7 @@ import {inject as service} from '@ember/service';
@tagName('button')
@attributeBindings('href', 'role', 'type')
export default class GhDropdownButton extends Component.extend(DropdownMixin) {
@service
dropdown;
@service dropdown;
role = 'button';

View File

@ -10,8 +10,7 @@ import {inject as service} from '@ember/service';
@classNames('dropdown')
@classNameBindings('fadeIn:fade-in-scale:fade-out', 'isOpen:open:closed')
export default class GhDropdown extends Component.extend(DropdownMixin) {
@service
dropdown;
@service dropdown;
name = null;
closeOnClick = false;

View File

@ -15,11 +15,8 @@ import {inject as service} from '@ember/service';
'isPreview:gh-editor-preview'
)
export default class GhEditor extends Component {
@service
feature;
@service
ui;
@service feature;
@service ui;
// Internal attributes
droppedFiles = null;

View File

@ -10,8 +10,7 @@ import {inject as service} from '@ember/service';
@classNames('switch')
@attributeBindings('for', 'disabled')
class FeatureFlagComponent extends Component {
@service
feature;
@service feature;
@computed('_disabled')
get disabled() {

View File

@ -21,14 +21,9 @@ import {inject as service} from '@ember/service';
'_isSplitScreen:gh-markdown-editor-side-by-side'
)
export default class GhMarkdownEditor extends Component.extend(ShortcutsMixin) {
@service
config;
@service
notifications;
@service
settings;
@service config;
@service notifications;
@service settings;
// Public attributes
autofocus = false;

View File

@ -7,18 +7,12 @@ import {task} from 'ember-concurrency-decorators';
import {tracked} from '@glimmer/tracking';
export default class extends Component {
@service
membersUtils
@service
ghostPaths
@service
ajax
@service
store
@service
feature
@service
settings
@service membersUtils
@service ghostPaths
@service ajax
@service store
@service feature
@service settings
constructor(...args) {
super(...args);

View File

@ -7,6 +7,5 @@ import {inject as service} from '@ember/service';
@tagName('nav')
@classNames('gh-mobile-nav-bar')
export default class GhMobileNavBar extends Component {
@service
ui;
@service ui;
}

View File

@ -6,20 +6,11 @@ import {inject as service} from '@ember/service';
@classic
export default class Footer extends Component {
@service
config;
@service
session;
@service
router;
@service
whatsNew;
@service
feature;
@service config;
@service session;
@service router;
@service whatsNew;
@service feature;
@and('config.clientExtensions.dropdown', 'session.user.isOwnerOnly')
showDropdownExtension;

View File

@ -13,44 +13,19 @@ import {task} from 'ember-concurrency';
@classic
@tagName('')
export default class Main extends Component.extend(ShortcutsMixin) {
@service
billing;
@service
config;
@service
customViews;
@service
feature;
@service
ghostPaths;
@service
modals;
@service
navigation;
@service
router;
@service
session;
@service
ui;
@service
whatsNew;
@service
membersStats;
@service
settings;
@service billing;
@service config;
@service customViews;
@service feature;
@service ghostPaths;
@service modals;
@service navigation;
@service router;
@service session;
@service ui;
@service whatsNew;
@service membersStats;
@service settings;
iconStyle = '';
iconClass = '';

View File

@ -10,8 +10,7 @@ import {inject as service} from '@ember/service';
@classNames('gh-notification', 'gh-notification-passive')
@classNameBindings('typeClass')
export default class GhNotification extends Component {
@service
notifications;
@service notifications;
message = null;

View File

@ -8,8 +8,7 @@ import {inject as service} from '@ember/service';
@tagName('aside')
@classNames('gh-notifications')
export default class GhNotifications extends Component {
@service
notifications;
@service notifications;
@alias('notifications.notifications')
messages;

View File

@ -9,14 +9,9 @@ import {task, timeout} from 'ember-concurrency';
@classic
@tagName('')
export default class GhPortalLinks extends Component {
@service
config;
@service
store;
@service
settings;
@service config;
@service store;
@service settings;
isLink = true;
prices = null;

View File

@ -10,35 +10,16 @@ import {tagName} from '@ember-decorators/component';
@classic
@tagName('')
export default class GhPostSettingsMenu extends Component {
@service
feature;
@service
store;
@service
config;
@service
ajax;
@service
ghostPaths;
@service
notifications;
@service
slugGenerator;
@service
session;
@service
settings;
@service
ui;
@service feature;
@service store;
@service config;
@service ajax;
@service ghostPaths;
@service notifications;
@service slugGenerator;
@service session;
@service settings;
@service ui;
post = null;
isViewingSubview = false;

View File

@ -13,23 +13,12 @@ const RETRY_EMAIL_MAX_POLL_LENGTH = 15 * 1000;
@classic
export default class Email extends Component {
@service
ajax;
@service
ghostPaths;
@service
notifications;
@service
session;
@service
settings;
@service
config;
@service ajax;
@service ghostPaths;
@service notifications;
@service session;
@service settings;
@service config;
post = null;
sendTestEmailError = '';

View File

@ -8,8 +8,7 @@ import {tagName} from '@ember-decorators/component';
@classic
@tagName('')
export default class GhPsmTagsInput extends Component {
@service
store;
@service store;
// public attrs
post = null;

View File

@ -9,8 +9,7 @@ import {task} from 'ember-concurrency';
@classic
@tagName('')
export default class GhPsmTemplateSelect extends Component {
@service
store;
@service store;
post = null;

View File

@ -11,11 +11,8 @@ const VISIBILITIES = [
@classic
export default class GhPsmVisibilityInput extends Component {
@service
settings;
@service
feature;
@service settings;
@service feature;
// public attrs
post = null;

View File

@ -10,8 +10,7 @@ import {task} from 'ember-concurrency';
@classic
export default class GhSimplemde extends TextArea {
@service
lazyLoader;
@service lazyLoader;
// Public attributes
autofocus = false;

View File

@ -8,8 +8,7 @@ import {inject as service} from '@ember/service';
@classic
@classNames('gh-input')
export default class GhTextarea extends TextArea.extend(TextInputMixin) {
@service
resizeDetector;
@service resizeDetector;
autoExpand = false;

View File

@ -9,8 +9,7 @@ import {inject as service} from '@ember/service';
@classic
@classNames('form-group', 'for-select')
export default class GhTimezoneSelect extends Component {
@service
clock;
@service clock;
timezone = null;
availableTimezones = null;

View File

@ -11,8 +11,7 @@ Example usage:
@classic
@classNames('ghost-url-preview')
export default class GhUrlPreview extends Component {
@service
config;
@service config;
prefix = null;
slug = null;

View File

@ -9,11 +9,8 @@ import {tagName} from '@ember-decorators/component';
@classic
@tagName('')
export default class GhUserInvited extends Component {
@service
notifications;
@service
store;
@service notifications;
@service store;
invite = null;
isSending = false;

View File

@ -7,6 +7,5 @@ import {inject as service} from '@ember/service';
@tagName('h2')
@classNames('view-title')
export default class GhViewTitle extends Component {
@service
ui;
@service ui;
}

View File

@ -7,11 +7,8 @@ import {task, timeout} from 'ember-concurrency';
@classic
export default class ModalCustomViewForm extends ModalComponent {
@service
customViews;
@service
router;
@service customViews;
@service router;
delayedModelColor = '';

View File

@ -9,17 +9,10 @@ const EU = {flag: '🇪🇺', name: 'EU', baseUrl: 'https://api.eu.mailgun.net/v
@classic
export default class MembersEmail extends Component {
@service
config;
@service
ghostPaths;
@service
ajax;
@service
settings;
@service config;
@service ghostPaths;
@service ajax;
@service settings;
replyAddresses = null;
recipientsSelectValue = null;
@ -229,4 +222,4 @@ export default class MembersEmail extends Component {
return defaultEmailRecipients;
}
}
}

View File

@ -7,29 +7,14 @@ import Controller from '@ember/controller';
@classic
export default class ApplicationController extends Controller {
@service
billing;
@service
config;
@service
dropdown;
@service
feature;
@service
router;
@service
session;
@service
settings;
@service
ui;
@service billing;
@service config;
@service dropdown;
@service feature;
@service router;
@service session;
@service settings;
@service ui;
@reads('config.hostSettings.billing.enabled')
showBilling;

View File

@ -5,6 +5,5 @@ import {inject as service} from '@ember/service';
/* eslint-disable ghost/ember/alias-model-in-controller */
@classic
export default class EditLoadingController extends Controller {
@service
ui;
@service ui;
}

View File

@ -9,6 +9,5 @@ export default class PagesLoadingController extends PostsLoadingController {
@controller('pages')
postsController;
@service
ui;
@service ui;
}

View File

@ -9,11 +9,8 @@ export default class PostsLoadingController extends Controller {
@controller('posts')
postsController;
@service
session;
@service
ui;
@service session;
@service ui;
@readOnly('postsController.availableTypes')
availableTypes;

View File

@ -49,17 +49,10 @@ const ORDERS = [{
@classic
export default class PostsController extends Controller {
@service
feature;
@service
session;
@service
store;
@service
settings;
@service feature;
@service session;
@service store;
@service settings;
// default values for these are set in `init` and defined in `helpers/reset-query-params`
queryParams = ['type', 'access', 'author', 'tag', 'order'];

View File

@ -6,11 +6,8 @@ import Controller from '@ember/controller';
@classic
export default class SettingsController extends Controller {
@service
settings;
@service
session;
@service settings;
@service session;
showLeaveSettingsModal = false;

View File

@ -7,11 +7,8 @@ import {task} from 'ember-concurrency';
@classic
export default class CodeInjectionController extends Controller {
@service
notifications;
@service
settings;
@service notifications;
@service settings;
@action
save() {

View File

@ -21,26 +21,13 @@ function randomPassword() {
@classic
export default class GeneralController extends Controller {
@service
config;
@service
ghostPaths;
@service
notifications;
@service
session;
@service
settings;
@service
frontend;
@service
ui;
@service config;
@service ghostPaths;
@service notifications;
@service session;
@service settings;
@service frontend;
@service ui;
availableTimezones = null;
imageExtensions = IMAGE_EXTENSIONS;

View File

@ -14,11 +14,8 @@ import {task, timeout} from 'ember-concurrency';
@classic
export default class IntegrationController extends Controller {
@service
config;
@service
ghostPaths;
@service config;
@service ghostPaths;
imageExtensions = IMAGE_EXTENSIONS;
imageMimeTypes = IMAGE_MIME_TYPES;

View File

@ -7,14 +7,9 @@ import {task} from 'ember-concurrency';
@classic
export default class IntegrationsController extends Controller {
@service
settings;
@service
store;
@service
config;
@service settings;
@service store;
@service config;
_allIntegrations = null;

View File

@ -7,11 +7,8 @@ import {task} from 'ember-concurrency';
@classic
export default class AmpController extends Controller {
@service
notifications;
@service
settings;
@service notifications;
@service settings;
leaveSettingsTransition = null;

View File

@ -7,11 +7,8 @@ import {task} from 'ember-concurrency';
@classic
export default class FirstpromoterController extends Controller {
@service
notifications;
@service
settings;
@service notifications;
@service settings;
leaveSettingsTransition = null;

View File

@ -10,17 +10,10 @@ import {task} from 'ember-concurrency';
@classic
export default class SlackController extends Controller {
@service
ghostPaths;
@service
ajax;
@service
notifications;
@service
settings;
@service ghostPaths;
@service ajax;
@service notifications;
@service settings;
leaveSettingsTransition = null;
slackArray = null;

View File

@ -7,11 +7,8 @@ import {task} from 'ember-concurrency';
@classic
export default class UnsplashController extends Controller {
@service
notifications;
@service
settings;
@service notifications;
@service settings;
leaveSettingsTransition = null;

View File

@ -10,8 +10,7 @@ import {task, timeout} from 'ember-concurrency';
@classic
export default class ZapierController extends Controller {
@service
ghostPaths;
@service ghostPaths;
selectedApiKey = null;
isApiKeyRegenerated = false;

View File

@ -37,29 +37,14 @@ const YAML_MIME_TYPE = [
@classic
export default class LabsController extends Controller {
@service
ajax;
@service
config;
@service
feature;
@service
ghostPaths;
@service
notifications;
@service
session;
@service
settings;
@service
utils;
@service ajax;
@service config;
@service feature;
@service ghostPaths;
@service notifications;
@service session;
@service settings;
@service utils;
importErrors = null;
importSuccessful = false;

View File

@ -9,11 +9,8 @@ import {task} from 'ember-concurrency';
@classic
export default class IndexController extends Controller {
@service
session;
@service
store;
@service session;
@service store;
showInviteUserModal = false;
showResetAllPasswordsModal = false;

View File

@ -7,11 +7,8 @@ import Controller from '@ember/controller';
@classic
export default class SetupController extends Controller {
@service
ghostPaths;
@service
router;
@service ghostPaths;
@service router;
@match('router.currentRouteName', /^setup\.(two|three)$/)
showBackLink;

View File

@ -14,20 +14,11 @@ export default class TwoController extends Controller.extend(ValidationEngine) {
@controller
application;
@service
ajax;
@service
config;
@service
ghostPaths;
@service
notifications;
@service
session;
@service ajax;
@service config;
@service ghostPaths;
@service notifications;
@service session;
// ValidationEngine settings
validationType = 'setup';

View File

@ -18,23 +18,12 @@ export default class SigninController extends Controller.extend(ValidationEngine
@controller
application;
@service
ajax;
@service
config;
@service
ghostPaths;
@service
notifications;
@service
session;
@service
settings;
@service ajax;
@service config;
@service ghostPaths;
@service notifications;
@service session;
@service settings;
submitting = false;
loggingIn = false;

View File

@ -11,11 +11,8 @@ const SCRATCH_PROPS = ['name', 'slug', 'description', 'metaTitle', 'metaDescript
@classic
export default class TagController extends Controller {
@service
notifications;
@service
router;
@service notifications;
@service router;
showDeleteTagModal = false;

View File

@ -6,8 +6,7 @@ import {inject as service} from '@ember/service';
@classic
export default class TagsController extends Controller {
@service
router;
@service router;
queryParams = ['type'];
type = 'public';