Files
astuto/app/javascript/containers/GeneralSiteSettings.tsx

71 lines
2.3 KiB
TypeScript
Raw Normal View History

2022-07-18 10:47:54 +02:00
import { connect } from "react-redux";
import GeneralSiteSettingsP from "../components/SiteSettings/General/GeneralSiteSettingsP";
import { updateTenant } from "../actions/Tenant/updateTenant";
2022-07-22 16:50:36 +02:00
import { State } from "../reducers/rootReducer";
2024-09-16 18:48:18 +02:00
import {
TenantSettingBrandDisplay,
TenantSettingCollapseBoardsInHeader,
TenantSettingFeedbackApprovalPolicy,
TenantSettingLogoLinksTo,
} from "../interfaces/ITenantSetting";
2022-07-18 10:47:54 +02:00
const mapStateToProps = (state: State) => ({
areUpdating: state.siteSettings.general.areUpdating,
error: state.siteSettings.general.error,
});
const mapDispatchToProps = (dispatch: any) => ({
updateTenant(
siteName: string,
2025-01-22 09:55:36 +01:00
siteLogo: File,
oldSiteLogo: string,
brandDisplaySetting: TenantSettingBrandDisplay,
2022-07-18 10:47:54 +02:00
locale: string,
useBrowserLocale: boolean,
rootBoardId: number,
2024-03-24 12:54:02 +01:00
customDomain: string,
isPrivate: boolean,
2024-07-12 20:38:46 +02:00
allowAnonymousFeedback: boolean,
feedbackApprovalPolicy: TenantSettingFeedbackApprovalPolicy,
2024-09-16 18:48:18 +02:00
logoLinksTo: TenantSettingLogoLinksTo,
logoCustomUrl: string,
showRoadmapInHeader: boolean,
collapseBoardsInHeader: TenantSettingCollapseBoardsInHeader,
showVoteCount: boolean,
showVoteButtonInBoard: boolean,
hideUnusedStatusesInFilterByStatus: boolean,
2024-02-27 18:32:14 +01:00
showPoweredBy: boolean,
2022-07-18 10:47:54 +02:00
authenticityToken: string
): Promise<any> {
return dispatch(updateTenant({
siteName,
siteLogo,
2025-01-22 09:55:36 +01:00
oldSiteLogo,
tenantSetting: {
brand_display: brandDisplaySetting,
use_browser_locale: useBrowserLocale,
root_board_id: rootBoardId,
is_private: isPrivate,
2024-07-12 20:38:46 +02:00
allow_anonymous_feedback: allowAnonymousFeedback,
feedback_approval_policy: feedbackApprovalPolicy,
2024-09-16 18:48:18 +02:00
logo_links_to: logoLinksTo,
logo_custom_url: logoCustomUrl,
show_roadmap_in_header: showRoadmapInHeader,
collapse_boards_in_header: collapseBoardsInHeader,
2024-07-12 20:38:46 +02:00
show_vote_count: showVoteCount,
show_vote_button_in_board: showVoteButtonInBoard,
hide_unused_statuses_in_filter_by_status: hideUnusedStatusesInFilterByStatus,
2024-07-12 20:38:46 +02:00
show_powered_by: showPoweredBy,
},
2022-07-18 10:47:54 +02:00
locale,
2024-03-24 12:54:02 +01:00
customDomain,
2022-07-18 10:47:54 +02:00
authenticityToken,
}));
},
});
export default connect(
mapStateToProps,
mapDispatchToProps
)(GeneralSiteSettingsP);