Merge branch 'develop' into mask-sql-errors
This commit is contained in:
commit
0cdbde3f3f
8 changed files with 75 additions and 51 deletions
|
|
@ -3,6 +3,7 @@ codecov:
|
|||
|
||||
coverage:
|
||||
status:
|
||||
patch: off
|
||||
project:
|
||||
default: false
|
||||
server:
|
||||
|
|
|
|||
|
|
@ -1,44 +1,47 @@
|
|||
context('Relative Timeframe', () => {
|
||||
before(() => {
|
||||
cy.login();
|
||||
cy.visit('/app/website');
|
||||
cy.window().its('frappe').then(frappe => {
|
||||
frappe.call("frappe.tests.ui_test_helpers.create_todo_records");
|
||||
});
|
||||
});
|
||||
it('sets relative timespan filter for last week and filters list', () => {
|
||||
cy.visit('/app/List/ToDo/List');
|
||||
cy.clear_filters();
|
||||
cy.get('.list-row:contains("this is fourth todo")').should('exist');
|
||||
cy.add_filter();
|
||||
cy.get('.fieldname-select-area').should('exist');
|
||||
cy.get('.fieldname-select-area input').type("Due Date{enter}", { delay: 100 });
|
||||
cy.get('select.condition.form-control').select("Timespan");
|
||||
cy.get('.filter-field select.input-with-feedback.form-control').select("last week");
|
||||
cy.intercept('POST', '/api/method/frappe.desk.reportview.get').as('list_refresh');
|
||||
cy.get('.filter-popover .apply-filters').click({ force: true });
|
||||
cy.wait('@list_refresh');
|
||||
cy.get('.list-row-container').its('length').should('eq', 1);
|
||||
cy.get('.list-row-container').should('contain', 'this is second todo');
|
||||
cy.intercept('POST', '/api/method/frappe.model.utils.user_settings.save')
|
||||
.as('save_user_settings');
|
||||
cy.clear_filters();
|
||||
cy.wait('@save_user_settings');
|
||||
});
|
||||
it('sets relative timespan filter for next week and filters list', () => {
|
||||
cy.visit('/app/List/ToDo/List');
|
||||
cy.clear_filters();
|
||||
cy.get('.list-row:contains("this is fourth todo")').should('exist');
|
||||
cy.add_filter();
|
||||
cy.get('.fieldname-select-area input').type("Due Date{enter}", { delay: 100 });
|
||||
cy.get('select.condition.form-control').select("Timespan");
|
||||
cy.get('.filter-field select.input-with-feedback.form-control').select("next week");
|
||||
cy.intercept('POST', '/api/method/frappe.desk.reportview.get').as('list_refresh');
|
||||
cy.get('.filter-popover .apply-filters').click({ force: true });
|
||||
cy.wait('@list_refresh');
|
||||
cy.intercept('POST', '/api/method/frappe.model.utils.user_settings.save')
|
||||
.as('save_user_settings');
|
||||
cy.clear_filters();
|
||||
cy.wait('@save_user_settings');
|
||||
});
|
||||
});
|
||||
// TODO: Enable this again
|
||||
// currently this is flaky possibly because of different timezone in CI
|
||||
|
||||
// context('Relative Timeframe', () => {
|
||||
// before(() => {
|
||||
// cy.login();
|
||||
// cy.visit('/app/website');
|
||||
// cy.window().its('frappe').then(frappe => {
|
||||
// frappe.call("frappe.tests.ui_test_helpers.create_todo_records");
|
||||
// });
|
||||
// });
|
||||
// it('sets relative timespan filter for last week and filters list', () => {
|
||||
// cy.visit('/app/List/ToDo/List');
|
||||
// cy.clear_filters();
|
||||
// cy.get('.list-row:contains("this is fourth todo")').should('exist');
|
||||
// cy.add_filter();
|
||||
// cy.get('.fieldname-select-area').should('exist');
|
||||
// cy.get('.fieldname-select-area input').type("Due Date{enter}", { delay: 100 });
|
||||
// cy.get('select.condition.form-control').select("Timespan");
|
||||
// cy.get('.filter-field select.input-with-feedback.form-control').select("last week");
|
||||
// cy.intercept('POST', '/api/method/frappe.desk.reportview.get').as('list_refresh');
|
||||
// cy.get('.filter-popover .apply-filters').click({ force: true });
|
||||
// cy.wait('@list_refresh');
|
||||
// cy.get('.list-row-container').its('length').should('eq', 1);
|
||||
// cy.get('.list-row-container').should('contain', 'this is second todo');
|
||||
// cy.intercept('POST', '/api/method/frappe.model.utils.user_settings.save')
|
||||
// .as('save_user_settings');
|
||||
// cy.clear_filters();
|
||||
// cy.wait('@save_user_settings');
|
||||
// });
|
||||
// it('sets relative timespan filter for next week and filters list', () => {
|
||||
// cy.visit('/app/List/ToDo/List');
|
||||
// cy.clear_filters();
|
||||
// cy.get('.list-row:contains("this is fourth todo")').should('exist');
|
||||
// cy.add_filter();
|
||||
// cy.get('.fieldname-select-area input').type("Due Date{enter}", { delay: 100 });
|
||||
// cy.get('select.condition.form-control').select("Timespan");
|
||||
// cy.get('.filter-field select.input-with-feedback.form-control').select("next week");
|
||||
// cy.intercept('POST', '/api/method/frappe.desk.reportview.get').as('list_refresh');
|
||||
// cy.get('.filter-popover .apply-filters').click({ force: true });
|
||||
// cy.wait('@list_refresh');
|
||||
// cy.intercept('POST', '/api/method/frappe.model.utils.user_settings.save')
|
||||
// .as('save_user_settings');
|
||||
// cy.clear_filters();
|
||||
// cy.wait('@save_user_settings');
|
||||
// });
|
||||
// });
|
||||
|
|
|
|||
|
|
@ -50,8 +50,8 @@ context('Timeline', () => {
|
|||
cy.click_modal_primary_button('Yes');
|
||||
|
||||
//Deleting the added ToDo
|
||||
cy.get('.menu-btn-group [data-original-title="Menu"]').click();
|
||||
cy.get('.menu-btn-group .dropdown-item').contains('Delete').click();
|
||||
cy.get('[id="page-ToDo"] .menu-btn-group [data-original-title="Menu"]').click();
|
||||
cy.get('[id="page-ToDo"] .menu-btn-group .dropdown-item').contains('Delete').click();
|
||||
cy.findByRole('button', {name: 'Yes'}).click();
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -1480,7 +1480,10 @@ def get_value(*args, **kwargs):
|
|||
|
||||
def as_json(obj, indent=1):
|
||||
from frappe.utils.response import json_handler
|
||||
return json.dumps(obj, indent=indent, sort_keys=True, default=json_handler, separators=(',', ': '))
|
||||
try:
|
||||
return json.dumps(obj, indent=indent, sort_keys=True, default=json_handler, separators=(',', ': '))
|
||||
except TypeError:
|
||||
return json.dumps(obj, indent=indent, default=json_handler, separators=(',', ': '))
|
||||
|
||||
def are_emails_muted():
|
||||
from frappe.utils import cint
|
||||
|
|
|
|||
|
|
@ -99,8 +99,8 @@ class IncompatibleApp(ValidationError): pass
|
|||
class InvalidDates(ValidationError): pass
|
||||
class DataTooLongException(ValidationError): pass
|
||||
class FileAlreadyAttachedException(Exception): pass
|
||||
class DocumentAlreadyRestored(Exception): pass
|
||||
class AttachmentLimitReached(Exception): pass
|
||||
class DocumentAlreadyRestored(ValidationError): pass
|
||||
class AttachmentLimitReached(ValidationError): pass
|
||||
class QueryTimeoutError(ValidationError): pass
|
||||
class QueryDeadlockError(ValidationError): pass
|
||||
# OAuth exceptions
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ frappe.ui.form.PrintView = class {
|
|||
|
||||
add_sidebar_item(df, is_dynamic) {
|
||||
if (df.fieldtype == 'Select') {
|
||||
df.input_class = 'btn btn-default btn-sm';
|
||||
df.input_class = 'btn btn-default btn-sm text-left';
|
||||
}
|
||||
|
||||
let field = frappe.ui.form.make_control({
|
||||
|
|
|
|||
|
|
@ -302,9 +302,20 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList {
|
|||
refresh(refresh_header=false) {
|
||||
super.refresh().then(() => {
|
||||
this.render_header(refresh_header);
|
||||
this.update_checkbox();
|
||||
});
|
||||
}
|
||||
|
||||
update_checkbox(target) {
|
||||
let $check_all_checkbox = this.$checkbox_actions.find(".list-check-all");
|
||||
|
||||
if ($check_all_checkbox.prop("checked") && target && !target.prop("checked")) {
|
||||
$check_all_checkbox.prop("checked", false);
|
||||
}
|
||||
|
||||
$check_all_checkbox.prop("checked", this.$checks.length === this.data.length);
|
||||
}
|
||||
|
||||
setup_freeze_area() {
|
||||
this.$freeze = $(
|
||||
`<div class="freeze flex justify-center align-center text-muted">${__(
|
||||
|
|
@ -1253,6 +1264,8 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList {
|
|||
}
|
||||
|
||||
this.$checkbox_cursor = $target;
|
||||
|
||||
this.update_checkbox($target);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -1398,6 +1411,7 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList {
|
|||
this.$checkbox_actions.show();
|
||||
this.$list_head_subject.hide();
|
||||
}
|
||||
this.update_checkbox();
|
||||
this.toggle_actions_menu_button(this.$checks.length > 0);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -147,7 +147,6 @@
|
|||
|
||||
.list-row-head {
|
||||
@extend .list-row;
|
||||
padding: 15px;
|
||||
cursor: default;
|
||||
|
||||
.list-subject {
|
||||
|
|
@ -214,6 +213,10 @@ input.list-check-all, input.list-row-checkbox {
|
|||
--checkbox-right-margin: calc(var(--checkbox-size) / 2 + #{$level-margin-right});
|
||||
}
|
||||
|
||||
input.list-check-all {
|
||||
margin-left: 15px;
|
||||
}
|
||||
|
||||
.render-list-checkbox {
|
||||
margin-left: 15px;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue