Änderungen von Dokument Licensed Extensions

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

Von Version 4.1
bearbeitet von xwikiadmin
am 2025/01/07 11:38
Änderungskommentar: Install extension [com.xwiki.licensing:application-licensing-licensor-ui/1.26]
Auf Version 2.1
bearbeitet von superadmin
am 2022/03/06 00:00
Änderungskommentar: Install extension [com.xwiki.licensing:application-licensing-licensor-ui/1.22]

Zusammenfassung

Details

Seiteneigenschaften
Dokument-Autor
... ... @@ -1,1 +1,1 @@
1 -XWiki.xwikiadmin
1 +XWiki.superadmin
Inhalt
... ... @@ -70,6 +70,5 @@
70 70   #displayOwnerDetailsForm
71 71   #displayLicensesLiveTable
72 72   #displayAddLicenseForm
73 - #feedbackForm
74 74  #end
75 75  {{/velocity}}
XWiki.ConfigurableClass[0]
Bereich (Scope)
... ... @@ -1,1 +1,0 @@
1 -WIKI
XWiki.JavaScriptExtension[0]
Code
... ... @@ -1,11 +1,4 @@
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) {
1 +define('licensor', ['jquery', 'xwiki-meta'], function($, xwikiMeta) {
9 9   return {
10 10   addLicense: function(data) {
11 11   return $.post(
... ... @@ -65,7 +65,7 @@
65 65   };
66 66  });
67 67  
68 -require(['jquery', 'licensor', 'xwiki-meta', 'xwiki-l10n!auto-update-button', 'xwiki-events-bridge', 'bootstrap'], function ($, licensor, xwikiMeta, l10n) {
61 +require(['jquery', 'licensor', 'xwiki-meta', 'xwiki-events-bridge', 'bootstrap'], function ($, licensor, xwikiMeta) {
69 69   //
70 70   // Owner Details Form
71 71   //
... ... @@ -131,7 +131,7 @@
131 131   // Remove "Extend Trial" buttons from livetable, if the trial licenses limits were reached.
132 132   var updateLivetableButtons = function() {
133 133   var instanceId = $('#instanceId').val();
134 - $('.licenseActions .licenseButton-extendTrial').each(function() {
127 + $('.licenseActions .btn-primary').each(function() {
135 135   // Compute the key to check in the localStorage.
136 136   var buttonData = JSON.parse($(this).attr('data-button'));
137 137   var featureId = buttonData.featureId;
... ... @@ -146,13 +146,13 @@
146 146  
147 147   // An extensionId could have multiple rows in the livetable if is installed on multiple subwikis, but the allowlist
148 148   // is applied to all namespaces.
149 - var updateExtensionOfOtherWikis = function(extensionId, isAutoUpgrade) {
142 + var updateExtensionOfOtherWikis = function(extensionId, isChecked) {
150 150   var similarExtensions = $("input[name='extensionId'][value='" + extensionId + "']");
151 151   similarExtensions.each(function() {
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));
145 + var checkbox = $(this).siblings("input[type='checkbox']");
146 + if (checkbox.prop('checked') != isChecked) {
147 + checkbox.prop('checked', isChecked);
148 + }
156 156   });
157 157   };
158 158  
... ... @@ -159,7 +159,7 @@
159 159   // xwiki:livetable:displayComplete might be triggered before the code from this jsx is executed. In this case, the
160 160   // livetable is also loaded before, because it is using Prototype.js which is loading before the page loads.
161 161   // Make sure that the livetable is loaded by checking for a row with some data.
162 - if ($('#licenseManager-display td.type').length > 0) {
155 + if ($('#licenseManager-display td.type').size() > 0) {
163 163   updateLivetableButtons();
164 164   }
165 165   $(document).on('xwiki:livetable:displayComplete', updateLivetableButtons);
... ... @@ -210,8 +210,7 @@
210 210  
211 211   // Manages the license buttons from the licenses livetable. If a trial is requested, it is automatically generated
212 212   // and installed, else the user is redirected to a page to buy a license.
213 - $('#licenseManager').on('click', '.licenseButton', function(e) {
214 - e.preventDefault();
206 + $('#licenseManager').on('click', '.licenseButton', function() {
215 215   var ownerDetailsForm = $('#ownerDetails');
216 216   if (!validateOwnerDetails(ownerDetailsForm)) {
217 217   return;
... ... @@ -253,7 +253,7 @@
253 253   updateLicensesButton.focus().popover('show');
254 254   });
255 255  
256 - $('#updateLicenses').on('click', function() {
248 + $('#updateLicenses').click(function() {
257 257   var updateButton = $(this);
258 258   updateButton.prop('disabled', true);
259 259   // Show a notification message.
... ... @@ -266,18 +266,13 @@
266 266   });
267 267   });
268 268  
269 - $(document).on('click', '.licenseButton-autoUpgrade', function(e) {
270 - e.preventDefault();
271 - var autoUpgradeButton = $(this);
272 - var autoUpgradeForm = autoUpgradeButton.closest('form').serializeArray();
261 + $(document).on('click', 'input[name=autoUpgrade]', function() {
262 + var autoUpgradeForm = $(this).parent('form').serializeArray();
273 273   licensor.modifyAutoUpgradesAllowList(autoUpgradeForm).success(function(data) {
274 - autoUpgradeButton.find('.action-icon').toggleClass('isAutoUpgrade', data.isAutoUpgrade);
275 275   if(data.isAutoUpgrade) {
276 - autoUpgradeButton.prop('title', l10n.get('prevent'));
277 277   new XWiki.widgets.Notification(
278 278   $jsontool.serialize($services.localization.render('licensor.moreActions.autoUpgrade.added')), 'done');
279 279   } else {
280 - autoUpgradeButton.prop('title', l10n.get('allow'));
281 281   new XWiki.widgets.Notification(
282 282   $jsontool.serialize($services.localization.render('licensor.moreActions.autoUpgrade.removed')), 'done');
283 283   }
... ... @@ -285,38 +285,6 @@
285 285   });
286 286   });
287 287  
288 - $(document).on('click', '.licenseButton-feedback', function(e) {
289 - // Get the data needed in the form.
290 - const buttonData = JSON.parse($(this).attr('data-button'));
291 - const ownerDetails = {};
292 - $('#ownerDetails').serializeArray().map(x => ownerDetails[x.name] = x.value);
293 - if (typeof MauticSDK !== 'undefined') {
294 - // Make sure no messages or errors remained from the previous submit.
295 - const formName = $('#feedbackFormModal').find('.webmecanikForm form').attr('data-mautic-form');
296 - MauticSDK.getValidator(formName).clearErrors();
297 - MauticSDK.getValidator(formName).setMessage('', 'message');
298 - // Prefill values.
299 - const fieldPrefix = '#mauticform_input_' + formName + '_';
300 - $(fieldPrefix + 'email').val(ownerDetails['email']);
301 - const instanceId = $(fieldPrefix + 'instance_id');
302 - instanceId.val(ownerDetails['instanceId']);
303 - const featureId = $(fieldPrefix + 'name_of_the_app');
304 - featureId.val(buttonData['featureId']);
305 -
306 - // Show the feedback form modal.
307 - $('#feedbackFormModal').modal('show');
308 - } else {
309 - const params = $.param({
310 - 'email': ownerDetails['email'],
311 - 'instanceId': ownerDetails['instanceId'],
312 - 'featureId': buttonData['featureId']
313 - });
314 -
315 - const feedbackURL = buttonData['storeFeedbackURL'] + '?' + params;
316 - window.open(feedbackURL, '_blank').focus();
317 - }
318 - });
319 -
320 320   // Set the documentation links to open in new tab.
321 321   $('#licenseManager-display td.name a').each(function() {
322 322   $(this).attr('target', '_blank')
XWiki.StyleSheetExtension[0]
Code
... ... @@ -6,18 +6,17 @@
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 +
9 9  /* .dropleft to be used after moving to Bootstrap 4 */
10 10  .dropdown-left {
11 11   right: 0;
12 12   left: auto;
13 13  }
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 -}
21 -.webmecanikForm input[type=text], .webmecanikForm input[type=email] {
22 - width: 100%;
23 -}
Content Type
... ... @@ -1,1 +1,1 @@
1 -LESS
1 +CSS
Inhalt parsen
... ... @@ -1,1 +1,1 @@
1 -Ja
1 +Nein