-
Notifications
You must be signed in to change notification settings - Fork 119
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 #5064 from gooddata/mkn-f1-437
feat: ui support for scheduling pdf exports
- Loading branch information
Showing
89 changed files
with
2,036 additions
and
5,487 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
18 changes: 7 additions & 11 deletions
18
libs/sdk-ui-dashboard/src/model/commandHandlers/scheduledEmail/saveScheduledEmailHandler.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 |
---|---|---|
@@ -1,32 +1,28 @@ | ||
// (C) 2021-2022 GoodData Corporation | ||
// (C) 2021-2024 GoodData Corporation | ||
import { SagaIterator } from "redux-saga"; | ||
import { call } from "redux-saga/effects"; | ||
import { DashboardContext } from "../../types/commonTypes.js"; | ||
import { IScheduledMailDefinition, ObjRef, isObjRef } from "@gooddata/sdk-model"; | ||
import { IAutomationMetadataObject, isObjRef } from "@gooddata/sdk-model"; | ||
import { SaveScheduledEmail } from "../../commands/scheduledEmail.js"; | ||
import { DashboardScheduledEmailSaved, scheduledEmailSaved } from "../../events/scheduledEmail.js"; | ||
|
||
function saveScheduledEmail( | ||
ctx: DashboardContext, | ||
scheduledEmail: IScheduledMailDefinition, | ||
filterContextRef?: ObjRef, | ||
): Promise<void> { | ||
scheduledEmail: IAutomationMetadataObject, | ||
): Promise<IAutomationMetadataObject> { | ||
const { backend, workspace } = ctx; | ||
if (!isObjRef(scheduledEmail)) { | ||
throw new Error("Cannot save schedule not referencing to an persisted object"); | ||
} | ||
return backend | ||
.workspace(workspace) | ||
.dashboards() | ||
.updateScheduledMail(scheduledEmail, scheduledEmail, filterContextRef); | ||
return backend.workspace(workspace).automations().updateAutomation(scheduledEmail); | ||
} | ||
|
||
export function* saveScheduledEmailHandler( | ||
ctx: DashboardContext, | ||
cmd: SaveScheduledEmail, | ||
): SagaIterator<DashboardScheduledEmailSaved> { | ||
const { scheduledEmail, filterContextRef } = cmd.payload; | ||
yield call(saveScheduledEmail, ctx, scheduledEmail, filterContextRef); | ||
const { scheduledEmail } = cmd.payload; | ||
yield call(saveScheduledEmail, ctx, scheduledEmail); | ||
|
||
return scheduledEmailSaved(ctx, cmd.correlationId); | ||
} |
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.