Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
42 changes: 32 additions & 10 deletions dist/doboard-widget-bundle.js

Large diffs are not rendered by default.

20 changes: 16 additions & 4 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.

1 change: 1 addition & 0 deletions js/src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ const getTasksDoboard = async (projectToken, sessionId, accountId, projectId, us
taskMeta: task.meta,
taskStatus: task.status,
viewers: task.comments_viewers,
taskToken: task.token
}));
await spotfixIndexedDB.clearPut(SPOTFIX_TABLE_TASKS, tasks);
storageSaveTasksCount(tasks);
Expand Down
2 changes: 1 addition & 1 deletion js/src/handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ function registerUser(taskDetails) {
const userName = taskDetails.userName;
const projectToken = taskDetails.projectToken;
const accountId = taskDetails.accountId;
const pageURL = taskDetails.selectedData.pageURL ? taskDetails.selectedData.pageURL : window.location.href;
const pageURL = taskDetails?.selectedData?.pageURL ? taskDetails?.selectedData?.pageURL : window.location.href;

const resultRegisterUser = (showMessageCallback) => registerUserDoboard(projectToken, accountId, userEmail, userName, pageURL)
.then((response) => {
Expand Down
7 changes: 7 additions & 0 deletions js/src/loaders/SpotFixSVGLoader.js

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

11 changes: 10 additions & 1 deletion js/src/loaders/SpotFixTemplatesLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,17 @@ class SpotFixTemplatesLoader {
</label>
</div>
</div>
<div class="doboard_task_widget-task_menu-item" style="height: 60px">
<img src="{{iconLinkChainDark}}" alt="" style="margin-right: 12px">
<div style="display: flex; justify-content: space-between; flex-grow: 1; align-items: center">
<span style="font-weight: 400; font-size: 14px; color: #252A2F; display: inline-flex; flex-direction: column;">
Link the doBoard task
<a href={{doboardLink}} style="font-weight: 400; font-size: 14px;">{{doboardLinkShort}}</a>
</span>
</div>
</div>
<div class="doboard_task_widget-task_menu-item"
style="flex-direction: column; height: fit-content; padding-top: 8px; max-height: 270px; overflow: auto;">
style="flex-direction: column; height: fit-content; padding-top: 8px; max-height: 200px; overflow: auto;">
{{viewers}}
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions js/src/websocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const handleIncomingData = async (data) => {
viewers: data.data.comments_viewers,
task_type: data.data.task_type,
commentsCount: data.data.comments_count,
taskToken: data.data.token,
});
break;

Expand Down
18 changes: 11 additions & 7 deletions js/src/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class CleanTalkWidgetDoboard {
iconSpotPublic: SpotFixSVGLoader.getAsDataURI('iconSpotPublic'),
iconSpotPrivate: SpotFixSVGLoader.getAsDataURI('iconSpotPrivate'),
iconLinkChain: SpotFixSVGLoader.getAsDataURI('iconLinkChain'),
iconLinkChainDark: SpotFixSVGLoader.getAsDataURI('iconLinkChainDark'),
};
this.fileUploader = new FileUploader(this.escapeHtml);
this.init(type);
Expand Down Expand Up @@ -766,8 +767,8 @@ class CleanTalkWidgetDoboard {
if (tasks.length > 0) {
const currentURL = window.location.href;
const sortedTasks = tasks.sort((a, b) => {
const aIsHere = JSON.parse(a.taskMeta).pageURL === currentURL ? 1 : 0;
const bIsHere = JSON.parse(b.taskMeta).pageURL === currentURL ? 1 : 0;
const aIsHere = JSON.parse(a.taskMeta)?.pageURL === currentURL ? 1 : 0;
const bIsHere = JSON.parse(b.taskMeta)?.pageURL === currentURL ? 1 : 0;
return bIsHere - aIsHere;
});

Expand All @@ -790,7 +791,7 @@ class CleanTalkWidgetDoboard {
taskData = null;
}
}
const currentPageURL = taskData ? taskData.pageURL : '';
const currentPageURL = taskData ? taskData?.pageURL : '';
let taskNodePath = ''; // nodePath need for only current page's spots

// Define publicity details
Expand Down Expand Up @@ -915,7 +916,10 @@ class CleanTalkWidgetDoboard {

templateVariables.taskName = currentTask.taskTitle;
templateVariables.taskType = currentTask.task_type === 'PUBLIC' ? this.srcVariables.iconPublicDark : this.srcVariables.iconLockDark;

templateVariables.doboardLink =
`https://app.doboard.com/${localStorage.getItem('spotfix_company_id')}/task/${currentTask.taskId}?token=${currentTask.taskToken}`;
templateVariables.doboardLinkShort =
`https://app.doboard.com/${localStorage.getItem('spotfix_company_id')}/task/${currentTask.taskId}`;

const currentUserId = localStorage.getItem('spotfix_user_id') || 0;

Expand Down Expand Up @@ -990,14 +994,14 @@ class CleanTalkWidgetDoboard {
let taskFormattedPageUrl = '';

if (typeof meta?.pageURL === 'string'){
taskFormattedPageUrl = meta.pageURL.replace(window.location.origin, '');
taskFormattedPageUrl = meta?.pageURL?.replace(window.location.origin, '');
templateVariables.taskFormattedPageUrl = taskFormattedPageUrl.length < 2
? meta.pageURL.replace(/^https?:\/\//, '')
? meta?.pageURL?.replace(/^https?:\/\//, '')
: taskFormattedPageUrl;
}
const issueLinkElement = document.getElementById('spotfix_doboard_task_widget_url');
if (issueLinkElement) {
issueLinkElement.innerHTML = `<a rel="nofollow" href="${meta.pageURL}">${templateVariables.taskFormattedPageUrl}</a>`;
issueLinkElement.innerHTML = `<a rel="nofollow" href="${meta?.pageURL}">${templateVariables.taskFormattedPageUrl}</a>`;
}

templateVariables.contenerClasess = +localStorage.getItem('maximize')
Expand Down