0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-17 23:44:39 -05:00

Settings cleanup (#2377)

refs: https://github.com/TryGhost/Toolbox/issues/327
requires: TryGhost/Ghost#14791

- lang / locale has had a lot of churn, but we decided this setting should always be locale
- Removed test relating to unused editor_is_launch_complete setting 

Co-authored-by: Rishabh <zrishabhgarg@gmail.com>
This commit is contained in:
Hannah Wolfe 2022-05-12 14:53:18 +01:00 committed by GitHub
parent 8932ba9b1a
commit 47d6c17135
6 changed files with 15 additions and 30 deletions

View file

@ -1156,3 +1156,9 @@ add|ember-template-lint|require-input-label|170|36|170|36|0ba8ec96b755e459805e0c
add|ember-template-lint|require-input-label|186|36|186|36|9522267520f8fbe733b544cd6f204b57efea84ea|1652227200000|1662595200000|1667782800000|app/components/editor-labs/modals/preview/social.hbs
add|ember-template-lint|require-input-label|222|20|222|20|6ac7c49ee511b196817761756e03a7697e8dc448|1652227200000|1662595200000|1667782800000|app/components/editor-labs/modals/preview/social.hbs
add|ember-template-lint|require-input-label|240|20|240|20|d3cc7e4d3b13fae817a60cd3c3e388988bdb8ec0|1652227200000|1662595200000|1667782800000|app/components/editor-labs/modals/preview/social.hbs
add|ember-template-lint|no-action|95|39|95|39|ba45af3e814e72ad4d95a8f317bb9cc9ad9215c8|1652313600000|1662681600000|1667865600000|app/templates/settings/general.hbs
add|ember-template-lint|no-action|96|43|96|43|2c1cc5f0c3aeddb4838344241fd5ad1706fa7f98|1652313600000|1662681600000|1667865600000|app/templates/settings/general.hbs
add|ember-template-lint|no-passed-in-event-handlers|95|32|95|32|c34c2e482b61c7ccd2b1103b5dee4b291eb2ec47|1652313600000|1662681600000|1667865600000|app/templates/settings/general.hbs
remove|ember-template-lint|no-action|95|39|95|39|3832366e419f440aded929f1573d476b8435f6ff|1652054400000|1662422400000|1665014400000|app/templates/settings/general.hbs
remove|ember-template-lint|no-action|96|43|96|43|659c404406f04b8153690817989630ae36f37989|1652054400000|1662422400000|1665014400000|app/templates/settings/general.hbs
remove|ember-template-lint|no-passed-in-event-handlers|95|32|95|32|50acf938ca8cb3c5633b20e7050d7750211b12f4|1652054400000|1662422400000|1665014400000|app/templates/settings/general.hbs

View file

@ -177,7 +177,7 @@ export default Component.extend({
const yearlyAmount = parseInt(this._scratchStripeYearlyAmount);
const monthlyAmount = parseInt(this._scratchStripeMonthlyAmount);
if (!yearlyAmount || yearlyAmount < 1 || !monthlyAmount || monthlyAmount < 1) {
const minimum = Intl.NumberFormat(this.settings.get('lang'), {
const minimum = Intl.NumberFormat(this.settings.get('locale'), {
currency: selectedCurrency.isoCode,
style: 'currency'
}).format(1);

View file

@ -12,7 +12,7 @@ export default Model.extend(ValidationEngine, {
coverImage: attr('string'),
icon: attr('string'),
accentColor: attr('string'),
lang: attr('string'),
locale: attr('string'),
timezone: attr('string', {defaultValue: 'Etc/UTC'}),
codeinjectionHead: attr('string'),
codeinjectionFoot: attr('string'),

View file

@ -89,14 +89,14 @@
<div class="gh-expandable-content">
{{#liquid-if this.langOpen}}
<div class="gh-setting-content-extended">
<GhFormGroup @errors={{this.settings.errors}} @hasValidated={{this.settings.hasValidated}} @property="lang">
<GhFormGroup @errors={{this.settings.errors}} @hasValidated={{this.settings.hasValidated}} @property="locale">
<GhTextInput
@value={{readonly this.settings.lang}}
@input={{action (mut this.settings.lang) value="target.value"}}
@focus-out={{action "validate" "lang" target=this.settings}}
data-test-input="lang"
@value={{readonly this.settings.locale}}
@input={{action (mut this.settings.locale) value="target.value"}}
@focus-out={{action "validate" "locale" target=this.settings}}
data-test-input="locale"
/>
<GhErrorMessage @errors={{this.settings.errors}} @property="lang" />
<GhErrorMessage @errors={{this.settings.errors}} @property="locale" />
<p>Default: English (<strong>en</strong>); you can add translation files to your theme for <a href="https://ghost.org/docs/themes/helpers/translate/" target="_blank" rel="noopener noreferrer">any language</a></p>
</GhFormGroup>
</div>

View file

@ -42,7 +42,7 @@ export default [
},
{
id: 5,
key: 'lang',
key: 'locale',
value: 'en',
group: 'site',
created_at: '2013-11-25T14:48:11.000Z',

View file

@ -1,5 +1,4 @@
import hbs from 'htmlbars-inline-precompile';
import {authenticateSession} from 'ember-simple-auth/test-support';
import {describe, it} from 'mocha';
import {expect} from 'chai';
import {find, findAll, render} from '@ember/test-helpers';
@ -27,24 +26,4 @@ describe('Integration: Component: <Dashboard::LatestMemberActivity>', function (
expect(findAll('[data-test-dashboard-member-activity-item]').length).to.equal(5);
});
it('renders nothing when owner has not completed launch', async function () {
let role = this.server.create('role', {name: 'Owner'});
this.server.create('user', {roles: [role]});
await authenticateSession();
const sessionService = this.owner.lookup('service:session');
await sessionService.populateUser();
this.server.create('setting', {
key: 'editor_is_launch_complete',
value: false,
group: 'editor'
});
const settingsService = this.owner.lookup('service:settings');
await settingsService.fetch();
await render(hbs(`<Dashboard::LatestMemberActivity />`));
expect(find('[data-test-dashboard-member-activity]')).to.not.exist;
});
});