-
Notifications
You must be signed in to change notification settings - Fork 753
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ISkinService for Abstractions Project #5838
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have 2 small concernes but I am not sure if relevant, just something to double-check...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 skin NamingI'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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much!
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. |
[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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
/// <inheritdoc cref="ISkinService.UpdateSkinPackage" /> | |
private static void UpdateSkinPackage(ISkinPackageInfo skinPackage) | |
{ | |
DataProvider.Instance().UpdateSkinPackage( | |
skinPackage.SkinPackageId, | |
skinPackage.PackageId, | |
skinPackage.PortalId, | |
skinPackage.SkinName, | |
SkinUtils.ToDatabaseName(skinPackage.SkinType), | |
UserController.Instance.GetCurrentUserInfo().UserID); | |
EventLogController.Instance.AddLog(skinPackage, PortalController.Instance.GetCurrentPortalSettings(), UserController.Instance.GetCurrentUserInfo().UserID, string.Empty, EventLogController.EventLogType.SKINPACKAGE_UPDATED); | |
foreach (var skin in skinPackage.Skins) | |
{ | |
UpdateSkin(skin.SkinId, skin.SkinSrc); | |
} | |
} |
Even though the property is deprecated, it's read-only now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
ISkinService
which is an abstraction layer forSkinController
.Things to validate
ID
toId
.Only
DotNetNuke.Abstractions.Users.IUserInfo
usesID
(AffiliateID
,PortalID
,UserID
), the rest usesId
.[TypeForwardTo]
so extensions don't have to recompile.[Obsolete]
and I haven't modified the calls toSkinController
.