Add ISkinService for Abstractions Project#5838
Add ISkinService for Abstractions Project#5838GerardSmit wants to merge 4 commits intodnnsoftware:developfrom
Conversation
valadas
left a comment
There was a problem hiding this comment.
I have 2 small concernes but I am not sure if relevant, just something to double-check...
bdukes
left a comment
There was a problem hiding this comment.
Thanks! We appreciate your work, this is a nice and clean PR. Hopefully we can quickly resolve our couple of questions and get it included.
|
I've changed the abstraction a little bit, in my eyes it makes more sense this way. SkinPackageTypeI've created a new enum named "SkinPackageType", this can be either Skin or Container. Instead of having a property "RootSkin" or "RootContainer", you call: Skin in SkinPackageInfoI also did see that there is a SkinInfo, but it's never used. I changed SkinPackageInfo.Skins to a list of SkinInfo. If we ever add more details in the table Because of the abstractions, I cannot implement In the abstractions I've added ISkinPackageInfo skinPackageInfo; // Instance of the Skin Package
ISkinInfo newSkin = skinPackageInfo.Skins.AddNew(); // New skinNamingI've also changed the naming a little bit, for example This means the abstraction is quite different than the implementation now, but it's way clearer what every method does, just by the name and arguments. If there is any feedback I like to hear it. |
Deprecate SkinPackageInfo.Skins, rename list to SkinPackageInfo.SkinsList
8b38df8 to
c70a8ba
Compare
|
@dnnsoftware/approvers I've rebased on |
|
Just thinking about this PR, should we call the new abstraction |
I don't have a strong preference. I would love it but then a lot of other code uses Skin terminology so not sure if it would add or remove confusion :) |
|
I think we can merge this PR as-is. I opened a new PR to discuss the potential naming change. |
| /// <summary>Gets or sets a dictionary mapping from <see cref="SkinInfo.SkinId"/> to <see cref="SkinInfo.SkinSrc"/>.</summary> | ||
| [XmlIgnore] | ||
| [JsonIgnore] | ||
| [Obsolete($"Deprecated in DotNetNuke 9.13.1. Use {nameof(ISkinPackageInfo)}.{nameof(ISkinPackageInfo.Skins)} instead. Scheduled for removal in v11.0.0.")] |
There was a problem hiding this comment.
Note, the SkinController only updates the SkinsList (skinPackage is ISkinPackageInfo here):
Dnn.Platform/DNN Platform/Library/UI/Skins/SkinController.cs
Lines 641 to 656 in 2d85973
Even though the property is deprecated, it's read-only now.
There was a problem hiding this comment.
I'm not sure I understand. Are you saying that UpdateSkinPackage is wrong to use skinPackage.Skins? Or that the ISkinPackageInfo.Skins property is fundamentally broken? Or that we're missing an update to keep the two collection in sync?
There was a problem hiding this comment.
We currently have two properties:
Skins = Dictionary<int, string>
SkinsList = List<ISkinInfo>
If you change the SkinsList and call UpdateSkinPackage the skins will be updated.
However, if you change the Skins and call UpdateSkinPackage the skins will not be updated, which does work in the current version.
Or that we're missing an update to keep the two collection in sync?
Correct.
|
I propose we move this PR to a 9.14.0 milestone. @dnnsoftware/approvers ? |
|
Per Technology meeting today, we agreed on a 9.14.0 milestone for this PR. Thanks! |
Fixes #5837
Summary
This PR adds
ISkinServicewhich is an abstraction layer forSkinController.Things to validate
IDtoId.Only
DotNetNuke.Abstractions.Users.IUserInfousesID(AffiliateID,PortalID,UserID), the rest usesId.[TypeForwardTo]so extensions don't have to recompile.[Obsolete]and I haven't modified the calls toSkinController.