diff --git a/dist/doboard-widget-bundle.js b/dist/doboard-widget-bundle.js
index a3f26b1..678eadb 100644
--- a/dist/doboard-widget-bundle.js
+++ b/dist/doboard-widget-bundle.js
@@ -6,120 +6,96 @@ const TABLE_TASKS = 'tasks';
const TABLE_COMMENTS = 'comments';
const LOCAL_DATA_BASE_TABLE = [
- {name: TABLE_USERS, keyPath: 'user_id'},
- {name: TABLE_TASKS, keyPath: 'taskId'},
- {name: TABLE_COMMENTS, keyPath: 'commentId'},
+ { name: TABLE_USERS, keyPath: 'user_id' },
+ { name: TABLE_TASKS, keyPath: 'taskId' },
+ { name: TABLE_COMMENTS, keyPath: 'commentId' },
];
-async function openIndexedDB(name, version = indexedDBVersion) {
+let dbPromise = null;
+
+function getDBName() {
+ return `${INDEXED_DB_NAME}_${
+ localStorage.getItem('spotfix_session_id') ||
+ localStorage.getItem('spotfix_project_token')
+ }`;
+}
+
+function openIndexedDB(name, version) {
return new Promise((resolve, reject) => {
const request = indexedDB.open(name, version);
+
+ request.onupgradeneeded = (e) => {
+ const db = e.target.result;
+
+ LOCAL_DATA_BASE_TABLE.forEach((item) => {
+ if (!db.objectStoreNames.contains(item.name)) {
+ const store = db.createObjectStore(item.name, {
+ keyPath: item.keyPath,
+ });
+
+ if (item.name === TABLE_COMMENTS) {
+ store.createIndex('taskId', 'taskId');
+ }
+ if (item.name === TABLE_TASKS) {
+ store.createIndex('userId', 'userId');
+ }
+ }
+ });
+ };
+
request.onsuccess = () => resolve(request.result);
request.onerror = () => reject(request.error);
- request.onupgradeneeded = (e) => resolve(request.result);
});
}
-async function deleteDB() {
- try {
- const dbs = await window.indexedDB.databases();
- for (const db of dbs) {
- await new Promise((resolve) => {
- const deleteReq = indexedDB.deleteDatabase(db.name);
- deleteReq.onsuccess = () => resolve();
- deleteReq.onerror = () => resolve();
- });
- }
- } catch (err) {
- console.warn('deleteDB error', err);
+function getDB() {
+ if (!dbPromise) {
+ dbPromise = openIndexedDB(getDBName(), indexedDBVersion);
}
+ return dbPromise;
}
-const spotfixIndexedDB = {
- getIndexedDBName: () =>
- `${INDEXED_DB_NAME}_${localStorage.getItem('spotfix_session_id') || localStorage.getItem('spotfix_project_token')}`,
-
- error: (request, error) => {
- console.error('IndexedDB error', request, error);
- },
+async function deleteCurrentDB() {
+ const name = getDBName();
+ return new Promise((resolve) => {
+ const req = indexedDB.deleteDatabase(name);
+ req.onsuccess = () => resolve();
+ req.onerror = () => resolve();
+ req.onblocked = () => {
+ console.warn('IndexedDB delete blocked');
+ resolve();
+ };
+ });
+}
+const spotfixIndexedDB = {
init: async () => {
const sessionId = localStorage.getItem('spotfix_session_id');
const projectToken = localStorage.getItem('spotfix_project_token');
- if (!sessionId && !projectToken) return { needInit: false };
-
- const dbName = spotfixIndexedDB.getIndexedDBName();
-
- await deleteDB();
-
- return new Promise((resolve, reject) => {
- const request = indexedDB.open(dbName, indexedDBVersion);
-
- request.onupgradeneeded = (e) => {
- const db = e.target.result;
- LOCAL_DATA_BASE_TABLE.forEach((item) => {
- if (!db.objectStoreNames.contains(item.name)) {
- const store = db.createObjectStore(item.name, { keyPath: item.keyPath });
- if (item.name === TABLE_COMMENTS) store.createIndex('taskId', 'taskId');
- if (item.name === TABLE_TASKS) store.createIndex('userId', 'userId');
- }
- });
- resolve({ needInit: true });
- };
+ if (!sessionId && !projectToken) {
+ return { needInit: false };
+ }
- request.onsuccess = (e) => {
- const db = e.target.result;
- const missingStores = LOCAL_DATA_BASE_TABLE.filter(
- (item) => !db.objectStoreNames.contains(item.name)
- );
+ await deleteCurrentDB();
- if (missingStores.length === 0) {
- db.close();
- resolve({ needInit: true });
- } else {
- const newVersion = db.version + 1;
- db.close();
- const upgradeRequest = indexedDB.open(dbName, newVersion);
- upgradeRequest.onupgradeneeded = (e2) => {
- const db2 = e2.target.result;
- missingStores.forEach((item) => {
- const store = db2.createObjectStore(item.name, { keyPath: item.keyPath });
- if (item.name === TABLE_COMMENTS) store.createIndex('taskId', 'taskId');
- if (item.name === TABLE_TASKS) store.createIndex('userId', 'userId');
- });
- };
- upgradeRequest.onsuccess = () => resolve({ needInit: true });
- upgradeRequest.onerror = (err) => reject(err);
- }
- };
+ dbPromise = null;
- request.onerror = (err) => reject(err);
- });
+ await getDB();
+ return { needInit: true };
},
withStore: async (table, mode = 'readwrite', callback) => {
- const dbName = spotfixIndexedDB.getIndexedDBName();
- const db = await openIndexedDB(dbName, indexedDBVersion);
+ const db = await getDB();
+
return new Promise((resolve, reject) => {
- try {
- const transaction = db.transaction(table, mode);
- const store = transaction.objectStore(table);
+ const tx = db.transaction(table, mode);
+ const store = tx.objectStore(table);
- const result = callback(store);
+ const result = callback(store);
- transaction.oncomplete = () => {
- db.close();
- resolve(result);
- };
- transaction.onerror = (e) => {
- db.close();
- reject(e.target.error);
- };
- } catch (err) {
- db.close();
- reject(err);
- }
+ tx.oncomplete = () => resolve(result);
+ tx.onerror = () => reject(tx.error);
});
},
@@ -140,37 +116,45 @@ const spotfixIndexedDB = {
},
clearTable: async (table) => {
- return spotfixIndexedDB.withStore(table, 'readwrite', (store) => store.clear());
+ return spotfixIndexedDB.withStore(table, 'readwrite', (store) =>
+ store.clear()
+ );
},
clearPut: async (table, data) => {
- await spotfixIndexedDB.clearTable(table);
- await spotfixIndexedDB.put(table, data);
+ return spotfixIndexedDB.withStore(table, 'readwrite', (store) => {
+ store.clear();
+ if (Array.isArray(data)) {
+ data.forEach((item) => store.put(item));
+ } else {
+ store.put(data);
+ }
+ });
},
getAll: async (table, indexName, value) => {
return spotfixIndexedDB.withStore(table, 'readonly', (store) => {
return new Promise((resolve, reject) => {
- let request;
- if (indexName && value !== undefined) {
- request = store.index(indexName).getAll(value);
- } else {
- request = store.getAll();
- }
- request.onsuccess = () => resolve(request.result);
- request.onerror = () => reject(request.error);
+ const req =
+ indexName && value !== undefined
+ ? store.index(indexName).getAll(value)
+ : store.getAll();
+
+ req.onsuccess = () => resolve(req.result);
+ req.onerror = () => reject(req.error);
});
});
},
getTable: async (table) => {
- if (!localStorage.getItem('spotfix_session_id') && !localStorage.getItem('spotfix_project_token')) return [];
+ if (
+ !localStorage.getItem('spotfix_session_id') &&
+ !localStorage.getItem('spotfix_project_token')
+ ) {
+ return [];
+ }
return spotfixIndexedDB.getAll(table);
},
-
- deleteTable: async (table, key) => {
- return spotfixIndexedDB.delete(table, key);
- },
};
const SPOTFIX_DOBOARD_API_URL = 'https://api.doboard.com';
@@ -515,6 +499,11 @@ const getReleaseVersion = async () => {
let socket = null;
let heartbeatInterval = null;
+let messageCallback = null;
+let lastEventId = null;
+let pendingUpdate = false;
+let reconnectTimer = null;
+let isIntentionalClose = false;
const WS_URL = 'wss://ws.doboard.com';
@@ -528,12 +517,67 @@ const buildMessage = (action) => ({
project_token: localStorage.getItem('spotfix_project_token'),
});
+const handleIncomingData = async (data) => {
+ switch (data.object) {
+ case 'users':
+ await spotfixIndexedDB.put(TABLE_USERS, data.data);
+ break;
+
+ case 'tasks':
+ if (data.data.status === 'REMOVED') {
+ await spotfixIndexedDB.delete(TABLE_TASKS, data.data.task_id);
+ const comments = await spotfixIndexedDB.getAll(TABLE_COMMENTS);
+ const filteredComments = comments.filter((comment) => +comment.taskId !== +data.data.task_id);
+ await spotfixIndexedDB.clearPut(TABLE_COMMENTS, filteredComments);
+ break;
+ }
+
+ await spotfixIndexedDB.put(TABLE_TASKS, {
+ taskId: data.data.task_id,
+ taskTitle: data.data.name,
+ userId: data.data.user_id,
+ taskLastUpdate: data.data.updated,
+ taskCreated: data.data.created,
+ taskCreatorTaskUser: data.data.creator_user_id,
+ taskMeta: data.data.meta,
+ taskStatus: data.data.status,
+ });
+ break;
+
+ case 'comments':
+ if (data.data.status === 'REMOVED') {
+ await spotfixIndexedDB.delete(TABLE_COMMENTS, data.data.comment_id);
+ break;
+ }
+ await spotfixIndexedDB.put(TABLE_COMMENTS, {
+ taskId: data.data.task_id,
+ commentId: data.data.comment_id,
+ userId: data.data.user_id,
+ commentBody: data.data.comment,
+ commentDate: data.data.updated,
+ status: data.data.status,
+ issueTitle: data.data.task_name,
+ });
+ break;
+
+ default:
+ break;
+ }
+};
+
+
const wsSpotfix = {
connect() {
+ if (reconnectTimer) {
+ clearTimeout(reconnectTimer);
+ reconnectTimer = null;
+ }
+
if ((socket && socket.readyState === WebSocket.OPEN) || !getSessionId()) {
return;
}
+ isIntentionalClose = false;
socket = new WebSocket(WS_URL);
socket.onopen = () => {
@@ -545,68 +589,46 @@ const wsSpotfix = {
wsSpotfix.send(buildMessage('SUBSCRIBE'));
};
- socket.onmessage = (event) => {
- if (event.data === 'heartbeat') {
+ socket.onmessage = async (event) => {
+ if (event.data === 'heartbeat') return;
+
+ let data;
+ try {
+ data = JSON.parse(event.data);
+ } catch {
+ console.warn('WS non-JSON message:', event.data);
return;
}
- try {
- const data = JSON.parse(event.data);
-
- switch (data.object) {
- case 'users':
- spotfixIndexedDB.put(TABLE_USERS, data.data);
- break;
- case 'tasks':
- if (data.data.status === 'REMOVED') {
- spotfixIndexedDB.delete(TABLE_TASKS, data.data.task_id);
- break;
- }
- spotfixIndexedDB.put(TABLE_TASKS, {
- taskId: data.data.task_id,
- taskTitle: data.data.name,
- userId: data.data.user_id,
- taskLastUpdate: data.data.updated,
- taskCreated: data.data.created,
- taskCreatorTaskUser: data.data.creator_user_id,
- taskMeta: data.data.meta,
- taskStatus: data.data.status,
- });
- break;
+ if (!['users', 'tasks', 'comments'].includes(data.object)) return;
- case 'comments':
- if (data.data.status === 'REMOVED') {
- spotfixIndexedDB.delete(TABLE_COMMENTS, data.data.comment_id);
- break;
- }
- spotfixIndexedDB.put(TABLE_COMMENTS, {
- taskId: data.data.task_id,
- commentId: data.data.comment_id,
- userId: data.data.user_id,
- commentBody: data.data.comment,
- commentDate: data.data.updated,
- status: data.data.status,
- issueTitle: data.data.task_name,
- });
- break;
+ const eventId = data.id ? `${data.object}-${data.id}` : JSON.stringify(data);
- default:
- break;
- }
- } catch (e) {
- console.warn('WS non-JSON message:', event.data);
+ if (eventId === lastEventId) return;
+ lastEventId = eventId;
+
+ await handleIncomingData(data);
+ if (!pendingUpdate) {
+ pendingUpdate = true;
+ setTimeout(() => {
+ pendingUpdate = false;
+ if (messageCallback) messageCallback();
+ }, 3000);
}
};
- socket.onclose = (e) => {
- console.warn('WS closed:', e.code, e.reason);
-
+ socket.onclose = () => {
socket = null;
-
if (heartbeatInterval) {
clearInterval(heartbeatInterval);
heartbeatInterval = null;
}
+
+ if (!isIntentionalClose) {
+ reconnectTimer = setTimeout(() => {
+ wsSpotfix.connect();
+ }, 2000);
+ }
};
socket.onerror = (e) => {
@@ -615,15 +637,17 @@ const wsSpotfix = {
},
send(data) {
- if (!socket || socket.readyState !== WebSocket.OPEN) {
- console.warn('WebSocket is not connected');
- return;
+ if (socket?.readyState === WebSocket.OPEN) {
+ socket.send(JSON.stringify(data));
}
- socket.send(JSON.stringify(data));
},
close() {
- wsSpotfix.unsubscribe();
+ isIntentionalClose = true;
+ if (reconnectTimer) {
+ clearTimeout(reconnectTimer);
+ reconnectTimer = null;
+ }
socket?.close();
},
@@ -638,118 +662,122 @@ const wsSpotfix = {
wsSpotfix.send(buildMessage('UNSUBSCRIBE'));
}
},
+
+ onMessage(cb) {
+ messageCallback = cb;
+ },
};
const SPOTFIX_VERSION = "1.1.5";
async function confirmUserEmail(emailConfirmationToken, params) {
- const result = await userConfirmEmailDoboard(emailConfirmationToken);
- // Save session data to LS
- localStorage.setItem('spotfix_email', result.email);
- localStorage.setItem('spotfix_session_id', result.sessionId);
- localStorage.setItem('spotfix_user_id', result.userId);
- await spotfixIndexedDB.init();
-
- // Get pending task from LS
- const pendingTaskRaw = localStorage.getItem('spotfix_pending_task');
- if (!pendingTaskRaw) throw new Error('No pending task data');
-
- let pendingTask;
- try {
- pendingTask = JSON.parse(pendingTaskRaw);
- } catch (error) {
- throw new Error('Invalid pending task data');
- }
-
- // Form taskDetails for task creation
- const taskDetails = {
- taskTitle: pendingTask.selectedText || 'New Task',
- taskDescription: pendingTask.description || '',
- selectedData: pendingTask,
- projectToken: params.projectToken,
- projectId: params.projectId,
- accountId: params.accountId,
- taskMeta: JSON.stringify(pendingTask)
- };
-
- // Create task
- const createdTask = await handleCreateTask(result.sessionId, taskDetails);
- // Clear pending task
- localStorage.removeItem('spotfix_pending_task');
-
- // Return created task
- return createdTask;
+ const result = await userConfirmEmailDoboard(emailConfirmationToken);
+ // Save session data to LS
+ localStorage.setItem('spotfix_email', result.email);
+ localStorage.setItem('spotfix_session_id', result.sessionId);
+ localStorage.setItem('spotfix_user_id', result.userId);
+ await spotfixIndexedDB.init();
+
+ // Get pending task from LS
+ const pendingTaskRaw = localStorage.getItem('spotfix_pending_task');
+ if (!pendingTaskRaw) throw new Error('No pending task data');
+
+ let pendingTask;
+ try {
+ pendingTask = JSON.parse(pendingTaskRaw);
+ } catch (error) {
+ throw new Error('Invalid pending task data');
+ }
+
+ // Form taskDetails for task creation
+ const taskDetails = {
+ taskTitle: pendingTask.selectedText || 'New Task',
+ taskDescription: pendingTask.description || '',
+ selectedData: pendingTask,
+ projectToken: params.projectToken,
+ projectId: params.projectId,
+ accountId: params.accountId,
+ taskMeta: JSON.stringify(pendingTask),
+ };
+
+ // Create task
+ const createdTask = await handleCreateTask(result.sessionId, taskDetails);
+ // Clear pending task
+ localStorage.removeItem('spotfix_pending_task');
+
+ // Return created task
+ return createdTask;
}
-async function getTasksFullDetails(params, tasks, currentActiveTaskId) {
+async function getTasksFullDetails(params, tasks, currentActiveTaskId, nonRequesting = false) {
if (tasks.length > 0) {
const sessionId = localStorage.getItem('spotfix_session_id');
- await getTasksCommentsDoboard(sessionId, params.accountId, params.projectToken);
+ if (!nonRequesting) {
+ await getTasksCommentsDoboard(sessionId, params.accountId, params.projectToken);
+ }
const comments = await spotfixIndexedDB.getAll(TABLE_COMMENTS);
- await getUserDoboard(sessionId, params.projectToken, params.accountId);
- const users = await spotfixIndexedDB.getAll(TABLE_USERS);
- const foundTask = tasks.find(item => +item.taskId === +currentActiveTaskId);
+ if (!nonRequesting) {
+ await getUserDoboard(sessionId, params.projectToken, params.accountId);
+ }
+ const users = await spotfixIndexedDB.getAll(TABLE_USERS);
+ const foundTask = tasks.find((item) => +item.taskId === +currentActiveTaskId);
return {
comments: comments,
users: users,
- taskStatus: foundTask?.taskStatus,
+ taskStatus: foundTask?.taskStatus,
+ taskName: foundTask?.taskTitle,
};
}
}
-async function getUserDetails(params) {
- const sessionId = localStorage.getItem('spotfix_session_id');
- const currentUserId = localStorage.getItem('spotfix_user_id');
- if(currentUserId) {
- await getUserDoboard(sessionId, params.projectToken, params.accountId, currentUserId);
- const users = await spotfixIndexedDB.getAll(TABLE_USERS);
- return users.find(user => +user.user_id === +currentUserId) || {};
- }
+async function getUserDetails(params, nonRequesting = false) {
+ const sessionId = localStorage.getItem('spotfix_session_id');
+ const currentUserId = localStorage.getItem('spotfix_user_id');
+ if (currentUserId) {
+ if (!nonRequesting) {
+ await getUserDoboard(sessionId, params.projectToken, params.accountId, currentUserId);
+ }
+ const users = await spotfixIndexedDB.getAll(TABLE_USERS);
+ return users.find((user) => +user.user_id === +currentUserId) || {};
+ }
}
async function handleCreateTask(sessionId, taskDetails) {
- try {
- const result = await createTaskDoboard(sessionId, taskDetails);
- if (result && result.taskId && taskDetails.taskDescription) {
+ try {
+ 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({
- projectToken: taskDetails.projectToken,
- accountId: taskDetails.accountId
- }, result.taskId, taskDetails.taskDescription+sign);
- }
- return result;
- } catch (err) {
- throw err;
- }
+ await addTaskComment({
+ projectToken: taskDetails.projectToken,
+ accountId: taskDetails.accountId,
+ }, result.taskId, taskDetails.taskDescription+sign);
+ }
+ return result;
+ } catch (err) {
+ throw err;
+ }
}
async function addTaskComment(params, taskId, commentText) {
- const sessionId = localStorage.getItem('spotfix_session_id');
- if (!sessionId) throw new Error('No session');
- if (!params.projectToken || !params.accountId) throw new Error('Missing params');
- return await createTaskCommentDoboard(params.accountId, sessionId, taskId, commentText, params.projectToken);
+ const sessionId = localStorage.getItem('spotfix_session_id');
+ if (!sessionId) throw new Error('No session');
+ if (!params.projectToken || !params.accountId) throw new Error('Missing params');
+ return await createTaskCommentDoboard(params.accountId, sessionId, taskId, commentText, params.projectToken);
}
-async function getUserTasks(params) {
- if (!localStorage.getItem('spotfix_session_id')) {
- return {};
- }
- const projectToken = params.projectToken;
- const sessionId = localStorage.getItem('spotfix_session_id');
- const userId = localStorage.getItem('spotfix_user_id');
- await getTasksDoboard(projectToken, sessionId, params.accountId, params.projectId, userId);
- return await spotfixIndexedDB.getAll(TABLE_TASKS, 'userId', userId);
-}
+async function getAllTasks(params, nonRequesting = false) {
-async function getAllTasks(params) {
- const projectToken = params.projectToken;
- const sessionId = localStorage.getItem('spotfix_session_id') || '';
- await getTasksDoboard(projectToken, sessionId, params.accountId, params.projectId);
- const tasksData = await spotfixIndexedDB.getAll(TABLE_TASKS);
+ const projectToken = params.projectToken;
+ const sessionId = localStorage.getItem('spotfix_session_id') || '';
+ if (!nonRequesting) {
+ await getTasksDoboard(projectToken, sessionId, params.accountId, params.projectId);
+ }
+ const tasksData = await spotfixIndexedDB.getAll(TABLE_TASKS);
+ storageSaveTasksCount(tasksData);
// Get only tasks with metadata
- const filteredTaskData = tasksData.filter(task => {
+ const filteredTaskData = tasksData.filter((task) => {
return task.taskMeta;
});
@@ -758,11 +786,11 @@ async function getAllTasks(params) {
function formatDate(dateStr) {
const months = [
- "January", "February", "March", "April", "May", "June",
- "July", "August", "September", "October", "November", "December"
+ 'January', 'February', 'March', 'April', 'May', 'June',
+ 'July', 'August', 'September', 'October', 'November', 'December',
];
// dateStr expected format: 'YYYY-MM-DD HH:mm:ss' or 'YYYY-MM-DDTHH:mm:ssZ'
- if (!dateStr) return { date: '', time: '' };
+ if (!dateStr) return {date: '', time: ''};
let dateObj;
if (dateStr.includes('T')) {
dateObj = new Date(dateStr);
@@ -771,7 +799,7 @@ function formatDate(dateStr) {
} else {
dateObj = new Date(dateStr);
}
- if (isNaN(dateObj.getTime())) return { date: '', time: '' };
+ if (isNaN(dateObj.getTime())) return {date: '', time: ''};
// Adjust to local timezone
const offsetMinutes = dateObj.getTimezoneOffset();
@@ -783,188 +811,187 @@ function formatDate(dateStr) {
const hours = localDateObj.getHours().toString().padStart(2, '0');
const minutes = localDateObj.getMinutes().toString().padStart(2, '0');
const time = `${hours}:${minutes}`;
- return { date, time };
+ return {date, time};
}
function getTaskAuthorDetails(params, taskId) {
- const sessionId = localStorage.getItem('spotfix_session_id');
- const mockUsersData =
+ const sessionId = localStorage.getItem('spotfix_session_id');
+ const mockUsersData =
[
- {
- 'taskId': '1',
- 'taskAuthorAvatarImgSrc': 'https://s3.eu-central-1.amazonaws.com/cleantalk-ctask-atts/accounts/1/avatars/081a1b65d20fe318/m.jpg',
- 'taskAuthorName': 'Test All Issues Single Author Name'
- }
- ]
-
- const defaultData =
+ {
+ 'taskId': '1',
+ 'taskAuthorAvatarImgSrc': 'https://s3.eu-central-1.amazonaws.com/cleantalk-ctask-atts/accounts/1/avatars/081a1b65d20fe318/m.jpg',
+ 'taskAuthorName': 'Test All Issues Single Author Name',
+ },
+ ];
+
+ const defaultData =
{
- 'taskId': null,
- 'taskAuthorAvatarImgSrc': null,
- 'taskAuthorName': 'Task Author'
+ 'taskId': null,
+ 'taskAuthorAvatarImgSrc': null,
+ 'taskAuthorName': 'Task Author',
};
- const data = mockUsersData.find((element) => element.taskId === taskId);
- return data === undefined ? defaultData : data;
+ const data = mockUsersData.find((element) => element.taskId === taskId);
+ return data === undefined ? defaultData : data;
}
function getIssuesCounterString(onPageSpotsCount, totalSpotsCount) {
- return ` (${onPageSpotsCount}/${totalSpotsCount})`;
+ return ` (${onPageSpotsCount}/${totalSpotsCount})`;
}
// Get the author's avatar
function getAvatarSrc(author) {
- if (author && author.avatar) {
- if (typeof author.avatar === 'object' && author.avatar.m) {
- return author.avatar.m;
- } else if (typeof author.avatar === 'string') {
- return author.avatar;
- }
- }
- return null;
+ if (author && author.avatar) {
+ if (typeof author.avatar === 'object' && author.avatar.m) {
+ return author.avatar.m;
+ } else if (typeof author.avatar === 'string') {
+ return author.avatar;
+ }
+ }
+ return null;
}
// Get the author's name
function getAuthorName(author) {
- if (author) {
- if (author.name && author.name.trim().length > 0) {
- return author.name;
- } else if (author.email && author.email.trim().length > 0) {
- return author.email;
- }
- }
- return 'Unknown Author';
+ if (author) {
+ if (author.name && author.name.trim().length > 0) {
+ return author.name;
+ } else if (author.email && author.email.trim().length > 0) {
+ return author.email;
+ }
+ }
+ return 'Unknown Author';
}
function registerUser(taskDetails) {
- const userEmail = taskDetails.userEmail;
- const userName = taskDetails.userName;
- const projectToken = taskDetails.projectToken;
- const accountId = taskDetails.accountId;
- const pageURL = taskDetails.selectedData.pageURL ? taskDetails.selectedData.pageURL : window.location.href;
-
- const resultRegisterUser = (showMessageCallback) => registerUserDoboard(projectToken, accountId, userEmail, userName, pageURL)
- .then(response => {
- if (response.accountExists) {
- document.querySelector(".doboard_task_widget-accordion>.doboard_task_widget-input-container").innerText = ksesFilter('Account already exists. Please, login usin your password.');
- document.querySelector(".doboard_task_widget-accordion>.doboard_task_widget-input-container.hidden").classList.remove('hidden');
- document.getElementById("doboard_task_widget-user_password").focus();
- } else if (response.sessionId) {
- localStorage.setItem('spotfix_session_id', response.sessionId);
- localStorage.setItem('spotfix_user_id', response.userId);
- localStorage.setItem('spotfix_email', response.email);
- spotfixIndexedDB.init();
- userUpdate(projectToken, accountId);
- } else if (response.operationStatus === 'SUCCESS' && response.operationMessage && response.operationMessage.length > 0) {
- if (response.operationMessage == 'Waiting for email confirmation') {
- response.operationMessage = 'Waiting for an email confirmation. Please check your Inbox.';
- }
- if (typeof showMessageCallback === 'function') {
- showMessageCallback(response.operationMessage, 'notice');
- }
- } else {
- throw new Error('Session ID not found in response');
- }
- })
- .catch(error => {
- throw error;
- });
-
- return resultRegisterUser;
+ const userEmail = taskDetails.userEmail;
+ const userName = taskDetails.userName;
+ const projectToken = taskDetails.projectToken;
+ const accountId = taskDetails.accountId;
+ const pageURL = taskDetails.selectedData.pageURL ? taskDetails.selectedData.pageURL : window.location.href;
+
+ const resultRegisterUser = (showMessageCallback) => registerUserDoboard(projectToken, accountId, userEmail, userName, pageURL)
+ .then((response) => {
+ if (response.accountExists) {
+ document.querySelector('.doboard_task_widget-accordion>.doboard_task_widget-input-container').innerText = ksesFilter('Account already exists. Please, login usin your password.');
+ document.querySelector('.doboard_task_widget-accordion>.doboard_task_widget-input-container.hidden').classList.remove('hidden');
+ document.getElementById('doboard_task_widget-user_password').focus();
+ } else if (response.sessionId) {
+ localStorage.setItem('spotfix_session_id', response.sessionId);
+ localStorage.setItem('spotfix_user_id', response.userId);
+ localStorage.setItem('spotfix_email', response.email);
+ spotfixIndexedDB.init();
+ userUpdate(projectToken, accountId);
+ } else if (response.operationStatus === 'SUCCESS' && response.operationMessage && response.operationMessage.length > 0) {
+ if (response.operationMessage == 'Waiting for email confirmation') {
+ response.operationMessage = 'Waiting for an email confirmation. Please check your Inbox.';
+ }
+ if (typeof showMessageCallback === 'function') {
+ showMessageCallback(response.operationMessage, 'notice');
+ }
+ } else {
+ throw new Error('Session ID not found in response');
+ }
+ })
+ .catch((error) => {
+ throw error;
+ });
+
+ return resultRegisterUser;
}
function loginUser(taskDetails) {
- const userEmail = taskDetails.userEmail;
- const userPassword = taskDetails.userPassword;
-
- return (showMessageCallback) => loginUserDoboard(userEmail, userPassword)
- .then(response => {
- if (response.sessionId) {
- localStorage.setItem('spotfix_session_id', response.sessionId);
- localStorage.setItem('spotfix_user_id', response.userId);
- localStorage.setItem('spotfix_email', userEmail);
- spotfixIndexedDB.init();
- } else if (response.operationStatus === 'SUCCESS' && response.operationMessage && response.operationMessage.length > 0) {
- if (typeof showMessageCallback === 'function') {
- showMessageCallback(response.operationMessage, 'notice');
- }
- } else {
- throw new Error('Session ID not found in response');
- }
- })
- .catch(error => {
- throw error;
- });
+ const userEmail = taskDetails.userEmail;
+ const userPassword = taskDetails.userPassword;
+
+ return (showMessageCallback) => loginUserDoboard(userEmail, userPassword)
+ .then((response) => {
+ if (response.sessionId) {
+ localStorage.setItem('spotfix_session_id', response.sessionId);
+ localStorage.setItem('spotfix_user_id', response.userId);
+ localStorage.setItem('spotfix_email', userEmail);
+ spotfixIndexedDB.init();
+ } else if (response.operationStatus === 'SUCCESS' && response.operationMessage && response.operationMessage.length > 0) {
+ if (typeof showMessageCallback === 'function') {
+ showMessageCallback(response.operationMessage, 'notice');
+ }
+ } else {
+ throw new Error('Session ID not found in response');
+ }
+ })
+ .catch((error) => {
+ throw error;
+ });
}
function userUpdate(projectToken, accountId) {
- const sessionId = localStorage.getItem('spotfix_session_id');
- const userId = localStorage.getItem('spotfix_user_id');
- const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
+ const sessionId = localStorage.getItem('spotfix_session_id');
+ const userId = localStorage.getItem('spotfix_user_id');
+ const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
- return userUpdateDoboard(projectToken, accountId, sessionId, userId, timezone);
+ return userUpdateDoboard(projectToken, accountId, sessionId, userId, timezone);
}
function spotFixSplitUrl(url) {
- try {
- if (!url || url.trim() === '') {
- return '';
- }
- const u = new URL(url);
- const domain = u.host;
-
- const segments = u.pathname.split('/').filter(Boolean);
-
- if (segments.length === 0) {
- return domain;
- }
-
- const reversed = segments.reverse();
- reversed.push(domain);
- return reversed.join(' / ');
- } catch (error) {
- return '';
- }
+ try {
+ if (!url || url.trim() === '') {
+ return '';
+ }
+ const u = new URL(url);
+ const domain = u.host;
+
+ const segments = u.pathname.split('/').filter(Boolean);
+
+ if (segments.length === 0) {
+ return domain;
+ }
+ const reversed = segments.reverse();
+ reversed.push(domain);
+ return reversed.join(' / ');
+ } catch (error) {
+ return '';
+ }
}
-function setToggleStatus(rootElement){
- const clickHandler = () => {
- const timer = setTimeout(() => {
- localStorage.setItem('spotfix_widget_is_closed', '1');
- wsSpotfix.close();
- rootElement.hide();
- clearTimeout(timer);
- }, 300);
- };
- const toggle = document.getElementById('widget_visibility');
- if(toggle) {
- toggle.checked = true;
- toggle.addEventListener('click', clickHandler);
- }
+function setToggleStatus(rootElement) {
+ const clickHandler = () => {
+ const timer = setTimeout(() => {
+ localStorage.setItem('spotfix_widget_is_closed', '1');
+ wsSpotfix.close();
+ rootElement.hide();
+ clearTimeout(timer);
+ }, 300);
+ };
+ const toggle = document.getElementById('widget_visibility');
+ if (toggle) {
+ toggle.checked = true;
+ toggle.addEventListener('click', clickHandler);
+ }
}
-function checkLogInOutButtonsVisible (){
- if(!localStorage.getItem('spotfix_session_id')) {
- const el = document
- .getElementById('doboard_task_widget-user_menu-logout_button')
- ?.closest('.doboard_task_widget-user_menu-item');
- if(el) el.style.display = 'none';
- } else {
- const el = document.getElementById('doboard_task_widget-user_menu-signlog_button');
- if(el) el.style.display = 'none';
- }
+function checkLogInOutButtonsVisible() {
+ if (!localStorage.getItem('spotfix_session_id')) {
+ const el = document
+ .getElementById('doboard_task_widget-user_menu-logout_button')
+ ?.closest('.doboard_task_widget-user_menu-item');
+ if (el) el.style.display = 'none';
+ } else {
+ const el = document.getElementById('doboard_task_widget-user_menu-signlog_button');
+ if (el) el.style.display = 'none';
+ }
}
-function changeSize(container){
- if(container && +localStorage.getItem('maximize')){
- container.classList.add('doboard_task_widget-container-maximize');
- } else if(container) {
- container.classList.remove('doboard_task_widget-container-maximize');
- }
+function changeSize(container) {
+ if (container && +localStorage.getItem('maximize')) {
+ container.classList.add('doboard_task_widget-container-maximize');
+ } else if (container) {
+ container.classList.remove('doboard_task_widget-container-maximize');
+ }
}
-let spotFixCSS = `.doboard_task_widget-send_message_paperclip .doboard_task_widget-paperclip-tooltip::after{content:"";position:absolute;left:8%;top:100%;transform:translateX(-50%);pointer-events:none;background:0 0;border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid #545b61;display:block}.doboard_task_widget-send_message_paperclip{position:relative}.doboard_task_widget-send_message_paperclip .doboard_task_widget-paperclip-tooltip{display:none;position:absolute;left:0;bottom:0;transform:translateX(-3%) translateY(-43px);background:#545b61;color:#FFF;border:none;border-radius:3px;padding:10px 16px;font-size:13px;line-height:1.4;z-index:100;min-width:220px;max-width:320px;text-align:left;pointer-events:none;text-transform:none}.doboard_task_widget-send_message_paperclip:hover .doboard_task_widget-paperclip-tooltip{display:block}.doboard_task_widget *{font-family:Inter,sans-serif;font-weight:400;font-size:14px;line-height:130%;color:#40484F}.doboard_task_widget-header *{color:#252A2F;margin:0}.doboard_task_widget-header-icons{display:flex}.doboard_task_widget a{text-decoration:underline;color:#2F68B7}.doboard_task_widget a:hover{text-decoration:none}.doboard_task_widget{position:fixed;right:50px;bottom:20px;z-index:9999;vertical-align:middle;transition:top .1s;transform:translateZ(0);-webkit-transform:translateZ(0);will-change:transform}.doboard_task_widget_cursor-pointer{cursor:pointer}.doboard_task_widget-container-maximize{width:80vw!important;max-width:1120px!important;max-height:calc(100vh - 40px);display:flex;flex-direction:column;-moz-flex-direction:column}.doboard_task_widget-container{width:430px;max-height:calc(100vh - 40px);display:flex;flex-direction:column;-moz-flex-direction:column}@media (max-height:800px){.doboard_task_widget-container,.doboard_task_widget-container-maximize{max-height:calc(60vh - 40px)}}.doboard_task_widget-header{display:flex;height:41px;min-height:41px;padding:0 16px;background-color:#EBF0F4;border-radius:8px 8px 0 0;border:1px solid #BBC7D1;border-bottom:none;justify-content:space-between;align-items:center;color:#FFF}.doboard_task_widget-user_menu-header{display:flex;padding:16px;border:1px solid #BBC7D1;border-bottom-color:#EBF0F4;border-radius:8px 8px 0 0;flex-direction:column;align-items:center;color:#252A2F;background-color:#F3F6F9}.doboard_task_widget-user_menu-header-top{display:flex;height:fit-content;align-items:center;width:100%;justify-content:space-between}.doboard_task_widget-user_menu-header-avatar{max-width:60px;max-height:60px;width:60px;height:60px;border-radius:50%;margin-bottom:4px}.doboard_task_widget-user_menu-item{display:flex;align-items:center;border-bottom:1px #EBF0F4 solid;padding:0 16px;height:65px}.doboard_task_widget-content{flex:1;overflow-y:auto;background:#FFF;border-radius:0 0 8px 8px;border:1px #BBC7D1;border-style:none solid solid;box-shadow:0 4px 15px 8px #CACACA40;scrollbar-width:none;max-height:60vh}.doboard_task_widget-element-container{margin-bottom:30px}.doboard_task_widget-wrap{box-shadow:none;position:fixed;right:-50px;padding:0;cursor:pointer;width:69px;height:52px;border-top-left-radius:4px;border-bottom-left-radius:4px;background-color:rgba(255,255,255,.9);border:1px solid #EBF0F4;display:flex;align-items:center;justify-content:center}.doboard_task_widget-input-container.hidden,.doboard_task_widget-login.hidden,.doboard_task_widget-wrap.hidden,.wrap_review::after{display:none}.doboard_task_widget-wrap img{width:32px;height:32px;transform:scaleX(-1)}.wrap_review{width:164px;min-width:164px;height:54px}.wrap_review img{width:28px;height:28px;transform:scaleX(-1)}.wrap_review:hover{background-color:#fff}@media (max-width:480px){.doboard_task_widget-wrap{right:-20px}}#review_content_button_text{color:#D5991A;margin-left:6px;font-weight:600;font-size:14px;text-transform:none!important}#doboard_task_widget-task_count{position:absolute;top:-12px;right:4px;width:22px;height:22px;opacity:1;background:#ef8b43;border-radius:50%;color:#FFF;text-align:center;line-height:22px}#doboard_task_widget-task_count.hidden{width:0;height:0;opacity:0}.doboard_task_widget-input-container{position:relative;margin-bottom:24px}.doboard_task_widget-input-container .doboard_task_widget-field{padding:0 8px;border-radius:4px;border:1px solid #BBC7D1;outline:0!important;appearance:none;width:100%;height:40px;background:#FFF;color:#000;max-width:-webkit-fill-available;max-width:-moz-available}.doboard_task_widget-field:focus{border-color:#2F68B7}.doboard_task_widget-input-container textarea.doboard_task_widget-field{height:94px;padding-top:11px;padding-bottom:11px}.doboard_task_widget-field+label{color:#252A2F;background:#fff;position:absolute;top:20px;left:8px;transform:translateY(-50%);transition:all .2s ease-in-out}.doboard_task_widget-field.has-value+label,.doboard_task_widget-field:focus+label{font-size:10px;top:0;left:12px;padding:0 4px;z-index:5}.doboard_task_widget-field:focus+label{color:#2F68B7}.doboard_task_widget-login{background:#F9FBFD;border:1px solid #BBC7D1;border-radius:4px;padding:11px 8px 8px;margin-bottom:24px}.doboard_task_widget-login .doboard_task_widget-accordion{height:0;overflow:hidden;opacity:0;transition:all .2s ease-in-out}.doboard_task_widget-login.active .doboard_task_widget-accordion{height:auto;overflow:visible;opacity:1}.doboard_task_widget-login .doboard_task_widget-input-container:last-child{margin-bottom:0}.doboard_task_widget-login span{display:block;position:relative;padding-right:24px;cursor:pointer}.doboard_task_widget-login.active span{margin-bottom:24px}.doboard_task_widget-login span::after{position:absolute;top:0;right:4px;content:"";display:block;width:10px;height:10px;transform:rotate(45deg);border:2px solid #40484F;border-radius:1px;border-top:none;border-left:none;transition:all .2s ease-in-out}.doboard_task_widget-login.active span::after{transform:rotate(-135deg);top:7px}.doboard_task_widget-login .doboard_task_widget-field+label,.doboard_task_widget-login .doboard_task_widget-input-container .doboard_task_widget-field{background:#F9FBFD}.doboard_task_widget-submit_button{height:48px;width:100%;max-width:400px;margin-bottom:10px;color:#FFF;background:#22A475;border:none;border-radius:6px;font-family:Inter,sans-serif;font-weight:700;font-size:16px;line-height:150%;cursor:pointer;transition:all .2s ease-in-out}.doboard_task_widget-submit_button:hover{background:#1C7857;color:#FFF}.doboard_task_widget-submit_button:disabled{background:rgba(117,148,138,.92);color:#FFF;cursor:wait}.doboard_task_widget-issue-title{max-width:200px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.doboard_task_widget-hidden_element{opacity:0}.doboard_task_widget-message-wrapper{border-radius:4px;padding:8px;margin-bottom:14px;display:grid;justify-items:center}.doboard_task_widget-error_message-wrapper.hidden,.doboard_task_widget-message-wrapper.hidden{display:none}.doboard_task_widget-error_message{background:#fdd;border:1px solid #cf6868}.doboard_task_widget-notice_message{background:#dde9ff;border:1px solid #68a6cf}#doboard_task_widget-error_message-header{font-weight:600}#doboard_task_widget-error_message{text-align:center}.doboard_task_widget-task_row{display:flex;max-height:55px;cursor:pointer;align-items:center;justify-content:space-between;padding:1px 15px}.doboard_task_widget-task_row:last-child{margin-bottom:0}.doboard_task_widget-task-text_bold{font-weight:700}.doboard_task_widget-element_selection,.doboard_task_widget-image_selection,.doboard_task_widget-text_selection,.doboard_task_widget-text_selection.image-highlight>img{background:rgba(208,213,127,.68)}.doboard_task_widget-issues_list_empty{text-align:center;margin:20px 0}.doboard_task_widget-avatar_container{display:flex;height:44px;width:44px;border-radius:50%;background-repeat:no-repeat;background-position:center;background-size:100%}.doboard_task_widget-comment_data_owner .doboard_task_widget-avatar_container{opacity:0}.doboard_task_widget-avatar_placeholder{min-height:44px;min-width:44px;border-radius:50%;font-size:24px;line-height:1.2083333333;padding:0;background:#1C7857;display:inline-grid;align-content:center;justify-content:center}.doboard_task_widget-avatar-initials{color:#FFF;width:inherit;text-align:center}.doboard_task_widget-avatar{width:44px;height:44px;border-radius:50%;object-fit:cover}.doboard_task_widget-description_container{height:55px;width:calc(100% - 44px - 8px);border-bottom:1px solid #EBF0F4;display:block;margin-left:8px}.doboard_task_widget-task_row:last-child .doboard_task_widget-description_container{border-bottom:none}.doboard_task_widget-all_issues{padding-bottom:0}.doboard_task_widget-all_issues-container,.doboard_task_widget-concrete_issues-container{overflow:auto;max-height:85vh;display:none}.doboard_task_widget-task_last_message,.doboard_task_widget-task_page_url a,.doboard_task_widget-task_title span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.doboard_task_widget-all_issues-container{scrollbar-width:none;margin-top:10px}.doboard_task_widget-content.doboard_task_widget-concrete_issue{padding:0}.doboard_task_widget-concrete_issues-container{padding:10px 16px 5px}.doboard_task_widget-all_issues-container::-webkit-scrollbar,.doboard_task_widget-all_issues::-webkit-scrollbar,.doboard_task_widget-concrete_issues-container::-webkit-scrollbar,.doboard_task_widget-content::-webkit-scrollbar{width:0}.doboard_task_widget-task_title{font-weight:700;display:flex;justify-content:space-between;align-items:center}.doboard_task_widget-task_title span{font-weight:700;display:inline-block}.doboard_task_widget-task_title-details{display:flex;max-width:calc(100% - 40px);align-items:center}.doboard_task_widget-task_title-unread_block{opacity:0;height:8px;width:8px;background:#f08c43;border-radius:50%;display:inline-block;font-size:8px;font-weight:600;position:relative}.doboard_task_widget-task_title-unread_block.unread{opacity:1}.doboard_task_widget-task_last_message{max-width:85%;height:36px}.doboard_task_widget-task_page_url{max-width:70%;height:36px;display:flex;align-items:center}.doboard_task_widget-task_page_url a{color:#40484F;text-decoration:none;margin-left:8px;max-width:100%}.doboard_task_widget-bottom{display:flex;justify-content:space-between}.doboard_task_widget-bottom-is-fixed{border-radius:10px;background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkiIGhlaWdodD0iMTkiIHZpZXdCb3g9IjAgMCAxOSAxOSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGQ9Ik03LjA4MTE5IDAuMjIzNDM0QzguOTkxNjkgLTAuMjA4MTY3IDEwLjk5MTMgLTAuMDExMjE5NCAxMi43ODA0IDAuNzg1OTM0QzEzLjE1ODQgMC45NTQ2MjQgMTMuMzI4NiAxLjM5ODAzIDEzLjE2MDMgMS43NzYxN0MxMi45OTE3IDIuMTU0MTkgMTIuNTQ4MiAyLjMyNDI0IDEyLjE3MDEgMi4xNTYwNUMxMC42NzY0IDEuNDkwNTIgOS4wMDcyNiAxLjMyNiA3LjQxMjI1IDEuNjg2MzJDNS44MTcxNyAyLjA0NjcxIDQuMzgwOTcgMi45MTI5NiAzLjMxODUgNC4xNTYwNUMyLjI1NjIzIDUuMzk5MDEgMS42MjQ0MSA2Ljk1MjI5IDEuNTE2NzQgOC41ODM3OUMxLjQwOTI0IDEwLjIxNTQgMS44MzE4NCAxMS44MzkgMi43MjE4MiAxMy4yMTA3QzMuNjExNzkgMTQuNTgyMiA0LjkyMTY0IDE1LjYyOTQgNi40NTUyMSAxNi4xOTYxQzcuOTg5MDIgMTYuNzYyNiA5LjY2NTUzIDE2LjgxODkgMTEuMjMzNSAxNi4zNTUzQzEyLjgwMTYgMTUuODkxNiAxNC4xNzgzIDE0LjkzMzUgMTUuMTU3NCAxMy42MjM4QzE2LjEzNjQgMTIuMzE0MiAxNi42NjYxIDEwLjcyMjcgMTYuNjY3MSA5LjA4NzY5TDE4LjE2NzEgOS4wODg2N0MxOC4xNjU4IDExLjA0NzEgMTcuNTMxMiAxMi45NTM2IDE2LjM1ODUgMTQuNTIyM0MxNS4xODU5IDE2LjA5MDcgMTMuNTM3MyAxNy4yMzg0IDExLjY1OTMgMTcuNzkzN0M5Ljc4MTEgMTguMzQ5MSA3Ljc3MjkzIDE4LjI4MiA1LjkzNTY4IDE3LjYwMzNDNC4wOTg1IDE2LjkyNDYgMi41MjkxMiAxNS42NzAxIDEuNDYzMDMgMTQuMDI3MUMwLjM5NzAzNSAxMi4zODQxIC0wLjEwOTEwOSAxMC40Mzk1IDAuMDE5NjY4MyA4LjQ4NTE1QzAuMTQ4NjA3IDYuNTMwOCAwLjkwNjMyMyA0LjY3MDMzIDIuMTc4ODUgMy4xODE0NEMzLjQ1MTM2IDEuNjkyNjggNS4xNzA4OCAwLjY1NTE2MiA3LjA4MTE5IDAuMjIzNDM0WiIgZmlsbD0iIzIyQTQ3NSIvPg0KPHBhdGggZD0iTTE2Ljg4NTkgMS44OTA0M0MxNy4xNzg2IDEuNTk3NTMgMTcuNjUzNCAxLjU5Nzg0IDE3Ljk0NjQgMS44OTA0M0MxOC4yMzkzIDIuMTgzMTYgMTguMjQwMSAyLjY1Nzk2IDE3Ljk0NzQgMi45NTA5N0w5LjYxMzQyIDExLjI5MjhDOS40NzI4MiAxMS40MzMzIDkuMjgxOTYgMTEuNTEyNCA5LjA4MzE1IDExLjUxMjVDOC44ODQzMiAxMS41MTI1IDguNjkzNDggMTEuNDMzMyA4LjU1Mjg3IDExLjI5MjhMNi4wNTI4NyA4Ljc5Mjc3QzUuNzYwMTQgOC40OTk5IDUuNzYwMTEgOC4wMjUwOCA2LjA1Mjg3IDcuNzMyMjJDNi4zNDU3MiA3LjQzOTM3IDYuODIwNTEgNy40Mzk0NiA3LjExMzQyIDcuNzMyMjJMOS4wODIxNyA5LjcwMDk3TDE2Ljg4NTkgMS44OTA0M1oiIGZpbGw9IiMyMkE0NzUiLz4NCjxwYXRoIGQ9Ik0xNy40MTcxIDcuNTcxMDlDMTcuODMxIDcuNTcxNDQgMTguMTY3IDcuOTA3MTYgMTguMTY3MSA4LjMyMTA5VjkuMDg4NjdMMTcuNDE3MSA5LjA4NzY5SDE2LjY2NzFWOC4zMjEwOUMxNi42NjcyIDcuOTA2OTQgMTcuMDAzIDcuNTcxMDkgMTcuNDE3MSA3LjU3MTA5WiIgZmlsbD0iIzIyQTQ3NSIvPg0KPC9zdmc+) 8px center no-repeat #EBFAF4;padding:4px 7px 4px 30px}.doboard_task_widget-bottom-is-fixed-task-block{text-align:center}.doboard_task_widget-bottom-is-fixed-task{background:#F3F6F9;color:#1C7857;display:inline-block;border-radius:10px;padding:5px 8px;margin:0 auto}.doboard_task_widget-task_row-green{background:#EBF0F4}.doboard_task_widget_return_to_all{display:flex;gap:8px;flex-direction:row;-moz-flex-direction:row;align-content:center;flex-wrap:wrap}.doboard_task_widget-task_title-last_update_time{font-family:Inter,serif;font-weight:400;font-style:normal;font-size:11px;leading-trim:NONE;line-height:100%}.doboard_task_widget-task_title_public_status_img{opacity:50%;margin-left:5px;scale:90%}.doboard_task_widget-description-textarea{resize:none}.doboard_task_widget-switch_row{display:flex;align-items:center;gap:12px;margin:16px 0;justify-content:space-between}.doboard_task_widget-switch-label{font-weight:600;font-size:16px;height:24px;align-content:center}.doboard_task_widget-switch{position:relative;display:inline-block;width:44px;height:24px;flex-shrink:0}.doboard_task_widget-switch input{opacity:0;width:0;height:0}.doboard_task_widget-slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;border-radius:24px;transition:.2s}.doboard_task_widget-slider:before{position:absolute;content:"";height:20px;width:20px;left:2px;bottom:2px;background-color:#fff;border-radius:50%;transition:.2s}.doboard_task_widget-switch input:checked+.doboard_task_widget-slider{background-color:#65D4AC}.doboard_task_widget-switch input:checked+.doboard_task_widget-slider:before{transform:translateX(20px)}.doboard_task_widget-switch-img{width:24px;height:24px;flex-shrink:0}.doboard_task_widget-switch-center{display:flex;gap:2px;flex-direction:column;-moz-flex-direction:column;flex:1 1 auto;min-width:0}.doboard_task_widget-switch-desc{display:block;font-size:12px;color:#707A83;margin:0;line-height:1.2;max-width:180px;word-break:break-word}.doboard_task_widget-concrete_issue-day_content{display:flex;flex-direction:column;-moz-flex-direction:column}.doboard_task_widget-concrete_issue_day_content-month_day{text-align:center;font-weight:400;font-size:12px;line-height:100%;padding:8px;opacity:.75}.doboard_task_widget-concrete_issue_day_content-messages_wrapper{display:flex;flex-direction:column;-moz-flex-direction:column}.doboard_task_widget-comment_data_wrapper{display:flex;flex-direction:row;-moz-flex-direction:row;margin-bottom:15px;align-items:flex-end}.doboard_task_widget-comment_text_container{position:relative;width:calc(100% - 44px - 5px);height:auto;margin-left:5px;background:#F3F6F9;border-radius:16px}.doboard_task_widget-comment_text_container:after{content:"";position:absolute;bottom:0;left:-5px;width:13px;height:19px;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTMiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAxMyAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTAuMTEyNTggMTkuMDMzNEM1LjI5NDg2IDE5LjgyMDEgMTAuNjEwNSAxNy45NzQxIDEyLjI3MTUgMTYuMTcxM0MxMi4yNzE1IDE2LjE3MTMgMTAuOTYyMyAtMi43ODEyNCA1LjA5NTU0IDAuMzQ5MDc5QzUuMDc0NCAxLjYxNDU0IDUuMDk1NTQgNS45OTQ5IDUuMDk1NTQgNi43NDA2OUM1LjA5NTU0IDE3LjA2NjIgLTAuODg0MDEyIDE4LjQ0MDEgMC4xMTI1OCAxOS4wMzM0WiIgZmlsbD0iI0YzRjZGOSIvPgo8L3N2Zz4K)}.doboard_task_widget-comment_data_owner .doboard_task_widget-comment_text_container{background:#EBFAF4}.doboard_task_widget-comment_data_owner .doboard_task_widget-comment_text_container:after{left:auto;right:-5px;height:13px;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTMiIGhlaWdodD0iMTMiIHZpZXdCb3g9IjAgMCAxMyAxMyIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEyLjc3NzEgMTIuMzA2NkM3LjMzMTM1IDEzLjA5MzcgMS43NDU0NCAxMS4yNDY5IDAgOS40NDMxOUw3LjM5MTYgMEM3LjM5MTYgMTAuMzMwMyAxMy44MjQ0IDExLjcxMzEgMTIuNzc3MSAxMi4zMDY2WiIgZmlsbD0iI0VCRkFGNCIvPgo8L3N2Zz4K)}.doboard_task_widget-comment_body,.doboard_task_widget-comment_time{position:relative;z-index:1}.doboard_task_widget-comment_body{padding:6px 8px;min-height:30px}.doboard_task_widget-comment_body strong{font-variation-settings:"wght" 700}.doboard_task_widget-comment_body blockquote{margin:0;border-left:3px solid #22a475}.doboard_task_widget-comment_body blockquote p{margin:0 10px}.doboard_task_widget-comment_body details .mce-accordion-body{padding-left:20px}.doboard_task_widget-comment_body details .mce-accordion-summary{background:url("data:image/svg+xml;charset=utf-8,%3Csvg transform='rotate(180 0 0)' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' style='enable-background:new 0 0 20 20' xml:space='preserve'%3E%3Cpath d='M10 13.3c-.2 0-.4-.1-.6-.2l-5-5c-.3-.3-.3-.9 0-1.2.3-.3.9-.3 1.2 0l4.4 4.4 4.4-4.4c.3-.3.9-.3 1.2 0 .3.3.3.9 0 1.2l-5 5c-.2.2-.4.2-.6.2z'/%3E%3C/svg%3E") 0 no-repeat;padding-left:20px}.doboard_task_widget-comment_body .mce-accordion[open] .mce-accordion-summary{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' style='enable-background:new 0 0 20 20' xml:space='preserve'%3E%3Cpath d='M10 13.3c-.2 0-.4-.1-.6-.2l-5-5c-.3-.3-.3-.9 0-1.2.3-.3.9-.3 1.2 0l4.4 4.4 4.4-4.4c.3-.3.9-.3 1.2 0 .3.3.3.9 0 1.2l-5 5c-.2.2-.4.2-.6.2z'/%3E%3C/svg%3E") 0 no-repeat}.doboard_task_widget-comment_body details .mce-accordion-summary::marker{content:""}.doboard_task_widget-comment_body pre{border:1px solid #d6dde3;border-left-width:8px;border-radius:4px;padding:13px 16px 14px 12px;white-space:pre-wrap}.doboard_task_widget-comment_time{font-weight:400;font-size:11px;opacity:.8;position:absolute;bottom:6px;right:6px}.doboard_task_widget-comment_body-img-strict{max-width:-webkit-fill-available;height:100px;margin-right:5px}.doboard_task_widget-send_message{padding:14px 10px;border-top:1px solid #BBC7D1;position:sticky;background:#fff;bottom:0;z-index:4}.doboard_task_widget-send_message_elements_wrapper{display:flex;flex-direction:row;-moz-flex-direction:row;align-content:center;flex-wrap:nowrap;justify-content:space-between;align-items:end}.doboard_task_widget-send_message_elements_wrapper button{height:37px;background:0 0;margin:0}.doboard_task_widget-send_message_elements_wrapper img{margin:0}.doboard_task_widget-send_message_input_wrapper{position:relative;display:inline-grid;align-items:center;justify-items:center;flex-grow:1;padding:0 6px}.doboard_task_widget-send_message_input_wrapper textarea{position:relative;width:100%;height:37px;border:none;outline:0;box-shadow:none;border-radius:24px;background:#F3F6F9;resize:none;margin-bottom:0!important;transition:height .2s ease-in-out;padding:8px;box-sizing:border-box}.doboard_task_widget-send_message_input_wrapper textarea.high{height:170px}.doboard_task_widget-send_message_input_wrapper textarea:focus{background:#F3F6F9;border-color:#007bff;outline:0}.doboard_task_widget-send_message_button,.doboard_task_widget-send_message_paperclip{display:inline-grid;border:none;background:0 0;cursor:pointer;padding:0;align-items:center;margin:0}.doboard_task_widget-send_message_button:hover,.doboard_task_widget-send_message_paperclip:hover rect{fill:#45a049}.doboard_task_widget-send_message_button:active,.doboard_task_widget-send_message_paperclip:active{transform:scale(.98)}.doboard_task_widget-spinner_wrapper_for_containers{display:flex;justify-content:center;align-items:center;min-height:60px;width:100%}.doboard_task_widget-spinner_for_containers{width:40px;height:40px;border-radius:50%;background:conic-gradient(transparent,#1C7857);mask:radial-gradient(farthest-side,transparent calc(100% - 4px),#fff 0);animation:spin 1s linear infinite}.doboard_task_widget-create_issue{padding:10px}.doboard_task_widget__file-upload__wrapper{display:none;border:1px solid #BBC7D1;margin-top:14px;padding:0 10px 10px;border-radius:4px}.doboard_task_widget__file-upload__list-header{text-align:left;font-size:.9em;margin:5px 0;color:#444c529e}.doboard_task_widget__file-upload__file-input-button{display:none}.doboard_task_widget__file-upload__file-list{border:1px solid #ddd;border-radius:5px;padding:6px;max-height:200px;overflow-y:auto;background:#f3f6f9}.doboard_task_widget__file-upload__file-item{display:flex;justify-content:space-between;align-items:center;padding:4px;border-bottom:1px solid #bbc7d16b}.doboard_task_widget__file-upload__file-item:last-child{border-bottom:none}.doboard_task_widget__file-upload__file_info{display:inline-flex;align-items:center}.doboard_task_widget__file-upload__file-name{font-weight:700;font-size:.9em}.doboard_task_widget__file-upload__file-item-content{width:100%}.doboard_task_widget__file-upload__file_size{color:#666;font-size:.8em;margin-left:6px}.doboard_task_widget__file-upload__remove-btn{background:#22a475;color:#fff;border:none;border-radius:3px;cursor:pointer}.doboard_task_widget__file-upload__error{display:block;margin:7px 0 0;padding:7px;border-radius:4px;background:#fdd;border:1px solid #cf6868}.doboard_task_widget-show_button{position:fixed;background:#1C7857;color:#FFF;padding:8px 12px;border-radius:4px;font-size:14px;z-index:10000;cursor:pointer;box-shadow:0 2px 8px rgba(0,0,0,.3);transform:translate(-50%,-100%);margin-top:-8px;white-space:nowrap;border:none;font-family:inherit}@keyframes spin{to{transform:rotate(1turn)}}@media (max-width:480px){.doboard_task_widget{position:fixed;right:0;top:auto;bottom:0;margin:0 20px 20px;box-sizing:border-box;transform:translateZ(0);-moz-transform:translateZ(0);will-change:transform;max-height:90vh}.doboard_task_widget-header{padding:8px}.doboard_task_widget-issue-title{max-width:70px}.doboard_task_widget-container,.doboard_task_widget-container-maximize{width:100%;max-width:290px;margin:0 auto;max-height:90vh}.doboard_task_widget-content{height:auto;max-height:none;scrollbar-width:none}.doboard_task_widget-content::-webkit-scrollbar{display:none}.doboard_task_widget-all_issues-container,.doboard_task_widget-concrete_issues-container{max-height:80vh}}@supports (-webkit-overflow-scrolling:touch){.doboard_task_widget{position:fixed}}.doboard_task_widget_tasks_list{background-color:#fff;position:sticky;bottom:0;height:38px;display:flex;flex-direction:column-reverse;align-items:center;padding-bottom:8px}#doboard_task_widget-user_menu-logout_button{display:inline-flex;align-items:center}.doboard_task_widget-text_selection{position:relative;display:inline-block}.doboard_task_widget-see-task{cursor:pointer;text-decoration:underline}.doboard_task_widget-text_selection_tooltip{position:absolute;bottom:100%;left:50%;transform:translateX(-50%);background:#FFF;color:#000;padding:4px 8px;border-radius:4px;font-size:10px;white-space:nowrap;z-index:9000;border:1px solid #BBC7D1;margin-bottom:8px}.doboard_task_widget-text_selection_tooltip::after{content:'';position:absolute;top:100%;left:50%;transform:translateX(-50%);border:5px solid transparent;border-top-color:#FFF}.doboard_task_widget-text_selection_tooltip::before{content:'';position:absolute;top:100%;left:50%;transform:translateX(-50%);border:6px solid transparent;border-top-color:#BBC7D1;z-index:-1}.doboard_task_widget-text_selection_tooltip_icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCINCgkgdmlld0JveD0iMCAwIDEwMyAxMDAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDEwMyAxMDA7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+DQoJLnN0MHtmaWxsLXJ1bGU6ZXZlbm9kZDtjbGlwLXJ1bGU6ZXZlbm9kZDtmaWxsOiMxNzcyNTA7fQ0KPC9zdHlsZT4NCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik01MywwSDB2MTAwaDMwLjJINTNDMTE5LjYsMTAwLDExOS42LDAsNTMsMHogTTMwLjIsMTAwYy0xNi42LDAtMzAtMTMuNC0zMC0zMHMxMy40LTMwLDMwLTMwDQoJYzE2LjYsMCwzMCwxMy40LDMwLDMwUzQ2LjgsMTAwLDMwLjIsMTAweiIvPg0KPC9zdmc+DQo=);background-repeat:no-repeat;width:22px;height:22px;margin:5px 3px}.doboard_task_widget-text_selection_tooltip_element{display:flex;justify-content:space-between}.toggle{position:relative;display:inline-block;width:46px;height:28px}.toggle input{opacity:0;width:0;height:0;position:absolute}.slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#bbc7d1;border-radius:24px;transition:.3s}.slider:before{content:"";position:absolute;height:24px;width:24px;left:2px;top:2px;background-color:#fff;border-radius:50%;transition:.3s}input:checked+.slider{background-color:#65d4ac}input:checked+.slider:before{transform:translateX(16px)}.logout_button{font-weight:500;font-size:14px;color:#707A83;cursor:pointer}`;
+let spotFixCSS = `.doboard_task_widget-send_message_paperclip .doboard_task_widget-paperclip-tooltip::after{content:"";position:absolute;left:8%;top:100%;transform:translateX(-50%);pointer-events:none;background:0 0;border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid #545b61;display:block}.doboard_task_widget-send_message_paperclip{position:relative}.doboard_task_widget-send_message_paperclip .doboard_task_widget-paperclip-tooltip{display:none;position:absolute;left:0;bottom:0;transform:translateX(-3%) translateY(-43px);background:#545b61;color:#FFF;border:none;border-radius:3px;padding:10px 16px;font-size:13px;line-height:1.4;z-index:100;min-width:220px;max-width:320px;text-align:left;pointer-events:none;text-transform:none}.doboard_task_widget-send_message_paperclip:hover .doboard_task_widget-paperclip-tooltip{display:block}.doboard_task_widget *{font-family:Inter,sans-serif;font-weight:400;font-size:14px;line-height:130%;color:#40484F}.doboard_task_widget-header *{color:#252A2F;margin:0}.doboard_task_widget-header-icons{display:flex}.doboard_task_widget a{text-decoration:underline;color:#2F68B7}.doboard_task_widget a:hover{text-decoration:none}.doboard_task_widget{position:fixed;right:50px;bottom:20px;z-index:9999;vertical-align:middle;transition:top .1s;transform:translateZ(0);-webkit-transform:translateZ(0);will-change:transform}.doboard_task_widget_cursor-pointer{cursor:pointer}.doboard_task_widget-container-maximize{width:80vw!important;max-width:1120px!important;max-height:calc(100vh - 40px);display:flex;flex-direction:column;-moz-flex-direction:column}.doboard_task_widget-container{width:430px;max-height:calc(100vh - 40px);display:flex;flex-direction:column;-moz-flex-direction:column}@media (max-height:800px){.doboard_task_widget-container,.doboard_task_widget-container-maximize{max-height:calc(60vh - 40px)}}.doboard_task_widget-header{display:flex;height:41px;min-height:41px;padding:0 16px;background-color:#EBF0F4;border-radius:8px 8px 0 0;border:1px solid #BBC7D1;border-bottom:none;justify-content:space-between;align-items:center;color:#FFF}.doboard_task_widget-user_menu-header{display:flex;padding:16px;border:1px solid #BBC7D1;border-bottom-color:#EBF0F4;border-radius:8px 8px 0 0;flex-direction:column;align-items:center;color:#252A2F;background-color:#F3F6F9}.doboard_task_widget-user_menu-header-top{display:flex;height:fit-content;align-items:center;width:100%;justify-content:space-between}.doboard_task_widget-user_menu-header-avatar{max-width:60px;max-height:60px;width:60px;height:60px;border-radius:50%;margin-bottom:4px}.doboard_task_widget-user_menu-item{display:flex;align-items:center;border-bottom:1px #EBF0F4 solid;padding:0 16px;height:65px}.doboard_task_widget-content{flex:1;overflow-y:auto;background:#FFF;border-radius:0 0 8px 8px;border:1px #BBC7D1;border-style:none solid solid;box-shadow:0 4px 15px 8px #CACACA40;scrollbar-width:none;max-height:60vh}.doboard_task_widget-element-container{margin-bottom:30px}.doboard_task_widget-wrap{box-shadow:none;position:fixed;right:-50px;padding:0;cursor:pointer;width:69px;height:52px;border-top-left-radius:4px;border-bottom-left-radius:4px;background-color:rgba(255,255,255,.9);border:1px solid #EBF0F4;display:flex;align-items:center;justify-content:center}.doboard_task_widget-input-container.hidden,.doboard_task_widget-login.hidden,.doboard_task_widget-wrap.hidden,.wrap_review::after{display:none}.doboard_task_widget-wrap img{width:32px;height:32px;transform:scaleX(-1)}.wrap_review{width:164px;min-width:164px;height:54px}.wrap_review img{width:28px;height:28px;transform:scaleX(-1)}.wrap_review:hover{background-color:#fff}@media (max-width:480px){.doboard_task_widget-wrap{right:-20px}}#review_content_button_text{color:#D5991A;margin-left:6px;font-weight:600;font-size:14px;text-transform:none!important}#doboard_task_widget-task_count{position:absolute;top:-12px;right:4px;width:22px;height:22px;opacity:1;background:#ef8b43;border-radius:50%;color:#FFF;text-align:center;line-height:22px}#doboard_task_widget-task_count.hidden{width:0;height:0;opacity:0}.doboard_task_widget-input-container{position:relative;margin-bottom:24px}.doboard_task_widget-input-container .doboard_task_widget-field{padding:0 8px;border-radius:4px;border:1px solid #BBC7D1;outline:0!important;appearance:none;width:100%;height:40px;background:#FFF;color:#000;max-width:-webkit-fill-available;max-width:-moz-available}.doboard_task_widget-field:focus{border-color:#2F68B7}.doboard_task_widget-input-container textarea.doboard_task_widget-field{height:94px;padding-top:11px;padding-bottom:11px}.doboard_task_widget-field+label{color:#252A2F;background:#fff;position:absolute;top:20px;left:8px;transform:translateY(-50%);transition:all .2s ease-in-out}.doboard_task_widget-field.has-value+label,.doboard_task_widget-field:focus+label{font-size:10px;top:0;left:12px;padding:0 4px;z-index:5}.doboard_task_widget-field:focus+label{color:#2F68B7}.doboard_task_widget-login{background:#F9FBFD;border:1px solid #BBC7D1;border-radius:4px;padding:11px 8px 8px;margin-bottom:24px}.doboard_task_widget-login .doboard_task_widget-accordion{height:0;overflow:hidden;opacity:0;transition:all .2s ease-in-out}.doboard_task_widget-login.active .doboard_task_widget-accordion{height:auto;overflow:visible;opacity:1}.doboard_task_widget-login .doboard_task_widget-input-container:last-child{margin-bottom:0}.doboard_task_widget-login span{display:block;position:relative;padding-right:24px;cursor:pointer}.doboard_task_widget-login.active span{margin-bottom:24px}.doboard_task_widget-login span::after{position:absolute;top:0;right:4px;content:"";display:block;width:10px;height:10px;transform:rotate(45deg);border:2px solid #40484F;border-radius:1px;border-top:none;border-left:none;transition:all .2s ease-in-out}.doboard_task_widget-login.active span::after{transform:rotate(-135deg);top:7px}.doboard_task_widget-login .doboard_task_widget-field+label,.doboard_task_widget-login .doboard_task_widget-input-container .doboard_task_widget-field{background:#F9FBFD}.doboard_task_widget-submit_button{height:48px;width:100%;max-width:400px;margin-bottom:10px;color:#FFF;background:#22A475;border:none;border-radius:6px;font-family:Inter,sans-serif;font-weight:700;font-size:16px;line-height:150%;cursor:pointer;transition:all .2s ease-in-out}.doboard_task_widget-submit_button:hover{background:#1C7857;color:#FFF}.doboard_task_widget-submit_button:disabled{background:rgba(117,148,138,.92);color:#FFF;cursor:wait}.doboard_task_widget-issue-title{max-width:200px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.doboard_task_widget-hidden_element{opacity:0}.doboard_task_widget-message-wrapper{border-radius:4px;padding:8px;margin-bottom:14px;display:grid;justify-items:center}.doboard_task_widget-error_message-wrapper.hidden,.doboard_task_widget-message-wrapper.hidden{display:none}.doboard_task_widget-error_message{background:#fdd;border:1px solid #cf6868}.doboard_task_widget-notice_message{background:#dde9ff;border:1px solid #68a6cf}#doboard_task_widget-error_message-header{font-weight:600}#doboard_task_widget-error_message{text-align:center}.doboard_task_widget-task_row{display:flex;max-height:55px;cursor:pointer;align-items:center;justify-content:space-between;padding:1px 15px}.doboard_task_widget-task_row:last-child{margin-bottom:0}.doboard_task_widget-task-text_bold{font-weight:700}.doboard_task_widget-element_selection,.doboard_task_widget-image_selection,.doboard_task_widget-text_selection,.doboard_task_widget-text_selection.image-highlight>img{background:rgba(208,213,127,.68)}.doboard_task_widget-issues_list_empty{text-align:center;margin:20px 0}.doboard_task_widget-avatar_container{display:flex;height:44px;width:44px;border-radius:50%;background-repeat:no-repeat;background-position:center;background-size:100%}.doboard_task_widget-comment_data_owner .doboard_task_widget-avatar_container{opacity:0}.doboard_task_widget-avatar_placeholder{min-height:44px;min-width:44px;border-radius:50%;font-size:24px;line-height:1.2083333333;padding:0;background:#1C7857;display:inline-grid;align-content:center;justify-content:center}.doboard_task_widget-avatar-initials{color:#FFF;width:inherit;text-align:center}.doboard_task_widget-avatar{width:44px;height:44px;border-radius:50%;object-fit:cover}.doboard_task_widget-description_container{height:55px;width:calc(100% - 44px - 8px);border-bottom:1px solid #EBF0F4;display:block;margin-left:8px}.doboard_task_widget-task_row:last-child .doboard_task_widget-description_container{border-bottom:none}.doboard_task_widget-all_issues{padding-bottom:0}.doboard_task_widget-all_issues-container,.doboard_task_widget-concrete_issues-container{overflow:auto;max-height:85vh;display:none}.doboard_task_widget-task_last_message,.doboard_task_widget-task_page_url a,.doboard_task_widget-task_title span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.doboard_task_widget-all_issues-container{scrollbar-width:none;margin-top:10px;min-height:60vh}.doboard_task_widget-content.doboard_task_widget-concrete_issue{padding:0}.doboard_task_widget-concrete_issues-container{padding:10px 16px 5px}.doboard_task_widget-all_issues-container::-webkit-scrollbar,.doboard_task_widget-all_issues::-webkit-scrollbar,.doboard_task_widget-concrete_issues-container::-webkit-scrollbar,.doboard_task_widget-content::-webkit-scrollbar{width:0}.doboard_task_widget-task_title{font-weight:700;display:flex;justify-content:space-between;align-items:center}.doboard_task_widget-task_title span{font-weight:700;display:inline-block}.doboard_task_widget-task_title-details{display:flex;max-width:calc(100% - 40px);align-items:center}.doboard_task_widget-task_title-unread_block{opacity:0;height:8px;width:8px;background:#f08c43;border-radius:50%;display:inline-block;font-size:8px;font-weight:600;position:relative}.doboard_task_widget-task_title-unread_block.unread{opacity:1}.doboard_task_widget-task_last_message{max-width:85%;height:36px}.doboard_task_widget-task_page_url{max-width:70%;height:36px;display:flex;align-items:center}.doboard_task_widget-task_page_url a{color:#40484F;text-decoration:none;margin-left:8px;max-width:100%}.doboard_task_widget-bottom{display:flex;justify-content:space-between}.doboard_task_widget-bottom-is-fixed{border-radius:10px;background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkiIGhlaWdodD0iMTkiIHZpZXdCb3g9IjAgMCAxOSAxOSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGQ9Ik03LjA4MTE5IDAuMjIzNDM0QzguOTkxNjkgLTAuMjA4MTY3IDEwLjk5MTMgLTAuMDExMjE5NCAxMi43ODA0IDAuNzg1OTM0QzEzLjE1ODQgMC45NTQ2MjQgMTMuMzI4NiAxLjM5ODAzIDEzLjE2MDMgMS43NzYxN0MxMi45OTE3IDIuMTU0MTkgMTIuNTQ4MiAyLjMyNDI0IDEyLjE3MDEgMi4xNTYwNUMxMC42NzY0IDEuNDkwNTIgOS4wMDcyNiAxLjMyNiA3LjQxMjI1IDEuNjg2MzJDNS44MTcxNyAyLjA0NjcxIDQuMzgwOTcgMi45MTI5NiAzLjMxODUgNC4xNTYwNUMyLjI1NjIzIDUuMzk5MDEgMS42MjQ0MSA2Ljk1MjI5IDEuNTE2NzQgOC41ODM3OUMxLjQwOTI0IDEwLjIxNTQgMS44MzE4NCAxMS44MzkgMi43MjE4MiAxMy4yMTA3QzMuNjExNzkgMTQuNTgyMiA0LjkyMTY0IDE1LjYyOTQgNi40NTUyMSAxNi4xOTYxQzcuOTg5MDIgMTYuNzYyNiA5LjY2NTUzIDE2LjgxODkgMTEuMjMzNSAxNi4zNTUzQzEyLjgwMTYgMTUuODkxNiAxNC4xNzgzIDE0LjkzMzUgMTUuMTU3NCAxMy42MjM4QzE2LjEzNjQgMTIuMzE0MiAxNi42NjYxIDEwLjcyMjcgMTYuNjY3MSA5LjA4NzY5TDE4LjE2NzEgOS4wODg2N0MxOC4xNjU4IDExLjA0NzEgMTcuNTMxMiAxMi45NTM2IDE2LjM1ODUgMTQuNTIyM0MxNS4xODU5IDE2LjA5MDcgMTMuNTM3MyAxNy4yMzg0IDExLjY1OTMgMTcuNzkzN0M5Ljc4MTEgMTguMzQ5MSA3Ljc3MjkzIDE4LjI4MiA1LjkzNTY4IDE3LjYwMzNDNC4wOTg1IDE2LjkyNDYgMi41MjkxMiAxNS42NzAxIDEuNDYzMDMgMTQuMDI3MUMwLjM5NzAzNSAxMi4zODQxIC0wLjEwOTEwOSAxMC40Mzk1IDAuMDE5NjY4MyA4LjQ4NTE1QzAuMTQ4NjA3IDYuNTMwOCAwLjkwNjMyMyA0LjY3MDMzIDIuMTc4ODUgMy4xODE0NEMzLjQ1MTM2IDEuNjkyNjggNS4xNzA4OCAwLjY1NTE2MiA3LjA4MTE5IDAuMjIzNDM0WiIgZmlsbD0iIzIyQTQ3NSIvPg0KPHBhdGggZD0iTTE2Ljg4NTkgMS44OTA0M0MxNy4xNzg2IDEuNTk3NTMgMTcuNjUzNCAxLjU5Nzg0IDE3Ljk0NjQgMS44OTA0M0MxOC4yMzkzIDIuMTgzMTYgMTguMjQwMSAyLjY1Nzk2IDE3Ljk0NzQgMi45NTA5N0w5LjYxMzQyIDExLjI5MjhDOS40NzI4MiAxMS40MzMzIDkuMjgxOTYgMTEuNTEyNCA5LjA4MzE1IDExLjUxMjVDOC44ODQzMiAxMS41MTI1IDguNjkzNDggMTEuNDMzMyA4LjU1Mjg3IDExLjI5MjhMNi4wNTI4NyA4Ljc5Mjc3QzUuNzYwMTQgOC40OTk5IDUuNzYwMTEgOC4wMjUwOCA2LjA1Mjg3IDcuNzMyMjJDNi4zNDU3MiA3LjQzOTM3IDYuODIwNTEgNy40Mzk0NiA3LjExMzQyIDcuNzMyMjJMOS4wODIxNyA5LjcwMDk3TDE2Ljg4NTkgMS44OTA0M1oiIGZpbGw9IiMyMkE0NzUiLz4NCjxwYXRoIGQ9Ik0xNy40MTcxIDcuNTcxMDlDMTcuODMxIDcuNTcxNDQgMTguMTY3IDcuOTA3MTYgMTguMTY3MSA4LjMyMTA5VjkuMDg4NjdMMTcuNDE3MSA5LjA4NzY5SDE2LjY2NzFWOC4zMjEwOUMxNi42NjcyIDcuOTA2OTQgMTcuMDAzIDcuNTcxMDkgMTcuNDE3MSA3LjU3MTA5WiIgZmlsbD0iIzIyQTQ3NSIvPg0KPC9zdmc+) 8px center no-repeat #EBFAF4;padding:4px 7px 4px 30px}.doboard_task_widget-bottom-is-fixed-task-block{text-align:center}.doboard_task_widget-bottom-is-fixed-task{background:#F3F6F9;color:#1C7857;display:inline-block;border-radius:10px;padding:5px 8px;margin:0 auto}.doboard_task_widget-task_row-green{background:#EBF0F4}.doboard_task_widget_return_to_all{display:flex;gap:8px;flex-direction:row;-moz-flex-direction:row;align-content:center;flex-wrap:wrap}.doboard_task_widget-task_title-last_update_time{font-family:Inter,serif;font-weight:400;font-style:normal;font-size:11px;leading-trim:NONE;line-height:100%}.doboard_task_widget-task_title_public_status_img{opacity:50%;margin-left:5px;scale:90%}.doboard_task_widget-description-textarea{resize:none}.doboard_task_widget-switch_row{display:flex;align-items:center;gap:12px;margin:16px 0;justify-content:space-between}.doboard_task_widget-switch-label{font-weight:600;font-size:16px;height:24px;align-content:center}.doboard_task_widget-switch{position:relative;display:inline-block;width:44px;height:24px;flex-shrink:0}.doboard_task_widget-switch input{opacity:0;width:0;height:0}.doboard_task_widget-slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;border-radius:24px;transition:.2s}.doboard_task_widget-slider:before{position:absolute;content:"";height:20px;width:20px;left:2px;bottom:2px;background-color:#fff;border-radius:50%;transition:.2s}.doboard_task_widget-switch input:checked+.doboard_task_widget-slider{background-color:#65D4AC}.doboard_task_widget-switch input:checked+.doboard_task_widget-slider:before{transform:translateX(20px)}.doboard_task_widget-switch-img{width:24px;height:24px;flex-shrink:0}.doboard_task_widget-switch-center{display:flex;gap:2px;flex-direction:column;-moz-flex-direction:column;flex:1 1 auto;min-width:0}.doboard_task_widget-switch-desc{display:block;font-size:12px;color:#707A83;margin:0;line-height:1.2;max-width:180px;word-break:break-word}.doboard_task_widget-concrete_issue-day_content{display:flex;flex-direction:column;-moz-flex-direction:column}.doboard_task_widget-concrete_issue_day_content-month_day{text-align:center;font-weight:400;font-size:12px;line-height:100%;padding:8px;opacity:.75}.doboard_task_widget-concrete_issue_day_content-messages_wrapper{display:flex;flex-direction:column;-moz-flex-direction:column}.doboard_task_widget-comment_data_wrapper{display:flex;flex-direction:row;-moz-flex-direction:row;margin-bottom:15px;align-items:flex-end}.doboard_task_widget-comment_text_container{position:relative;width:calc(100% - 44px - 5px);height:auto;margin-left:5px;background:#F3F6F9;border-radius:16px}.doboard_task_widget-comment_text_container:after{content:"";position:absolute;bottom:0;left:-5px;width:13px;height:19px;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTMiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAxMyAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTAuMTEyNTggMTkuMDMzNEM1LjI5NDg2IDE5LjgyMDEgMTAuNjEwNSAxNy45NzQxIDEyLjI3MTUgMTYuMTcxM0MxMi4yNzE1IDE2LjE3MTMgMTAuOTYyMyAtMi43ODEyNCA1LjA5NTU0IDAuMzQ5MDc5QzUuMDc0NCAxLjYxNDU0IDUuMDk1NTQgNS45OTQ5IDUuMDk1NTQgNi43NDA2OUM1LjA5NTU0IDE3LjA2NjIgLTAuODg0MDEyIDE4LjQ0MDEgMC4xMTI1OCAxOS4wMzM0WiIgZmlsbD0iI0YzRjZGOSIvPgo8L3N2Zz4K)}.doboard_task_widget-comment_data_owner .doboard_task_widget-comment_text_container{background:#EBFAF4}.doboard_task_widget-comment_data_owner .doboard_task_widget-comment_text_container:after{left:auto;right:-5px;height:13px;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTMiIGhlaWdodD0iMTMiIHZpZXdCb3g9IjAgMCAxMyAxMyIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEyLjc3NzEgMTIuMzA2NkM3LjMzMTM1IDEzLjA5MzcgMS43NDU0NCAxMS4yNDY5IDAgOS40NDMxOUw3LjM5MTYgMEM3LjM5MTYgMTAuMzMwMyAxMy44MjQ0IDExLjcxMzEgMTIuNzc3MSAxMi4zMDY2WiIgZmlsbD0iI0VCRkFGNCIvPgo8L3N2Zz4K)}.doboard_task_widget-comment_body,.doboard_task_widget-comment_time{position:relative;z-index:1}.doboard_task_widget-comment_body{padding:6px 8px;min-height:30px}.doboard_task_widget-comment_body strong{font-variation-settings:"wght" 700}.doboard_task_widget-comment_body blockquote{margin:0;border-left:3px solid #22a475}.doboard_task_widget-comment_body blockquote p{margin:0 10px}.doboard_task_widget-comment_body details .mce-accordion-body{padding-left:20px}.doboard_task_widget-comment_body details .mce-accordion-summary{background:url("data:image/svg+xml;charset=utf-8,%3Csvg transform='rotate(180 0 0)' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' style='enable-background:new 0 0 20 20' xml:space='preserve'%3E%3Cpath d='M10 13.3c-.2 0-.4-.1-.6-.2l-5-5c-.3-.3-.3-.9 0-1.2.3-.3.9-.3 1.2 0l4.4 4.4 4.4-4.4c.3-.3.9-.3 1.2 0 .3.3.3.9 0 1.2l-5 5c-.2.2-.4.2-.6.2z'/%3E%3C/svg%3E") 0 no-repeat;padding-left:20px}.doboard_task_widget-comment_body .mce-accordion[open] .mce-accordion-summary{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' style='enable-background:new 0 0 20 20' xml:space='preserve'%3E%3Cpath d='M10 13.3c-.2 0-.4-.1-.6-.2l-5-5c-.3-.3-.3-.9 0-1.2.3-.3.9-.3 1.2 0l4.4 4.4 4.4-4.4c.3-.3.9-.3 1.2 0 .3.3.3.9 0 1.2l-5 5c-.2.2-.4.2-.6.2z'/%3E%3C/svg%3E") 0 no-repeat}.doboard_task_widget-comment_body details .mce-accordion-summary::marker{content:""}.doboard_task_widget-comment_body pre{border:1px solid #d6dde3;border-left-width:8px;border-radius:4px;padding:13px 16px 14px 12px;white-space:pre-wrap}.doboard_task_widget-comment_time{font-weight:400;font-size:11px;opacity:.8;position:absolute;bottom:6px;right:6px}.doboard_task_widget-comment_body-img-strict{max-width:-webkit-fill-available;height:100px;margin-right:5px}.doboard_task_widget-send_message{padding:14px 10px;border-top:1px solid #BBC7D1;position:sticky;background:#fff;bottom:0;z-index:4}.doboard_task_widget-send_message_elements_wrapper{display:flex;flex-direction:row;-moz-flex-direction:row;align-content:center;flex-wrap:nowrap;justify-content:space-between;align-items:end}.doboard_task_widget-send_message_elements_wrapper button{height:37px;background:0 0;margin:0}.doboard_task_widget-send_message_elements_wrapper img{margin:0}.doboard_task_widget-send_message_input_wrapper{position:relative;display:inline-grid;align-items:center;justify-items:center;flex-grow:1;padding:0 6px}.doboard_task_widget-send_message_input_wrapper textarea{position:relative;width:100%;height:37px;border:none;outline:0;box-shadow:none;border-radius:24px;background:#F3F6F9;resize:none;margin-bottom:0!important;transition:height .2s ease-in-out;padding:8px;box-sizing:border-box}.doboard_task_widget-send_message_input_wrapper textarea.high{height:170px}.doboard_task_widget-send_message_input_wrapper textarea:focus{background:#F3F6F9;border-color:#007bff;outline:0}.doboard_task_widget-send_message_button,.doboard_task_widget-send_message_paperclip{display:inline-grid;border:none;background:0 0;cursor:pointer;padding:0;align-items:center;margin:0}.doboard_task_widget-send_message_button:hover,.doboard_task_widget-send_message_paperclip:hover rect{fill:#45a049}.doboard_task_widget-send_message_button:active,.doboard_task_widget-send_message_paperclip:active{transform:scale(.98)}.doboard_task_widget-spinner_wrapper_for_containers{display:flex;justify-content:center;align-items:center;min-height:60px;width:100%}.doboard_task_widget-spinner_for_containers{width:40px;height:40px;border-radius:50%;background:conic-gradient(transparent,#1C7857);mask:radial-gradient(farthest-side,transparent calc(100% - 4px),#fff 0);animation:spin 1s linear infinite}.doboard_task_widget-create_issue{padding:10px}.doboard_task_widget__file-upload__wrapper{display:none;border:1px solid #BBC7D1;margin-top:14px;padding:0 10px 10px;border-radius:4px}.doboard_task_widget__file-upload__list-header{text-align:left;font-size:.9em;margin:5px 0;color:#444c529e}.doboard_task_widget__file-upload__file-input-button{display:none}.doboard_task_widget__file-upload__file-list{border:1px solid #ddd;border-radius:5px;padding:6px;max-height:200px;overflow-y:auto;background:#f3f6f9}.doboard_task_widget__file-upload__file-item{display:flex;justify-content:space-between;align-items:center;padding:4px;border-bottom:1px solid #bbc7d16b}.doboard_task_widget__file-upload__file-item:last-child{border-bottom:none}.doboard_task_widget__file-upload__file_info{display:inline-flex;align-items:center}.doboard_task_widget__file-upload__file-name{font-weight:700;font-size:.9em}.doboard_task_widget__file-upload__file-item-content{width:100%}.doboard_task_widget__file-upload__file_size{color:#666;font-size:.8em;margin-left:6px}.doboard_task_widget__file-upload__remove-btn{background:#22a475;color:#fff;border:none;border-radius:3px;cursor:pointer}.doboard_task_widget__file-upload__error{display:block;margin:7px 0 0;padding:7px;border-radius:4px;background:#fdd;border:1px solid #cf6868}.doboard_task_widget-show_button{position:fixed;background:#1C7857;color:#FFF;padding:8px 12px;border-radius:4px;font-size:14px;z-index:10000;cursor:pointer;box-shadow:0 2px 8px rgba(0,0,0,.3);transform:translate(-50%,-100%);margin-top:-8px;white-space:nowrap;border:none;font-family:inherit}@keyframes spin{to{transform:rotate(1turn)}}@media (max-width:480px){.doboard_task_widget{position:fixed;right:0;top:auto;bottom:0;margin:0 20px 20px;box-sizing:border-box;transform:translateZ(0);-moz-transform:translateZ(0);will-change:transform;max-height:90vh}.doboard_task_widget-header{padding:8px}.doboard_task_widget-issue-title{max-width:70px}.doboard_task_widget-container,.doboard_task_widget-container-maximize{width:100%;max-width:290px;margin:0 auto;max-height:90vh}.doboard_task_widget-container{min-width:290px}.doboard_task_widget-content{height:auto;max-height:100%;min-height:100%;scrollbar-width:none}.doboard_task_widget-content::-webkit-scrollbar{display:none}.doboard_task_widget-all_issues-container,.doboard_task_widget-concrete_issues-container{max-height:80vh}}@supports (-webkit-overflow-scrolling:touch){.doboard_task_widget{position:fixed}}.doboard_task_widget_tasks_list{background-color:#fff;position:sticky;bottom:0;height:38px;display:flex;flex-direction:column-reverse;align-items:center;padding-bottom:8px}#doboard_task_widget-user_menu-logout_button{display:inline-flex;align-items:center}.doboard_task_widget-text_selection{position:relative;display:inline-block}.doboard_task_widget-see-task{cursor:pointer;text-decoration:underline}.doboard_task_widget-text_selection_tooltip{position:absolute;bottom:100%;left:50%;transform:translateX(-50%);background:#FFF;color:#000;padding:4px 8px;border-radius:4px;font-size:10px;white-space:nowrap;z-index:9000;border:1px solid #BBC7D1;margin-bottom:8px}.doboard_task_widget-text_selection_tooltip::after{content:'';position:absolute;top:100%;left:50%;transform:translateX(-50%);border:5px solid transparent;border-top-color:#FFF}.doboard_task_widget-text_selection_tooltip::before{content:'';position:absolute;top:100%;left:50%;transform:translateX(-50%);border:6px solid transparent;border-top-color:#BBC7D1;z-index:-1}.doboard_task_widget-text_selection_tooltip_icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCINCgkgdmlld0JveD0iMCAwIDEwMyAxMDAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDEwMyAxMDA7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+DQoJLnN0MHtmaWxsLXJ1bGU6ZXZlbm9kZDtjbGlwLXJ1bGU6ZXZlbm9kZDtmaWxsOiMxNzcyNTA7fQ0KPC9zdHlsZT4NCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik01MywwSDB2MTAwaDMwLjJINTNDMTE5LjYsMTAwLDExOS42LDAsNTMsMHogTTMwLjIsMTAwYy0xNi42LDAtMzAtMTMuNC0zMC0zMHMxMy40LTMwLDMwLTMwDQoJYzE2LjYsMCwzMCwxMy40LDMwLDMwUzQ2LjgsMTAwLDMwLjIsMTAweiIvPg0KPC9zdmc+DQo=);background-repeat:no-repeat;width:22px;height:22px;margin:5px 3px}.doboard_task_widget-text_selection_tooltip_element{display:flex;justify-content:space-between}.toggle{position:relative;display:inline-block;width:46px;height:28px}.toggle input{opacity:0;width:0;height:0;position:absolute}.slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#bbc7d1;border-radius:24px;transition:.3s}.slider:before{content:"";position:absolute;height:24px;width:24px;left:2px;top:2px;background-color:#fff;border-radius:50%;transition:.3s}input:checked+.slider{background-color:#65d4ac}input:checked+.slider:before{transform:translateX(16px)}.logout_button{font-weight:500;font-size:14px;color:#707A83;cursor:pointer}`;
/**
* Widget class to create a task widget
*/
@@ -1018,7 +1045,7 @@ class CleanTalkWidgetDoboard {
try {
// Confirm email and create task
const createdTask = await confirmUserEmail(emailToken, this.params);
- this.allTasksData = await getAllTasks(this.params);
+ this.allTasksData = await getAllTasks(this.params, this.nonRequesting);
// Open task interface
this.currentActiveTaskId = createdTask.taskId;
type = 'concrete_issue';
@@ -1034,7 +1061,7 @@ class CleanTalkWidgetDoboard {
// Load all tasks
const isWidgetClosed = localStorage.getItem('spotfix_widget_is_closed');
if((isWidgetClosed && !this.selectedText) || !isWidgetClosed){
- this.allTasksData = await getAllTasks(this.params);
+ this.allTasksData = await getAllTasks(this.params, this.nonRequesting);
}
}
@@ -1226,7 +1253,7 @@ class CleanTalkWidgetDoboard {
}
// refersh tasks list after creation
- this.allTasksData = await getAllTasks(this.params);
+ this.allTasksData = await getAllTasks(this.params, this.nonRequesting);
// save updates
storageSaveTasksUpdateData(this.allTasksData);
@@ -1242,10 +1269,13 @@ class CleanTalkWidgetDoboard {
* Create widget element
* @return {HTMLElement} widget element
*/
- async createWidgetElement(type, showOnlyCurrentPage = false) {
+ async createWidgetElement(type, nonRequesting = false, showOnlyCurrentPage = false) {
const widgetContainer = document.querySelector('.doboard_task_widget') ? document.querySelector('.doboard_task_widget') : document.createElement('div');
widgetContainer.className = 'doboard_task_widget';
- widgetContainer.innerHTML = ksesFilter('');
+
+ if(!nonRequesting) {
+ widgetContainer.innerHTML = ksesFilter('');
+ }
widgetContainer.removeAttribute('style');
let templateName = '';
@@ -1259,6 +1289,8 @@ class CleanTalkWidgetDoboard {
case 'create_issue':
templateName = 'create_issue';
this.type_name = templateName;
+ this.socket_type_name = templateName;
+ this.nonRequesting = nonRequesting;
templateVariables = {
selectedText: this.selectedText,
currentDomain: document.location.hostname || '',
@@ -1275,21 +1307,31 @@ class CleanTalkWidgetDoboard {
}
templateName = 'wrap';
+ this.type_name = templateName;
+ this.socket_type_name = templateName;
+ this.nonRequesting = nonRequesting;
templateVariables = {position: !Number.isNaN(Number(config?.verticalPosition))
? `${Number(config?.verticalPosition)}vh` : '0vh', ...this.srcVariables};
break;
case 'wrap_review':
templateName = 'wrap_review';
+ this.type_name = templateName;
+ this.socket_type_name = templateName;
+ this.nonRequesting = nonRequesting;
templateVariables = {position: !Number.isNaN(Number(config?.verticalPosition))
? `${Number(config?.verticalPosition)}vh` : '0vh', ...this.srcVariables};
break;
case 'all_issues':
templateName = 'all_issues';
this.type_name = templateName;
+ this.socket_type_name = templateName;
+ this.nonRequesting = nonRequesting;
templateVariables = {...this.srcVariables};
break;
case 'user_menu':
templateName = 'user_menu';
+ this.socket_type_name = templateName;
+ this.nonRequesting = nonRequesting;
const version = localStorage.getItem('spotfix_app_version') || SPOTFIX_VERSION;
templateVariables = {
spotfixVersion: version ? 'Spotfix version ' + version + '.' : '',
@@ -1305,6 +1347,8 @@ class CleanTalkWidgetDoboard {
case 'concrete_issue':
templateName = 'concrete_issue';
this.type_name = templateName;
+ this.socket_type_name = templateName;
+ this.nonRequesting = nonRequesting;
// Update the number of tasks
this.savedIssuesQuantityAll = Array.isArray(this.allTasksData) ? this.allTasksData.length : 0;
// Calculate the number of issues on the current page
@@ -1327,11 +1371,13 @@ class CleanTalkWidgetDoboard {
default:
break;
}
- widgetContainer.innerHTML = this.loadTemplate(templateName, templateVariables);
- document.body.appendChild(widgetContainer);
+ if(!nonRequesting) {
+ widgetContainer.innerHTML = this.loadTemplate(templateName, templateVariables);
+ document.body.appendChild(widgetContainer);
- // remove highlights before any screen called
- spotFixRemoveHighlights();
+ // remove highlights before any screen called
+ spotFixRemoveHighlights();
+ }
const container = document.querySelector('.doboard_task_widget-container');
switch (type) {
case 'create_issue':
@@ -1377,15 +1423,16 @@ class CleanTalkWidgetDoboard {
});
break;
case 'all_issues':
+ if (this.nonRequesting) {
+ hideContainersSpinner();
+ } else {
changeSize(container);
-
+ }
spotFixRemoveHighlights();
let issuesQuantityOnPage = 0;
- if (!this.allTasksData?.length) {
- this.allTasksData = await getAllTasks(this.params);
- }
+ this.allTasksData = await getAllTasks(this.params, this.nonRequesting);
const tasks = this.allTasksData;
- tasksFullDetails = await getTasksFullDetails(this.params, tasks, this.currentActiveTaskId);
+ tasksFullDetails = await getTasksFullDetails(this.params, tasks, this.currentActiveTaskId, this.nonRequesting);
let spotsToBeHighlighted = [];
if (tasks.length > 0) {
const currentURL = window.location.href;
@@ -1476,7 +1523,7 @@ class CleanTalkWidgetDoboard {
this.savedIssuesQuantityOnPage = issuesQuantityOnPage;
this.savedIssuesQuantityAll = tasks.length;
spotFixHighlightElements(spotsToBeHighlighted, this);
- document.querySelector('.doboard_task_widget-header span').innerHTML += ksesFilter(' ' + getIssuesCounterString(this.savedIssuesQuantityOnPage, this.savedIssuesQuantityAll));
+ document.querySelector('.doboard_task_widget-header span').innerHTML = ksesFilter('All spots ' + getIssuesCounterString(this.savedIssuesQuantityOnPage, this.savedIssuesQuantityAll));
}
if (tasks.length === 0) {
@@ -1492,10 +1539,11 @@ class CleanTalkWidgetDoboard {
setToggleStatus(this);
checkLogInOutButtonsVisible();
- const user = await getUserDetails(this.params);
- const gitHubAppVersion = await getReleaseVersion();
+ const user = await getUserDetails(this.params, this.nonRequesting);
+ let gitHubAppVersion = '';
+ if(!this.nonRequesting) gitHubAppVersion = await getReleaseVersion();
let spotfixVersion = '';
- const version = localStorage.getItem('spotfix_app_version') || gitHubAppVersion || SPOTFIX_VERSION;
+ const version = gitHubAppVersion || localStorage.getItem('spotfix_app_version') || SPOTFIX_VERSION;
spotfixVersion = version ? `Spotfix version ${version}.` : '';
templateVariables.spotfixVersion = spotfixVersion || '';
@@ -1513,19 +1561,22 @@ class CleanTalkWidgetDoboard {
break;
case 'concrete_issue':
- changeSize(container);
- tasksFullDetails = await getTasksFullDetails(this.params, this.allTasksData, this.currentActiveTaskId);
- const taskDetails = await getTaskFullDetails(tasksFullDetails, this.currentActiveTaskId);
+ if(this.nonRequesting) {
+ hideContainersSpinner();
+ this.allTasksData = await spotfixIndexedDB.getAll(TABLE_TASKS);
+ } else {
+ changeSize(container);
+ }
+ tasksFullDetails = await getTasksFullDetails(this.params, this.allTasksData, this.currentActiveTaskId, this.nonRequesting);
+ const taskDetails = await getTaskFullDetails(tasksFullDetails, this.currentActiveTaskId, this.nonRequesting);
// Update issue title in the interface
const issueTitleElement = document.querySelector('.doboard_task_widget-issue-title');
if (issueTitleElement) {
- issueTitleElement.innerText = ksesFilter(taskDetails.issueTitle);
+ issueTitleElement.innerText = ksesFilter(tasksFullDetails.taskName || taskDetails?.issueTitle);
}
-
- templateVariables.issueTitle = taskDetails?.issueTitle;
+ templateVariables.issueTitle = tasksFullDetails.taskName || taskDetails?.issueTitle;
templateVariables.issueComments = taskDetails?.issueComments;
-
// Highlight the task's selected text
let nodePath = null;
const currentTaskData = this.allTasksData.find((element) => String(element.taskId) === String(taskDetails.taskId));
@@ -1541,11 +1592,25 @@ class CleanTalkWidgetDoboard {
templateVariables.taskPageUrl = meta.pageURL;
const taskFormattedPageUrl = meta.pageURL.replace(window.location.origin, '');
templateVariables.taskFormattedPageUrl = taskFormattedPageUrl.length < 2
- ? meta.pageURL.replace(window.location.protocol + '/', '') : taskFormattedPageUrl;
+ ? meta.pageURL.replace(/^https?:\/\//, '') : taskFormattedPageUrl;
+
+ const issueLinkElement = document.getElementById('spotfix_doboard_task_widget_url');
+ if (issueLinkElement) {
+ issueLinkElement.innerHTML = `${templateVariables.taskFormattedPageUrl}`;
+ }
+
templateVariables.contenerClasess = +localStorage.getItem('maximize')
? 'doboard_task_widget-container-maximize doboard_task_widget-container' : 'doboard_task_widget-container'
- widgetContainer.innerHTML = this.loadTemplate('concrete_issue', templateVariables);
- document.body.appendChild(widgetContainer);
+ if (this.nonRequesting) {
+ const containerEl = document.getElementById('doboard_task_widget_concrete-container');
+ if (containerEl) {
+ containerEl.className = templateVariables.contenerClasess;
+ }
+ }
+ if (!this.nonRequesting) {
+ widgetContainer.innerHTML = this.loadTemplate('concrete_issue', templateVariables);
+ document.body.appendChild(widgetContainer);
+ }
// remove old highlights before adding new ones
spotFixRemoveHighlights();
@@ -1559,6 +1624,11 @@ class CleanTalkWidgetDoboard {
}
const issuesCommentsContainer = document.querySelector('.doboard_task_widget-concrete_issues-container');
+ if (!issuesCommentsContainer) return;
+
+ const currentScrollTop = issuesCommentsContainer.scrollTop;
+ const wasAtBottom = currentScrollTop + issuesCommentsContainer.clientHeight >= issuesCommentsContainer.scrollHeight - 10;
+
let dayMessagesData = [];
const initIssuerID = localStorage.getItem('spotfix_user_id');
let userIsIssuer = false;
@@ -1608,7 +1678,14 @@ class CleanTalkWidgetDoboard {
},
);
}
- issuesCommentsContainer.innerHTML = daysWrapperHTML;
+ if (!this.nonRequesting) {
+ issuesCommentsContainer.innerHTML = daysWrapperHTML;
+ } else {
+ if (issuesCommentsContainer.innerHTML !== daysWrapperHTML) {
+ issuesCommentsContainer.innerHTML = daysWrapperHTML;
+ }
+ }
+
} else {
issuesCommentsContainer.innerHTML = ksesFilter('No comments');
}
@@ -1633,13 +1710,15 @@ class CleanTalkWidgetDoboard {
hideContainersSpinner();
// Scroll to the bottom comments
- setTimeout(() => {
- const contentContainer = document.querySelector('.doboard_task_widget-content');
- contentContainer.scrollTo({
- top: contentContainer.scrollHeight,
- behavior: 'smooth'
- });
- }, 0);
+ if(!this.nonRequesting) {
+ setTimeout(() => {
+ const contentContainer = document.querySelector('.doboard_task_widget-content');
+ contentContainer.scrollTo({
+ top: contentContainer.scrollHeight,
+ behavior: 'smooth',
+ });
+ }, 0);
+ }
const sendButton = document.querySelector('.doboard_task_widget-send_message_button');
if (sendButton) {
@@ -1745,9 +1824,15 @@ class CleanTalkWidgetDoboard {
this.createWidgetElement(this.type_name)
}) || '';
+ wsSpotfix.onMessage(() => {
+ this.createWidgetElement(this.socket_type_name, true)
+ });
+
return widgetContainer;
}
+
+
bindIssuesClick() {
document.querySelectorAll('.issue-item').forEach(item => {
item.addEventListener('click', async () => {
@@ -1862,14 +1947,28 @@ class CleanTalkWidgetDoboard {
let tasksCount;
- if(tasksCountLS !== 0 && !tasksCountLS){
- await getTasksDoboard(projectToken, sessionId, this.params.accountId, this.params.projectId);
+ if(tasksCountLS === undefined){
+ if(!this.nonRequesting) {
+ await getTasksDoboard(projectToken, sessionId, this.params.accountId, this.params.projectId);
+ }
const tasks = await spotfixIndexedDB.getAll(TABLE_TASKS);
+ storageSaveTasksCount(tasks);
const filteredTasks = tasks.filter(task => {
return task.taskMeta;
});
tasksCount = filteredTasks.length;
- } else tasksCount = tasksCountLS;
+ } else {
+ if (this.nonRequesting) {
+ const tasks = await spotfixIndexedDB.getAll(TABLE_TASKS);
+ storageSaveTasksCount(tasks);
+ const filteredTasks = tasks.filter(task => {
+ return task.taskMeta;
+ });
+ tasksCount = filteredTasks.length;
+ } else {
+ tasksCount = tasksCountLS;
+ }
+ }
const taskCountElement = document.getElementById('doboard_task_widget-task_count');
if ( taskCountElement ) {
@@ -2046,8 +2145,10 @@ class CleanTalkWidgetDoboard {
}
}
- widget.style.top = `${top}px`;
- widget.style.bottom = 'auto';
+ if(widget) {
+ widget.style.top = `${top}px`;
+ widget.style.bottom = 'auto';
+ }
}
handleScroll() {
@@ -3677,7 +3778,7 @@ class SpotFixTemplatesLoader {
static concrete_issue() {
return `
-