68 Commits

Author SHA1 Message Date
Erez Rokah
e0b1246810
feat: populate new entry from URL params (#3343) 2020-03-02 11:32:22 +01:00
Bartholomew
cf81f587cf
fix: ensure draft changes (#3306) 2020-02-28 11:40:51 +01:00
Stéphane Klein
8874769b31
feat: sanitize media filenames according to global slug setting (#3315) 2020-02-25 19:12:11 +01:00
Erez Rokah
02ef2010e7
Fix: show specific field media files in library, cascade folder templates (#3252)
* feat: cascade & compose media folders - initial commit

* refactor: code cleanup

* fix: pass field instead of folder to getAsset

* fix: only show field media files in library

* test: fix medial library selector test

* fix: fallback to original path when asset not found

* fix: only show field media files in media library

* fix: properly handle empty strings in field folders
2020-02-14 15:31:33 -05:00
stefanprobst
2447f9c311
fix: dispatch QUERY_FAILURE on query failure (#3243) 2020-02-13 11:48:02 +02:00
Erez Rokah
ab685e8594
fix: change getAsset to not return a promise (#3232)
* fix: change getAsset to not return a promise

* fix: update markdown widget per getAsset changes

* test: fix editor component image test

* docs: update getAsset docs
2020-02-12 19:12:36 -05:00
Erez Rokah
31dbd72273
feat(proxy-server): add local fs middleware and make it the default (#3217) 2020-02-10 11:07:52 -05:00
Erez Rokah
97bc0c8dc4
feat: field based media/public folders (#3208) 2020-02-10 11:05:47 -05:00
Erez Rokah
614f1aea63
feat(core): auto detect proxy server on load (#3195)
* feat: auto detect proxy server on load

* fix: opt-in for auto proxy server detection
2020-02-05 10:56:11 -05:00
Erez Rokah
18e284ece8
feat: add preUnpublish, postUnpublish events (#3196) 2020-02-04 13:49:30 +02:00
Erez Rokah
7d792f3005
fix: load missing assets when retrieving backup (#3192) 2020-02-04 11:12:59 +02:00
Bartholomew
4f5544287f
fix: media library on reload (#3174) 2020-02-03 14:33:09 +02:00
Erez Rokah
0d7e36ba79
feat: add prePublish,postPublish events (#3172) 2020-01-31 16:44:01 -08:00
Erez Rokah
7e8084be87 chore: add proxy backend (#3126)
* feat(backends): add proxy backend

* feat: add proxy server initial commit

* fix: move from joi to @hapi/joi

* test: add joi validation tests

* feat: proxy server initial implementations

* test: add tests, fix build

* chore: update yarn.lock

* build: fix develop command

* fix(back-proxy): fix bugs

* test(backend-proxy): add cypress tests

* chore: cleanup

* chore: support node 10

* chore: code cleanup

* chore: run cypress on ubuntu 16.04

* test(e2e): fix proxy backend cypress tests

* chore: don't start proxy server on yarn develop
2020-01-22 16:47:34 -05:00
Erez Rokah
cf57da223d Feat: media folders templates (#3116)
* refactor: typescript backendHelper

* test: add string templating tests

* test: add createPreviewUrl invalid date test

* refactor: move all formatters to one file

* feat: support media folders templating

* feat: add filename and extension template variables

* feat: support paths in string templates

* docs: add media folder templating docs

* style(docs): remove line break
2020-01-22 13:42:24 -05:00
Erez Rokah
6f221ab3c1 Feat: editorial workflow bitbucket gitlab (#3014)
* refactor: typescript the backends

* feat: support multiple files upload for GitLab and BitBucket

* fix: load entry media files from media folder or UI state

* chore: cleanup log message

* chore: code cleanup

* refactor: typescript the test backend

* refactor: cleanup getEntry unsued variables

* refactor: moved shared backend code to lib util

* chore: rename files to preserve history

* fix: bind readFile method to API classes

* test(e2e): switch to chrome in cypress tests

* refactor: extract common api methods

* refactor: remove most of immutable js usage from backends

* feat(backend-gitlab): initial editorial workflow support

* feat(backend-gitlab): implement missing workflow methods

* chore: fix lint error

* feat(backend-gitlab): support files deletion

* test(e2e): add gitlab cypress tests

* feat(backend-bitbucket): implement missing editorial workflow methods

* test(e2e): add BitBucket backend e2e tests

* build: update node version to 12 on netlify builds

* fix(backend-bitbucket): extract BitBucket avatar url

* test: fix git-gateway AuthenticationPage test

* test(e2e): fix some backend tests

* test(e2e): fix tests

* test(e2e): add git-gateway editorial workflow test

* chore: code cleanup

* test(e2e): revert back to electron

* test(e2e): add non editorial workflow tests

* fix(git-gateway-gitlab): don't call unpublishedEntry in simple workflow

gitlab git-gateway doesn't support editorial workflow APIs yet. This change makes sure not to call them in simple workflow

* refactor(backend-bitbucket): switch to diffstat API instead of raw diff

* chore: fix test

* test(e2e): add more git-gateway tests

* fix: post rebase typescript fixes

* test(e2e): fix tests

* fix: fix parsing of content key and add tests

* refactor: rename test file

* test(unit): add getStatues unit tests

* chore: update cypress

* docs: update beta docs
2020-01-14 17:15:14 -05:00
Erez Rokah
0a50efda8e feat: support per collection public_folder (#3069)
* feat: support per collection public_folder

* test: improve tests readability
2020-01-14 13:02:53 -05:00
Erez Rokah
5bd724026c
fix: don't wait for external media library to load (#3050) 2020-01-08 17:21:14 +02:00
Bartholomew
9e7aa0c500 fix: duplicate and new entry action (#3003)
* fix: duplicate and new entry action

* test(e2e): flush clock when duplicating entry to handle debounced fields

Co-authored-by: Erez Rokah <erezrokah@users.noreply.github.com>
2019-12-25 11:47:02 +02:00
Erez Rokah
8c175f6132 fix: rebase open authoring branches (#2975)
* fix: create open authoring branches from default origin branch

* refactor: pass repoURL to getBranch

* fix(backend-github): rebase open authoring branch,support multiple files
2019-12-20 12:33:43 -05:00
Erez Rokah
2b41d8a838 feat: bundle assets with content (#2958)
* fix(media_folder_relative): use collection name in unpublished entry

* refactor: pass arguments as object to AssetProxy ctor

* feat: support media folders per collection

* feat: resolve media files path based on entry path

* fix: asset public path resolving

* refactor: introduce typescript for AssetProxy

* refactor: code cleanup

* refactor(asset-proxy): add tests,switch to typescript,extract arguments

* refactor: typescript for editorialWorkflow

* refactor: add typescript for media library actions

* refactor: fix type error on map set

* refactor: move locale selector into reducer

* refactor: add typescript for entries actions

* refactor: remove duplication between asset store and media lib

* feat: load assets from backend using API

* refactor(github): add typescript, cache media files

* fix: don't load media URL if already loaded

* feat: add media folder config to collection

* fix: load assets from API when not in UI state

* feat: load entry media files when opening media library

* fix: editorial workflow draft media files bug fixes

* test(unit): fix unit tests

* fix: editor control losing focus

* style: add eslint object-shorthand rule

* test(cypress): re-record mock data

* fix: fix non github backends, large media

* test: uncomment only in tests

* fix(backend-test): add missing displayURL property

* test(e2e): add media library tests

* test(e2e): enable visual testing

* test(e2e): add github backend media library tests

* test(e2e): add git-gateway large media tests

* chore: post rebase fixes

* test: fix tests

* test: fix tests

* test(cypress): fix tests

* docs: add media_folder docs

* test(e2e): add media library delete test

* test(e2e): try and fix image comparison on CI

* ci: reduce test machines from 9 to 8

* test: add reducers and selectors unit tests

* test(e2e): disable visual regression testing for now

* test: add getAsset unit tests

* refactor: use Asset class component instead of hooks

* build: don't inline source maps

* test: add more media path tests
2019-12-18 11:16:02 -05:00
Bartholomew
d180bffb44 feat: duplicate entry (#2956) 2019-12-10 20:33:02 -05:00
Bartholomew
45a6ee92cc fix: unpublish published entry (#2931) 2019-11-29 17:49:19 +02:00
Bartholomew
caaa8b6db4 fix: load unpublished entries (#2927)
* fix: load unpublished entries

* test(cypress): re-record fixtures data
2019-11-28 17:07:07 +02:00
Bartholomew
41bb9aac0d feat: workflow unpublished entry (#2914)
* feat: workflow unpublished entry

* fix: post rebase fix - load unpublished entry after unpublish

* feat: change unpublish button to dropdown

* test(cypress): add unpublish entry cypress test
2019-11-26 12:14:04 +02:00
Bartholomew
465f463959 fix(backend-github): prepend collection name (#2878)
* fix(backend-github): prepend collection name

* chore: prefer migrating entries

* chore: cleanup

* chore: move migration to listUnpublishedBranches

* chore: prefer flowAsync

* chore: feedback updates

* refactor: extract current metadata version to a const

* refactor: don't send pulls request on open authoring

* test: update recorded data

* fix: hardcode migration key/branch logic

* test(backend-github): add unit tests for migration code

* fix(github-graphql): add ref property to result of createBranch

* test(cypress): update recorded data

* fix: load unpublished entries once

* fix: run migration for published draft entry

* fix: failing test

* chore: use hardcoded version number

* fix: use hardcoded version number

* test(cypress): update recorded data
2019-11-26 10:40:27 +02:00
Erez Rokah
ead46af194
chore(deps): update dependency prettier to v1.19.1 (#2893)
* chore(deps): update dependency prettier to v1.19.1

* style: format files after prettier upgrade
2019-11-18 17:51:51 +02:00
Erez Rokah
6515dee871
feat: commit media with post (#2851)
* feat: commit media with post - initial commit

* feat: add draft media indication

* feat: sync UI media files with GitHub on entry load

* feat: bug fixes

* feat: delete media files from github when removed from library

* test: add GitHub backend tests

* test: add unit tests

* fix: meta data object files are not updated

* feat: used nested paths when update a tree instead of recursion

* feat(test-backend): update test backend to persist media file with entry

* test(e2e): re-record fixtures data

* chore: code cleanup

* chore: code cleanup

* fix: wait for library to load before adding entry media files

* chore: code cleanup

* fix: don't add media files on entry when not a draft

* fix: sync media library after draft entry was published

* feat: update media library card draft style, add tests

* test: add Editor unit tests

* chore: test code cleanup

* fix: publishing an entry from workflow tab throws an error

* fix: duplicate media files when using test backend

* refactor: fix lodash import

* chore: update translations and yarn file after rebase

* test(cypress): update recorded data

* fix(test-backend): fix mapping of media files on publish
2019-11-17 11:51:50 +02:00
Erez Rokah
f5c8ff31f1
fix(media-libs): accept string or string array for insertMedia action (#2857) 2019-11-11 11:30:34 +02:00
ed ho
1d78a2705f improvement: add logs when a 404 error is expected (#2807)
improvement: add logs when a 404 error is expected

improvement: address code review feedback -return rejected promise
2019-11-10 10:34:03 +02:00
polemius
04b371825e chore: fix the typos in comments (#2679) 2019-09-24 16:16:09 -04:00
Sam Lanning
a47a29fb8b Allow for relative paths of media files (#2394)
* Allow for relative paths of media files

fixes #325

* Switch to calculating the relative path based on collection

The required relative path is now calculated depending on the
location of the collection of the current entry having the
media inserted into. And the configuration option has now been
changed to a boolean flag.

This allows collections to not neccesarily all be in the same
location relative to the media folder, and simplifies config.

* Clean up code and fix linting

* Add unit tests to resolveMediaFilename()

* Rework insertMedia action to fetch own config

This moves more of the media path resolution logic into the action
which makes it easier to unit test

* Add unit tests for the mediaLibrary.insertMedia action

* yarn run format

* add dependabot config (#2580)
2019-08-24 16:03:09 -04:00
Benaiah Mischenko
34e1f09105 Open Authoring bugfixes and pagination improvements (#2523)
* Fix handling of displayURLs which are strings

* Add fromFetchArguments to unsentRequest

* Add parseLinkHeader to backendUtil

* Handle paginated endpoints in GitHub API

* Rename fork workflow to Open Authoring across the whole repo

* Fixes for bugs in GitHub API introduced by Open Authoring changes

* Fix getDeployPreview

* Fix incorrect auth header formatting GitHub implementation

cf. https://github.com/netlify/netlify-cms/pull/2456#discussion_r309633387

* Remove unused and broken method from GitHub API

cf. https://github.com/netlify/netlify-cms/pull/2456#discussion_r308687145

* Fix editorialWorkflowGit method in GitHub API

* Request published entry content from origin repo

* Better error when deleting a published post in Open Authoring

* Rename to Open Authoring in fork request message

Also adds a note to the fork request message that an existing fork of
the same repo will be used automatically.

* fix linting
2019-08-24 13:54:59 -04:00
Benaiah Mischenko
edf0a3afdc feat(backend-github): Open Authoring (#2430)
* Make filterPromises resolve entries before filtering

* Add filterPromisesWith & onlySuccessfulPromises to utility library

* Memoize user method in GitHub API

* Make storeMetadata safe to call concurrently in GitHub API

* Fork workflow: startup and authentication

* Fork workflow: backend support

* Fork workflow: disable unused UI elements

* Fork workflow: docs

* Fork workflow: fix deploy previews

* Suggested edits for fork workflow doc

* Change future tense to present

* Fork workflow: add beta status to docs

* remove debug statement

* rename fork workflow to Open Authoring
2019-07-24 18:20:41 -04:00
Bartholomew
1806a2f041 fix(core): list widget default values (#2374) 2019-06-14 11:46:33 -04:00
Bartholomew
0ce995d78c fix(core): ensure against slug overwrite (#2139) 2019-04-10 16:38:53 -04:00
Benaiah Mischenko
d39a361e2d fix(editorial-workflow): fix LM pointers changing to binary files (#2228) 2019-03-22 09:59:06 -04:00
Tony Alves
82cc7941cc feat: provide usable UMD builds for all packages (#2141) 2019-03-16 18:44:29 -04:00
Shawn Erquhart
37138834d6 Fix raw GitHub URL being output to content (#2147)
* fix thumbnail quality

* Revert "fix(git-gateway): fix previews for GitHub images not in Large Media (#2125)"

This reverts commit d17f896f479292db06d3a4b39f2e51b6c41101bd.

* wip

* Stop using thunks to load media display URLs

* Revert changes to dev-test

* Revert changes to large media docs

* fix lint error

* Update docs to point to the upcoming version with non-broken media
2019-03-07 18:28:14 -08:00
Shawn Erquhart
efa650ccf8
fix(config): strip leading slashes from collection location config (#2131) 2019-03-01 09:45:23 -05:00
Shawn Erquhart
686504adee
feat(core): recover entry after unexpected quit (#2129) 2019-02-28 13:30:23 -05:00
Benaiah Mischenko
da2249c651 Netlify Large Media integration (#2124) 2019-02-26 13:11:15 -05:00
Shawn Erquhart
15d221d4a4
feat(workflow): add deploy preview links (#2028) 2019-02-08 12:26:59 -05:00
Bartholomew
627e600d29 fix(netlify-cms-core): validate nested fields (#1873) 2019-02-05 17:27:34 -05:00
Tony Alves
14f94a022c feat(config): allow config.yml file load to be skipped (#2053) 2019-02-03 17:48:40 -05:00
Bartholomew
cedcbf89a5 fix(netlify-cms-core): avoid partially loaded collection list (#1964) 2018-12-19 15:28:45 -05:00
Bartholomew
42d6478117 improvement(netlify-cms-core): avoid redundant workflow status update (#1958) 2018-12-17 14:59:39 -05:00
sysoce
0f1ebd1060 fix(netlify-cms-core): support translation in error message (#1935) 2018-12-11 10:50:23 -05:00
Shawn Erquhart
1fc2f50499
feat: add cloudinary support (#1932) 2018-12-04 17:04:52 -05:00
Tony Alves
da91038067 improvement(backends): changes for registerBackend compatibility (#1880) 2018-11-26 16:30:50 -05:00