1
0
Fork 0
mirror of https://github.com/TryGhost/Ghost-Admin.git synced 2023-12-14 02:33:04 +01:00
Commit graph

62 commits

Author SHA1 Message Date
Kevin Ansfield 37a23122c2 Switch from embor-browserify to ember-auto-import
no issue
- minor reduction in build size. Before/after:
  - `vendor.min.js 3.32 MB (710.66 KB gzipped)`
  - `vendor.min.js 3.29 MB (706 KB gzipped)`
2019-01-22 13:09:38 +00:00
Moritz Schramm e261b80c22 🎨 Added post title to document title for easier location with multiple editor tabs (#1072)
closes https://github.com/tryghost/ghost/issues/10088
* added `updateDocumentTitle` action to base route and replace usage of `.send('collectTitleTokens, [])`
* added `.titleToken()` method to editor route to add post title to document title
* called `.send('updateDocumentTitle')` after saving post title in editor controller to keep document title in sync
* updated editor controller test for latest ember-mocha and ember-test-helpers
2019-01-21 11:44:30 +00:00
Kevin Ansfield d58363513c Minor cleanups
no issue
- replace unnecessary destructuring with direct import
- remove unused action
2018-10-22 21:00:02 +01:00
Kevin Ansfield 05eb7db8e9 Removed dated permalinks setting
no issue
- permalink config is now handled through `routes.yaml`
2018-08-14 17:49:50 +01:00
Austin Burdine fd6f2551bb Bower => NPM (#972)
no issue

- Convert validator to an npm dependency
  - clean up validator imports
  - fix validator function imports
  - remove unused validator extensions
- Convert devicejs to an npm dependency
- Convert remaining used bower deps to npm deps
- 🔥 Remove bower & unused bower dependencies
- remove globals imports in favor of direct module imports where possible
2018-03-19 17:56:09 +00:00
Kevin Ansfield e648de4e7e ESLint fixes for latest eslint-plugin-ember
no issue
2018-03-19 13:05:02 +00:00
Hey24sheep 09fe424eb1 🐛 Fixed "Are you sure" modal being shown incorrectly after toggling private mode (#964)
closes TryGhost/Ghost#9472
- add `changedAttributes()` passthrough to `settings` service
- use `changedAttributes()` in general settings `toggleIsPrivate` method to reset the password to the last known value when disabling private mode
2018-03-09 14:42:27 +00:00
Kevin Ansfield ac16e6504c ESLint: Consistent ember property/method ordering
no issue
- https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/order-in-components.md
- https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/order-in-controllers.md
- https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/order-in-routes.md
2018-01-12 12:17:56 +00:00
Kevin Ansfield 0ef503f23d ESLint: Don't use observers if possible
closes https://github.com/TryGhost/Ghost/issues/8690
- https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/no-observers.md
- remove observers where possible
- move night shift toggle behaviour to the feature service
	- refresh feature service after import to fix stuck night shift toggle
2018-01-12 12:17:56 +00:00
Kevin Ansfield 050f4d99b6 ESLint: Alias model in controllers
no issue
- https://github.com/ember-cli/eslint-plugin-ember/blob/HEAD/docs/rules/alias-model-in-controller.md
- replace `model` with a meaningful property name everywhere possible
- refactor `design` and `general` settings controllers to use a directly injected settings service rather than passing it in as a "model" to be more explicit
2018-01-12 12:17:56 +00:00
Kevin Ansfield 7afb88a0c2 Switch to eslint-plugin-ghost extending plugin:ghost/ember
no issue
- fix lint errors in lib/gh-koenig
- fix ghost:base eslint errors
- update ember plugin refs, remove ember-suave plugin refs
- remove old jshint refs
- add `lint:js` script
- switch to `eslint-plugin-ghost` extending `plugin:ghost/ember`
2018-01-12 12:17:56 +00:00
Kevin Ansfield 756439fc75 🐛 Fixed unresponsive upload buttons
closes https://github.com/TryGhost/Ghost/issues/9292
- fix a global find/replace error that caused the wrong element classes in the general and labs file dialog trigger events
2017-11-30 07:00:25 +00:00
Kevin Ansfield f8c7d606c7 Avoid leaking state in Ember objects
no issue
- https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/avoid-leaking-state-in-ember-objects.md
2017-11-25 09:49:49 +00:00
Kevin Ansfield 74428efd8b
🐛 Fixed inability to re-upload the same redirects file (#912)
closes https://github.com/TryGhost/Ghost/issues/9266
- `emberx-file-input` passes a `resetInput` function through to it's action handler but we weren't doing that in our override component. Added the missing functionality and updated all of our handlers to use that instead of doing manual resets
- added a `setFiles` action to `{{gh-uploader}}` and yield it for use in block invocations
2017-11-22 17:04:48 +00:00
Kevin Ansfield ea34d49c89
🐛 Fixed failing Facebook URL validation for group urls (#906)
closes https://github.com/TryGhost/Ghost/issues/9160
- simplified FB validation to allow any valid FB url (autocomplete of raw usernames and facebook-like URLs is still in place)
- fixed a bug with sticky Twitter validation message, if you entered an invalid URL then changed it to an invalid username you still saw the invalid URL message (surfaced through new test helpers for validating facebook/twitter fields)
2017-11-10 16:38:30 +00:00
Kevin Ansfield 238983a5df Match service/controller import to ember-modules-codemod style for consistency
no issue

Automated tools, code generators, and editor integrations are increasingly standardising on the import style used in `ember-modules-codemod`. Our import style differed a little with regards to service/controller injection imports which meant we were starting to see inconsistent naming.
2017-10-30 09:38:01 +00:00
Katharina Irrgang cb576b14d3 Display private RSS feed url in general settings (#888)
refs https://github.com/TryGhost/Ghost/issues/9001

- show private feed url if private blogging is enabled
- added a `.avoid-break-out` CSS utility class to prevent layout issues caused by non-breaking text such as long links
2017-10-05 10:59:14 +01:00
Aileen Nowak bbbe6038b2 🎨 Added confirmation dialog when leaving settings screen with unsaved changes (#871)
closes TryGhost/Ghost#8483

- Added a new modal component that gets rendered when leaving general/settings after changes have been done but not saved
- Removed independent saving logic for social URL for consistent UX
2017-10-04 11:49:30 +01:00
Kevin Ansfield 6cf39d49af Upload/Download redirects UI
closes TryGhost/Ghost#9028

- add upload/download UI to labs screen
  - displays success/failure state in the button for 5 secs after uploading
- minor refactor to remove redundant `{{#if}}` conditionals in general settings screen
- minor naming refactor of `onUploadFail` -> `onUploadFailure` for `{{gh-uploader}}`'s closure action
2017-09-21 17:01:40 +02:00
Kevin Ansfield d4faa15f46 Upgrade eslint dependencies (#855)
no issue

- bump ember-cli-eslint and eslint-plugin-ember
- fix indentation & "unnecessary escape chars" lint errors
2017-09-11 14:56:11 +07:00
Kevin Ansfield 88449ed639 Switched from ember-cli-shims to new module imports (#779)
no issue

- add eslint-plugin-ember, configure no-old-shims rule
- run `eslint --fix` on `app`, `lib`, `mirage`, and `tests` to move imports to the new module imports
- further cleanup of Ember globals usage
- remove event-dispatcher initializer now that `canDispatchToEventManager` is deprecated
2017-08-22 14:53:26 +07:00
Katharina Irrgang dfbbd53265 🐛 fix image upload for icons: reset input (#754)
closes TryGhost/Ghost#8545
2017-06-20 16:54:27 +07:00
Kevin Ansfield 43a18115ba 🐛 fix IE11 bugs and styles (#724)
closes https://github.com/TryGhost/Ghost/issues/8384

- fixes image uploads on settings/general by reverting to jQuery for triggering the file dialog because IE11 doesn't support `MouseEvent` events or have the `.closest` method on native DOM elements
- gives all SVG elements an explicit `width` and `height` - if one property is set to `auto` or not specified IE11 will treat it as 100% of the container
- fixes horizontal scroll + scrollbar on the main app viewport
2017-06-01 23:02:03 +02:00
Kevin Ansfield 7eefbba69f 💄🐷 sort-imports eslint rule (#712)
no issue

- adds `eslint-plugin-sort-imports-es6-autofix` dependency
  - implements ESLint's base `sort-imports` rule but has a distinction in that `import {foo} from 'bar';` is considered `multiple` rather than `single`
  - fixes ESLint's autofix behaviour so `eslint --fix` will actually fix the sort order
- updates all unordered import rules by using `eslint --fix`

With the increased number of `import` statements since Ember+ecosystem started moving towards es6 modules I've found it frustrating at times trying to search through randomly ordered import statements. Recently I've been sorting imports manually when I've added new code or touched old code so I thought I'd add an ESLint rule to codify it.
2017-05-29 20:50:03 +02:00
Kevin Ansfield 9db932ee48 streamline image uploads in settings/general (#702)
refs TryGhost/Ghost#8455

- ensure `uploadUrls` and `errors` are cleared in `gh-uploader` when new uploads are started
- yield `isUploading` in `gh-uploader` component
- replace image upload modals in settings/general with in-page uploads
2017-05-23 10:50:04 +02:00
Aileen Nowak 371b9fd78e 🐛 Make cmd+s work for all save-buttons (#700)
closes TryGhost/Ghost#8443
- Fixes a bug where the keyboard shortcut `cmd+s` would cause a `Maximum call stack size` error and not save.
- Wherever there is a `save` button, the keyboard shortcut to save works now.
2017-05-18 11:48:37 +01:00
Rodney Folz 7457ffb26d 🐛 permit Facebook usernames with less than 5 chars (#632)
refs https://github.com/TryGhost/Ghost/issues/8296
- permit Facebook usernames with less than 5 chars
    - brands are allowed to have Page names with less than 5 chars (ex: facebook.com/nike)
    - current/former employees are allowed to have usernames with less than 5 chars (ex: facebook.com/zuck)
2017-05-15 19:26:34 +01:00
Kevin Ansfield bc4e607661 🎨 refactor settings screens to use ember-concurrency & gh-task-button
refs https://github.com/TryGhost/Ghost/issues/7865
- updates all settings screens to use EC tasks and `gh-task-button` to get save-state save buttons
- removes now-unused `settings-save` mixin
- moves the order of button color CSS so that grey buttons can change to green/red after completing
- removes the heading from `apps-loading` template so that there's no odd flash when loading slack/amp screens directly
2017-03-08 10:00:03 -07:00
Kevin Ansfield 0f4ea73254 rename settings/navigation -> settings/design, move theme management (#543)
no issue

- following from the `settings/general` redesign, navigation and themes management are now co-located in `settings/design`
2017-02-21 19:04:50 +00:00
Kevin Ansfield c43974c14b fetch themes from /themes endpoint (#542)
refs https://github.com/TryGhost/Ghost/pull/8022

- use `/themes` API endpoint to fetch list of themes instead of `settings[0].availableThemes`
2017-02-21 18:28:44 +00:00
Kevin Ansfield 11dd3b93ff 🔥 remove unused CPs (#509)
no issue
-  `settings/general` controller contained a number of `xImageSource` CPs that are no longer being used
2017-01-26 11:01:49 -06:00
Aileen Nowak 7af0f51b53 Blog icon uplod (#397)
refs TryGhost/Ghost#7688
- Adds new upload functionality for a blog icon in general settings.
- Icons will be uploaded to a new endpoint `uploads/icons` to trigger different validations.
2017-01-26 11:17:34 +00:00
John O'Mahoney 2ea63c6753 Show error message for invalid data in PostsPerPage (#419)
closes TryGhost/Ghost#7746
- Added gh-form-group around PostsPerPage
- Changed focusOut action to validate
- Removed now redundant `checkPostsPerPage()` call
2017-01-08 09:55:19 -06:00
Kevin Ansfield 4a604ce64f Update code to match eslint rules
no issue
- switch `jscs` and `jshint` inline config to `eslint` config
- fix eslint errors, predominantly in tests where the config now the main app config more closely
2016-11-14 13:26:00 +00:00
Kevin Ansfield 5581c6ba5a theme management UI
refs https://github.com/TryGhost/Ghost/issues/7204, requires https://github.com/TryGhost/Ghost/pull/7209

- replaces theme dropdown with a table
- adds theme upload modal
    - validates theme mime type
    - prevents upload of `casper.zip` (default Casper theme can't be overwritten)
    - warns if an upload will overwrite an existing theme
    - gives option of immediately activating the uploaded theme or closing after successful upload
- adds theme activation link/action
- adds theme download link/action
- adds theme deletion modal
    - warns about no undo possibility
    - offers possibility to download theme
- modifies mirage config to handle theme changes
2016-08-23 12:42:38 +01:00
Kevin Ansfield 96f2d4088f Handle automatic timezone override
refs https://github.com/TryGhost/Ghost/pull/7142, https://github.com/TryGhost/Ghost/pull/7143
- moves timezone selection template and logic into a component
- detect if the current `activeTimezone` is not in our pre-defined list of timezones, if it isn't:
  - add a line indicating that there has been an override with the current `activeTimezone` value
  - add a blank option to the timezone select list
2016-07-26 11:50:24 +01:00
Austin Burdine a9ce94de9f convert ember imports to ember-cli-shim imports where possible (#95) 2016-06-30 11:21:47 +01:00
Kevin Ansfield 604fda4348 Update package.json details, rename module to ghost-admin
no issue
- updates `package.json` details to better reflect the separation from the `Ghost` package
- update ember config and all import statements to reflect the new `ghost-admin` module name in `package.json`
2016-06-03 16:12:54 +01:00
Aileen Nowak be8b31ec85 Timezones: Always use the timezone of blog setting
closes TryGhost/Ghost#6406

follow-up PR of #2

- adds a `timeZone` Service to provide the offset (=timezone reg. moment-timezone) of the users blog settings
- `gh-datetime-input` will read the offset of the timezone now and adjust the `publishedAt` date with it. This is the date which will be shown in the PSM 'Publish Date' field. When the user writes a new date/time, the offset is considered and will be deducted again before saving it to the model. This way, we always work with a UTC publish date except for this input field.
- gets `availableTimezones` from `configuration/timezones` API endpoint
- adds a `moment-utc` transform on all date attr (`createdAt`, `updatedAt`, `publishedAt`, `unsubscribedAt` and `lastLogin`) to only work with UTC times on serverside
- when switching the timezone in the select box, the user will be shown the local time of the selected timezone
- `createdAt`-property in `gh-user-invited` returns now `moment(createdAt).fromNow()` as `createdAt` is a moment date already
- added clock service to show actual time ticking below select box
- default timezone is '(GMT) Greenwich Mean Time : Dublin, Edinburgh, London'
- if no timezone is saved in the settings yet, the default value will be used
- shows the local time in 'Publish Date'  in PSM by default, until user overwrites it
- adds dependency `moment-timezone 0.5.4` to `bower.json`

---------

**Tests:**

- sets except for clock service in test env
- adds fixtures to mirage
- adds `service.ajax` and `service:ghostPaths` to navigation-test.js
- adds unit test for `gh-format-timeago` helper
- updates acceptance test `general-setting`
- adds acceptance test for `editor`
- adds integration tests for `services/config` and `services/time-zone`

---------

**Todos:**

- [ ] Integration tests: ~~`services/config`~~, ~~`services/time-zone`~~, `components/gh-datetime-input`
- [x] Acceptance test: `editor`
- [ ] Unit tests: `utils/date-formatting`
- [ ] write issue for renaming date properties (e. g. `createdAt` to `createdAtUTC`) and translate those for server side with serializers
2016-06-03 16:23:39 +02:00
Kevin Ansfield a45c0884c3 Fix unwanted clearing of social inputs on blur with no edits
no issue
- updates the logic to expect `null` scratch values as the scratch values won't be set until the input value has changed
- adds tests for initial value display and regression tests for the cleared input bug
2016-05-17 19:14:14 +01:00
Aileen Nowak 7923641cb1 Fixes error in validation
closes #6826

- refactors the validation of facebook and twitter input field in `general.js` and `user.js` controller
	- Example validations for facebook:
		- `facebook.com/username` will be corrected to the full URL
		- `user` will show error `Your Page name is not a valid Facebook Page name' for `general.js` and `Your Username is not a valid Facebook Username` for `user.js` as the username in facebook has to be at least 5 characters long
		- `twitter.com/username` will be autocorrected to the valid facebook URL incl. the `username`
	- Example validations for twitter:
		- `twitter.com/user_` will be corrected to the full URL
                - `user:99` will show error `Your Username is not a valid Twitter Username`
                - `facebook.com/username` will be autocorrected to the valid twitter URL incl. the `username`
- updates both acceptance tests
- adds further validation for facebook pages in general settings and user. Submitting a url which incl. `/page/` or `/pages/` will now accept any username followed incl. further `/`.
- adds a custom transform `facebook-url-user` which will extract the username (if it's a facebook page, incl. `pages/`) to store only this in the backend
- uses the `twitter-url-user` transform now also for user
2016-05-17 17:44:23 +01:00
Austin Burdine 2f58e17b7e update document title on blog title change
no issue
- force document.title to recompute when the blog title is changed in settings/general
2016-05-15 18:41:28 -06:00
Aileen Nowak 0f9645f97d Structured Data 3.0
closes #6534
- new input fields in general settings incl. validation
- facebook and twitter as new models in settings.js
- adds values for facebook and twitter to default-settings.js
- adds blog helpers for facebook and twittter
- rather than saving the whole URL, the Twitter username incl. '@' will be extracted from URL and saved in the settings. The User will still input the full URL. After saving the blog setting, the stored Twitter username will be parsed again as the full URL and available in the input field. A custom transform is used for this.
- adding meta fields to be rendered in {{ghost_head}}:
	- '<meta property="article:publisher" content="https://www.facebook.com/page" />' and
	- '<meta name="twitter:site" content="@user"/>'
- adds facebook and twitter to unit test for structured data
- adds unit test for general settings
- adds acceptance test for new input fields in general settings
- adds a custom transform for twitter model to save only the username to the server
- adds unit test for transform
2016-05-08 17:43:59 +02:00
Kevin Ansfield d4ca5ced75 Don't share errors and hasValidated references between validator instances
no issue
- ensure that each validator instance gets it's own `errors` and `hasValidated` objects
- updates some uses of `ValidationEngine` that were relying on side-effects of the unintended reference sharing
- fixes issue with add subscriber modal displaying an error state after opening if it previously had errors when closing
2016-04-25 10:56:11 +01:00
Austin Burdine b2c91dd3be cleanup usage of Ember.inject 2016-01-19 07:03:27 -06:00
Kevin Ansfield 97bb577496 Refactor modals
refs #5798, closes #5018
- adds new `gh-fullscreen-modal` component - modals are now specified in-context so that they can have deeper interaction with their surrounding components/controller/route, i.e. a modal component can be a thin confirm/deny wrapper over the underlying controller action keeping all context-sensitive logic in one place
- adds spin-buttons to all modals with async behaviour
- adds/improves behaviour of inline-validation in modals
- improves re-authenticate modal to properly handle validation and authentication errors
2016-01-12 20:53:08 +00:00
Kevin Ansfield 7ce3726589 Use es6 across client and add ember-suave to enforce rules
no issue
- add ember-suave dependency
- upgrade grunt-jscs dependency
- add a new .jscsrc for the client's tests directory that extends from client's base .jscsrc
- separate client tests in Gruntfile jscs task so they pick up the test's .jscsrc
- standardize es6 usage across client
2015-11-30 10:41:01 +00:00
Kevin Ansfield 55840eb57f Avoid duplicate alerts, clear alerts on successful retry or sign-in
closes #5903, refs #5409
- switch alert/notification component tests from unit to integration where appropriate
- rename `notifications.closeAll` to `notifications.clearAll` to better represent it's behaviour
- add concept of a "key" to alerts/notifications and ability to close only specified keys through notifications service
- close duplicate alerts/notifications before showing a new one
- specify a key for all existing alerts
- close failure alerts on successful retries
- clear all currently displayed alerts on successful sign-in
2015-10-12 19:21:30 +01:00
Kevin Ansfield fbb92476f0 Ember-cli, Ember, & Ember Data 1.13.x upgrades
closes #5630
- upgrade ember-cli to latest version
- upgrade ember to latest 1.13.x release
- upgrade ember data to latest 1.13.x release
    - update custom adapters and serialisers for new internal JSON-API compatible formats [(docs)][1]
    - update all store queries to use new standardised query methods [(docs)][2]
    - add ember-data-filter addon ready for store.filter removal in ember-data 2.0 [(docs)][3]
- remove use of prototype extensions for computed properties and observers
- consolidate pagination into a single route mixin and simplify configuration

[1]: http://emberjs.com/blog/2015/06/18/ember-data-1-13-released.html#toc_transition-to-the-new-jsonserializer-and-restserializer-apis
[2]: http://emberjs.com/blog/2015/06/18/ember-data-1-13-released.html#toc_simplified-find-methods
[3]: http://emberjs.com/blog/2015/06/18/ember-data-1-13-released.html#toc_ds-store-filter-moved-to-an-addon
2015-10-06 16:09:05 +01:00
Kevin Ansfield ebd826f8c8 Minor validations fixes
no issue
- clear private blog password validation errors on enable/disable
- validate maximum tag name length
- fix sticky validations when moving between tags or navigating to/from tags manager
2015-09-02 10:34:22 +01:00