Fix error TS2769 reported by TypeScript

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
This commit is contained in:
Maurício Meneghini Fauth 2023-04-21 17:13:55 -03:00
parent c0ac1b178d
commit 0701a3cbeb
No known key found for this signature in database
GPG Key ID: 6A16FD38AFC89CC8
13 changed files with 26 additions and 13 deletions

View File

@ -134,6 +134,7 @@ const DatabaseEvents = {
'ui-dialog-titlebar-close': 'btn-close'
},
width: 500,
// @ts-ignore
buttons: buttonOptions,
title: data.title
});
@ -335,6 +336,7 @@ const DatabaseEvents = {
height: 500,
width: '70%',
minWidth: 500,
// @ts-ignore
buttons: buttonOptions,
// Issue #15810 - use button titles for modals (eg: new procedure)
// Respect the order: title on href tag, href content, title sent in response

View File

@ -150,6 +150,7 @@ const DatabaseRoutines = {
'ui-dialog-titlebar-close': 'btn-close'
},
width: 500,
// @ts-ignore
buttons: buttonOptions,
title: data.title
});
@ -350,6 +351,7 @@ const DatabaseRoutines = {
},
width: '70%',
minWidth: 500,
// @ts-ignore
buttons: buttonOptions,
// Issue #15810 - use button titles for modals (eg: new procedure)
// Respect the order: title on href tag, href content, title sent in response
@ -896,6 +898,7 @@ const DatabaseRoutines = {
'ui-dialog-titlebar-close': 'btn-close'
},
width: 650,
// @ts-ignore
buttons: buttonOptions,
title: data.title,
modal: true,
@ -1020,7 +1023,7 @@ AJAX.registerOnload('database/routines.js', function () {
* @var new_param_row A string containing the HTML code for the
* new row for the routine parameters table
*/
const newParamRow = DatabaseRoutines.paramTemplate.replace(/%s/g, $routineParamsTable.find('tr').length - 1);
const newParamRow = DatabaseRoutines.paramTemplate.replace(/%s/g, ($routineParamsTable.find('tr').length - 1).toString());
// Append the new row to the parameters table
$routineParamsTable.append(newParamRow);
// Make sure that the row is correctly shown according to the type of routine

View File

@ -145,6 +145,7 @@ const DatabaseTriggers = {
'ui-dialog-titlebar-close': 'btn-close'
},
width: 500,
// @ts-ignore
buttons: buttonOptions,
title: data.title
});
@ -343,6 +344,7 @@ const DatabaseTriggers = {
},
width: '70%',
minWidth: 500,
// @ts-ignore
buttons: buttonOptions,
// Issue #15810 - use button titles for modals (eg: new procedure)
// Respect the order: title on href tag, href content, title sent in response

View File

