Skip to content
Draft
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
2 changes: 1 addition & 1 deletion frontend/src/assets/sass/backlogs/_taskboard.sass
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
* - .board
*
* Also use by the Column Width preference to determine the unit width of the
* swimlanes. See RB.Taskboard.initialize()
* swimlanes. See Taskboard constructor()

/* status labels */

Expand Down
281 changes: 138 additions & 143 deletions frontend/src/stimulus/controllers/dynamic/backlogs/backlog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
// See COPYRIGHT and LICENSE files for more details.
//++

import { Burndown } from './burndown';
import { EditableSprint } from './sprint';
import { EditableStory, EditableStoryType } from './story';

/******************************************
BACKLOG
A backlog is a visual representation of
Expand All @@ -37,146 +41,137 @@
sheet (or in Redmine Backlogs!) to
visualize the sprint.
******************************************/

// @ts-expect-error TS(2304): Cannot find name 'RB'.
RB.Backlog = (function ($) {
// @ts-expect-error TS(2304): Cannot find name 'RB'.
return RB.Object.create({

initialize(el:any) {
this.$ = $(el);
this.el = el;

// Associate this object with the element for later retrieval
this.$.data('this', this);

// Make the list sortable
this.getList().sortable({
connectWith: '.stories',
dropOnEmpty: true,
start: this.dragStart,
stop: this.dragStop,
update: this.dragComplete,
receive: this.dragChanged,
remove: this.dragChanged,
containment: $('#backlogs_container'),
cancel: 'input, textarea, button, select, option, .prevent_drag',
scroll: true,
helper(event:any, ui:any) {
const $clone = $(ui).clone();
$clone.css('position', 'absolute');
return $clone.get(0);
},
});

// Observe menu items
this.$.find('.add_new_story').click(this.handleNewStoryClick);

if (this.isSprintBacklog()) {
// @ts-expect-error TS(2304): Cannot find name 'RB'.
RB.Factory.initialize(RB.Sprint, this.getSprint());
// @ts-expect-error TS(2304): Cannot find name 'RB'.
this.burndown = RB.Factory.initialize(RB.Burndown, this.$.find('.show_burndown_chart'));
this.burndown.setSprintId(this.getSprint().data('this').getID());
}

// Initialize each item in the backlog
this.getStories().each(function (this:any, index:any) {
// 'this' refers to an element with class="story"
// @ts-expect-error TS(2304): Cannot find name 'RB'.
RB.Factory.initialize(RB.Story, this);
});

if (this.isSprintBacklog()) {
this.refresh();
}
},

dragChanged(e:any, ui:any) {
$(this).parents('.backlog').data('this').refresh();
},

dragComplete(e:any, ui:any) {
const isDropTarget = (ui.sender === null || ui.sender === undefined);

// jQuery triggers dragComplete of source and target.
// Thus we have to check here. Otherwise, the story
// would be saved twice.
if (isDropTarget) {
ui.item.data('this').saveDragResult();
}
},

dragStart(e:any, ui:any) {
ui.item.addClass('dragging');
},

dragStop(e:any, ui:any) {
ui.item.removeClass('dragging');
},

getSprint() {
return $(this.el).find('.model.sprint').first();
},

getStories() {
return this.getList().children('.story');
},

getList() {
return this.$.children('.stories').first();
},

handleNewStoryClick(e:any) {
const toggler = $(this).parents('.header').find('.toggler');
if (toggler.hasClass('closed')) {
toggler.click();
}
e.preventDefault();
$(this).parents('.backlog').data('this').newStory();
},

// return true if backlog has an element with class="sprint"
isSprintBacklog() {
return $(this.el).find('.sprint').length === 1;
},

newStory() {
let story;
let o;

story = $('#story_template').children().first().clone();
this.getList().prepend(story);

// @ts-expect-error TS(2304): Cannot find name 'RB'.
o = RB.Factory.initialize(RB.Story, story[0]);
o.edit();

story.find('.editor').first().focus();
},

refresh() {
this.recalcVelocity();
this.recalcOddity();
},

recalcVelocity() {
let total:any;

if (!this.isSprintBacklog()) {
return;
}

total = 0;
this.getStories().each(function (this:any, index:any) {
total += $(this).data('this').getPoints();
});
this.$.children('.header').children('.velocity').text(total);
},

recalcOddity() {
this.$.find('.story:even').removeClass('odd').addClass('even');
this.$.find('.story:odd').removeClass('even').addClass('odd');
},
});
}(jQuery));
export class Backlog {
private $:JQuery;
private el:HTMLElement;
burndown:Burndown;

constructor(el:HTMLElement) {
this.$ = $(el);
this.el = el;

// Associate this object with the element for later retrieval
this.$.data('this', this);

// Make the list sortable
this.getList().sortable({
connectWith: '.stories',
dropOnEmpty: true,
start: this.dragStart,

Check failure on line 60 in frontend/src/stimulus/controllers/dynamic/backlogs/backlog.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/backlogs/backlog.ts#L60 <@typescript-eslint/unbound-method>(https://typescript-eslint.io/rules/unbound-method)

A method that is not declared with `this: void` may cause unintentional scoping of `this` when separated from its object. Consider using an arrow function or explicitly `.bind()`ing the method to avoid calling the method with an unintended `this` value. If a function does not access `this`, it can be annotated with `this: void`.
Raw output
{"ruleId":"@typescript-eslint/unbound-method","severity":2,"message":"A method that is not declared with `this: void` may cause unintentional scoping of `this` when separated from its object.\nConsider using an arrow function or explicitly `.bind()`ing the method to avoid calling the method with an unintended `this` value. \nIf a function does not access `this`, it can be annotated with `this: void`.","line":60,"column":14,"nodeType":"MemberExpression","messageId":"unboundWithoutThisAnnotation","endLine":60,"endColumn":28}
stop: this.dragStop,

Check failure on line 61 in frontend/src/stimulus/controllers/dynamic/backlogs/backlog.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/backlogs/backlog.ts#L61 <@typescript-eslint/unbound-method>(https://typescript-eslint.io/rules/unbound-method)

A method that is not declared with `this: void` may cause unintentional scoping of `this` when separated from its object. Consider using an arrow function or explicitly `.bind()`ing the method to avoid calling the method with an unintended `this` value. If a function does not access `this`, it can be annotated with `this: void`.
Raw output
{"ruleId":"@typescript-eslint/unbound-method","severity":2,"message":"A method that is not declared with `this: void` may cause unintentional scoping of `this` when separated from its object.\nConsider using an arrow function or explicitly `.bind()`ing the method to avoid calling the method with an unintended `this` value. \nIf a function does not access `this`, it can be annotated with `this: void`.","line":61,"column":13,"nodeType":"MemberExpression","messageId":"unboundWithoutThisAnnotation","endLine":61,"endColumn":26}
update: this.dragComplete,

Check failure on line 62 in frontend/src/stimulus/controllers/dynamic/backlogs/backlog.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/backlogs/backlog.ts#L62 <@typescript-eslint/unbound-method>(https://typescript-eslint.io/rules/unbound-method)

A method that is not declared with `this: void` may cause unintentional scoping of `this` when separated from its object. Consider using an arrow function or explicitly `.bind()`ing the method to avoid calling the method with an unintended `this` value. If a function does not access `this`, it can be annotated with `this: void`.
Raw output
{"ruleId":"@typescript-eslint/unbound-method","severity":2,"message":"A method that is not declared with `this: void` may cause unintentional scoping of `this` when separated from its object.\nConsider using an arrow function or explicitly `.bind()`ing the method to avoid calling the method with an unintended `this` value. \nIf a function does not access `this`, it can be annotated with `this: void`.","line":62,"column":15,"nodeType":"MemberExpression","messageId":"unboundWithoutThisAnnotation","endLine":62,"endColumn":32}
receive: this.dragChanged,

Check failure on line 63 in frontend/src/stimulus/controllers/dynamic/backlogs/backlog.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/backlogs/backlog.ts#L63 <@typescript-eslint/unbound-method>(https://typescript-eslint.io/rules/unbound-method)

A method that is not declared with `this: void` may cause unintentional scoping of `this` when separated from its object. Consider using an arrow function or explicitly `.bind()`ing the method to avoid calling the method with an unintended `this` value. If a function does not access `this`, it can be annotated with `this: void`.
Raw output
{"ruleId":"@typescript-eslint/unbound-method","severity":2,"message":"A method that is not declared with `this: void` may cause unintentional scoping of `this` when separated from its object.\nConsider using an arrow function or explicitly `.bind()`ing the method to avoid calling the method with an unintended `this` value. \nIf a function does not access `this`, it can be annotated with `this: void`.","line":63,"column":16,"nodeType":"MemberExpression","messageId":"unboundWithoutThisAnnotation","endLine":63,"endColumn":32}
remove: this.dragChanged,

Check failure on line 64 in frontend/src/stimulus/controllers/dynamic/backlogs/backlog.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/backlogs/backlog.ts#L64 <@typescript-eslint/unbound-method>(https://typescript-eslint.io/rules/unbound-method)

A method that is not declared with `this: void` may cause unintentional scoping of `this` when separated from its object. Consider using an arrow function or explicitly `.bind()`ing the method to avoid calling the method with an unintended `this` value. If a function does not access `this`, it can be annotated with `this: void`.
Raw output
{"ruleId":"@typescript-eslint/unbound-method","severity":2,"message":"A method that is not declared with `this: void` may cause unintentional scoping of `this` when separated from its object.\nConsider using an arrow function or explicitly `.bind()`ing the method to avoid calling the method with an unintended `this` value. \nIf a function does not access `this`, it can be annotated with `this: void`.","line":64,"column":15,"nodeType":"MemberExpression","messageId":"unboundWithoutThisAnnotation","endLine":64,"endColumn":31}
containment: $('#backlogs_container'),
cancel: 'input, textarea, button, select, option, .prevent_drag',
scroll: true,
helper(ui) {
const $clone = $(ui).clone();
$clone.css('position', 'absolute');
return $clone.get(0) as unknown as Element;
},
});

// Observe menu items
this.$.find('.add_new_story').click(this.handleNewStoryClick);

Check failure on line 76 in frontend/src/stimulus/controllers/dynamic/backlogs/backlog.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/backlogs/backlog.ts#L76 <@typescript-eslint/unbound-method>(https://typescript-eslint.io/rules/unbound-method)

A method that is not declared with `this: void` may cause unintentional scoping of `this` when separated from its object. Consider using an arrow function or explicitly `.bind()`ing the method to avoid calling the method with an unintended `this` value. If a function does not access `this`, it can be annotated with `this: void`.
Raw output
{"ruleId":"@typescript-eslint/unbound-method","severity":2,"message":"A method that is not declared with `this: void` may cause unintentional scoping of `this` when separated from its object.\nConsider using an arrow function or explicitly `.bind()`ing the method to avoid calling the method with an unintended `this` value. \nIf a function does not access `this`, it can be annotated with `this: void`.","line":76,"column":41,"nodeType":"MemberExpression","messageId":"unboundWithoutThisAnnotation","endLine":76,"endColumn":65}
Copy link

Copilot AI Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method handleNewStoryClick is passed as a callback without binding its context. When jQuery calls this callback, this will refer to the clicked DOM element, not the Backlog instance. This causes this.newStory() on line 136 to fail. Bind the method using an arrow function or .bind(this): this.$.find('.add_new_story').click((e) => this.handleNewStoryClick(e))

Suggested change
this.$.find('.add_new_story').click(this.handleNewStoryClick);
this.$.find('.add_new_story').click((e) => this.handleNewStoryClick(e));

Copilot uses AI. Check for mistakes.

if (this.isSprintBacklog()) {
new EditableSprint(this.getSprint()[0]);
this.burndown = new Burndown(this.$.find('.show_burndown_chart')[0]);
this.burndown.setSprintId(this.getSprint().data('this').getID());

Check failure on line 81 in frontend/src/stimulus/controllers/dynamic/backlogs/backlog.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/backlogs/backlog.ts#L81 <@typescript-eslint/no-unsafe-argument>(https://typescript-eslint.io/rules/no-unsafe-argument)

Unsafe argument of type `any` assigned to a parameter of type `number`.
Raw output
{"ruleId":"@typescript-eslint/no-unsafe-argument","severity":2,"message":"Unsafe argument of type `any` assigned to a parameter of type `number`.","line":81,"column":33,"nodeType":"CallExpression","messageId":"unsafeArgument","endLine":81,"endColumn":70}

Check failure on line 81 in frontend/src/stimulus/controllers/dynamic/backlogs/backlog.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/backlogs/backlog.ts#L81 <@typescript-eslint/no-unsafe-call>(https://typescript-eslint.io/rules/no-unsafe-call)

Unsafe call of a(n) `any` typed value.
Raw output
{"ruleId":"@typescript-eslint/no-unsafe-call","severity":2,"message":"Unsafe call of a(n) `any` typed value.","line":81,"column":33,"nodeType":"MemberExpression","messageId":"unsafeCall","endLine":81,"endColumn":68}

Check failure on line 81 in frontend/src/stimulus/controllers/dynamic/backlogs/backlog.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/backlogs/backlog.ts#L81 <@typescript-eslint/no-unsafe-member-access>(https://typescript-eslint.io/rules/no-unsafe-member-access)

Unsafe member access .getID on an `any` value.
Raw output
{"ruleId":"@typescript-eslint/no-unsafe-member-access","severity":2,"message":"Unsafe member access .getID on an `any` value.","line":81,"column":63,"nodeType":"Identifier","messageId":"unsafeMemberExpression","endLine":81,"endColumn":68}
}

// Initialize each item in the backlog
this.getStories().each((index, element) => {
// refers to an element with class="story"
new EditableStory(element);
});

if (this.isSprintBacklog()) {
this.refresh();
}
}

dragChanged(e:JQueryEventObject, ui:JQueryUI.SortableUIParams) {

Check failure on line 95 in frontend/src/stimulus/controllers/dynamic/backlogs/backlog.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/backlogs/backlog.ts#L95 <@typescript-eslint/no-unused-vars>(https://typescript-eslint.io/rules/no-unused-vars)

'e' is defined but never used. Allowed unused args must match /^_/u.
Raw output
{"ruleId":"@typescript-eslint/no-unused-vars","severity":2,"message":"'e' is defined but never used. Allowed unused args must match /^_/u.","line":95,"column":15,"nodeType":null,"messageId":"unusedVar","endLine":95,"endColumn":16}

Check failure on line 95 in frontend/src/stimulus/controllers/dynamic/backlogs/backlog.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/backlogs/backlog.ts#L95 <@typescript-eslint/no-unused-vars>(https://typescript-eslint.io/rules/no-unused-vars)

'ui' is defined but never used. Allowed unused args must match /^_/u.
Raw output
{"ruleId":"@typescript-eslint/no-unused-vars","severity":2,"message":"'ui' is defined but never used. Allowed unused args must match /^_/u.","line":95,"column":36,"nodeType":null,"messageId":"unusedVar","endLine":95,"endColumn":38}
$(this).parents('.backlog').data('this').refresh();

Check failure on line 96 in frontend/src/stimulus/controllers/dynamic/backlogs/backlog.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/backlogs/backlog.ts#L96 <@typescript-eslint/no-unsafe-call>(https://typescript-eslint.io/rules/no-unsafe-call)

Unsafe call of a(n) `any` typed value.
Raw output
{"ruleId":"@typescript-eslint/no-unsafe-call","severity":2,"message":"Unsafe call of a(n) `any` typed value.","line":96,"column":5,"nodeType":"MemberExpression","messageId":"unsafeCall","endLine":96,"endColumn":53}

Check failure on line 96 in frontend/src/stimulus/controllers/dynamic/backlogs/backlog.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/backlogs/backlog.ts#L96 <@typescript-eslint/no-unsafe-member-access>(https://typescript-eslint.io/rules/no-unsafe-member-access)

Unsafe member access .refresh on an `any` value.
Raw output
{"ruleId":"@typescript-eslint/no-unsafe-member-access","severity":2,"message":"Unsafe member access .refresh on an `any` value.","line":96,"column":46,"nodeType":"Identifier","messageId":"unsafeMemberExpression","endLine":96,"endColumn":53}
}

dragComplete(e:JQueryEventObject, ui:JQueryUI.SortableUIParams) {
const isDropTarget = (ui.sender === null || ui.sender === undefined);

// jQuery triggers dragComplete of source and target.
// Thus we have to check here. Otherwise, the story
// would be saved twice.
if (isDropTarget) {
ui.item.data('this').saveDragResult();

Check failure on line 106 in frontend/src/stimulus/controllers/dynamic/backlogs/backlog.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/backlogs/backlog.ts#L106 <@typescript-eslint/no-unsafe-call>(https://typescript-eslint.io/rules/no-unsafe-call)

Unsafe call of a(n) `any` typed value.
Raw output
{"ruleId":"@typescript-eslint/no-unsafe-call","severity":2,"message":"Unsafe call of a(n) `any` typed value.","line":106,"column":7,"nodeType":"MemberExpression","messageId":"unsafeCall","endLine":106,"endColumn":42}

Check failure on line 106 in frontend/src/stimulus/controllers/dynamic/backlogs/backlog.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/backlogs/backlog.ts#L106 <@typescript-eslint/no-unsafe-member-access>(https://typescript-eslint.io/rules/no-unsafe-member-access)

Unsafe member access .saveDragResult on an `any` value.
Raw output
{"ruleId":"@typescript-eslint/no-unsafe-member-access","severity":2,"message":"Unsafe member access .saveDragResult on an `any` value.","line":106,"column":28,"nodeType":"Identifier","messageId":"unsafeMemberExpression","endLine":106,"endColumn":42}
}
}

dragStart(e:JQueryEventObject, ui:JQueryUI.SortableUIParams) {
ui.item.addClass('dragging');
}

dragStop(e:JQueryEventObject, ui:JQueryUI.SortableUIParams) {
ui.item.removeClass('dragging');
}

getSprint() {
return $(this.el).find('.model.sprint').first();
}

getStories() {
return this.getList().children('.story');
}

getList() {
return this.$.children('.stories').first();
}

handleNewStoryClick(e:JQuery.Event) {
const toggler = $(this).parents('.header').find('.toggler');
Copy link

Copilot AI Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method uses $(this) expecting it to be the DOM element, but when called as a class method, this refers to the Backlog instance. This conflicts with the callback binding issue in line 76. Either change line 76 to bind properly and use this.$ here, or change the method to be a standalone function that receives the correct context.

Suggested change
const toggler = $(this).parents('.header').find('.toggler');
const toggler = $(e.currentTarget).parents('.header').find('.toggler');

Copilot uses AI. Check for mistakes.
if (toggler.hasClass('closed')) {
toggler.click();
}
e.preventDefault();
this.newStory();
}

// return true if backlog has an element with class="sprint"
isSprintBacklog() {
return $(this.el).find('.sprint').length === 1;
}

newStory() {
const story = $('#story_template').children().first().clone();
this.getList().prepend(story);

const o = new EditableStory(story[0]);
o.edit();

story.find('.editor').first().focus();
}

refresh() {
this.recalcVelocity();
this.recalcOddity();
}

recalcVelocity() {
let total:any;

Check failure on line 160 in frontend/src/stimulus/controllers/dynamic/backlogs/backlog.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/backlogs/backlog.ts#L160 <@typescript-eslint/no-explicit-any>(https://typescript-eslint.io/rules/no-explicit-any)

Unexpected any. Specify a different type.
Raw output
{"ruleId":"@typescript-eslint/no-explicit-any","severity":2,"message":"Unexpected any. Specify a different type.","line":160,"column":15,"nodeType":"TSAnyKeyword","messageId":"unexpectedAny","endLine":160,"endColumn":18,"suggestions":[{"messageId":"suggestUnknown","fix":{"range":[4805,4808],"text":"unknown"},"desc":"Use `unknown` instead, this will force you to explicitly, and safely assert the type is correct."},{"messageId":"suggestNever","fix":{"range":[4805,4808],"text":"never"},"desc":"Use `never` instead, this is useful when instantiating generic type parameters that you don't need to know the type of."}]}

if (!this.isSprintBacklog()) {
return;
}

total = 0;
this.getStories().each((index, element) => {
total += ($(element).data('this') as EditableStoryType).getPoints();
});
this.$.children('.header').children('.velocity').text(total);

Check failure on line 170 in frontend/src/stimulus/controllers/dynamic/backlogs/backlog.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/backlogs/backlog.ts#L170 <@typescript-eslint/no-unsafe-argument>(https://typescript-eslint.io/rules/no-unsafe-argument)

Unsafe argument of type `any` assigned to a parameter of type `string | number | boolean | ((this: HTMLElement, index: number, text: string) => string | number | boolean)`.
Raw output
{"ruleId":"@typescript-eslint/no-unsafe-argument","severity":2,"message":"Unsafe argument of type `any` assigned to a parameter of type `string | number | boolean | ((this: HTMLElement, index: number, text: string) => string | number | boolean)`.","line":170,"column":59,"nodeType":"Identifier","messageId":"unsafeArgument","endLine":170,"endColumn":64}
}

recalcOddity() {
this.$.find('.story:even').removeClass('odd').addClass('even');
this.$.find('.story:odd').removeClass('even').addClass('odd');
}
}
63 changes: 32 additions & 31 deletions frontend/src/stimulus/controllers/dynamic/backlogs/burndown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,42 +26,43 @@
// See COPYRIGHT and LICENSE files for more details.
//++

