-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #454 from Esri/f/165476-public-hub-lock
f/165476 added target change to allow locking of private non-enterpri…
- Loading branch information
Showing
14 changed files
with
1,558 additions
and
180 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type DownloadTarget = "hub" | "portal" | "enterprise"; |
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 |
---|---|---|
@@ -1,8 +1,9 @@ | ||
/* Copyright (c) 2020 Environmental Systems Research Institute, Inc. | ||
* Apache-2.0 */ | ||
|
||
export * from "./poll-download-metadata" | ||
export * from "./poll-download-metadata"; | ||
export * from "./request-dataset-export"; | ||
export * from "./request-download-metadata"; | ||
export * from "./download-format"; | ||
export * from "./download-target"; | ||
export * from "./poller"; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { DownloadTarget } from "../download-target"; | ||
|
||
const DOWNLOADS_LOCK_MS = 10 * 60 * 1000; | ||
|
||
/** | ||
* @private | ||
*/ | ||
export function isRecentlyUpdated( | ||
target: DownloadTarget, | ||
lastEditDate: number | ||
): boolean { | ||
return ( | ||
target === "portal" && | ||
lastEditDate && | ||
new Date().getTime() - lastEditDate <= DOWNLOADS_LOCK_MS | ||
); | ||
} |
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
Oops, something went wrong.