@ -251,11 +251,11 @@ AJAX.registerOnload('import.js', function () {
var estimatedTime;
if (minutes > 0) {
estimatedTime = window.Messages.uploadProgressRemainingMin
.replace('%MIN', minutes)
.replace('%SEC', seconds);
.replace('%MIN', minutes.toString())
.replace('%SEC', seconds.toString());
} else {
estimatedTime = window.Messages.uploadProgressRemainingSec
.replace('%SEC', seconds);
.replace('%SEC', seconds.toString());
}
statusText += '<br>' + speed + '<br><br>' + estimatedTime;

View File

@ -1439,7 +1439,7 @@ const makeGrid = function (t, enableResize = undefined, enableReorder = undefine
$(g.t).find('td.to_be_saved').parents('tr').each(function () {
var newClause = $(this).data('new_clause');
var $whereClause = $(this).find('.where_clause');
var oldClause = $whereClause.val();
var oldClause = ($whereClause.val() as string);
var decodedOldClause = oldClause;
var decodedNewClause = newClause;
@ -1870,6 +1870,7 @@ const makeGrid = function (t, enableResize = undefined, enableReorder = undefine
// prepend "show all column" button at top if the list is too long
if ($firstRowCols.length > 10) {
var clone = showAll.cloneNode(true);
// @ts-ignore
$(g.cList).prepend(clone);
$(clone).on('click', function () {
g.showAllColumns();

View File

@ -13,8 +13,8 @@ import { ajaxShowMessage } from './modules/ajax-message.ts';
AJAX.registerOnload('multi_column_sort.js', function () {
$('th.draggable.column_heading.pointer.marker a').on('click', function (event) {
var orderUrlRemove = $(this).parent().find('input[name="url-remove-order"]').val();
var orderUrlAdd = $(this).parent().find('input[name="url-add-order"]').val();
var orderUrlRemove = ($(this).parent().find('input[name="url-remove-order"]').val() as string);
var orderUrlAdd = ($(this).parent().find('input[name="url-add-order"]').val() as string);
var argsep = CommonParams.get('arg_separator');
if (event.ctrlKey || event.altKey) {
event.preventDefault();

View File

@ -49,6 +49,7 @@ function serverResponseError () {
classes: {
'ui-dialog-titlebar-close': 'btn-close'
},
// @ts-ignore
buttons: btns
});
}
@ -802,6 +803,7 @@ AJAX.registerOnload('server/status/monitor.js', function () {
},
width: 'auto',
height: 'auto',
// @ts-ignore
buttons: dlgBtns
});
});
@ -853,6 +855,7 @@ AJAX.registerOnload('server/status/monitor.js', function () {
},
width: '60%',
height: 'auto',
// @ts-ignore
buttons: dlgBtns
}).find('img.ajaxIcon').show();
@ -1147,6 +1150,7 @@ AJAX.registerOnload('server/status/monitor.js', function () {
'ui-dialog-titlebar-close': 'btn-close'
},
width: 400,
// @ts-ignore
buttons: dlgBtns
});
}
@ -1546,6 +1550,7 @@ AJAX.registerOnload('server/status/monitor.js', function () {
},
width: 'auto',
height: 'auto',
// @ts-ignore
buttons: dlgBtns
});
@ -1850,6 +1855,7 @@ AJAX.registerOnload('server/status/monitor.js', function () {
},
width: 'auto',
height: 'auto',
// @ts-ignore
buttons: dlgBtns
});
@ -2276,6 +2282,7 @@ AJAX.registerOnload('server/status/monitor.js', function () {
width: 'auto',
height: 'auto',
resizable: false,
// @ts-ignore
buttons: dlgBtns,
close: function () {
if (profilingChart !== null) {

View File

@ -37,7 +37,7 @@ $(function () {
$(this).remove();
});
link.html(link.html().replace('#MSG_COUNT', hiddenMessages.length));
link.html(link.html().replace('#MSG_COUNT', hiddenMessages.length.toString()));
link.show();
}
});

View File

@ -438,7 +438,6 @@ AJAX.registerTeardown('sql.js', function () {
$(document).off('mouseenter', 'th.column_heading.pointer');
$(document).off('mouseleave', 'th.column_heading.pointer');
$(document).off('click', 'th.column_heading.marker');
$(document).off('scroll', window);
$(document).off('keyup', '.filter_rows');
if (window.codeMirrorEditor) {
// @ts-ignore

View File

@ -845,7 +845,7 @@ function addNewContinueInsertionFields (event) {
/** index of {@link $lastCheckbox} */
var lastCheckboxIndex = parseInt(lastCheckboxName.match(/\d+/), 10);
/** name of new {@link $lastCheckbox} */
var newName = lastCheckboxName.replace(/\d+/, lastCheckboxIndex + 1);
var newName = lastCheckboxName.replace(/\d+/, (lastCheckboxIndex + 1).toString());
$('<br><div class="clearfloat"></div>')
.insertBefore($('table.insertRowTable').last());

View File

@ -202,7 +202,7 @@ AJAX.registerTeardown('table/gis_visualization.js', function () {
$(document).off('click', '#up_arrow');
$(document).off('click', '#down_arrow');
$('.vector').off('mousemove').off('mouseout');
$('#placeholder').get(0).removeEventListener('wheel', onGisMouseWheel, { passive: false });
$('#placeholder').get(0).removeEventListener('wheel', onGisMouseWheel);
if (map) {
// Removes ol.Map's resize listener from window
map.setTarget(null);

View File

@ -224,7 +224,7 @@ AJAX.registerOnload('table/relation.js', function () {
$newRow.find('input, select').each(function () {
$(this).attr('name',
$(this).attr('name').replace(/\d/, newIndex)
$(this).attr('name').replace(/\d/, newIndex.toString())
);
});

View File

@ -13,7 +13,6 @@ const typeScriptErrorsToIgnore = [
2322, // TS2322: Type '%s' is not assignable to type '%s'.
2345, // TS2345: Argument of type '%s' is not assignable to parameter of type '%s'.
2538, // TS2538: Type '%s' cannot be used as an index type.
2769, // TS2769: No overload matches this call.
5096, // TS5096: Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set.
];