v1.2.11.1

This commit is contained in:
2023-10-16 16:22:45 +01:00
parent fbac433f63
commit 52232331f8
21 changed files with 82 additions and 23 deletions
@@ -43,7 +43,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
responseData.SetControlError(nameof(model.ContactValue), Localiser["msg.validation.mandatory.value"]); responseData.SetControlError(nameof(model.ContactValue), Localiser["msg.validation.mandatory.value"]);
// Method specific value validation. // Method specific value validation.
if (!SaxContactMethodHelper.IsValidContactMethodValue(method, model.ContactValue)) if (!model.ContactValue.IsEmpty() && !SaxContactMethodHelper.IsValidContactMethodValue(method, model.ContactValue))
{ {
// Log invalid values so that the validation can be adjusted if needed. // Log invalid values so that the validation can be adjusted if needed.
SaLogger.Warn(fn + " Invalid contact method value. Mathod: " + method.ToString() + ". Value: " + model.ContactValue); SaLogger.Warn(fn + " Invalid contact method value. Mathod: " + method.ToString() + ". Value: " + model.ContactValue);
@@ -146,7 +146,7 @@
<div class="sax-content"> <div class="sax-content">
<div class="row"> <div class="row">
<div class="fixed"> <div class="fixed">
<img alt="" title="" class="OrganisationLogo" style="display:none;max-width:@(Sax.Config.Organisation.Logo.DisplayWidthMax_List + "px");max-height:@(Sax.Config.Organisation.Logo.DisplayHeightMax_List + "px");margin-right:8px;border:1px solid #c0c0c0;border-radius:2px;" /> <div style="min-width:48px;"><img alt="" title="" class="OrganisationLogo" style="display:none;max-width:@(Sax.Config.Organisation.Logo.DisplayWidthMax_List + "px");max-height:@(Sax.Config.Organisation.Logo.DisplayHeightMax_List + "px");margin-right:8px;border:1px solid #c0c0c0;border-radius:2px;" /></div>
</div> </div>
<div class="col"> <div class="col">
<div class="row"> <div class="row">
@@ -97,13 +97,13 @@
.sax-panel-filter .sax-header .sax-results-paging .sax-action .sax-panel-filter .sax-header .sax-results-paging .sax-action
{ {
margin: 2px 1px 0 1px; margin: 2px 1px 0 1px;
background-color: #b0b0b0; background-color: #c0c0c0;
box-shadow: 0 0 0 1px #40404080 inset; box-shadow: 0 0 0 1px #40404080 inset;
} }
.sax-panel-filter .sax-header .sax-results-paging .sax-action:hover .sax-panel-filter .sax-header .sax-results-paging .sax-action:hover
{ {
background-color: #c0c0c0; background-color: #e0e0e0;
} }
/* Panel header - Burger */ /* Panel header - Burger */
@@ -57,8 +57,8 @@
opt.buttons[sax.dlg.btn.ok] = function () { cm.fn.applyChanges(); }; opt.buttons[sax.dlg.btn.ok] = function () { cm.fn.applyChanges(); };
opt.buttons[sax.dlg.btn.cancel] = function () { $(this).dialog('close'); }; opt.buttons[sax.dlg.btn.cancel] = function () { $(this).dialog('close'); };
$dlg.conMth = $('#dlgContactMethod').dialog(opt); $dlg.conMth = $('#dlgContactMethod').dialog(opt);
cm.$mth = $('.sax-select.ContactMethod', $dlg.conMth); cm.$mth = $('.sax-select.ContactMethod', $dlg.conMth).on('change', function () { sax.clearControlError(this); });
cm.$val = $('.sax-input.ContactValue', $dlg.conMth); cm.$val = $('.sax-input.ContactValue', $dlg.conMth).on('input', function () { sax.clearControlError(this); });
}); });
//-------------------------------------------------------------- //--------------------------------------------------------------
@@ -208,7 +208,7 @@
//-------------------------------------------------------------- //--------------------------------------------------------------
oa.removeItem = function (item, $item) oa.removeItem = function (item, $item)
{ {
sax.debug('removeItem') //sax.debug('removeItem')
oa.clearItem(); oa.clearItem();
let frm = $frm.assoc; let frm = $frm.assoc;
$('.ItemAssociationId', frm).val(item.id); $('.ItemAssociationId', frm).val(item.id);
@@ -219,7 +219,7 @@
} }
oa.onRemoveItem = function (response) oa.onRemoveItem = function (response)
{ {
sax.debug('', response) //sax.debug('', response)
if (!response.success) return; if (!response.success) return;
oa.refreshResults(); oa.refreshResults();
} }
@@ -18,6 +18,7 @@ using Saxonite.Net.Standard.Base.App;
using Saxonite.Net.Core.Web.Online.Helpers; using Saxonite.Net.Core.Web.Online.Helpers;
using Org.BouncyCastle.Security; using Org.BouncyCastle.Security;
using static Saxonite.Net.Standard.Base.App.Sax; using static Saxonite.Net.Standard.Base.App.Sax;
using System.Text.Json.Serialization;
namespace Saxonite.Net.Core.Web.Online.Controllers namespace Saxonite.Net.Core.Web.Online.Controllers
{ {
@@ -152,6 +153,9 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
/// </summary> /// </summary>
private class AssociationOrganisationData private class AssociationOrganisationData
{ {
[JsonIgnore]
public SysId OrganisationId { get; set; }
public String Id { get; set; }
public String Name { get; set; } public String Name { get; set; }
public String Display public String Display
{ {
@@ -165,6 +169,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
} }
public String Region { get; set; } public String Region { get; set; }
public String Sport { get; set; } public String Sport { get; set; }
public String LogoUrl { get; set; }
} }
private class OrganisationItemData : OrganisationListData private class OrganisationItemData : OrganisationListData
{ {
@@ -198,7 +203,6 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
if (!ValidUserSession) return GetAjaxResult_InvalidSession(responseData); if (!ValidUserSession) return GetAjaxResult_InvalidSession(responseData);
RefreshModel(model); RefreshModel(model);
// Record disposable items as they are created so all can be disposed when needed. // Record disposable items as they are created so all can be disposed when needed.
using (DisposableCollection<SacsHierarchyItem> disposableItems = new DisposableCollection<SacsHierarchyItem>()) using (DisposableCollection<SacsHierarchyItem> disposableItems = new DisposableCollection<SacsHierarchyItem>())
{ {
@@ -281,6 +285,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
colItemTypeFrom, colItemIdFrom, colOrganisationFrom_Name, colOrganisationFrom_SportIdPrimary, colOrganisationFrom_RegionIdPrimary, colItemTypeFrom, colItemIdFrom, colOrganisationFrom_Name, colOrganisationFrom_SportIdPrimary, colOrganisationFrom_RegionIdPrimary,
colItemTypeTo, colItemIdTo, colOrganisationTo_Name, colOrganisationTo_SportIdPrimary, colOrganisationTo_RegionIdPrimary colItemTypeTo, colItemIdTo, colOrganisationTo_Name, colOrganisationTo_SportIdPrimary, colOrganisationTo_RegionIdPrimary
}; };
List<SysId> assocOrganisationIds = new List<SysId>();
SaxItemAssociation.Params prmAssociations = new SaxItemAssociation.Params(); SaxItemAssociation.Params prmAssociations = new SaxItemAssociation.Params();
prmAssociations.ItemIdsIncluded.Add(organisation.GetItemId()); prmAssociations.ItemIdsIncluded.Add(organisation.GetItemId());
prmAssociations.StatusCat = SaxItemAssociation.StatusCat.ActiveOnly; prmAssociations.StatusCat = SaxItemAssociation.StatusCat.ActiveOnly;
@@ -308,6 +313,9 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
{ {
// 'From' item is the 'Other' organisation. // 'From' item is the 'Other' organisation.
AssociationOrganisationData assocOrgData = new AssociationOrganisationData(); AssociationOrganisationData assocOrgData = new AssociationOrganisationData();
assocOrgData.OrganisationId = itemIdFrom.Id;
assocOrganisationIds.AddId(assocOrgData.OrganisationId);
assocOrgData.Id = model.EncryptId(assocOrgData.OrganisationId);
assocOrgData.Name = values.GetString(colOrganisationFrom_Name.DataName); assocOrgData.Name = values.GetString(colOrganisationFrom_Name.DataName);
if (!orgSportIdFrom.Equals(orgSportIdTo)) if (!orgSportIdFrom.Equals(orgSportIdTo))
assocOrgData.Sport = model.GetSportCaption(orgSportIdFrom); assocOrgData.Sport = model.GetSportCaption(orgSportIdFrom);
@@ -319,6 +327,9 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
{ {
// 'To' item is the 'Other' organisation. // 'To' item is the 'Other' organisation.
AssociationOrganisationData assocOrgData = new AssociationOrganisationData(); AssociationOrganisationData assocOrgData = new AssociationOrganisationData();
assocOrgData.OrganisationId = itemIdTo.Id;
assocOrganisationIds.AddId(assocOrgData.OrganisationId);
assocOrgData.Id = model.EncryptId(assocOrgData.OrganisationId);
assocOrgData.Name = values.GetString(colOrganisationTo_Name.DataName); assocOrgData.Name = values.GetString(colOrganisationTo_Name.DataName);
if (!orgSportIdFrom.Equals(orgSportIdTo)) if (!orgSportIdFrom.Equals(orgSportIdTo))
assocOrgData.Sport = model.GetSportCaption(orgSportIdTo); assocOrgData.Sport = model.GetSportCaption(orgSportIdTo);
@@ -328,6 +339,33 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
} }
} }
} }
// Populate Associated Orgaisation Logo URLs.
if (assocOrganisationIds.Any())
{
ColumnDfn colAssocOrganisation_Id = AccountMgr.GetOrganisationColumnDfn(SaxOrganisation.Column.Id);
ColumnDfn colAssocOrganisation_LogoCount = AccountMgr.GetOrganisationColumnDfn(SaxOrganisation.Column.LogoImage_Count);
List<ColumnDfn> columns = new List<ColumnDfn>() { colAssocOrganisation_Id, colAssocOrganisation_LogoCount };
SaxOrganisation.Params prmAssocOrganisation = new SaxOrganisation.Params();
prmAssocOrganisation.IdsIncluded.AddIds(assocOrganisationIds);
using (DbResultSet resultSet = AccountMgr.ExecuteOrganisationQuery(columns, prmAssocOrganisation))
{
while (resultSet != null && resultSet.HasRows && resultSet.NextRecord())
{
NamedValue.Map values = resultSet.GetRecordValues();
SysId assocOrganisationId = new SysId(values.GetLong(colAssocOrganisation_Id.DataName));
if (values.GetLong(colAssocOrganisation_LogoCount.DataName) > 0)
{
foreach (List<AssociationOrganisationData> assocOrganisations in associationTypeGroups.Values)
{
foreach (AssociationOrganisationData assocOrganisation in assocOrganisations.Where(item => item.OrganisationId.Equals(assocOrganisationId)))
assocOrganisation.LogoUrl = GetOrganisationLogoLink(assocOrganisation.OrganisationId, false);
}
}
}
}
}
// Populate associations to response. // Populate associations to response.
foreach (SaxItemAssociation.TypeOptionData associationTypeGroup in associationTypeGroups.Keys.OrderBy(item => (int)item.TypeOption)) foreach (SaxItemAssociation.TypeOptionData associationTypeGroup in associationTypeGroups.Keys.OrderBy(item => (int)item.TypeOption))
{ {
@@ -41,7 +41,7 @@ namespace Saxonite.Net.Core.Web.Online.Helpers
case Sax.ContactMethod.LinkedIn: case Sax.ContactMethod.LinkedIn:
return "<a href='" + url + "' target='" + Sax.Config.Links.Targets.LinkedIn + "'>" + ConstructImageElement("icon/contact/linkedin-24.png") + value + " </a>"; return "<a href='" + url + "' target='" + Sax.Config.Links.Targets.LinkedIn + "'>" + ConstructImageElement("icon/contact/linkedin-24.png") + value + " </a>";
case Sax.ContactMethod.Twitter: case Sax.ContactMethod.Twitter:
return "<a href='" + url + "' target='" + Sax.Config.Links.Targets.Twitter + "'>" + ConstructImageElement("icon/contact/twitter-24.png") + value + " </a>"; return "<a href='" + url + "' target='" + Sax.Config.Links.Targets.Twitter + "'>" + ConstructImageElement("icon/contact/x-24.png") + value + " </a>";
case Sax.ContactMethod.Facebook: case Sax.ContactMethod.Facebook:
return "<a href='" + url + "' target='" + Sax.Config.Links.Targets.Facebook + "'>" + ConstructImageElement("icon/contact/facebook-24.png") + value + " </a>"; return "<a href='" + url + "' target='" + Sax.Config.Links.Targets.Facebook + "'>" + ConstructImageElement("icon/contact/facebook-24.png") + value + " </a>";
case Sax.ContactMethod.Instagram: case Sax.ContactMethod.Instagram:
@@ -146,7 +146,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="fixed"><img src="" class="OrganisationLogo" alt="" title=""></div> <div class="fixed"><div style="min-width:48px;"><img src="" class="OrganisationLogo" alt="" title=""></div></div>
</div> </div>
</div> </div>
@@ -14,7 +14,7 @@
{ {
min-height: 40px; min-height: 40px;
max-height: 170px; max-height: 170px;
padding: 2px 4px; padding: 4px 4px 2px 4px;
border: 1px solid #a0a0a0; border: 1px solid #a0a0a0;
border-top-left-radius: 4px; border-top-left-radius: 4px;
border-bottom-left-radius: 4px; border-bottom-left-radius: 4px;
@@ -23,13 +23,27 @@
#dlgOrganisation .OrganisationAssociations .sax-value .sax-assoc-type #dlgOrganisation .OrganisationAssociations .sax-value .sax-assoc-type
{ {
padding: 2px 4px 2px 4px;
font-weight: bold; font-weight: bold;
text-decoration: underline; background-color: #e0e0e0;
} }
#dlgOrganisation .OrganisationAssociations .sax-value .sax-assoc-org #dlgOrganisation .OrganisationAssociations .sax-value .sax-assoc-org
{ {
padding-left: 12px; margin: 2px 0 0 12px;
padding: 0 0 0 8px;
}
#dlgOrganisation .OrganisationAssociations .sax-value .sax-assoc-org:hover
{
cursor: pointer;
text-decoration: underline;
}
#dlgOrganisation .OrganisationAssociations .sax-value .sax-assoc-org img.icon
{
height: 24px;
margin-right:4px;
} }
</style> </style>
<script type="text/javascript"> <script type="text/javascript">
@@ -88,14 +88,14 @@
.sax-panel-filter .sax-header .sax-results-paging .sax-action .sax-panel-filter .sax-header .sax-results-paging .sax-action
{ {
margin: 2px 1px 0 1px; margin: 2px 1px 0 1px;
background-color: #a0a0a0; background-color: #c0c0c0;
opacity: 0.8; opacity: 1.0;
box-shadow: 0 0 0 1px #40404080 inset; box-shadow: 0 0 0 1px #40404080 inset;
} }
.sax-panel-filter .sax-header .sax-results-paging .sax-action:hover .sax-panel-filter .sax-header .sax-results-paging .sax-action:hover
{ {
background-color: #c0c0c0; background-color: #e0e0e0;
} }
/* Panel header - Burger */ /* Panel header - Burger */
Binary file not shown.

After

Width:  |  Height:  |  Size: 362 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 525 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 743 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 522 B

@@ -0,0 +1 @@
<svg viewBox="0 0 24 24" aria-hidden="true" class="r-k200y r-18jsvk2 r-4qtqp9 r-yyyyoo r-5sfk15 r-dnmrzs r-kzbkwu r-bnwqim r-1plcrui r-lrvibr"><g><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"></path></g></svg>

After

Width:  |  Height:  |  Size: 329 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 537 B

@@ -144,7 +144,7 @@
{ {
$assocs.append($("<div class='sax-assoc-type'>").text(assoc.caption)); $assocs.append($("<div class='sax-assoc-type'>").text(assoc.caption));
for (const org of assoc.organisations) for (const org of assoc.organisations)
$assocs.append($("<div class='sax-assoc-org'>").text(org.display)); $assocs.append(so.createAssocOrgItem(org));
} }
$('.OrganisationAssociations', dlg).toggle(item.associations.length>0); $('.OrganisationAssociations', dlg).toggle(item.associations.length>0);
let contact = []; let contact = [];
@@ -157,6 +157,12 @@
$dlg.org.dialog('option', 'title', item.name || sax.dlg.title.organisation); $dlg.org.dialog('option', 'title', item.name || sax.dlg.title.organisation);
sax.openDialog($dlg.org, 720, 800); sax.openDialog($dlg.org, 720, 800);
} }
so.createAssocOrgItem = function (org)
{
let $org = $('<div class="sax-assoc-org">').text(org.display).on('click', function (evt) { so.viewItem(org); });
$org.prepend($('<img class="icon">').prop('src', org.logoUrl || '../img/action/network-24.png'));
return $org;
}
//-------------------------------------------------------------- //--------------------------------------------------------------
$(function () $(function ()
{ {
+3 -3
View File
@@ -18,7 +18,7 @@ namespace Saxonite.Net.Standard.Base.App
//------------------------------------------------------------------- //-------------------------------------------------------------------
public static class Version public static class Version
{ {
private static String version { get; } = "1.2.11.0"; private static String version { get; } = "1.2.11.1";
// Retrieve version. // Retrieve version.
public static String GetFullVersion () { return version; } public static String GetFullVersion () { return version; }
public static String GetAppVersion () public static String GetAppVersion ()
@@ -42,11 +42,11 @@ namespace Saxonite.Net.Standard.Base.App
//------------------------------------------------------------------- //-------------------------------------------------------------------
// 1.2.11 6-Jul-2023 // 1.2.11 6-Jul-2023
// - Organisation associations. // - Organisation associations.
// 1.2.10 11-Oct-2022 // 1.2.10 11-Oct-2022
// - Online organisations display issue fixed. // - Online organisations display issue fixed.
// - User Sport 'Preparing' options. // - User Sport 'Preparing' options.
// - User reports. // - User reports.
// 1.2.9 12-Oct-2022 // 1.2.9 12-Oct-2022
// - Online Sports Experience update bug resolved. // - Online Sports Experience update bug resolved.
// - Sports Experience Awards. // - Sports Experience Awards.
// - Profile Sports and Organisations on separate pages. // - Profile Sports and Organisations on separate pages.
@@ -269,7 +269,7 @@ namespace Saxonite.Net.Standard.Base.App
contactMethodCodes.Add(Sax.ContactMethod.Wikipedia, Sax.ContactMethod.Wikipedia.ToString(), "Wikipedia"); contactMethodCodes.Add(Sax.ContactMethod.Wikipedia, Sax.ContactMethod.Wikipedia.ToString(), "Wikipedia");
// Social media. // Social media.
contactMethodCodes.Add(Sax.ContactMethod.LinkedIn, Sax.ContactMethod.LinkedIn.ToString(), "LinkedIn"); contactMethodCodes.Add(Sax.ContactMethod.LinkedIn, Sax.ContactMethod.LinkedIn.ToString(), "LinkedIn");
contactMethodCodes.Add(Sax.ContactMethod.Twitter, Sax.ContactMethod.Twitter.ToString(), "Twitter"); contactMethodCodes.Add(Sax.ContactMethod.Twitter, Sax.ContactMethod.Twitter.ToString(), "X");
contactMethodCodes.Add(Sax.ContactMethod.Facebook, Sax.ContactMethod.Facebook.ToString(), "Facebook"); contactMethodCodes.Add(Sax.ContactMethod.Facebook, Sax.ContactMethod.Facebook.ToString(), "Facebook");
contactMethodCodes.Add(Sax.ContactMethod.Instagram, Sax.ContactMethod.Instagram.ToString(), "Instagram"); contactMethodCodes.Add(Sax.ContactMethod.Instagram, Sax.ContactMethod.Instagram.ToString(), "Instagram");
contactMethodCodes.Add(Sax.ContactMethod.YouTube, Sax.ContactMethod.YouTube.ToString(), "YouTube"); contactMethodCodes.Add(Sax.ContactMethod.YouTube, Sax.ContactMethod.YouTube.ToString(), "YouTube");
@@ -65,7 +65,7 @@ namespace Saxonite.Net.Standard.Base.Helpers
} }
else if (method == Sax.ContactMethod.Twitter) else if (method == Sax.ContactMethod.Twitter)
{ {
// Twitter. // X (was Twitter).
return SacsDataValidationHelper.IsValidTwitterUrl(value); return SacsDataValidationHelper.IsValidTwitterUrl(value);
} }
else if (method == Sax.ContactMethod.Facebook) else if (method == Sax.ContactMethod.Facebook)