-
Notifications
You must be signed in to change notification settings - Fork 1
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 #761 from wri/release/utltimate-ulmus
[RELEASE] Utltimate Ulmus
- Loading branch information
Showing
206 changed files
with
7,807 additions
and
1,320 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Workflow taken from the Storybook docs: https://storybook.js.org/docs/sharing/publish-storybook#github-pages | ||
name: Build and Publish Storybook to GitHub Pages | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'staging' | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20.x' | ||
|
||
- uses: bitovi/[email protected] | ||
with: | ||
install_command: yarn install | ||
build_command: yarn build-storybook | ||
path: storybook-static | ||
checkout: false |
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,80 @@ | ||
import { Alert, AlertTitle, CircularProgress } from "@mui/material"; | ||
import { FC, useEffect, useState } from "react"; | ||
import { useStore } from "react-redux"; | ||
|
||
import ApiSlice from "@/store/apiSlice"; | ||
import { AppStore } from "@/store/store"; | ||
|
||
type DelayedJobsProgressAlertProps = { | ||
show: boolean; | ||
title?: string; | ||
setIsLoadingDelayedJob?: (value: boolean) => void; | ||
}; | ||
|
||
const DelayedJobsProgressAlert: FC<DelayedJobsProgressAlertProps> = ({ show, title, setIsLoadingDelayedJob }) => { | ||
const [delayedJobProcessing, setDelayedJobProcessing] = useState<number>(0); | ||
const [delayedJobTotal, setDalayedJobTotal] = useState<number>(0); | ||
const [progressMessage, setProgressMessage] = useState<string>("Running 0 out of 0 polygons (0%)"); | ||
|
||
const store = useStore<AppStore>(); | ||
useEffect(() => { | ||
let intervalId: any; | ||
if (show) { | ||
intervalId = setInterval(() => { | ||
const { total_content, processed_content, progress_message } = store.getState().api; | ||
setDalayedJobTotal(total_content); | ||
setDelayedJobProcessing(processed_content); | ||
if (progress_message != "") { | ||
setProgressMessage(progress_message); | ||
} | ||
}, 1000); | ||
} | ||
|
||
return () => { | ||
if (intervalId) { | ||
setDelayedJobProcessing(0); | ||
setDalayedJobTotal(0); | ||
setProgressMessage("Running 0 out of 0 polygons (0%)"); | ||
clearInterval(intervalId); | ||
} | ||
}; | ||
}, [show]); | ||
|
||
const abortDelayedJob = () => { | ||
ApiSlice.abortDelayedJob(true); | ||
ApiSlice.addTotalContent(0); | ||
ApiSlice.addProgressContent(0); | ||
ApiSlice.addProgressMessage("Running 0 out of 0 polygons (0%)"); | ||
setDelayedJobProcessing(0); | ||
setDalayedJobTotal(0); | ||
setIsLoadingDelayedJob?.(false); | ||
}; | ||
|
||
if (!show) return null; | ||
|
||
const calculatedProgress = delayedJobTotal! > 0 ? Math.round((delayedJobProcessing! / delayedJobTotal!) * 100) : 0; | ||
|
||
const severity = calculatedProgress >= 75 ? "success" : calculatedProgress >= 50 ? "info" : "warning"; | ||
|
||
return ( | ||
<div className="fixed bottom-5 left-0 z-50 flex w-full items-center justify-center"> | ||
<Alert | ||
severity={severity} | ||
icon={<CircularProgress size={18} color="inherit" />} | ||
action={ | ||
<button | ||
onClick={abortDelayedJob} | ||
className="ml-2 rounded px-2 py-1 text-sm font-medium text-red-200 hover:bg-red-300" | ||
> | ||
Cancel | ||
</button> | ||
} | ||
> | ||
<AlertTitle>{title}</AlertTitle> | ||
{progressMessage ?? "Running 0 out of 0 polygons (0%)"} | ||
</Alert> | ||
</div> | ||
); | ||
}; | ||
|
||
export default DelayedJobsProgressAlert; |
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.