[WJ-1266][WJ-1267] Implement Page Lock UI#2935
Conversation
| const newerLock = lockHistory[index - 1] | ||
| const deletedAt = new Date(lock.deleted_at).getTime() | ||
| const newerCreatedAt = new Date(newerLock.created_at).getTime() | ||
| if (Math.abs(newerCreatedAt - deletedAt) < 5000) { |
There was a problem hiding this comment.
| if (Math.abs(newerCreatedAt - deletedAt) < 5000) { | |
| if (Math.abs(newerCreatedAt - deletedAt) < 5000) { // 5 seconds |
| export async function pageLockHistory( | ||
| reqContext: RequestContext | ||
| ): Promise<PageLockModel[]> { | ||
| return client.request("page_lock_get_history", {}, reqContext) |
There was a problem hiding this comment.
Deepwell api functions should use explicit page reference instead of only inferring from context, since when accessing the site's default page, the params.slug will be null and the page reference cannot be inferred.
There was a problem hiding this comment.
Fair point for now, but ideally the request context should always be able to get the right "page" it's on unless absolutely not applicable (ie. forum pages, inter-site pages like user profile...) I'll think a bit more to make it work, will send in a commit to change.
There was a problem hiding this comment.
We should also consider that the context system with page slug would be more appropriate for a web client, and less so for an api client, so if we were to create a public api backed by deepwell in the future, it would still be better to use explicit page references.
Implemented a
LockPaneto manage page locks.Wikidot Layout:


Wikijump Layout: