Skip to content
This repository has been archived by the owner on Mar 16, 2021. It is now read-only.

Commit

Permalink
Description
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Cullmann committed Mar 15, 2017
1 parent 974d98f commit 475a645
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 29 deletions.
2 changes: 2 additions & 0 deletions Components/PortalGroupAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public IEnumerable<PortalGroupInfo> SiteGroups()
{
AuthenticationDomain = g.AuthenticationDomain,
PortalGroupId = g.PortalGroupId,
Description = g.PortalGroupDescription,
MasterPortal = new PortalInfo
{
PortalName = g.MasterPortalName,
Expand Down Expand Up @@ -76,6 +77,7 @@ int UpdatePortalGroup(PortalGroupInfo portalGroup)
var @group = PortalGroupController.GetPortalGroups().Single(g => g.PortalGroupId == portalGroup.PortalGroupId);
@group.PortalGroupName = portalGroup.PortalGroupName;
@group.AuthenticationDomain = portalGroup.AuthenticationDomain;
@group.PortalGroupDescription = portalGroup.Description;
PortalGroupController.UpdatePortalGroup(@group);
var currentPortals = PortalsOfGroup(portalGroup.PortalGroupId, portalGroup.MasterPortal.PortalId).ToList();
foreach (var portal in currentPortals)
Expand Down
1 change: 1 addition & 0 deletions DTOs/PortalGroupInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ public class PortalGroupInfo
public string AuthenticationDomain { get; set; }
public PortalInfo MasterPortal { get; set; }
public IEnumerable<PortalInfo> Portals { get; set; }
public string Description { get; set; }
}
}
39 changes: 26 additions & 13 deletions SiteGroups.Web/src/components/Editor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,28 @@ import Button from "dnn-button";
import AssignedSelector from "./AssignedSelector";
//import Label from "dnn-label";
import SingleLineInputWithError from "dnn-single-line-input-with-error";
import MultiLineInputWithError from "dnn-multi-line-input-with-error";
import "./Editor.less";

