-
Notifications
You must be signed in to change notification settings - Fork 132
feat: add preview side editor #38
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
Merged
Merged
Changes from 12 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
e4531cf
chore: rename env variables
remidej 3f26652
chore: turn on future flags
remidej fe458e8
feat: side editor
remidej 9672130
chore: update readme instructions
remidej adb26a4
chore: new strapi exp
remidej 09c7590
fix: env example files
remidej d415e6e
fix: duplicate env vars
remidej 1425c19
chore: upgrade strapi experimental
remidej f16c5a2
feat: bump strapi version
remidej f12a325
Merge remote-tracking branch 'origin/main' into feat/side-editor
remidej 2b396e4
fix: generic uid in strapi package.json
remidej 3ce0797
fix: remove yarn integrity file
remidej fa8c547
Update strapi/config/features.ts
remidej 0bc7bc1
Merge remote-tracking branch 'origin/main' into feat/side-editor
remidej File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,43 @@ | ||
export default ({ env }) => ({ | ||
auth: { | ||
secret: env('ADMIN_JWT_SECRET'), | ||
secret: env("ADMIN_JWT_SECRET"), | ||
}, | ||
apiToken: { | ||
salt: env('API_TOKEN_SALT'), | ||
salt: env("API_TOKEN_SALT"), | ||
}, | ||
transfer: { | ||
token: { | ||
salt: env('TRANSFER_TOKEN_SALT'), | ||
salt: env("TRANSFER_TOKEN_SALT"), | ||
}, | ||
}, | ||
flags: { | ||
nps: env.bool('FLAG_NPS', true), | ||
promoteEE: env.bool('FLAG_PROMOTE_EE', true), | ||
nps: env.bool("FLAG_NPS", true), | ||
promoteEE: env.bool("FLAG_PROMOTE_EE", true), | ||
}, | ||
preview: { | ||
enabled: true, | ||
config: { | ||
allowedOrigins: [env('STRAPI_ADMIN_CLIENT_URL')], | ||
allowedOrigins: [env("CLIENT_URL")], | ||
async handler(uid, { documentId, locale, status }) { | ||
const document = await strapi.documents(uid).findOne({ | ||
documentId, populate: null, | ||
documentId, | ||
populate: null, | ||
fields: ["slug"], | ||
}); | ||
const { slug } = document; | ||
|
||
const urlSearchParams = new URLSearchParams({ | ||
secret: env('STRAPI_ADMIN_CLIENT_PREVIEW_SECRET'), | ||
secret: env("PREVIEW_SECRET"), | ||
...(slug && { slug }), | ||
locale, | ||
uid, | ||
status | ||
status, | ||
}); | ||
|
||
const previewURL = `${env('STRAPI_ADMIN_CLIENT_URL')}/api/preview?${urlSearchParams}` | ||
const previewURL = `${env("CLIENT_URL")}/api/preview?${urlSearchParams}`; | ||
|
||
return previewURL | ||
return previewURL; | ||
}, | ||
} | ||
|
||
} | ||
}, | ||
}, | ||
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export default ({ env }) => ({ | ||
future: { | ||
unstablePreviewSideEditor: true, | ||
unstableRelationsOnTheFly: true, | ||
}, | ||
}); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 0 additions & 44 deletions
44
strapi/src/admin/extensions/components/PreviewButton/index.tsx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.