-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fetch restore progress details from
/restore
endpoint (#47212)
Co-authored-by: elliottprogrammer <bryan@elliottprogrammer.com>
- Loading branch information
1 parent
9692be7
commit 81db137
Showing
6 changed files
with
62 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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 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 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 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
10 changes: 10 additions & 0 deletions
10
client/state/data-layer/wpcom/activity-log/rewind/restore-status/type.ts
This file contains 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,10 @@ | ||
export interface RestoreProgress { | ||
errorCode: string; | ||
failureReason: string; | ||
message: string; | ||
percent: number; | ||
status: string; | ||
rewindId: string; | ||
context: string; | ||
currentEntry: string; | ||
} |
This file contains 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,23 @@ | ||
/** | ||
* Internal dependencies | ||
*/ | ||
|
||
/** | ||
* Type dependencies | ||
*/ | ||
import { AppState } from 'calypso/types'; | ||
import type { RestoreProgress } from 'calypso/state/data-layer/wpcom/activity-log/rewind/restore-status/type'; | ||
|
||
/** | ||
* Get the progress details of a restore for a specified site | ||
* | ||
* @param {AppState} state Global state tree | ||
* @param {number | string} siteId the site ID | ||
* @returns {RestoreProgress} Progress details | ||
*/ | ||
export default function getRestoreProgress( | ||
state: AppState, | ||
siteId: number | string | ||
): RestoreProgress | undefined { | ||
return state.activityLog?.restoreProgress?.[ siteId ]; | ||
} |