export default class SiteGroupEditor extends React.Component {
constructor(props) {
super(props);
}

render() {
return <div className="sitegroup-details-editor">
<GridCell>
<Grid numberOfColums={2}>
<div className="editor-container">
<div className="editor-row divider">
<SingleLineInputWithError
value={this.props.group.MasterPortal.PortalName}
enabled={false}
label={Resx.get("MasterSite.Label")}
tooltipMessage={Resx.get("MasterSite.Help")}
inputStyle={{ marginBottom: 15 }}
tabIndex={1} />
</div>
<div className="editor-row divider">
<SingleLineInputWithError
value={this.props.portalGroupName}
Expand All @@ -30,33 +40,34 @@ export default class SiteGroupEditor extends React.Component {
errorMessage={Resx.get("GroupName.Required")}
autoComplete="off"
inputStyle={{ marginBottom: 15 }}
tabIndex={1} />
tabIndex={2} />
</div>
</div>
<div className="editor-container right-column">
<div className="editor-row divider">
<SingleLineInputWithError
value={this.props.group.MasterPortal.PortalName}
enabled={false}
label={Resx.get("MasterSite.Label")}
tooltipMessage={Resx.get("MasterSite.Help")}
inputStyle={{ marginBottom: 15 }}
tabIndex={2} />
</div>
<div className="editor-row divider">
<SingleLineInputWithError
value={this.props.authenticationDomain}
enabled={true}
onChange={(e) => this.props.onAuthenticationDomainChanged(e.target.value)}
maxLength={50}
error={this.props.errors.authenticationDomain}
label={Resx.get("AuthenticationDomain.Label")}
tooltipMessage={Resx.get("AuthenticationDomain.Help")}
errorMessage={Resx.get("AuthenticationDomain.Required")}
autoComplete="off"
inputStyle={{ marginBottom: 15 }}
tabIndex={3} />
</div>
<div className="editor-row divider">
<MultiLineInputWithError
value={this.props.description}
enabled={true}
onChange={(e) => this.props.onDescriptionChanged(e.target.value)}
maxLength={50}
label={Resx.get("Description.Label")}
tooltipMessage={Resx.get("Description.Help")}
autoComplete="off"
inputStyle={{ marginBottom: 15 }}
tabIndex={4} />
</div>
</div>
</Grid>
<div className="selector-container">
Expand All @@ -83,13 +94,15 @@ SiteGroupEditor.propTypes = {
portalGroupName: React.PropTypes.string,
errors: React.PropTypes.object,
authenticationDomain: React.PropTypes.string,
description: React.PropTypes.string,
portals: React.PropTypes.array,
group: React.PropTypes.object,
unassignedSites: React.PropTypes.array,
onCancel: React.PropTypes.func,
onDeleteGroup: React.PropTypes.func,
onSave: React.PropTypes.func,
onGroupNameChanged: React.PropTypes.func,
onDescriptionChanged: React.PropTypes.func,
onAuthenticationDomainChanged: React.PropTypes.func,
onClickOnPortal: React.PropTypes.func,
onMoveItemsLeft: React.PropTypes.func,
Expand Down
5 changes: 4 additions & 1 deletion SiteGroups.Web/src/components/Editor.less
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,12 @@
vertical-align: middle;
margin-top: 9px;
}
.dnn-single-line-input-with-error, input {
.dnn-single-line-input-with-error,.dnn-multi-line-input-with-error, input {
width: 100%;
}
.dnn-multi-line-input-with-error textarea {
min-height:0;
}
&.divider {
padding-bottom: 15px;
.dnn-uicommon-select, .dnn-ui-common-single-line-input {
Expand Down
15 changes: 7 additions & 8 deletions SiteGroups.Web/src/components/Row.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ export default class SiteGroupRow extends React.Component {
this.state = {
PortalGroupName: props.group.PortalGroupName || "",
AuthenticationDomain: props.group.AuthenticationDomain,
Description: props.group.Description,
Portals: JSON.parse(JSON.stringify(props.group.Portals)) || [],
UnassignedSites: JSON.parse(JSON.stringify(props.unassignedSites || []))
.filter((site) => site.PortalId !== this.props.group.MasterPortal.PortalId),
errors: {
groupName: false,
authenticationDomain: false,
},
};
this.submitted = false;
Expand Down Expand Up @@ -129,6 +129,7 @@ export default class SiteGroupRow extends React.Component {
this.setState({
PortalGroupName: props.group.PortalGroupName || "",
AuthenticationDomain: props.group.AuthenticationDomain,
Description: props.group.Description,
Portals: JSON.parse(JSON.stringify(props.group.Portals)),
UnassignedSites: JSON.parse(JSON.stringify(props.unassignedSites)),
errors: {
Expand All @@ -142,18 +143,12 @@ export default class SiteGroupRow extends React.Component {
let valid = true;
if (this.submitted) {
let {PortalGroupName} = this.state;
let {AuthenticationDomain} = this.state;
let {errors} = this.state;
errors.groupName = false;
errors.authenticationDomain = false;
if (PortalGroupName === "") {
errors.groupName = true;
valid = false;
}
if (AuthenticationDomain === "") {
errors.authenticationDomain = true;
valid = false;
}
this.setState({ errors });
}
return valid;
Expand All @@ -167,6 +162,7 @@ export default class SiteGroupRow extends React.Component {
PortalGroupName: this.state.PortalGroupName,
MasterPortal: this.props.group.MasterPortal,
Portals: this.state.Portals,
Description: this.state.Description,
},
UnassignedSites: this.state.UnassignedSites,
};
Expand All @@ -193,6 +189,7 @@ export default class SiteGroupRow extends React.Component {
group={this.props.group}
portalGroupName={this.state.PortalGroupName}
authenticationDomain={this.state.AuthenticationDomain}
description={this.state.Description}
errors={this.state.errors}
unassignedSites={this.state.UnassignedSites}
portals={this.state.Portals}
Expand All @@ -202,7 +199,9 @@ export default class SiteGroupRow extends React.Component {
onSave={() => this.save()}
onAuthenticationDomainChanged={(value) => {
this.setState({ AuthenticationDomain: value });
this.isValid();
}}
onDescriptionChanged={(value) => {
this.setState({ Description: value });
}}
onGroupNameChanged={(value) => {
this.setState({ PortalGroupName: value });
Expand Down
17 changes: 10 additions & 7 deletions admin/personaBar/App_LocalResources/SiteGroups.resx
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,8 @@
<data name="AuthenticationDomain.Label" xml:space="preserve">
<value>Authentication Domain:</value>
</data>
<data name="AuthenticationDomain.Description" xml:space="preserve">
<value>All sites with the same auth.domain share the auth cookie.</value>
</data>
<data name="AuthenticationDomain.Required" xml:space="preserve">
<value>An authentication domain is required</value>
<data name="AuthenticationDomain.Help" xml:space="preserve">
<value>Typically not required.</value>
</data>
<data name="EditModule_Unassigned.Label" xml:space="preserve">
<value>Unassigned</value>
Expand All @@ -150,11 +147,17 @@
<data name="GroupName.Label" xml:space="preserve">
<value>Group Name:</value>
</data>
<data name="GroupName.Description" xml:space="preserve">
<data name="GroupName.Help" xml:space="preserve">
<value>The name helps to identifier the group.</value>
</data>
<data name="GroupName.Required" xml:space="preserve">
<value>A group name is required</value>
</data>
<data name="Description.Label" xml:space="preserve">
<value>Description:</value>
</data>
<data name="Description.Help" xml:space="preserve">
<value>Describe your site group</value>
</data>
<data name="Edit.Button" xml:space="preserve">
<value>Edit</value>
Expand All @@ -165,7 +168,7 @@
<data name="MasterSite.Label" xml:space="preserve">
<value>Master Site:</value>
</data>
<data name="MasterSite.Description" xml:space="preserve">
<data name="MasterSite.Help" xml:space="preserve">
<value>Master Site</value>
</data>
<data name="ChooseASite.Label" xml:space="preserve">
Expand Down

0 comments on commit 475a645

Please sign in to comment.