fix(minor): test and linting

This commit is contained in:
Rushabh Mehta 2022-02-22 10:34:38 +05:30
parent 5fd693d50e
commit 4cb37c129b
3 changed files with 9 additions and 6 deletions

View file

@ -12,6 +12,7 @@ context('List View', () => {
cy.get('.list-row-container .list-row-checkbox').click({ multiple: true, force: true });
cy.get('.actions-btn-group button').contains('Actions').should('be.visible');
cy.intercept('/api/method/frappe.desk.reportview.get').as('list-refresh');
cy.wait(300); // wait before you hit another refresh
cy.get('button[data-original-title="Refresh"]').click();
cy.wait('@list-refresh');
cy.get('.list-row-container .list-row-checkbox:checked').should('be.visible');

View file

@ -340,7 +340,7 @@ export default class GridRow {
</div>
<div class='control-input-wrapper selected-fields'>
</div>
<p class='help-box small text-muted hidden-xs'>
<p class='help-box small text-muted'>
<a class='add-new-fields text-muted'>
+ ${__('Add / Remove Columns')}
</a>
@ -420,10 +420,10 @@ export default class GridRow {
data-label='${docfield.label}' data-type='${docfield.fieldtype}'>
<div class='row'>
<div class='col-md-1'>
<div class='col-md-1' style='padding-top: 2px'>
<a style='cursor: grabbing;'>${frappe.utils.icon('drag', 'xs')}</a>
</div>
<div class='col-md-7' style='padding-left:0px;'>
<div class='col-md-7' style='padding-left:0px; padding-top:3px'>
${__(docfield.label)}
</div>
<div class='col-md-3' style='padding-left:0px;margin-top:-2px;' title='${__('Columns')}'>
@ -431,7 +431,7 @@ export default class GridRow {
value='${docfield.columns || cint(d.columns)}'
data-fieldname='${docfield.fieldname}' style='background-color: #ffff; display: inline'>
</div>
<div class='col-md-1'>
<div class='col-md-1' style='padding-top: 3px'>
<a class='text-muted remove-field' data-fieldname='${docfield.fieldname}'>
<i class='fa fa-trash-o' aria-hidden='true'></i>
</a>

View file

@ -467,7 +467,7 @@ frappe.views.BaseList = class BaseList {
refresh() {
let args = this.get_call_args();
if (this.no_change(args)) {
console.log('throttled');
// console.log('throttled');
return Promise.resolve();
}
this.freeze(true);
@ -494,7 +494,9 @@ frappe.views.BaseList = class BaseList {
return true;
}
this.last_args = JSON.stringify(args);
setTimeout(() => { this.last_args = null}, 3000);
setTimeout(() => {
this.last_args = null;
}, 3000);
return false;
}