-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ui support for scheduling pdf exports
Add support for scheduling pdf exports in the dashboard component. Refactor components to new model and methods. Cleanup unnecessary bear-backend related logic. Map updated scheduling functionality to proper feature flag. risk: low JIRA: F1-437
- 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.