feat(core): simple recovery history ui poc (#5033)

Simple recovery history UI poc.
What's missing
- [x] e2e

All biz logic should be done, excluding complete ui details.
- [ ] offline prompt
- [ ] history timeline
- [ ] page ui

https://github.com/toeverything/AFFiNE/assets/584378/fc3f6a48-ff7f-4265-b9f5-9c0087cb2635
This commit is contained in:
Peng Xiao
2023-11-27 02:41:19 +00:00
parent f04ec50d12
commit 34d575078c
23 changed files with 1291 additions and 14 deletions
@@ -0,0 +1,13 @@
query listHistory(
$workspaceId: String!
$pageDocId: String!
$take: Int
$before: DateTime
) {
workspace(id: $workspaceId) {
histories(guid: $pageDocId, take: $take, before: $before) {
id
timestamp
}
}
}
@@ -362,6 +362,22 @@ query getWorkspaces {
}`,
};
export const listHistoryQuery = {
id: 'listHistoryQuery' as const,
operationName: 'listHistory',
definitionName: 'workspace',
containsFile: false,
query: `
query listHistory($workspaceId: String!, $pageDocId: String!, $take: Int, $before: DateTime) {
workspace(id: $workspaceId) {
histories(guid: $pageDocId, take: $take, before: $before) {
id
timestamp
}
}
}`,
};
export const getInvoicesCountQuery = {
id: 'getInvoicesCountQuery' as const,
operationName: 'getInvoicesCount',
@@ -445,6 +461,17 @@ mutation publishPage($workspaceId: String!, $pageId: String!, $mode: PublicPageM
}`,
};
export const recoverDocMutation = {
id: 'recoverDocMutation' as const,
operationName: 'recoverDoc',
definitionName: 'recoverDoc',
containsFile: false,
query: `
mutation recoverDoc($workspaceId: String!, $docId: String!, $timestamp: DateTime!) {
recoverDoc(workspaceId: $workspaceId, guid: $docId, timestamp: $timestamp)
}`,
};
export const removeAvatarMutation = {
id: 'removeAvatarMutation' as const,
operationName: 'removeAvatar',
@@ -0,0 +1,7 @@
mutation recoverDoc(
$workspaceId: String!
$docId: String!
$timestamp: DateTime!
) {
recoverDoc(workspaceId: $workspaceId, guid: $docId, timestamp: $timestamp)
}