// @ts-expect-error TS(2304): Cannot find name 'RB'.
RB.Burndown = (function ($) {
// @ts-expect-error TS(2304): Cannot find name 'RB'.
return RB.Object.create({
import { RBGlobal } from './common';

initialize(el:any) {
this.$ = $(el);
this.el = el;
declare const RB:RBGlobal;

// Associate this object with the element for later retrieval
this.$.data('this', this);
export class Burndown {
$:JQuery;
el:HTMLElement;
sprintId:number;

// Observe menu items
this.$.click(this.show);
},
constructor(el:HTMLElement) {
this.$ = $(el);
this.el = el;

setSprintId(sprintId:any) {
this.sprintId = sprintId;
},
// Associate this object with the element for later retrieval
this.$.data('this', this);

getSprintId() {
return this.sprintId;
},
// Observe menu items
this.$.click(this.show);

Check failure on line 46 in frontend/src/stimulus/controllers/dynamic/backlogs/burndown.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/backlogs/burndown.ts#L46 <@typescript-eslint/unbound-method>(https://typescript-eslint.io/rules/unbound-method)

A method that is not declared with `this: void` may cause unintentional scoping of `this` when separated from its object. Consider using an arrow function or explicitly `.bind()`ing the method to avoid calling the method with an unintended `this` value. If a function does not access `this`, it can be annotated with `this: void`.
Raw output
{"ruleId":"@typescript-eslint/unbound-method","severity":2,"message":"A method that is not declared with `this: void` may cause unintentional scoping of `this` when separated from its object.\nConsider using an arrow function or explicitly `.bind()`ing the method to avoid calling the method with an unintended `this` value. \nIf a function does not access `this`, it can be annotated with `this: void`.","line":46,"column":18,"nodeType":"MemberExpression","messageId":"unboundWithoutThisAnnotation","endLine":46,"endColumn":27}
}

show(e:any) {
e.preventDefault();
setSprintId(sprintId:number) {
this.sprintId = sprintId;
}

if ($('#charts').length === 0) {
$('<div id="charts"></div>').appendTo('body');
}
// @ts-expect-error TS(2304): Cannot find name 'RB'.
$('#charts').html(`<div class='loading'>${RB.i18n.generating_graph}</div>`);
getSprintId() {
return this.sprintId;
}

// @ts-expect-error TS(2304): Cannot find name 'RB'.
const url = RB.urlFor('show_burndown_chart', { sprint_id: $(this).data('this').sprintId, project_id: RB.constants.project_id });
window.open(url);
},
});
}(jQuery));
show(e:JQuery.Event) {
e.preventDefault();

if ($('#charts').length === 0) {
$('<div id="charts"></div>').appendTo('body');
}
$('#charts').html(`<div class='loading'>${RB.i18n.generating_graph}</div>`);

const url = RB.urlFor('show_burndown_chart', { sprint_id: $(this).data('this').sprintId, project_id: RB.constants.project_id });

Check failure on line 65 in frontend/src/stimulus/controllers/dynamic/backlogs/burndown.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/backlogs/burndown.ts#L65 <@typescript-eslint/no-unsafe-assignment>(https://typescript-eslint.io/rules/no-unsafe-assignment)

Unsafe assignment of an `any` value.
Raw output
{"ruleId":"@typescript-eslint/no-unsafe-assignment","severity":2,"message":"Unsafe assignment of an `any` value.","line":65,"column":52,"nodeType":"Property","messageId":"anyAssignment","endLine":65,"endColumn":92}

Check failure on line 65 in frontend/src/stimulus/controllers/dynamic/backlogs/burndown.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/backlogs/burndown.ts#L65 <@typescript-eslint/no-unsafe-member-access>(https://typescript-eslint.io/rules/no-unsafe-member-access)

Unsafe member access .sprintId on an `any` value.
Raw output
{"ruleId":"@typescript-eslint/no-unsafe-member-access","severity":2,"message":"Unsafe member access .sprintId on an `any` value.","line":65,"column":84,"nodeType":"Identifier","messageId":"unsafeMemberExpression","endLine":65,"endColumn":92}
window.open(url);
}
}
Loading
Loading