-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(backend-github): prepend collection name #2878
Changes from all commits
b1e8a58
0c04316
232de41
93b9b75
73e7ef5
19a650f
7f32f8e
6bc1071
32c5e99
8bbd5d6
c448609
24cd1d5
6b534e4
eca36df
7ae7e52
2a9a3bd
24ccfd9
3910cea
f7ce7b7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ export const branch = gql` | |
} | ||
id | ||
name | ||
prefix | ||
repository { | ||
...RepositoryParts | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import uuid from 'uuid/v4'; | ||
import { get } from 'lodash'; | ||
import { actions as notifActions } from 'redux-notifications'; | ||
import { BEGIN, COMMIT, REVERT } from 'redux-optimist'; | ||
import { serializeValues } from 'Lib/serializeEntryValues'; | ||
|
@@ -242,6 +243,12 @@ export function loadUnpublishedEntry(collection, slug) { | |
return async (dispatch, getState) => { | ||
const state = getState(); | ||
const backend = currentBackend(state.config); | ||
const entriesLoaded = get(state.editorialWorkflow.toJS(), 'pages.ids', false); | ||
//run possible unpublishedEntries migration | ||
if (!entriesLoaded) { | ||
const response = await backend.unpublishedEntries(state.collections).catch(() => false); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For published entry that have a draft entry, let's run the migration code first before loading the draft. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can happen when opening an entry in edit mode directly without going through the workflow tab first? Am I correct? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, that's correct. |
||
response && dispatch(unpublishedEntriesLoaded(response.entries, response.pagination)); | ||
} | ||
|
||
dispatch(unpublishedEntryLoading(collection, slug)); | ||
|
||
|
@@ -294,8 +301,10 @@ export function loadUnpublishedEntry(collection, slug) { | |
export function loadUnpublishedEntries(collections) { | ||
return (dispatch, getState) => { | ||
const state = getState(); | ||
if (state.config.get('publish_mode') !== EDITORIAL_WORKFLOW) return; | ||
const backend = currentBackend(state.config); | ||
const entriesLoaded = get(state.editorialWorkflow.toJS(), 'pages.ids', false); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The unpublished entries(workflow page) should now load only once. |
||
if (state.config.get('publish_mode') !== EDITORIAL_WORKFLOW || entriesLoaded) return; | ||
|
||
dispatch(unpublishedEntriesLoading()); | ||
backend | ||
.unpublishedEntries(collections) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!