Skip to content

Commit

Permalink
Merge pull request #5452 from gooddata/release-to-master
Browse files Browse the repository at this point in the history
Merge release into master
  • Loading branch information
hackerstanislav authored Oct 8, 2024
2 parents b8d6987 + 27a3f8f commit 241776c
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 1 deletion.
1 change: 1 addition & 0 deletions libs/sdk-model/api/sdk-model.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3178,6 +3178,7 @@ export interface ISettings {
platformEdition?: PlatformEdition;
responsiveUiDateFormat?: string;
showHiddenCatalogItems?: boolean;
timezone?: string;
weekStart?: WeekStart;
whiteLabeling?: IWhiteLabeling;
}
Expand Down
5 changes: 5 additions & 0 deletions libs/sdk-model/src/settings/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,11 @@ export interface ISettings {
*/
metadataTimeZone?: string;

/**
* Timezone
*/
timezone?: string;

/**
* Enable new max bucket size items limit for Pivot Table
*/
Expand Down
3 changes: 3 additions & 0 deletions libs/sdk-ui-dashboard/api/sdk-ui-dashboard.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -7866,6 +7866,9 @@ export const selectSupportsSettingConnectingAttributes: DashboardSelector<boolea
// @internal
export const selectSupportsSingleSelectDependentFilters: DashboardSelector<boolean>;

// @public
export const selectTimezone: DashboardSelector<string | undefined>;

// @alpha
export const selectUsers: DashboardSelector<IWorkspaceUser[]>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@ export const selectLocale: DashboardSelector<ILocale> = createSelector(selectCon
return state.locale ?? undefined;
});

/**
* Returns timezone
*
* @public
*/
export const selectTimezone: DashboardSelector<string | undefined> = createSelector(selectConfig, (state) => {
return state.settings.timezone ?? undefined;
});

/**
* Returns number separators to use when rendering numeric values on charts or KPIs.
*
Expand Down
1 change: 1 addition & 0 deletions libs/sdk-ui-dashboard/src/model/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export {
selectEnableKPIDashboardDrillFromAttribute,
selectIsShareButtonHidden,
selectWeekStart,
selectTimezone,
selectIsDrillDownEnabled,
selectEnableUnavailableItemsVisibility,
selectEnableKDDependentFilters,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
isCustomWidget,
ExtendedDashboardWidget,
selectCurrentUser,
selectTimezone,
} from "../../../../model/index.js";
import { normalizeTime } from "@gooddata/sdk-ui-kit";
import { WidgetAttachmentType } from "../types.js";
Expand Down Expand Up @@ -73,6 +74,8 @@ export function useEditScheduledEmail(props: IUseEditScheduledEmailProps) {
// Dashboard
const dashboardId = useDashboardSelector(selectDashboardId);
const dashboardTitle = useDashboardSelector(selectDashboardTitle);
const timezone = useDashboardSelector(selectTimezone);

const areDashboardFiltersChanged = !!dashboardFilters;

const currentUser = useDashboardSelector(selectCurrentUser);
Expand All @@ -85,6 +88,7 @@ export function useEditScheduledEmail(props: IUseEditScheduledEmailProps) {
newAutomationMetadataObjectDefinition(
isWidget
? {
timezone,
dashboardId: dashboardId!,
notificationChannel: firstChannel,
insight,
Expand All @@ -93,6 +97,7 @@ export function useEditScheduledEmail(props: IUseEditScheduledEmailProps) {
widgetFilters,
}
: {
timezone,
dashboardId: dashboardId!,
notificationChannel: firstChannel,
title: dashboardTitle,
Expand Down Expand Up @@ -439,6 +444,7 @@ function newWidgetExportDefinitionMetadataObjectDefinition({
}

function newAutomationMetadataObjectDefinition({
timezone,
dashboardId,
notificationChannel,
title,
Expand All @@ -448,6 +454,7 @@ function newAutomationMetadataObjectDefinition({
dashboardFilters,
widgetFilters,
}: {
timezone?: string;
dashboardId: string;
notificationChannel: string;
title?: string;
Expand Down Expand Up @@ -482,7 +489,7 @@ function newAutomationMetadataObjectDefinition({
tags: [],
schedule: {
firstRun: toModifiedISOString(normalizedFirstRun),
timezone: getUserTimezone().identifier,
timezone: timezone ?? getUserTimezone().identifier,
cron,
},
details: {
Expand Down

0 comments on commit 241776c

Please sign in to comment.