-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CORE-1952 Display limit check errors from instant launch actions
* Updated the `InstantLaunchButtonWrapper` to check for error codes related to VICE permission or limit errors, and to display the same related dialog as displayed from the `AppName` in the apps listing. * Since `POST /analyses` does not return `limitChecks` info in errors, refactored the `instantlyLaunch` service facade to parse `limitChecks` info from the `/quicklaunches/{id}/app-info` call it already makes, and to reject the call if the `canRun` flag is set to `false`. * Removed `catch` from `instantlyLaunch` promises so that errors from those endpoints can be properly displayed in the UI (rather than causing undefined `ql` or `app` exceptions). * Refactored `RunErrorDialog` from `AppName` into its own component. * Removed duplicate `usageSummary*Response` mocks from data stories. * Removed duplicate template args from data listing stories. * Fixed a deprecated `rows` warning in `FormMultilineTextField`. * Added missing and updated vice i18n namespaces to pages.
- Loading branch information
Showing
18 changed files
with
603 additions
and
332 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
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,50 @@ | ||
/** | ||
* A dialog component to display the App launch run error code. | ||
* | ||
* @author sriram, psarando | ||
*/ | ||
import React from "react"; | ||
|
||
import { useTranslation } from "i18n"; | ||
import { ERROR_CODES } from "components/error/errorCode"; | ||
import DEDialog from "components/utils/DEDialog"; | ||
import RunError from "./RunError"; | ||
|
||
import { Button, Typography } from "@material-ui/core"; | ||
|
||
const RunErrorDialog = (props) => { | ||
const { baseId, code, open, viceQuota, runningJobs, onClose } = props; | ||
|
||
const { t } = useTranslation(["launch", "common"]); | ||
|
||
let title; | ||
if (code === ERROR_CODES.ERR_LIMIT_REACHED) { | ||
title = t("jobLimitReached"); | ||
} else if (code === ERROR_CODES.ERR_FORBIDDEN) { | ||
title = t("accessDenied"); | ||
} | ||
|
||
return ( | ||
<DEDialog | ||
baseId={baseId} | ||
title={title} | ||
open={open} | ||
actions={ | ||
<Button color="primary" onClick={onClose}> | ||
{t("common:ok")} | ||
</Button> | ||
} | ||
onClose={onClose} | ||
> | ||
<Typography> | ||
<RunError | ||
code={code} | ||
viceQuota={viceQuota} | ||
runningJobs={runningJobs} | ||
/> | ||
</Typography> | ||
</DEDialog> | ||
); | ||
}; | ||
|
||
export default RunErrorDialog; |
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
Oops, something went wrong.