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
feat: implement a feature for previewing posts and single pages #3983
Conversation
Codecov Report
@@ Coverage Diff @@
## main #3983 +/- ##
============================================
- Coverage 60.52% 60.35% -0.18%
- Complexity 2342 2360 +18
============================================
Files 353 356 +3
Lines 12106 12215 +109
Branches 881 889 +8
============================================
+ Hits 7327 7372 +45
- Misses 4347 4403 +56
- Partials 432 440 +8
|
可以 |
/hold |
Signed-off-by: Ryan Wang <i@ryanc.cc>
Signed-off-by: Ryan Wang <i@ryanc.cc>
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.
/lgtm
能否在新创建时也显示预览按钮而不是点击了保存之后再显示,反正预览时都会保存内容 |
Signed-off-by: Ryan Wang <i@ryanc.cc>
已修改。 |
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.
/lgtm
@guqing: you cannot LGTM your own PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JohnNiang The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind feature
/area core
/area console
/milestone 2.6.x
What this PR does / why we need it:
新增文章和自定义页面预览功能
提供了以下两个路由用于预览,必须登录且是对应文章或自定义页面的 contributors 才能访问,如果不是 contributor 则先得到没有权限访问异常,如果有权限访问但预览文章不存在则得到 404
GET /preview/posts/{name}
GET /preview/singlepages/{name}
两个路由都可以通过查询参数 snapshotName 来指定需要预览的内容快照,它是可选的,默认为当前正在编辑的内容
Which issue(s) this PR fixes:
Fixes #2349
Does this PR introduce a user-facing change?