Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
ba19a01
Upd. Added user menu.
veronika-tseleva-cleantalk Dec 17, 2025
379d1e6
Fix. Increased padding.
veronika-tseleva-cleantalk Dec 17, 2025
4b92c72
Fix. Increased closing time.
veronika-tseleva-cleantalk Dec 17, 2025
cc89747
Upd. Added and renamed buttons
veronika-tseleva-cleantalk Dec 18, 2025
fa4e9d3
Fix. Fixed unlimited loading
veronika-tseleva-cleantalk Dec 18, 2025
a6fee5a
Upd. Added a method for unlogging
veronika-tseleva-cleantalk Dec 22, 2025
d44eb85
Merge branch 'dev' into user-menu
veronika-tseleva-cleantalk Dec 22, 2025
1e2d63f
Fix. Merge conflicts
veronika-tseleva-cleantalk Dec 22, 2025
fc88c41
Upd. Added the ability to change the size, added new icons and adjust…
veronika-tseleva-cleantalk Dec 22, 2025
6cae373
Fix. Ability to change the size
veronika-tseleva-cleantalk Dec 22, 2025
66a7d13
Upd. Added a new icon
veronika-tseleva-cleantalk Dec 22, 2025
51f4f8b
Fix. Shortened the code
veronika-tseleva-cleantalk Dec 22, 2025
d0e8ac4
Fix. Fix style
veronika-tseleva-cleantalk Dec 22, 2025
ab2d3c8
Fix. Fix top position
veronika-tseleva-cleantalk Dec 22, 2025
cfb095e
Fix. Fix right position for mobile
veronika-tseleva-cleantalk Dec 23, 2025
f76b7d8
Upd. Add wrapped widget position customisation
veronika-tseleva-cleantalk Dec 23, 2025
d2bff2f
Fix. Corrected a typo
veronika-tseleva-cleantalk Dec 25, 2025
298c5f4
Fix. Edits based on comments from the review
veronika-tseleva-cleantalk Dec 25, 2025
3affaf5
Fix. Edits based on comments from the review
veronika-tseleva-cleantalk Dec 27, 2025
bc86034
Fix. Edits based on comments from the review
veronika-tseleva-cleantalk Dec 27, 2025
b8bb5b8
Fix. Fix email field
veronika-tseleva-cleantalk Dec 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
426 changes: 389 additions & 37 deletions dist/doboard-widget-bundle.js

Large diffs are not rendered by default.

170 changes: 148 additions & 22 deletions dist/doboard-widget-bundle.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/doboard-widget-bundle.min.js.map

Large diffs are not rendered by default.

37 changes: 35 additions & 2 deletions js/src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const userConfirmEmailDoboard = async (emailConfirmationToken) => {
};

const createTaskDoboard = async (sessionId, taskDetails) => {
const accountId = taskDetails.accountId
const accountId = taskDetails.accountId;
const data = {
session_id: sessionId,
project_token: taskDetails.projectToken,
Expand Down Expand Up @@ -185,6 +185,20 @@ const loginUserDoboard = async (email, password) => {
}
}

const logoutUserDoboard = async (accountId) => {
const sessionId = localStorage.getItem('spotfix_session_id');
if(sessionId && accountId) {
const data = {
session_id: sessionId,
};

const result = await spotfixApiCall(data, 'user_unauthorize', accountId);
if(result.operation_status === 'SUCCESS') {
clearLocalstorageOnLogout();
}
}
}

const getTasksDoboard = async (projectToken, sessionId, accountId, projectId, userId) => {
const data = {
session_id: sessionId,
Expand Down Expand Up @@ -230,11 +244,13 @@ const getTasksCommentsDoboard = async (sessionId, accountId, projectToken, statu
}));
};

const getUserDoboard = async (sessionId, projectToken, accountId) => {
const getUserDoboard = async (sessionId, projectToken, accountId, userId) => {
const data = {
session_id: sessionId,
project_token: projectToken,
}
if (userId) data.user_id = userId;

const result = await spotfixApiCall(data, 'user_get', accountId);
return result.users;

Expand Down Expand Up @@ -277,3 +293,20 @@ const userUpdateDoboard = async (projectToken, accountId, sessionId, userId, tim
success: true
};
}

const getReleaseVersion = async () => {
try {
const res = await fetch('https://api.github.com/repos/CleanTalk/SpotFix/releases');
const data = await res.json();

if (data.length > 0 && data[0].tag_name) {
storageSaveSpotfixVersion(data[0].tag_name);
return data[0].tag_name;
}

return null;
} catch (err) {
return null;
}
};

43 changes: 43 additions & 0 deletions js/src/handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@ async function getTasksFullDetails(params, tasks, currentActiveTaskId) {
}
}

async function getUserDetails(params) {
const sessionId = localStorage.getItem('spotfix_session_id');
const currentUserId = localStorage.getItem('spotfix_user_id');
if(currentUserId) {
const users = await getUserDoboard(sessionId, params.projectToken, params.accountId, currentUserId);
return users[0] || {};
}
}

async function handleCreateTask(sessionId, taskDetails) {
try {
const result = await createTaskDoboard(sessionId, taskDetails);
Expand Down Expand Up @@ -270,3 +279,37 @@ function spotFixSplitUrl(url) {

}

function setToggleStatus(rootElement){
const clickHandler = () => {
const timer = setTimeout(() => {
localStorage.setItem('spotfix_widget_is_closed', '1');
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 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');
}
}
79 changes: 74 additions & 5 deletions js/src/loaders/SpotFixSVGLoader.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading