Änderungen von Dokument Licensed Extensions

Zuletzt geändert von xwikiadmin am 2025/01/07 11:38

Von Version 1.1
bearbeitet von xwikiadmin
am 2022/04/27 15:47
Änderungskommentar: Copied from templateostfalia:Licenses.WebHome
Auf Version 2.1
bearbeitet von xwikiadmin
am 2023/04/25 10:57
Änderungskommentar: Install extension [com.xwiki.licensing:application-licensing-licensor-ui/1.24.1]

Zusammenfassung

Details

XWiki.ConfigurableClass[0]
Code zum Ausführen
... ... @@ -1,0 +1,1 @@
1 +{{include reference="Licenses.WebHome" /}}
Anzeigen in der Kategorie
... ... @@ -1,0 +1,1 @@
1 +extensionmanager
Anzeigen in Sektion
... ... @@ -1,0 +1,1 @@
1 +Licenses
Bereich (Scope)
... ... @@ -1,0 +1,1 @@
1 +WIKI
Reihenfolge der Sektionen
... ... @@ -1,0 +1,1 @@
1 +600
XWiki.JavaScriptExtension[0]
Code
... ... @@ -1,4 +1,11 @@
1 -define('licensor', ['jquery', 'xwiki-meta'], function($, xwikiMeta) {
1 +define('auto-update-button', {
2 + prefix: 'licensor.moreActions.autoUpgrade.',
3 + keys: [
4 + 'allow',
5 + 'prevent'
6 + ]
7 +});
8 +define('licensor', ['jquery', 'xwiki-meta', 'xwiki-l10n!auto-update-button'], function($, xwikiMeta, l10n) {
2 2   return {
3 3   addLicense: function(data) {
4 4   return $.post(
... ... @@ -58,7 +58,7 @@
58 58   };
59 59  });
60 60  
61 -require(['jquery', 'licensor', 'xwiki-meta', 'xwiki-events-bridge', 'bootstrap'], function ($, licensor, xwikiMeta) {
68 +require(['jquery', 'licensor', 'xwiki-meta', 'xwiki-l10n!auto-update-button', 'xwiki-events-bridge', 'bootstrap'], function ($, licensor, xwikiMeta, l10n) {
62 62   //
63 63   // Owner Details Form
64 64   //
... ... @@ -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 .btn-primary').each(function() {
134 + $('.licenseActions .licenseButton-extendTrial').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, isChecked) {
149 + var updateExtensionOfOtherWikis = function(extensionId, isAutoUpgrade) {
143 143   var similarExtensions = $("input[name='extensionId'][value='" + extensionId + "']");
144 144   similarExtensions.each(function() {
145 - var checkbox = $(this).siblings("input[type='checkbox']");
146 - if (checkbox.prop('checked') != isChecked) {
147 - checkbox.prop('checked', isChecked);
148 - }
152 + var autoUpgradeButton = $(this).siblings('.licenseButton-autoUpgrade');
153 + autoUpgradeButton.find('.action-icon').toggleClass('isAutoUpgrade', isAutoUpgrade);
154 + var translationKey = isAutoUpgrade ? 'prevent' : 'allow';
155 + autoUpgradeButton.prop('title', l10n.get(translationKey));
149 149   });
150 150   };
151 151  
... ... @@ -203,7 +203,8 @@
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() {
213 + $('#licenseManager').on('click', '.licenseButton', function(e) {
214 + e.preventDefault();
207 207   var ownerDetailsForm = $('#ownerDetails');
208 208   if (!validateOwnerDetails(ownerDetailsForm)) {
209 209   return;
... ... @@ -245,7 +245,7 @@
245 245   updateLicensesButton.focus().popover('show');
246 246   });
247 247  
248 - $('#updateLicenses').click(function() {
256 + $('#updateLicenses').on('click', function() {
249 249   var updateButton = $(this);
250 250   updateButton.prop('disabled', true);
251 251   // Show a notification message.
... ... @@ -258,13 +258,18 @@
258 258   });
259 259   });
260 260  
261 - $(document).on('click', 'input[name=autoUpgrade]', function() {
262 - var autoUpgradeForm = $(this).parent('form').serializeArray();
269 + $(document).on('click', '.licenseButton-autoUpgrade', function(e) {
270 + e.preventDefault();
271 + var autoUpgradeButton = $(this);
272 + var autoUpgradeForm = autoUpgradeButton.closest('form').serializeArray();
263 263   licensor.modifyAutoUpgradesAllowList(autoUpgradeForm).success(function(data) {
274 + autoUpgradeButton.find('.action-icon').toggleClass('isAutoUpgrade', data.isAutoUpgrade);
264 264   if(data.isAutoUpgrade) {
276 + autoUpgradeButton.prop('title', l10n.get('prevent'));
265 265   new XWiki.widgets.Notification(
266 266   $jsontool.serialize($services.localization.render('licensor.moreActions.autoUpgrade.added')), 'done');
267 267   } else {
280 + autoUpgradeButton.prop('title', l10n.get('allow'));
268 268   new XWiki.widgets.Notification(
269 269   $jsontool.serialize($services.localization.render('licensor.moreActions.autoUpgrade.removed')), 'done');
270 270   }
XWiki.StyleSheetExtension[0]
Code
... ... @@ -6,17 +6,15 @@
6 6   margin-top: .7em;
7 7  }
8 8  
9 -/* Duplicate some rules from style.css for input[type='email'].
10 - Should be removed when https://jira.xwiki.org/browse/XWIKI-13803 is implemented.*/
11 -.xform input[type="email"] {
12 - width: 100%;
13 - padding: 6px 12px;
14 - border: 1px solid #ccc;
15 - border-radius: 4px;
16 -}
17 -
18 18  /* .dropleft to be used after moving to Bootstrap 4 */
19 19  .dropdown-left {
20 20   right: 0;
21 21   left: auto;
22 22  }
14 +
15 +.licenseButton-paid .action-icon, .licenseButton-extendPaid .action-icon, .isAutoUpgrade {
16 + color: @brand-success;
17 +}
18 +.licenseButton-trial .action-icon, .licenseButton-extendTrial .action-icon {
19 + color: @link-color;
20 +}
Content Type
... ... @@ -1,1 +1,1 @@
1 -CSS
1 +LESS
Inhalt parsen
... ... @@ -1,1 +1,1 @@
1 -Nein
1 +Ja