Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
shridhar-tl committed Jun 1, 2023
2 parents 016ab28 + 39c302c commit 7dc318d
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 20 deletions.
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jira-assistant",
"version": "2.49.0",
"version": "2.51.0",
"description": "Help to track & upload work done on a Jira Ticket on timely basis and generate Worklog, Sprint and other custom reports",
"homepage": "/",
"author": {
Expand Down Expand Up @@ -57,20 +57,20 @@
"@forge/api": "^2.15.3",
"@forge/bridge": "^2.5.6",
"@forge/resolver": "^1.5.7",
"@fullcalendar/core": "6.1.7",
"@fullcalendar/daygrid": "6.1.7",
"@fullcalendar/interaction": "6.1.7",
"@fullcalendar/list": "6.1.7",
"@fullcalendar/moment": "6.1.7",
"@fullcalendar/react": "6.1.7",
"@fullcalendar/timegrid": "6.1.7",
"@fullcalendar/core": "6.1.8",
"@fullcalendar/daygrid": "6.1.8",
"@fullcalendar/interaction": "6.1.8",
"@fullcalendar/list": "6.1.8",
"@fullcalendar/moment": "6.1.8",
"@fullcalendar/react": "6.1.8",
"@fullcalendar/timegrid": "6.1.8",
"bootstrap-daterangepicker": "3.1.0",
"chart.js": "4.3.0",
"classnames": "2.3.2",
"dexie": "3.2.3",
"espree": "9.5.2",
"exceljs": "4.3.0",
"firebase": "9.22.0",
"firebase": "9.22.1",
"font-awesome": "4.7.0",
"jquery": "3.7.0",
"jsd-report": "0.1.11",
Expand All @@ -82,8 +82,8 @@
"patternomaly": "1.3.2",
"primeflex": "3.3.0",
"primeicons": "6.0.1",
"primereact": "9.4.0",
"queue": "6.0.2",
"primereact": "9.5.0",
"queue": "7.0.0",
"rc-time-picker": "3.7.3",
"react": "18.2.0",
"react-bootstrap-daterangepicker": "8.0.0",
Expand Down
2 changes: 1 addition & 1 deletion public/chrome/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"minimum_chrome_version": "102",
"name": "Jira Assistant: Worklog, Sprint report, etc",
"short_name": "Jira Assist",
"version": "2.49",
"version": "2.51",
"description": "Help to track & upload work done on a Jira Ticket on timely basis and generate Worklog, Sprint and other custom reports.",
"icons": {
"24": "/assets/icon_24.png",
Expand Down
2 changes: 1 addition & 1 deletion public/edge/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"minimum_chrome_version": "102",
"name": "Jira Assistant: Worklog, Sprint report, etc",
"short_name": "Jira Assist",
"version": "2.49",
"version": "2.51",
"description": "Help to track & upload work done on a Jira Ticket on timely basis and generate Worklog, Sprint and other custom reports.",
"icons": {
"24": "assets/icon_24.png",
Expand Down
2 changes: 1 addition & 1 deletion public/firefox/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "Jira Assistant: Worklog, Sprint report, etc",
"short_name": "Jira Assist",
"version": "2.49",
"version": "2.51",
"description": "Help to track & upload work done on a Jira Ticket on timely basis and generate Worklog, Sprint and other custom reports.",
"icons": {
"24": "/assets/icon_24.png",
Expand Down
2 changes: 1 addition & 1 deletion public/firefox_selfhost/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "Jira Assistant: Worklog, Sprint report, etc",
"short_name": "Jira Assist",
"version": "2.49",
"version": "2.51",
"updateURL": "https://raw.githubusercontent.com/shridhar-tl/jira-assistant/master/release/firefox/update_manifest.json",
"updateLink": "https://github.com/shridhar-tl/jira-assistant/raw/master/release/firefox/JiraAssist_Latest.xpi",
"applications": {
Expand Down
2 changes: 1 addition & 1 deletion public/opera/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"minimum_chrome_version": "102",
"name": "Jira Assistant: Worklog, Sprint report, etc",
"short_name": "Jira Assist",
"version": "2.49",
"version": "2.51",
"description": "Help to track & upload work done on a Jira Ticket on timely basis and generate Worklog, Sprint and other custom reports.",
"icons": {
"24": "/assets/icon_24.png",
Expand Down
2 changes: 1 addition & 1 deletion src/constants/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const GoogleOAuth = {
}
};

export const AppVersionNo = 2.49;
export const AppVersionNo = 2.51;

let AnalyticsTrackingId = "G-CJQYE6Q1JQ"; //"UA-108841109-1"; // This is for public tracking id

Expand Down
17 changes: 16 additions & 1 deletion src/gadgets/WorklogReport/userdaywise/utils_group.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,9 @@ export function generateUserDayWiseData(data, groups, pageSettings) {
ticket.totalCost = calcCostPerSecs(totalHours, usr.costPerHour);
return ticket;
});

arrangeTicketsByFirstWorklogDate(usrInfo, dates);

// Set date wise total per user
const logClass = usrInfo.logClass;
const usrTotal = usrInfo.total;
Expand All @@ -317,7 +320,7 @@ export function generateUserDayWiseData(data, groups, pageSettings) {
usrInfo.grandTotal = usrGTotal;
usrInfo.grandTotalCost = calcCostPerSecs(usrGTotal, usr.costPerHour);
return usrInfo;
});
}).orderBy(u => u.firstWorklogStartIndex);

grpInfo.usersMap = grpInfo.users.reduce((obj, u) => {
obj[u.name] = u;
Expand Down Expand Up @@ -379,6 +382,18 @@ export function generateUserDayWiseData(data, groups, pageSettings) {
return { groupedData, weeks: getWeekHeader(dates), dates };
}

function arrangeTicketsByFirstWorklogDate(user, dates) {
const tickets = user.tickets;

tickets.forEach(t => {
const { logs } = t;
t.worklogStartIndex = dates.findIndex(d => !!logs[d.prop]);
});

user.tickets = tickets.orderBy(t => t.worklogStartIndex);
user.firstWorklogStartIndex = user.tickets[0]?.worklogStartIndex;
}

export function filterDaysWithoutWorklog(daysToHide, dates) {
if (!daysToHide || daysToHide === '1') {
return dates;
Expand Down
2 changes: 1 addition & 1 deletion src/services/jira-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ export default class JiraService {

function runOnQueue(items, concurrent, execute) {
return new Promise((done, reject) => {
const queue = Queue({ results: [] });
const queue = new Queue({ results: [] });
queue.concurrency = concurrent;
items.forEach(t => queue.push(() => execute(t)));
queue.start((err) => {
Expand Down
5 changes: 5 additions & 0 deletions src/views/bulk-import/issue/field-mapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ const fieldMapping = {

export function transformHeader(customFields) {
return (c) => {
// As prototype functions of array are passed to this function, need to check if this is string
if (!c || typeof c !== 'string') {
return null;
}

c = c.replace(/ /g, '').toLowerCase();
let fieldName = fieldMapping[c] || null;

Expand Down
9 changes: 8 additions & 1 deletion src/views/bulk-import/worklog/ImportWorklog.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,14 @@ class ImportWorklog extends BaseImport {
});
}

transformHeader = (c) => fieldMapping[c.replace(/ /g, '').toLowerCase()] || null;
transformHeader = (c) => {
// As prototype functions of array are passed to this function, need to check if this is string
if (!c || typeof c !== 'string') {
return null;
}

return fieldMapping[c.replace(/ /g, '').toLowerCase()] || null;
};

processData(data) {
const worklogData = data.map(w => {
Expand Down

0 comments on commit 7dc318d

Please sign in to comment.