最近の検索


最近の検索はありません

Fikri Hedianto's Avatar

Fikri Hedianto

参加日2021年4月16日

·

前回のアクティビティ2021年10月27日

フォロー中

0

フォロワー

0

合計アクティビティ

7

投票

1

受信登録

2

アクティビティの概要

さんの最近のアクティビティ Fikri Hedianto

Fikri Hediantoさんがコメントを作成しました:

コミュニティのコメント Feedback - Ticketing system (Support)

Hi @...,

 

Are there any update on this product roadmap?

 

Thanks

コメントを表示 · 投稿日時:2020年5月14日 · Fikri Hedianto

0

フォロワー

2

投票

0

コメント


Fikri Hediantoさんがコメントを作成しました:

コミュニティのコメント Discussion - Tips and best practices from the community

Hi @...,

I have tried to check in the console, everything is working fine. But it seems like the "if" for error check is not being read at all on my end.

Below is my code, I may miss something here.

// Function to start observing node for mutations
var startObserveMutations = function (nodeSelector, options, callbackFunction) {
var node = document.querySelector(nodeSelector);
if (node) {
var observer = new MutationObserver(callbackFunction);
observer.observe(node, options);
return observer;
}
};
// clear or select Attachment checkbox according to dropdown
var mutationObservedForm = function (mutationsList) {
mutationsList.forEach(function (mutation) {
if (mutation.type == 'childList') {
setFormAttachmentCheckbox();
}
});
};

// Define some variables for requiring form attachments
var attachmentCheckboxField = 'request_custom_fields_360026907032';
var attachmentCheckboxId = '#' + attachmentCheckboxField;
var attachmentErrorNotification = 'Report must be attached';
var formObserveMutationOptions = { childList: true, subtree: true };

function setFormAttachmentCheckbox() {
if ($('#request-attachments-pool .upload-item').length) {
selectCheckbox(attachmentCheckboxId);
}
else {
clearCheckbox(attachmentCheckboxId);
}
}

// Clear checkbox
function clearCheckbox(eltselector) {
$(eltselector).prop('checked', false);
}

// Select checkbox
function selectCheckbox(eltselector) {
$(eltselector).prop('checked', true);
}

// If attachment checkbox field exists, select it,
// and watch for changes to attachments and dropdown
if ($(attachmentCheckboxId).length) {
clearCheckbox(attachmentCheckboxId);
startObserveMutations('#request-attachments-pool', formObserveMutationOptions, mutationObservedForm);
}
// Adjust attachment error notification
var attachmentErrorElt = $('.' + attachmentCheckboxField + ' .notification-error');
if (attachmentErrorElt.length) {
attachmentErrorElt.text(attachmentErrorNotification);
}
}

コメントを表示 · 投稿日時:2020年2月04日 · Fikri Hedianto

0

フォロワー

0

投票

0

コメント


Fikri Hediantoさんがコメントを作成しました:

コミュニティのコメント Discussion - Tips and best practices from the community

@...

 

I am able to receive error message but just the default "Attachment: cannot be blank" message when I already put the script below which should change the error notification message:

var attachmentErrorNotification = 'Report must be attached';

 

I also have added the startObserveMutations code to observe the change in the form and everything is working, only the error notifications that seems to be skipped.

コメントを表示 · 投稿日時:2020年1月14日 · Fikri Hedianto

0

フォロワー

0

投票

0

コメント


Fikri Hediantoさんがコメントを作成しました:

コミュニティのコメント Discussion - Tips and best practices from the community

Hi @...,

 

I tried to use the script above and some adjustment for my case its working out. But I have some issue where the code to check the attachment error notification below doesn't work.

// Adjust attachment error notification
var attachmentErrorElt = $('.' + attachmentCheckboxField + '.notification-error');
if (attachmentErrorElt.length) {
attachmentErrorElt.text(attachmentErrorNotification);
}

Do you know what could possibly cause this? Thanks before for providing us the idea of solution to this case!

 

コメントを表示 · 投稿日時:2020年1月13日 · Fikri Hedianto

0

フォロワー

0

投票

0

コメント