Changes for page Licensed Extensions

Last modified by Jean Franco on 2022/10/27 21:09

From version < 2.1
edited by Jean Franco
on 2022/10/27 21:09
To version 1.1 >
edited by Jean Franco
on 2022/07/30 13:08
Change comment: Install extension [com.xwiki.licensing:application-licensing-licensor-ui/1.22]

Summary

Details

XWiki.ConfigurableClass[0]
configureGlobally
... ... @@ -1,1 +1,0 @@
1 -1
XWiki.JavaScriptExtension[0]
Code
... ... @@ -124,7 +124,7 @@
124 124   // Remove "Extend Trial" buttons from livetable, if the trial licenses limits were reached.
125 125   var updateLivetableButtons = function() {
126 126   var instanceId = $('#instanceId').val();
127 - $('.licenseActions .licenseButton-extendTrial').each(function() {
127 + $('.licenseActions .btn-primary').each(function() {
128 128   // Compute the key to check in the localStorage.
129 129   var buttonData = JSON.parse($(this).attr('data-button'));
130 130   var featureId = buttonData.featureId;
... ... @@ -139,13 +139,13 @@
139 139  
140 140   // An extensionId could have multiple rows in the livetable if is installed on multiple subwikis, but the allowlist
141 141   // is applied to all namespaces.
142 - var updateExtensionOfOtherWikis = function(extensionId, isAutoUpgrade) {
142 + var updateExtensionOfOtherWikis = function(extensionId, isChecked) {
143 143   var similarExtensions = $("input[name='extensionId'][value='" + extensionId + "']");
144 144   similarExtensions.each(function() {
145 - var autoUpgradeButton = $(this).siblings('.licenseButton-autoUpgrade');
146 - autoUpgradeButton.find('.action-icon').toggleClass('isAutoUpgrade', isAutoUpgrade);
147 - var translationKey = isAutoUpgrade ? 'data-prevent-label' : 'data-allow-label';
148 - autoUpgradeButton.prop('title', autoUpgradeButton.attr(translationKey));
145 + var checkbox = $(this).siblings("input[type='checkbox']");
146 + if (checkbox.prop('checked') != isChecked) {
147 + checkbox.prop('checked', isChecked);
148 + }
149 149   });
150 150   };
151 151  
... ... @@ -203,8 +203,7 @@
203 203  
204 204   // Manages the license buttons from the licenses livetable. If a trial is requested, it is automatically generated
205 205   // and installed, else the user is redirected to a page to buy a license.
206 - $('#licenseManager').on('click', '.licenseButton', function(e) {
207 - e.preventDefault();
206 + $('#licenseManager').on('click', '.licenseButton', function() {
208 208   var ownerDetailsForm = $('#ownerDetails');
209 209   if (!validateOwnerDetails(ownerDetailsForm)) {
210 210   return;
... ... @@ -259,18 +259,13 @@
259 259   });
260 260   });
261 261  
262 - $(document).on('click', '.licenseButton-autoUpgrade', function(e) {
263 - e.preventDefault();
264 - var autoUpgradeButton = $(this);
265 - var autoUpgradeForm = autoUpgradeButton.closest('form').serializeArray();
261 + $(document).on('click', 'input[name=autoUpgrade]', function() {
262 + var autoUpgradeForm = $(this).parent('form').serializeArray();
266 266   licensor.modifyAutoUpgradesAllowList(autoUpgradeForm).success(function(data) {
267 - autoUpgradeButton.find('.action-icon').toggleClass('isAutoUpgrade', data.isAutoUpgrade);
268 268   if(data.isAutoUpgrade) {
269 - autoUpgradeButton.prop('title', autoUpgradeButton.attr('data-prevent-label'));
270 270   new XWiki.widgets.Notification(
271 271   $jsontool.serialize($services.localization.render('licensor.moreActions.autoUpgrade.added')), 'done');
272 272   } else {
273 - autoUpgradeButton.prop('title', autoUpgradeButton.attr('data-allow-label'));
274 274   new XWiki.widgets.Notification(
275 275   $jsontool.serialize($services.localization.render('licensor.moreActions.autoUpgrade.removed')), 'done');
276 276   }
XWiki.StyleSheetExtension[0]
Code
... ... @@ -20,10 +20,3 @@
20 20   right: 0;
21 21   left: auto;
22 22  }
23 -
24 -.licenseButton-paid .action-icon, .licenseButton-extendPaid .action-icon, .isAutoUpgrade {
25 - color: @brand-success;
26 -}
27 -.licenseButton-trial .action-icon, .licenseButton-extendTrial .action-icon {
28 - color: @link-color;
29 -}
Content Type
... ... @@ -1,1 +1,1 @@
1 -LESS
1 +CSS
Parse content
... ... @@ -1,1 +1,1 @@
1 -Yes
1 +No
Maila Networks