fix build log snackbar not appearing for derivative function deploy

This commit is contained in:
Sidney Alcantara
2021-11-29 19:40:13 +11:00
parent 6d9d3d4fce
commit d20e98e600
3 changed files with 15 additions and 4 deletions

View File

@@ -12,6 +12,7 @@ import Loading from "@src/components/Loading";
import { useProjectContext } from "@src/contexts/ProjectContext";
import { useConfirmation } from "@src/components/ConfirmationDialog";
import { useSnackLogContext } from "@src/contexts/SnackLogContext";
import { FieldType } from "@src/constants/fields";
import { runRoutes } from "@src/constants/runRoutes";
@@ -27,6 +28,7 @@ export default function FieldSettings(props: IMenuModalProps) {
const { requestConfirmation } = useConfirmation();
const { tableState, rowyRun } = useProjectContext();
const snackLogContext = useSnackLogContext();
const rendedFieldSettings = useMemo(
() =>
@@ -164,6 +166,7 @@ export default function FieldSettings(props: IMenuModalProps) {
cancel: "Later",
handleConfirm: async () => {
if (!rowyRun) return;
snackLogContext.requestSnackLog();
rowyRun({
route: runRoutes.buildFunction,
body: {

View File

@@ -118,6 +118,7 @@ export default function BuildLogsSnack({ onClose, onOpenPanel }) {
aria-label="Expand"
size="small"
onClick={() => setExpanded(!expanded)}
style={{ color: "white" }}
>
{expanded ? <CollapseIcon /> : <ExpandIcon />}
</IconButton>
@@ -135,13 +136,19 @@ export default function BuildLogsSnack({ onClose, onOpenPanel }) {
buildLogExpanded: 0,
});
}}
style={{ color: "white" }}
>
<OpenIcon />
</IconButton>
</Tooltip>
<Tooltip title="Close">
<IconButton aria-label="Close" size="small" onClick={onClose}>
<IconButton
aria-label="Close"
size="small"
onClick={onClose}
style={{ color: "white" }}
>
<CloseIcon />
</IconButton>
</Tooltip>

View File

@@ -76,8 +76,8 @@ export default function Extensions() {
const handleSaveDeploy = async () => {
handleSaveExtensions();
try {
snackLogContext.requestSnackLog();
if (rowyRun)
if (rowyRun) {
snackLogContext.requestSnackLog();
rowyRun({
route: runRoutes.buildFunction,
body: {
@@ -86,7 +86,8 @@ export default function Extensions() {
tableConfigPath: tableState?.config.tableConfig.path,
},
});
analytics.logEvent("deployed_extensions");
analytics.logEvent("deployed_extensions");
}
} catch (e) {
console.error(e);
}