Skip to content

Commit

Permalink
Move after login/logout/registration redirection to site settings wit…
Browse files Browse the repository at this point in the history
…h other page settings (#3845)

Co-authored-by: Brian Dukes <bdukes@engagesoftware.com>
  • Loading branch information
donker and bdukes authored Jul 9, 2020
1 parent 9009378 commit 63aa99e
Show file tree
Hide file tree
Showing 10 changed files with 4,347 additions and 4,172 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { Component } from "react";
import PropTypes from "prop-types";
import { connect } from "react-redux";
import { security as SecurityActions } from "../../actions";
import { InputGroup, Dropdown, PagePicker, Switch, Label, Button } from "@dnnsoftware/dnn-react-common";
import { InputGroup, Dropdown, Switch, Label, Button } from "@dnnsoftware/dnn-react-common";
import "./style.less";
import util from "../../utils";
import resx from "../../resources";
Expand Down Expand Up @@ -150,36 +150,7 @@ class BasicSettingsPanelBody extends Component {
onSelect={this.onSettingChange.bind(this, "PrimaryAdministratorId") }
enabled={canEdit} />
</InputGroup>
<InputGroup>
<Label
tooltipMessage={resx.get("Redirect_AfterLogin.Help") }
label={resx.get("Redirect_AfterLogin") } />
<PagePicker
serviceFramework={util.utilities.sf}
style={{ width: "100%", zIndex: 2 }}
selectedTabId={state.basicLoginSettings.RedirectAfterLoginTabId}
OnSelect={this.onSettingChange.bind(this, "RedirectAfterLoginTabId") }
defaultLabel={state.basicLoginSettings.RedirectAfterLoginTabName !== "" ? state.basicLoginSettings.RedirectAfterLoginTabName : noneSpecifiedText}
noneSpecifiedText={noneSpecifiedText}
CountText={"{0} Results"}
PortalTabsParameters={RedirectAfterLoginParameters}
enabled={canEdit} />
</InputGroup>
<InputGroup>
<Label
tooltipMessage={resx.get("Redirect_AfterLogout.Help") }
label={resx.get("Redirect_AfterLogout") } />
<PagePicker
serviceFramework={util.utilities.sf}
style={{ width: "100%", zIndex: 1 }}
selectedTabId={state.basicLoginSettings.RedirectAfterLogoutTabId}
OnSelect={this.onSettingChange.bind(this, "RedirectAfterLogoutTabId") }
defaultLabel={state.basicLoginSettings.RedirectAfterLogoutTabName !== "" ? state.basicLoginSettings.RedirectAfterLogoutTabName : noneSpecifiedText}
noneSpecifiedText={noneSpecifiedText}
CountText={"{0} Results"}
PortalTabsParameters={RedirectAfterLogoutParameters}
enabled={canEdit} />
</InputGroup>
<div style={{paddingBottom: "15px", fontStyle: "italic"}}>{resx.get("RedirectionMovedToSiteSettings")}</div>
<InputGroup>
<div className="loginSettings-row_switch" style={{ margin: "0" }}>
<Label
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
RadioButtons,
Label,
Button,
PagePicker,
Tooltip
} from "@dnnsoftware/dnn-react-common";
import "./style.less";
Expand Down Expand Up @@ -272,23 +271,7 @@ class RegistrationSettingsPanelBody extends Component {
enabled={canEdit} />
</div>
</InputGroup>
<InputGroup>
<div className="registrationSettings-row-input">
<Label
tooltipMessage={resx.get("Redirect_AfterRegistration.Help") }
label={resx.get("Redirect_AfterRegistration") } />
<PagePicker
serviceFramework={util.utilities.sf}
style={{ width: "100%", zIndex: 1 }}
selectedTabId={state.registrationSettings.RedirectAfterRegistrationTabId}
OnSelect={this.onSettingChange.bind(this, "RedirectAfterRegistrationTabId") }
defaultLabel={state.registrationSettings.RedirectAfterRegistrationTabName !== "" ? state.registrationSettings.RedirectAfterRegistrationTabName : noneSpecifiedText}
noneSpecifiedText={noneSpecifiedText}
CountText={"{0} Results"}
PortalTabsParameters={RedirectAfterRegistrationParameters}
enabled={canEdit} />
</div>
</InputGroup>
<div style={{paddingBottom: "15px", fontStyle: "italic"}}>{resx.get("RedirectionMovedToSiteSettings")}</div>
<InputGroup>
<div className="registrationSettings-row_switch">
<Label
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,32 +132,17 @@ class DefaultPagesSettingsPanelBody extends Component {
let TabParameters_2 = Object.assign(Object.assign({}, TabParameters), { disabledNotSelectable: true });
let TabParameters_Login = Object.assign(Object.assign({}, TabParameters), { disabledNotSelectable: false, validateTab: "Account Login" });
let TabParameters_Search = Object.assign(Object.assign({}, TabParameters), { disabledNotSelectable: false, validateTab: "Search Results" });
let TabParameters_Anonymous = Object.assign(Object.assign({}, TabParameters), { disabledNotSelectable: true, roles: "-1" });
if (state.defaultPagesSettings) {
const columnOne = <div key="column-one" className="left-column">
<InputGroup>
<Label
tooltipMessage={resx.get("plSplashTabId.Help")}
label={resx.get("plSplashTabId")}
/>
<PagePicker
serviceFramework={util.utilities.sf}
style={{ width: "100%", zIndex: 6 }}
selectedTabId={state.defaultPagesSettings.SplashTabId ? state.defaultPagesSettings.SplashTabId : -1}
OnSelect={this.onSettingChange.bind(this, "SplashTabId")}
defaultLabel={state.defaultPagesSettings.SplashTabName ? state.defaultPagesSettings.SplashTabName : noneSpecifiedText}
noneSpecifiedText={noneSpecifiedText}
CountText={"{0} Results"}
PortalTabsParameters={TabParameters_1}
/>
</InputGroup>
<InputGroup>
<Label
tooltipMessage={resx.get("plHomeTabId.Help")}
label={resx.get("plHomeTabId")}
/>
<PagePicker
serviceFramework={util.utilities.sf}
style={{ width: "100%", zIndex: 5 }}
style={{ width: "100%", zIndex: 7 }}
selectedTabId={state.defaultPagesSettings.HomeTabId ? state.defaultPagesSettings.HomeTabId : -1}
OnSelect={this.onSettingChange.bind(this, "HomeTabId")}
defaultLabel={state.defaultPagesSettings.HomeTabName ? state.defaultPagesSettings.HomeTabName : noneSpecifiedText}
Expand All @@ -173,7 +158,7 @@ class DefaultPagesSettingsPanelBody extends Component {
/>
<PagePicker
serviceFramework={util.utilities.sf}
style={{ width: "100%", zIndex: 4 }}
style={{ width: "100%", zIndex: 6 }}
selectedTabId={state.defaultPagesSettings.LoginTabId ? state.defaultPagesSettings.LoginTabId : -1}
OnSelect={this.onSettingChange.bind(this, "LoginTabId")}
defaultLabel={state.defaultPagesSettings.LoginTabName ? state.defaultPagesSettings.LoginTabName : noneSpecifiedText}
Expand All @@ -192,7 +177,7 @@ class DefaultPagesSettingsPanelBody extends Component {
/>
<PagePicker
serviceFramework={util.utilities.sf}
style={{ width: "100%", zIndex: 3 }}
style={{ width: "100%", zIndex: 5 }}
selectedTabId={state.defaultPagesSettings.RegisterTabId ? state.defaultPagesSettings.RegisterTabId : -1}
OnSelect={this.onSettingChange.bind(this, "RegisterTabId")}
defaultLabel={state.defaultPagesSettings.RegisterTabName ? state.defaultPagesSettings.RegisterTabName : noneSpecifiedText}
Expand All @@ -208,7 +193,7 @@ class DefaultPagesSettingsPanelBody extends Component {
/>
<PagePicker
serviceFramework={util.utilities.sf}
style={{ width: "100%", zIndex: 2 }}
style={{ width: "100%", zIndex: 4 }}
selectedTabId={state.defaultPagesSettings.UserTabId ? state.defaultPagesSettings.UserTabId : -1}
OnSelect={this.onSettingChange.bind(this, "UserTabId")}
defaultLabel={state.defaultPagesSettings.UserTabName ? state.defaultPagesSettings.UserTabName : noneSpecifiedText}
Expand All @@ -217,8 +202,69 @@ class DefaultPagesSettingsPanelBody extends Component {
PortalTabsParameters={TabParameters_1}
/>
</InputGroup>
<InputGroup>
<Label
tooltipMessage={resx.get("Redirect_AfterLogin.Help") }
label={resx.get("Redirect_AfterLogin") } />
<PagePicker
serviceFramework={util.utilities.sf}
style={{ width: "100%", zIndex: 3 }}
selectedTabId={state.defaultPagesSettings.RedirectAfterLoginTabId ? state.defaultPagesSettings.RedirectAfterLoginTabId : -1}
OnSelect={this.onSettingChange.bind(this, "RedirectAfterLoginTabId") }
defaultLabel={state.defaultPagesSettings.RedirectAfterLoginTabName ? state.defaultPagesSettings.RedirectAfterLoginTabName : noneSpecifiedText}
noneSpecifiedText={noneSpecifiedText}
CountText={"{0} Results"}
PortalTabsParameters={TabParameters_2}
/>
</InputGroup>
<InputGroup>
<Label
tooltipMessage={resx.get("Redirect_AfterLogout.Help") }
label={resx.get("Redirect_AfterLogout") } />
<PagePicker
serviceFramework={util.utilities.sf}
style={{ width: "100%", zIndex: 2 }}
selectedTabId={state.defaultPagesSettings.RedirectAfterLogoutTabId ? state.defaultPagesSettings.RedirectAfterLogoutTabId : -1}
OnSelect={this.onSettingChange.bind(this, "RedirectAfterLogoutTabId") }
defaultLabel={state.defaultPagesSettings.RedirectAfterLogoutTabName ? state.defaultPagesSettings.RedirectAfterLogoutTabName : noneSpecifiedText}
noneSpecifiedText={noneSpecifiedText}
CountText={"{0} Results"}
PortalTabsParameters={TabParameters_Anonymous}
/>
</InputGroup>
<InputGroup>
<Label
tooltipMessage={resx.get("Redirect_AfterRegistration.Help") }
label={resx.get("Redirect_AfterRegistration") } />
<PagePicker
serviceFramework={util.utilities.sf}
style={{ width: "100%", zIndex: 1 }}
selectedTabId={state.defaultPagesSettings.RedirectAfterRegistrationTabId ? state.defaultPagesSettings.RedirectAfterRegistrationTabId : -1}
OnSelect={this.onSettingChange.bind(this, "RedirectAfterRegistrationTabId") }
defaultLabel={state.defaultPagesSettings.RedirectAfterRegistrationTabName ? state.defaultPagesSettings.RedirectAfterRegistrationTabName : noneSpecifiedText}
noneSpecifiedText={noneSpecifiedText}
CountText={"{0} Results"}
PortalTabsParameters={TabParameters_2}
/>
</InputGroup>
</div>;
const columnTwo = <div key="column-two" className="right-column">
<InputGroup>
<Label
tooltipMessage={resx.get("plSplashTabId.Help")}
label={resx.get("plSplashTabId")}
/>
<PagePicker
serviceFramework={util.utilities.sf}
style={{ width: "100%", zIndex: 7 }}
selectedTabId={state.defaultPagesSettings.SplashTabId ? state.defaultPagesSettings.SplashTabId : -1}
OnSelect={this.onSettingChange.bind(this, "SplashTabId")}
defaultLabel={state.defaultPagesSettings.SplashTabName ? state.defaultPagesSettings.SplashTabName : noneSpecifiedText}
noneSpecifiedText={noneSpecifiedText}
CountText={"{0} Results"}
PortalTabsParameters={TabParameters_1}
/>
</InputGroup>
<InputGroup>
<Label
tooltipMessage={resx.get("plSearchTabId.Help")}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information
namespace Dnn.PersonaBar.SiteSettings.Services.Dto
{
using Newtonsoft.Json;

// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information

namespace Dnn.PersonaBar.SiteSettings.Services.Dto
{
using Dnn.PersonaBar.Security.Attributes;

public class UpdateDefaultPagesSettingsRequest
{
public int? PortalId { get; set; }
Expand Down Expand Up @@ -32,5 +33,15 @@ public class UpdateDefaultPagesSettingsRequest
public int PrivacyTabId { get; set; }

public string PageHeadText { get; set; }

[TabExist]
public int RedirectAfterLoginTabId { get; set; }

[TabExist]
public int RedirectAfterLogoutTabId { get; set; }

[TabExist]
public int RedirectAfterRegistrationTabId { get; set; }

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ public class UpdateBasicLoginSettingsRequest
[UserExist(RoleNames = new string[] { Library.Constants.AdminsRoleName })]
public int PrimaryAdministratorId { get; set; }

[TabExist]
public int RedirectAfterLoginTabId { get; set; }

[TabExist]
public int RedirectAfterLogoutTabId { get; set; }

public bool RequireValidProfileAtLogin { get; set; }

public bool CaptchaLogin { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ public class UpdateRegistrationSettingsRequest

public bool UseCaptchaRegister { get; set; }

[TabExist]
public int RedirectAfterRegistrationTabId { get; set; }

public bool EnableRegisterNotification { get; set; }
}
}
Loading

0 comments on commit 63aa99e

Please sign in to comment.