From 475a6452d2e3866dd83ae8f45f20c31b084783a1 Mon Sep 17 00:00:00 2001 From: Stefan Cullmann Date: Wed, 15 Mar 2017 22:52:47 +0100 Subject: [PATCH] Description --- Components/PortalGroupAdapter.cs | 2 + DTOs/PortalGroupInfo.cs | 1 + SiteGroups.Web/src/components/Editor.jsx | 39 ++++++++++++------- SiteGroups.Web/src/components/Editor.less | 5 ++- SiteGroups.Web/src/components/Row.jsx | 15 ++++--- .../App_LocalResources/SiteGroups.resx | 17 ++++---- 6 files changed, 50 insertions(+), 29 deletions(-) diff --git a/Components/PortalGroupAdapter.cs b/Components/PortalGroupAdapter.cs index 3a425bf..5ffa636 100644 --- a/Components/PortalGroupAdapter.cs +++ b/Components/PortalGroupAdapter.cs @@ -22,6 +22,7 @@ public IEnumerable SiteGroups() { AuthenticationDomain = g.AuthenticationDomain, PortalGroupId = g.PortalGroupId, + Description = g.PortalGroupDescription, MasterPortal = new PortalInfo { PortalName = g.MasterPortalName, @@ -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) diff --git a/DTOs/PortalGroupInfo.cs b/DTOs/PortalGroupInfo.cs index df0b084..8601798 100644 --- a/DTOs/PortalGroupInfo.cs +++ b/DTOs/PortalGroupInfo.cs @@ -9,5 +9,6 @@ public class PortalGroupInfo public string AuthenticationDomain { get; set; } public PortalInfo MasterPortal { get; set; } public IEnumerable Portals { get; set; } + public string Description { get; set; } } } \ No newline at end of file diff --git a/SiteGroups.Web/src/components/Editor.jsx b/SiteGroups.Web/src/components/Editor.jsx index 51976e7..63e0fd6 100644 --- a/SiteGroups.Web/src/components/Editor.jsx +++ b/SiteGroups.Web/src/components/Editor.jsx @@ -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
+
+ +
+ tabIndex={2} />
-
- -
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} />
+
+ 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} /> +
@@ -83,6 +94,7 @@ 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, @@ -90,6 +102,7 @@ SiteGroupEditor.propTypes = { 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, diff --git a/SiteGroups.Web/src/components/Editor.less b/SiteGroups.Web/src/components/Editor.less index b0fcd68..9b736b6 100644 --- a/SiteGroups.Web/src/components/Editor.less +++ b/SiteGroups.Web/src/components/Editor.less @@ -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 { diff --git a/SiteGroups.Web/src/components/Row.jsx b/SiteGroups.Web/src/components/Row.jsx index 97a016a..8ba6d18 100644 --- a/SiteGroups.Web/src/components/Row.jsx +++ b/SiteGroups.Web/src/components/Row.jsx @@ -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; @@ -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: { @@ -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; @@ -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, }; @@ -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} @@ -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 }); diff --git a/admin/personaBar/App_LocalResources/SiteGroups.resx b/admin/personaBar/App_LocalResources/SiteGroups.resx index 5712bcb..37e705b 100644 --- a/admin/personaBar/App_LocalResources/SiteGroups.resx +++ b/admin/personaBar/App_LocalResources/SiteGroups.resx @@ -132,11 +132,8 @@ Authentication Domain: - - All sites with the same auth.domain share the auth cookie. - - - An authentication domain is required + + Typically not required. Unassigned @@ -150,11 +147,17 @@ Group Name: - + The name helps to identifier the group. A group name is required + + + Description: + + + Describe your site group Edit @@ -165,7 +168,7 @@ Master Site: - + Master Site