diff --git a/dist/doboard-widget-bundle.js b/dist/doboard-widget-bundle.js
index e30ca39..e1c5b48 100644
--- a/dist/doboard-widget-bundle.js
+++ b/dist/doboard-widget-bundle.js
@@ -8732,10 +8732,13 @@ async function handleCreateTask(sessionId, taskDetails) {
const result = await createTaskDoboard(sessionId, taskDetails);
if (result && result.taskId && taskDetails.taskDescription) {
const sign = `
The spot has been posted at the following URL ${window.location.href}`;
- await addTaskComment({
+
+ const commentResponse = await addTaskComment({
projectToken: taskDetails.projectToken,
accountId: taskDetails.accountId,
- }, result.taskId, taskDetails.taskDescription+sign);
+ }, result.taskId, taskDetails.taskDescription + sign);
+
+ result.initialComment = commentResponse;
}
return result;
} catch (err) {
@@ -9179,7 +9182,7 @@ class CleanTalkWidgetDoboard {
} else {
// Load all tasks
const isWidgetClosed = localStorage.getItem('spotfix_widget_is_closed');
- if((isWidgetClosed && !this.selectedText) || !isWidgetClosed){
+ if(((isWidgetClosed && !this.selectedText) || !isWidgetClosed) && type !== 'create_issue'){
this.allTasksData = await getAllTasks(this.params, this.nonRequesting);
}
}
@@ -9377,6 +9380,23 @@ class CleanTalkWidgetDoboard {
return;
}
+ if (this.fileUploader?.hasFiles() && submitTaskResult?.initialComment?.commentId) {
+ const sessionId = localStorage.getItem('spotfix_session_id');
+ try {
+ const attachmentsSendResult = await this.fileUploader.sendAttachmentsForComment(
+ this.params,
+ sessionId,
+ submitTaskResult.initialComment.commentId
+ );
+
+ if (!attachmentsSendResult.success) {
+ console.error(attachmentsSendResult);
+ }
+ } catch (uploadErr) {
+ console.error(uploadErr);
+ }
+ }
+
// Return the submit button normal state
submitButton.disabled = false;
submitButton.style.cursor = 'pointer';
@@ -9912,35 +9932,44 @@ class CleanTalkWidgetDoboard {
this.bindCreateTaskEvents();
this.bindShowLoginFormEvents();
+ this.fileUploader = new FileUploader(this.escapeHtml);
+ this.fileUploader.init();
+
const savedDescription = localStorage.getItem('spotfix-description-ls') || '';
+ const fileUploaderDesc = this.fileUploader;
+
- // Create description editor iframe
- window.DescriptionEditorIframe.create({
- savedContent: savedDescription,
- onChange: function(content) {
- localStorage.setItem('spotfix-description-ls', content);
- },
- handlers: {
- onAttachmentClick: function() {
- // Attachment button clicked in description editor
- // Currently disabled
+ if (window.DescriptionEditorIframe.iframe && !this.nonRequesting) {
+ window.DescriptionEditorIframe.remove();
+ }
+ if(!this.nonRequesting) {
+ // Create description editor iframe
+ window.DescriptionEditorIframe.create({
+ savedContent: savedDescription,
+ onChange: function(content) {
+ localStorage.setItem('spotfix-description-ls', content);
},
- onScreenshotClick: function() {
- // Screenshot button clicked in description editor
- // Currently disabled
+ handlers: {
+ onAttachmentClick: function() {
+ fileUploaderDesc?.fileInput?.click();
+ },
+ onScreenshotClick: function() {
+ fileUploaderDesc?.makeScreenshot();
+ },
}
- }
- }).catch(function(error) {
- console.error('Failed to create description editor:', error);
- });
+ }).catch(function(error) {
+ console.error('Failed to create description editor:', error);
+ });
+ }
+
break;
case 'wrap':
await this.getTaskCount();
- document.querySelector('.doboard_task_widget-wrap').addEventListener('click', (e) => {
+ document.querySelector('.doboard_task_widget-wrap').addEventListener('click', async (e) => {
const widgetElementClasses = e.currentTarget.classList;
if (widgetElementClasses && !widgetElementClasses.contains('hidden')) {
- this.createWidgetElement('all_issues');
+ if(this.type_name !== 'all_issues') await this.createWidgetElement('all_issues');
}
});
hideContainersSpinner(false);
@@ -9960,7 +9989,7 @@ class CleanTalkWidgetDoboard {
let issuesQuantityOnPage = 0;
const sessionId = localStorage.getItem('spotfix_session_id');
- const notifications = await getNotificationsDoboard(this.params.projectToken, sessionId, this.params.accountId, this.params.projectId);
+ const notifications = this.nonRequesting ? [] : await getNotificationsDoboard(this.params.projectToken, sessionId, this.params.accountId, this.params.projectId);
this.allTasksData = await getAllTasks(this.params, this.nonRequesting);
const tasks = this.allTasksData;
@@ -10518,8 +10547,8 @@ class CleanTalkWidgetDoboard {
logoutUserDoboard(this.params.projectToken);
}) || '';
- document.getElementById('addNewTaskButton')?.addEventListener('click', () => {
- spotFixShowWidget();
+ document.getElementById('addNewTaskButton')?.addEventListener('click', async () => {
+ if(this.type_name !== 'create_issue') await this.createWidgetElement('create_issue');
}) || '';
document.getElementById('maximizeWidgetContainer')?.addEventListener('click', () => {
@@ -12944,6 +12973,13 @@ class SpotFixTemplatesLoader {
+