Änderungen von Dokument Licensed Extensions

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

Von 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]
Auf Version 3.1
bearbeitet von xwikiadmin
am 2025/01/07 11:38
Änderungskommentar: Install extension [com.xwiki.licensing:application-licensing-licensor-ui/1.26]

Zusammenfassung

Details

Seiteneigenschaften
Inhalt
... ... @@ -70,5 +70,6 @@
70 70   #displayOwnerDetailsForm
71 71   #displayLicensesLiveTable
72 72   #displayAddLicenseForm
73 + #feedbackForm
73 73  #end
74 74  {{/velocity}}
XWiki.JavaScriptExtension[0]
Code
... ... @@ -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').size() > 0) {
162 + if ($('#licenseManager-display td.type').length > 0) {
163 163   updateLivetableButtons();
164 164   }
165 165   $(document).on('xwiki:livetable:displayComplete', updateLivetableButtons);
... ... @@ -285,6 +285,38 @@
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 +
288 288   // Set the documentation links to open in new tab.
289 289   $('#licenseManager-display td.name a').each(function() {
290 290   $(this).attr('target', '_blank')
XWiki.StyleSheetExtension[0]
Code
... ... @@ -18,3 +18,6 @@
18 18  .licenseButton-trial .action-icon, .licenseButton-extendTrial .action-icon {
19 19   color: @link-color;
20 20  }
21 +.webmecanikForm input[type=text], .webmecanikForm input[type=email] {
22 + width: 100%;
23 +}