Merge pull request #12669 from prssanna/redesign-fixes
fix: Redesign fixes
This commit is contained in:
commit
f4655e648f
12 changed files with 77 additions and 21 deletions
|
|
@ -100,6 +100,7 @@ def get_docinfo(doc=None, doctype=None, name=None):
|
|||
"assignment_logs": get_comments(doc.doctype, doc.name, 'assignment'),
|
||||
"permissions": get_doc_permissions(doc),
|
||||
"shared": frappe.share.get_users(doc.doctype, doc.name),
|
||||
"info_logs": get_comments(doc.doctype, doc.name, 'Info'),
|
||||
"share_logs": get_comments(doc.doctype, doc.name, 'share'),
|
||||
"like_logs": get_comments(doc.doctype, doc.name, 'Like'),
|
||||
"views": get_view_logs(doc.doctype, doc.name),
|
||||
|
|
|
|||
|
|
@ -693,4 +693,10 @@
|
|||
<symbol viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" id="icon-star">
|
||||
<path d="M11.5516 2.90849C11.735 2.53687 12.265 2.53687 12.4484 2.90849L14.8226 7.71919C14.8954 7.86677 15.0362 7.96905 15.1991 7.99271L20.508 8.76415C20.9181 8.82374 21.0818 9.32772 20.7851 9.61699L16.9435 13.3616C16.8257 13.4765 16.7719 13.642 16.7997 13.8042L17.7066 19.0916C17.7766 19.5001 17.3479 19.8116 16.9811 19.6187L12.2327 17.1223C12.087 17.0457 11.913 17.0457 11.7673 17.1223L7.01888 19.6187C6.65207 19.8116 6.22335 19.5001 6.29341 19.0916L7.20028 13.8042C7.2281 13.642 7.17433 13.4765 7.05648 13.3616L3.21491 9.61699C2.91815 9.32772 3.08191 8.82374 3.49202 8.76415L8.80094 7.99271C8.9638 7.96905 9.10458 7.86677 9.17741 7.71919L11.5516 2.90849Z" fill="var(--star-fill)" stroke="var(--star-fill)"/>
|
||||
</symbol>
|
||||
<symbol fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" id="icon-map">
|
||||
<g stroke="#111" stroke-miterlimit="10">
|
||||
<path d="M11.467 3.458c1.958 1.957 1.958 5.088.027 7.02L7.97 14l-3.523-3.523a4.945 4.945 0 010-6.993l.026-.026a4.922 4.922 0 016.993 0zm0 0c-.026-.026-.026-.026 0 0z"></path>
|
||||
<path d="M7.971 8.259a1.305 1.305 0 100-2.61 1.305 1.305 0 000 2.61z"></path>
|
||||
</g>
|
||||
</symbol>
|
||||
</svg>
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 91 KiB After Width: | Height: | Size: 91 KiB |
|
|
@ -139,6 +139,7 @@ class FormTimeline extends BaseTimeline {
|
|||
this.timeline_items.push(...this.get_custom_timeline_contents());
|
||||
this.timeline_items.push(...this.get_assignment_timeline_contents());
|
||||
this.timeline_items.push(...this.get_attachment_timeline_contents());
|
||||
this.timeline_items.push(...this.get_info_timeline_contents());
|
||||
this.timeline_items.push(...this.get_milestone_timeline_contents());
|
||||
}
|
||||
}
|
||||
|
|
@ -269,6 +270,17 @@ class FormTimeline extends BaseTimeline {
|
|||
return assignment_timeline_contents;
|
||||
}
|
||||
|
||||
get_info_timeline_contents() {
|
||||
let info_timeline_contents = [];
|
||||
(this.doc_info.info_logs || []).forEach(info_log => {
|
||||
info_timeline_contents.push({
|
||||
creation: info_log.creation,
|
||||
content: `${this.get_user_link(info_log.comment_email)} ${info_log.content}`,
|
||||
});
|
||||
});
|
||||
return info_timeline_contents;
|
||||
}
|
||||
|
||||
get_attachment_timeline_contents() {
|
||||
let attachment_timeline_contents = [];
|
||||
(this.doc_info.attachment_logs || []).forEach(attachment_log => {
|
||||
|
|
|
|||
|
|
@ -179,7 +179,8 @@ frappe.views.BaseList = class BaseList {
|
|||
'Calendar': 'calendar',
|
||||
'Gantt': 'gantt',
|
||||
'Kanban': 'kanban',
|
||||
'Dashboard': 'dashboard'
|
||||
'Dashboard': 'dashboard',
|
||||
'Map': 'map',
|
||||
};
|
||||
|
||||
if (frappe.boot.desk_settings.view_switcher) {
|
||||
|
|
@ -285,6 +286,7 @@ frappe.views.BaseList = class BaseList {
|
|||
}
|
||||
|
||||
setup_filter_area() {
|
||||
if (this.hide_filters) return;
|
||||
this.filter_area = new FilterArea(this);
|
||||
|
||||
if (this.filters && this.filters.length > 0) {
|
||||
|
|
@ -293,6 +295,7 @@ frappe.views.BaseList = class BaseList {
|
|||
}
|
||||
|
||||
setup_sort_selector() {
|
||||
if (this.hide_sort_selector) return;
|
||||
this.sort_selector = new frappe.ui.SortSelector({
|
||||
parent: this.$filter_section,
|
||||
doctype: this.doctype,
|
||||
|
|
@ -410,7 +413,7 @@ frappe.views.BaseList = class BaseList {
|
|||
doctype: this.doctype,
|
||||
fields: this.get_fields(),
|
||||
filters: this.get_filters_for_args(),
|
||||
order_by: this.sort_selector.get_sql_string(),
|
||||
order_by: this.sort_selector && this.sort_selector.get_sql_string(),
|
||||
start: this.start,
|
||||
page_length: this.page_length,
|
||||
view: this.view,
|
||||
|
|
@ -821,6 +824,7 @@ frappe.views.view_modes = [
|
|||
"Image",
|
||||
"Inbox",
|
||||
"Tree",
|
||||
"Map",
|
||||
];
|
||||
frappe.views.is_valid = (view_mode) =>
|
||||
frappe.views.view_modes.includes(view_mode);
|
||||
|
|
|
|||
|
|
@ -417,11 +417,11 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList {
|
|||
|
||||
get_no_result_message() {
|
||||
let help_link = this.get_documentation_link();
|
||||
let filters = this.filter_area.get();
|
||||
let no_result_message = filters.length
|
||||
let filters = this.filter_area && this.filter_area.get();
|
||||
let no_result_message = filters && filters.length
|
||||
? __("No {0} found", [__(this.doctype)])
|
||||
: __("You haven't created a {0} yet", [__(this.doctype)]);
|
||||
let new_button_label = filters.length
|
||||
let new_button_label = filters && filters.length
|
||||
? __("Create a new {0}", [__(this.doctype)])
|
||||
: __("Create your first {0}", [__(this.doctype)]);
|
||||
let empty_state_image =
|
||||
|
|
@ -461,7 +461,7 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList {
|
|||
}
|
||||
|
||||
before_refresh() {
|
||||
if (frappe.route_options) {
|
||||
if (frappe.route_options && this.filter_area) {
|
||||
this.filters = this.parse_filters_from_route_options();
|
||||
frappe.route_options = null;
|
||||
|
||||
|
|
@ -527,9 +527,9 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList {
|
|||
this.view_name
|
||||
);
|
||||
this.save_view_user_settings({
|
||||
filters: this.filter_area.get(),
|
||||
sort_by: this.sort_selector.sort_by,
|
||||
sort_order: this.sort_selector.sort_order,
|
||||
filters: this.filter_area && this.filter_area.get(),
|
||||
sort_by: this.sort_selector && this.sort_selector.sort_by,
|
||||
sort_order: this.sort_selector && this.sort_selector.sort_order,
|
||||
});
|
||||
this.toggle_paging && this.$paging_area.toggle(false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -123,7 +123,14 @@ frappe.views.ListViewSelect = class ListViewSelect {
|
|||
kanbans => this.setup_kanban_switcher(kanbans)
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
Map: {
|
||||
condition: this.list_view.settings.get_coords_method ||
|
||||
(this.list_view.meta.fields.find(i => i.fieldname === "latitude") &&
|
||||
this.list_view.meta.fields.find(i => i.fieldname === "longitude")) ||
|
||||
(this.list_view.meta.fields.find(i => i.fieldname === 'location' && i.fieldtype == 'Geolocation')),
|
||||
action: () => this.set_route("map")
|
||||
},
|
||||
};
|
||||
|
||||
frappe.views.view_modes.forEach(view => {
|
||||
|
|
|
|||
|
|
@ -36,6 +36,18 @@ frappe.ui.FieldSelect = Class.extend({
|
|||
var item = me.awesomplete.get_item(value);
|
||||
me.$input.val(item.label);
|
||||
});
|
||||
this.$input.on("awesomplete-open", () => {
|
||||
let modal = this.$input.parents('.modal-dialog')[0];
|
||||
if (modal) {
|
||||
$(modal).removeClass("modal-dialog-scrollable");
|
||||
}
|
||||
});
|
||||
this.$input.on("awesomplete-close", () => {
|
||||
let modal = this.$input.parents('.modal-dialog')[0];
|
||||
if (modal) {
|
||||
$(modal).addClass("modal-dialog-scrollable");
|
||||
}
|
||||
});
|
||||
|
||||
if(this.filter_fields) {
|
||||
for(var i in this.filter_fields)
|
||||
|
|
|
|||
|
|
@ -283,6 +283,7 @@ frappe.ui.FilterGroup = class {
|
|||
}
|
||||
|
||||
get_filter_area_template() {
|
||||
/* eslint-disable indent */
|
||||
return $(`
|
||||
<div class="filter-area">
|
||||
<div class="filter-edit-area">
|
||||
|
|
@ -293,19 +294,23 @@ frappe.ui.FilterGroup = class {
|
|||
<hr class="divider"></hr>
|
||||
<div class="filter-action-buttons">
|
||||
<button class="text-muted add-filter btn btn-xs">
|
||||
${__('+ Add a Filter')}
|
||||
+ ${__('Add a Filter')}
|
||||
</button>
|
||||
<div>
|
||||
<button class="btn btn-secondary btn-xs clear-filters">
|
||||
${__('Clear Filters')}
|
||||
</button>
|
||||
<button class="btn btn-primary btn-xs apply-filters">
|
||||
${__('Apply Filters')}
|
||||
</button>
|
||||
${this.filter_button ?
|
||||
`<button class="btn btn-primary btn-xs apply-filters">
|
||||
${__('Apply Filters')}
|
||||
</button>`
|
||||
: ''
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>`
|
||||
);
|
||||
/* eslint-disable indent */
|
||||
}
|
||||
|
||||
get_filters_as_object() {
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@ frappe.views.DashboardView = class DashboardView extends frappe.views.ListView {
|
|||
setup_page() {
|
||||
this.hide_sidebar = true;
|
||||
this.hide_page_form = true;
|
||||
this.hide_filters = true;
|
||||
this.hide_sort_selector = true;
|
||||
super.setup_page();
|
||||
}
|
||||
|
||||
|
|
@ -74,6 +76,10 @@ frappe.views.DashboardView = class DashboardView extends frappe.views.ListView {
|
|||
this.toggle_customization_buttons(false);
|
||||
}
|
||||
|
||||
set_primary_action() {
|
||||
// Don't render Add doc button for dashboard view
|
||||
}
|
||||
|
||||
toggle_customization_buttons(show) {
|
||||
this.save_customizations_button.toggle(show);
|
||||
this.discard_customizations_button.toggle(show);
|
||||
|
|
|
|||
|
|
@ -573,14 +573,17 @@ export default class ChartWidget extends Widget {
|
|||
xIsSeries: this.chart_doc.timeseries,
|
||||
shortenYAxisNumbers: 1
|
||||
},
|
||||
tooltipOptions: {
|
||||
};
|
||||
|
||||
if (this.report_result && this.report_result.chart) {
|
||||
chart_args.tooltipOptions = {
|
||||
formatTooltipY: value =>
|
||||
frappe.format(value, {
|
||||
fieldtype: this.report_result.chart.fieldtype,
|
||||
options: this.report_result.chart.options
|
||||
}, { always_show_decimals: true, inline: true })
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
if (this.chart_doc.type == "Heatmap") {
|
||||
const heatmap_year = parseInt(this.selected_heatmap_year || this.chart_settings.heatmap_year || this.chart_doc.heatmap_year);
|
||||
|
|
|
|||
|
|
@ -332,10 +332,6 @@ input.list-check-all, input.list-row-checkbox {
|
|||
}
|
||||
|
||||
.page-form {
|
||||
// .awesomplete > ul {
|
||||
// min-width: 300px;
|
||||
// }
|
||||
|
||||
.standard-filter-section {
|
||||
flex-wrap: wrap;
|
||||
// width: 65%;
|
||||
|
|
|
|||
|
|
@ -117,6 +117,10 @@
|
|||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.awesomplete > ul {
|
||||
min-width: 300px;
|
||||
}
|
||||
}
|
||||
|
||||
.form-inner-toolbar {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue