fix: conflict in symbol defs
This commit is contained in:
commit
0a0c4b3601
23 changed files with 272 additions and 143 deletions
|
|
@ -139,7 +139,7 @@ frappe.ui.form.on("Communication", {
|
|||
});
|
||||
},
|
||||
function () {
|
||||
frappe.show_alert('Document not Relinked')
|
||||
frappe.show_alert({message:__('Document not Relinked'), 'indicator': 'info'})
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ frappe.listview_settings['User Permission'] = {
|
|||
}
|
||||
frappe.show_alert({
|
||||
message,
|
||||
indicator: 'green'
|
||||
indicator: 'info'
|
||||
});
|
||||
list_view.refresh();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ class Workspace {
|
|||
this.wrapper = $(wrapper);
|
||||
this.page = wrapper.page;
|
||||
this.prepare_container();
|
||||
this.setup_dropdown();
|
||||
this.pages = {};
|
||||
this.sidebar_items = {};
|
||||
this.sidebar_categories = [
|
||||
|
|
@ -115,7 +116,7 @@ class Workspace {
|
|||
const make_sidebar_category_item = item => {
|
||||
if (item.name == this.get_page_to_show()) {
|
||||
item.selected = true;
|
||||
this.current_page = item.name;
|
||||
this.current_page_name = item.name;
|
||||
}
|
||||
|
||||
let $item = get_sidebar_item(item);
|
||||
|
|
@ -130,18 +131,20 @@ class Workspace {
|
|||
}
|
||||
|
||||
show_page(page) {
|
||||
if (this.current_page && this.pages[this.current_page]) {
|
||||
this.pages[this.current_page].hide();
|
||||
if (this.current_page_name && this.pages[this.current_page_name]) {
|
||||
this.pages[this.current_page_name].hide();
|
||||
}
|
||||
|
||||
if (this.sidebar_items && this.sidebar_items[this.current_page]) {
|
||||
this.sidebar_items[this.current_page].removeClass("selected");
|
||||
if (this.sidebar_items && this.sidebar_items[this.current_page_name]) {
|
||||
this.sidebar_items[this.current_page_name].removeClass("selected");
|
||||
this.sidebar_items[page].addClass("selected");
|
||||
}
|
||||
this.current_page = page;
|
||||
this.current_page_name = page;
|
||||
localStorage.current_desk_page = page;
|
||||
|
||||
this.pages[page] ? this.pages[page].show() : this.make_page(page);
|
||||
this.current_page = this.pages[page];
|
||||
this.setup_dropdown();
|
||||
}
|
||||
|
||||
make_page(page) {
|
||||
|
|
@ -153,6 +156,47 @@ class Workspace {
|
|||
this.pages[page] = $page;
|
||||
return $page;
|
||||
}
|
||||
|
||||
customize() {
|
||||
if (this.current_page && this.current_page.allow_customization) {
|
||||
this.page.clear_menu()
|
||||
this.current_page.customize();
|
||||
|
||||
this.page.set_primary_action(
|
||||
__("Save Customizations"),
|
||||
() => {
|
||||
this.current_page.save_customization();
|
||||
this.page.clear_primary_action();
|
||||
this.setup_dropdown();
|
||||
},
|
||||
null,
|
||||
__("Saving")
|
||||
)
|
||||
|
||||
this.page.set_secondary_action(
|
||||
__("Discard"),
|
||||
() => {
|
||||
this.current_page.reload();
|
||||
this.page.clear_secondary_action();
|
||||
this.setup_dropdown();
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
setup_dropdown() {
|
||||
this.page.clear_menu();
|
||||
|
||||
this.page.add_menu_item('Customize', () => {
|
||||
this.customize();
|
||||
}, 1);
|
||||
|
||||
// this.page.add_menu_item('Reset', () => {
|
||||
// }, 1);
|
||||
|
||||
// this.page.add_menu_item('Hide Page', () => {
|
||||
// }, 1)
|
||||
}
|
||||
}
|
||||
|
||||
class DesktopPage {
|
||||
|
|
@ -235,9 +279,6 @@ class DesktopPage {
|
|||
// We need to remove this as the chart group will be visible during customization
|
||||
$('.widget.onboarding-widget-box').hide();
|
||||
|
||||
this.customize_link.hide();
|
||||
this.save_or_discard_link.show();
|
||||
|
||||
Object.keys(this.sections).forEach(section => {
|
||||
this.sections[section].customize();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ frappe.ui.form.on('Data Migration Connector', {
|
|||
frm.set_value('connector_type', 'Custom');
|
||||
frm.set_value('python_module', r.message);
|
||||
frm.save();
|
||||
frappe.show_alert(__(`New module created ${r.message}`));
|
||||
frappe.show_alert({message: __(`New module created ${r.message}`), indicator: 'success'});
|
||||
d.hide();
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -347,7 +347,7 @@ class TranslationTool {
|
|||
)
|
||||
.then(() => {
|
||||
frappe.dom.unfreeze();
|
||||
frappe.show_alert(__('Successfully Submitted!'));
|
||||
frappe.show_alert({ message:__('Successfully Submitted!'), indicator: 'success'});
|
||||
this.edited_translations = {};
|
||||
this.update_header();
|
||||
this.fetch_messages_then_render();
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
<symbol viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg" id="icon-both">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M6 2l3 3H3l3-3zm3 5l-3 3-3-3h6z" fill="#112B42"></path>
|
||||
</symbol>
|
||||
<symbol viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg" id="icon-edit">
|
||||
<symbol viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg" id="icon-edit-round">
|
||||
<circle cx="13" cy="13" r="12.5" fill="#fff" stroke="#CDD2D7"></circle>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M16.305 7.62c-.192.08-.367.197-.515.345l-.612.612 2.244 2.245.613-.612a1.586 1.586 0 0 0-1.73-2.59zm.41 3.91l-2.244-2.246-6.163 6.163a.5.5 0 0 0-.128.222l-.67 2.452a.3.3 0 0 0 .37.368l2.451-.669a.5.5 0 0 0 .222-.129l6.162-6.162z"
|
||||
fill="#70818F"></path>
|
||||
|
|
@ -209,11 +209,11 @@
|
|||
</symbol>
|
||||
<symbol viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg" id="icon-drag">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.875 1.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0 9a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm-1.5-3a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm6.75-6a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zM8.625 12a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm1.5-6a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z"
|
||||
fill="#ACB5BD"></path>
|
||||
fill="#ACB5BD" stroke="none" stroke-width="0"></path>
|
||||
</symbol>
|
||||
<symbol viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" id="icon-drag-1">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.9 3a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0 10a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zM5.4 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zM12.15 3a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm-1.5 11.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zm1.5-6.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z"
|
||||
fill="#ACB5BD"></path>
|
||||
fill="#ACB5BD" stroke="none" stroke-width="0"></path>
|
||||
</symbol>
|
||||
<symbol viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" id="icon-down">
|
||||
<path d="M3 5.5l5 5 5-5" stroke="#12283A" stroke-linecap="round" stroke-linejoin="round"></path>
|
||||
|
|
@ -230,9 +230,8 @@
|
|||
<symbol viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" id="icon-create">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.146 11.217a.5.5 0 1 0 .708.708l3.182-3.182 3.181 3.182a.5.5 0 1 0 .708-.708l-3.182-3.18 3.182-3.182a.5.5 0 1 0-.708-.708l-3.18 3.181-3.183-3.182a.5.5 0 0 0-.708.708l3.182 3.182-3.182 3.181z" fill="#70818F"></path>
|
||||
</symbol>
|
||||
<symbol viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" id="icon-close_alt">
|
||||
<path d="M14 7.666l-5.313 5.221c-1.51 1.484-4.045 1.484-5.555 0-1.51-1.483-1.51-3.975 0-5.458L7.842 2.8a2.73 2.73 0 0 1 3.864 0c1.087 1.068 1.087 2.73 0 3.797L7.358 10.81c-.603.593-1.57.593-2.113 0-.603-.593-.603-1.543 0-2.077l3.623-3.56" stroke="#12283A"
|
||||
stroke-miterlimit="10" stroke-linecap="round"></path>
|
||||
<symbol viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" id="icon-close-alt">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.78033 2.71967C3.48744 2.42678 3.01257 2.42678 2.71967 2.71967C2.42678 3.01256 2.42678 3.48744 2.71967 3.78033L6.94054 8.00119L2.71967 12.2221C2.42678 12.515 2.42678 12.9898 2.71967 13.2827C3.01257 13.5756 3.48744 13.5756 3.78033 13.2827L8.0012 9.06185L12.222 13.2826C12.5149 13.5755 12.9897 13.5755 13.2826 13.2826C13.5755 12.9897 13.5755 12.5148 13.2826 12.222L9.06186 8.00119L13.2826 3.78044C13.5755 3.48755 13.5755 3.01267 13.2826 2.71978C12.9897 2.42688 12.5149 2.42689 12.222 2.71978L8.0012 6.94054L3.78033 2.71967Z" fill="#8C9AA6" stroke="none"/>
|
||||
</symbol>
|
||||
<symbol viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" id="icon-close">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.146 11.217a.5.5 0 1 0 .708.708l3.182-3.182 3.181 3.182a.5.5 0 1 0 .708-.708l-3.182-3.18 3.182-3.182a.5.5 0 1 0-.708-.708l-3.18 3.181-3.183-3.182a.5.5 0 0 0-.708.708l3.182 3.182-3.182 3.181z" fill="#4C5A67" stroke-width="0"></path>
|
||||
|
|
@ -519,4 +518,16 @@
|
|||
<path d="M12.706 1.15a3.784 3.784 0 0 0-5.434 0c-.104.106-.183.227-.272.34-.089-.113-.168-.234-.272-.34a3.784 3.784 0 0 0-5.434 0C.73 1.727.495 2.704.5 3.78c.015 3.468 3 5.85 5.745 7.886.45.334 1.06.334 1.51 0 2.746-2.035 5.73-4.418 5.745-7.886.005-1.077-.231-2.054-.794-2.63z"
|
||||
stroke="none" fill="#E24C4C"></path>
|
||||
</symbol>
|
||||
<symbol viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" id="icon-solid-error">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM8.0429 8.04289C8.43342 7.65237 9.06659 7.65237 9.45711 8.04289L12.0011 10.5869L14.5451 8.04294C14.9356 7.65242 15.5688 7.65242 15.9593 8.04294C16.3499 8.43347 16.3499 9.06663 15.9593 9.45716L13.4154 12.0011L15.9593 14.5451C16.3499 14.9356 16.3499 15.5688 15.9593 15.9593C15.5688 16.3499 14.9357 16.3499 14.5451 15.9593L12.0011 13.4154L9.45711 15.9594C9.06659 16.3499 8.43342 16.3499 8.0429 15.9594C7.65237 15.5689 7.65237 14.9357 8.0429 14.5452L10.5869 12.0011L8.0429 9.45711C7.65237 9.06658 7.65237 8.43342 8.0429 8.04289Z" fill="#F56B6B" stroke="none"/>
|
||||
</symbol>
|
||||
<symbol viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" id="icon-solid-info">
|
||||
<path opacity="0.8" fill-rule="evenodd" clip-rule="evenodd" d="M12 2C6.5 2 2 6.5 2 12C2 17.5 6.5 22 12 22C17.5 22 22 17.5 22 12C22 6.5 17.5 2 12 2ZM12 10.5C12.5523 10.5 13 10.9477 13 11.5V17C13 17.5523 12.5523 18 12 18C11.4477 18 11 17.5523 11 17V11.5C11 10.9477 11.4477 10.5 12 10.5ZM13 7.99976C13 7.44747 12.5523 6.99976 12 6.99976C11.4477 6.99976 11 7.44747 11 7.99976V8.1C11 8.65228 11.4477 9.1 12 9.1C12.5523 9.1 13 8.65228 13 8.1V7.99976Z" fill="#318AD8" stroke="none"/>
|
||||
</symbol>
|
||||
<symbol viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" id="icon-solid-success">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12ZM16.8734 10.1402C17.264 9.74969 17.264 9.11652 16.8734 8.726C16.4829 8.33547 15.8498 8.33547 15.4592 8.726L14.6259 9.55933L12.9592 11.226L10.333 13.8522L9.37345 12.8927L8.54011 12.0593C8.14959 11.6688 7.51643 11.6688 7.1259 12.0593C6.73538 12.4499 6.73538 13.083 7.1259 13.4735L7.95923 14.3069L9.6259 15.9735C9.81344 16.1611 10.0678 16.2664 10.333 16.2664C10.5982 16.2664 10.8526 16.1611 11.0401 15.9735L14.3734 12.6402L16.0401 10.9735L16.8734 10.1402Z" fill="#68D391" stroke="none"/>
|
||||
</symbol>
|
||||
<symbol viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" id="icon-solid-warning">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.00288 21.3966C2.47791 21.3966 1.51397 19.7584 2.25456 18.4253L10.2527 4.02871C11.0147 2.65709 12.9873 2.6571 13.7493 4.02872L21.7474 18.4253C22.488 19.7584 21.524 21.3966 19.9991 21.3966H4.00288ZM11.9991 18.4126C12.5688 18.4126 13.0307 17.9507 13.0307 17.381C13.0307 16.8113 12.5688 16.3495 11.9991 16.3495C11.4294 16.3495 10.9675 16.8113 10.9675 17.381C10.9675 17.9507 11.4294 18.4126 11.9991 18.4126ZM13 8.8601C13 8.30782 12.5523 7.8601 12 7.8601C11.4477 7.8601 11 8.30782 11 8.8601V13.9074C11 14.4597 11.4477 14.9074 12 14.9074C12.5523 14.9074 13 14.4597 13 13.9074V8.8601Z" fill="#D6932E" stroke="none"/>
|
||||
</symbol>
|
||||
</svg>
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 58 KiB |
|
|
@ -216,7 +216,7 @@ frappe.Application = Class.extend({
|
|||
s.hide();
|
||||
d.hide();//hide waiting indication
|
||||
if (!passed["message"]) {
|
||||
frappe.show_alert("Login Failed please try again", 5);
|
||||
frappe.show_alert({message: __("Login Failed please try again"), indicator: 'error'}, 5);
|
||||
me.email_password_prompt(email_account, user, i);
|
||||
} else {
|
||||
if (i + 1 < email_account.length) {
|
||||
|
|
|
|||
|
|
@ -284,16 +284,18 @@ frappe.ui.form.PrintPreview = Class.extend({
|
|||
});
|
||||
} else {
|
||||
frappe.show_alert({
|
||||
message: __('PDF printing via "Raw Print" is not yet supported. Please remove the printer mapping in Printer Settings and try again.'),
|
||||
indicator: 'blue'
|
||||
message: __('PDF printing via "Raw Print" is not supported.'),
|
||||
subtitle: __('Please remove the printer mapping in Printer Settings and try again.'),
|
||||
indicator: 'info'
|
||||
}, 14);
|
||||
//Note: need to solve "Error: Cannot parse (FILE)<URL> as a PDF file" to enable qz pdf printing.
|
||||
}
|
||||
} else if (me.is_raw_printing()) {
|
||||
// printer not mapped in localstorage and the current print format is raw printing
|
||||
frappe.show_alert({
|
||||
message: __('Please set a printer mapping for this print format in the Printer Settings'),
|
||||
indicator: 'blue'
|
||||
message: __('Printer mapping not set.'),
|
||||
subtitle: __('Please set a printer mapping for this print format in the Printer Settings'),
|
||||
indicator: 'warning'
|
||||
}, 14);
|
||||
me.printer_setting_dialog();
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ frappe.ui.form.save = function (frm, action, callback, btn) {
|
|||
freeze_message: freeze_message
|
||||
});
|
||||
} else {
|
||||
!frm.is_dirty() && frappe.show_alert({message: __("No changes in document"), indicator: "blue"});
|
||||
!frm.is_dirty() && frappe.show_alert({message: __("No changes in document"), indicator: "orange"});
|
||||
$(btn).prop("disabled", false);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ frappe.ui.form.ScriptManager = Class.extend({
|
|||
this.trigger('setup');
|
||||
},
|
||||
log_error: function(caller, e) {
|
||||
frappe.show_alert("Error in Client Script.");
|
||||
frappe.show_alert({message: __("Error in Client Script."), indicator: "error"});
|
||||
console.group && console.group();
|
||||
console.log("----- error in client script -----");
|
||||
console.log("method: " + caller);
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ frappe.ui.form.Toolbar = Class.extend({
|
|||
},
|
||||
show_unchanged_document_alert: function() {
|
||||
frappe.show_alert({
|
||||
indicator: "yellow",
|
||||
indicator: "info",
|
||||
message: __("Unchanged")
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -29,7 +29,8 @@ frappe.call = function(opts) {
|
|||
if (!frappe.is_online()) {
|
||||
frappe.show_alert({
|
||||
indicator: 'orange',
|
||||
message: __('You are not connected to Internet. Retry after sometime.')
|
||||
message: __('Connection Lost'),
|
||||
subtitle: __('You are not connected to Internet. Retry after sometime.')
|
||||
}, 3);
|
||||
opts.always && opts.always();
|
||||
return $.ajax();
|
||||
|
|
|
|||
|
|
@ -348,43 +348,53 @@ frappe.hide_progress = function() {
|
|||
|
||||
// Floating Message
|
||||
frappe.show_alert = function(message, seconds=7, actions={}) {
|
||||
if(typeof message==='string') {
|
||||
let indicator_icon_map = {
|
||||
'orange': "solid-warning",
|
||||
'yellow': "solid-warning",
|
||||
'blue': "solid-success",
|
||||
'green': "solid-success",
|
||||
'red': "solid-red"
|
||||
};
|
||||
|
||||
if (typeof message==='string') {
|
||||
message = {
|
||||
message: message
|
||||
};
|
||||
}
|
||||
if(!$('#dialog-container').length) {
|
||||
|
||||
if (!$('#dialog-container').length) {
|
||||
$('<div id="dialog-container"><div id="alert-container"></div></div>').appendTo('body');
|
||||
}
|
||||
|
||||
let body_html;
|
||||
|
||||
if (message.body) {
|
||||
body_html = message.body;
|
||||
let icon;
|
||||
if (message.indicator) {
|
||||
icon = indicator_icon_map[message.indicator.toLowerCase()] || 'solid-' + message.indicator;
|
||||
} else {
|
||||
icon = 'solid-info'
|
||||
}
|
||||
|
||||
const div = $(`
|
||||
<div class="alert desk-alert">
|
||||
<div class="alert-message small"></div>
|
||||
<div class="alert-message-container">
|
||||
<div class="alert-title-container">
|
||||
<div>${frappe.utils.icon(icon, 'lg')}</div>
|
||||
<div class="alert-message">${message.message}</div>
|
||||
</div>
|
||||
<div class="alert-subtitle">${message.subtitle || '' }</div>
|
||||
</div>
|
||||
<div class="alert-body" style="display: none"></div>
|
||||
<a class="close">×</a>
|
||||
<a class="close">${frappe.utils.icon('close-alt')}</a>
|
||||
</div>`);
|
||||
|
||||
if(message.indicator) {
|
||||
div.find('.alert-message').append(`<span class="indicator ${message.indicator}"></span>`);
|
||||
div.hide().appendTo("#alert-container").show();
|
||||
|
||||
if (message.body) {
|
||||
div.find('.alert-body').show().html(message.body);
|
||||
}
|
||||
|
||||
div.find('.alert-message').append(message.message);
|
||||
|
||||
if (body_html) {
|
||||
div.find('.alert-body').show().html(body_html);
|
||||
}
|
||||
|
||||
div.hide().appendTo("#alert-container").show()
|
||||
.css('transform', 'translateX(0)');
|
||||
|
||||
div.find('.close, button').click(function() {
|
||||
div.remove();
|
||||
div.addClass('out')
|
||||
setTimeout(() => div.remove(), 800);
|
||||
return false;
|
||||
});
|
||||
|
||||
|
|
@ -392,7 +402,17 @@ frappe.show_alert = function(message, seconds=7, actions={}) {
|
|||
div.find(`[data-action=${key}]`).on('click', actions[key]);
|
||||
});
|
||||
|
||||
div.delay(seconds * 1000).fadeOut(300);
|
||||
if (seconds > 2) {
|
||||
// Delay for animation
|
||||
seconds = seconds - 0.8
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
div.addClass('out')
|
||||
setTimeout(() => div.remove(), 800);
|
||||
return false;
|
||||
}, seconds * 1000)
|
||||
|
||||
return div;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -221,7 +221,7 @@ frappe.ui.toolbar.clear_cache = frappe.utils.throttle(function() {
|
|||
frappe.xcall('frappe.sessions.clear').then(message => {
|
||||
frappe.show_alert({
|
||||
message: message,
|
||||
indicator: 'green'
|
||||
indicator: 'info'
|
||||
});
|
||||
location.reload(true);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -336,7 +336,7 @@ frappe.views.ReportView = class ReportView extends frappe.views.ListView {
|
|||
],
|
||||
primary_action: ({ column, insert_before }) => {
|
||||
if (!columns_in_picker.map(col => col.value).includes(column)) {
|
||||
frappe.show_alert(__('Invalid column'));
|
||||
frappe.show_alert({message: __('Invalid column'), indicator: 'orange'});
|
||||
d.hide();
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,21 +24,21 @@ export default class Widget {
|
|||
this.in_customize_mode = true;
|
||||
this.action_area.empty();
|
||||
|
||||
options.allow_sorting &&
|
||||
this.add_custom_button(
|
||||
frappe.utils.icon('drag', 'xs'),
|
||||
null,
|
||||
"drag-handle",
|
||||
);
|
||||
|
||||
options.allow_delete &&
|
||||
this.add_custom_button(
|
||||
'<i class="fa fa-trash" aria-hidden="true"></i>',
|
||||
frappe.utils.icon('delete', 'xs'),
|
||||
() => this.delete(),
|
||||
"",
|
||||
`${__('Delete')}`
|
||||
);
|
||||
|
||||
options.allow_sorting &&
|
||||
this.add_custom_button(
|
||||
'<i class="fa fa-arrows" aria-hidden="true"></i>',
|
||||
null,
|
||||
"drag-handle",
|
||||
);
|
||||
|
||||
if (options.allow_hiding) {
|
||||
if (this.hidden) {
|
||||
this.widget.removeClass("hidden");
|
||||
|
|
@ -62,7 +62,7 @@ export default class Widget {
|
|||
|
||||
options.allow_edit &&
|
||||
this.add_custom_button(
|
||||
'<i class="fa fa-pencil" aria-hidden="true"></i>',
|
||||
frappe.utils.icon("edit", "xs"),
|
||||
() => this.edit()
|
||||
);
|
||||
|
||||
|
|
@ -92,7 +92,10 @@ export default class Widget {
|
|||
${ this.shadow ? "widget-shadow" : " " }
|
||||
" data-widget-name="${this.name ? this.name : ''}">
|
||||
<div class="widget-head">
|
||||
<div class="widget-title ellipsis"></div>
|
||||
<div>
|
||||
<div class="widget-title ellipsis"></div>
|
||||
<div class="widget-subtitle"></div>
|
||||
</div>
|
||||
<div class="widget-control"></div>
|
||||
</div>
|
||||
<div class="widget-body">
|
||||
|
|
@ -102,6 +105,7 @@ export default class Widget {
|
|||
</div>`);
|
||||
|
||||
this.title_field = this.widget.find(".widget-title");
|
||||
this.subtitle_field = this.widget.find(".widget-subtitle");
|
||||
this.body = this.widget.find(".widget-body");
|
||||
this.action_area = this.widget.find(".widget-control");
|
||||
this.head = this.widget.find(".widget-head");
|
||||
|
|
@ -122,6 +126,7 @@ export default class Widget {
|
|||
this.title_field[0].setAttribute('title', this.label);
|
||||
}
|
||||
}
|
||||
this.subtitle && this.subtitle_field.html(this.subtitle);
|
||||
}
|
||||
|
||||
add_custom_button(html, action, class_name = "", title="") {
|
||||
|
|
|
|||
|
|
@ -432,16 +432,6 @@ export default class OnboardingWidget extends Widget {
|
|||
return false;
|
||||
}
|
||||
|
||||
set_title(title) {
|
||||
super.set_title(title);
|
||||
if (this.subtitle) {
|
||||
let subtitle = $(
|
||||
`<div class="widget-subtitle">${this.subtitle}</div>`
|
||||
);
|
||||
subtitle.appendTo(this.title_field);
|
||||
}
|
||||
}
|
||||
|
||||
set_actions() {
|
||||
this.action_area.empty();
|
||||
if (!this.user_can_dismiss) return;
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ export default class ShortcutWidget extends Widget {
|
|||
? this.color.toLowerCase()
|
||||
: 'grey';
|
||||
|
||||
const buttons = $(`<div class="small indicator-pill ${color}">${label}</div>`);
|
||||
const buttons = $(`<div class="indicator-pill ${color}">${label}</div>`);
|
||||
buttons.appendTo(this.action_area);
|
||||
}
|
||||
}
|
||||
|
|
@ -49,74 +49,6 @@ a[disabled="disabled"] {
|
|||
margin-top: 3px;
|
||||
}
|
||||
|
||||
/* alert */
|
||||
|
||||
|
||||
#alert-container {
|
||||
position: fixed;
|
||||
bottom: 0px;
|
||||
right: 20px;
|
||||
z-index: 1050;
|
||||
}
|
||||
|
||||
#alert-container .desk-alert {
|
||||
box-shadow: 0 0px 5px rgba(0, 0, 0, 0.1);
|
||||
max-width: 400px;
|
||||
min-width: 200px;
|
||||
max-height: 200px;
|
||||
background-color: @light-yellow;
|
||||
border: 1px solid @border-color;
|
||||
|
||||
// word-break: break-all;
|
||||
overflow-y: auto;
|
||||
position: relative;
|
||||
transform: translateX(calc(100% + 20px));
|
||||
transition: transform 300ms ease;
|
||||
padding: 0px;
|
||||
|
||||
.alert-message {
|
||||
padding: 10px 40px 10px 10px;
|
||||
|
||||
.indicator::before {
|
||||
margin-bottom: 1px;
|
||||
}
|
||||
}
|
||||
|
||||
.close {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
color: inherit;
|
||||
opacity: 1;
|
||||
font-size: inherit;
|
||||
}
|
||||
|
||||
.next-action-container {
|
||||
display: flex;
|
||||
|
||||
.next-action {
|
||||
border: none;
|
||||
background: none;
|
||||
width: 100%;
|
||||
border-top: 1px solid @border-color;
|
||||
border-right: 1px solid @border-color;
|
||||
padding: 7px;
|
||||
outline: none;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
color: @text-light;
|
||||
|
||||
&:hover {
|
||||
background-color: darken(@light-yellow, 5%);
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
border-right: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.missing-image {
|
||||
background-color: @light-bg;
|
||||
line-height: 140px;
|
||||
|
|
|
|||
|
|
@ -132,14 +132,14 @@ $panel-bg: $gray-50;
|
|||
flex-direction: column;
|
||||
min-height: 1px;
|
||||
padding: 15px;
|
||||
border-radius: 8px;
|
||||
border-radius: var(--border-radius-md);
|
||||
height: 100%;
|
||||
|
||||
&.widget-shadow {
|
||||
box-shadow: 0px 1px 4px rgba(17, 43, 66, 0.1);
|
||||
box-shadow: 0px 1px 4px rgba(17, 43, 66, 0.1), 0px 2px 6px rgba(17, 43, 66, 0.08);
|
||||
|
||||
&:hover {
|
||||
box-shadow: 0px 1px 4px rgba(17, 43, 66, 0.1), 0px 2px 6px rgba(17, 43, 66, 0.08);
|
||||
box-shadow: 0px 2px 8px rgba(17, 43, 66, 0.1), 0px 3px 12px rgba(17, 43, 66, 0.08);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -211,6 +211,7 @@ $panel-bg: $gray-50;
|
|||
min-height: 65px;
|
||||
background-color: $disabled-background;
|
||||
color: $text-muted;
|
||||
border: 1px dashed var(--grey-300);
|
||||
display: flex;
|
||||
align-content: center;
|
||||
justify-content: center;
|
||||
|
|
@ -369,6 +370,10 @@ $panel-bg: $gray-50;
|
|||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.indicator-pill {
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
|
||||
&.links-widget-box {
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
@import "list";
|
||||
@import "navbar";
|
||||
@import "modal";
|
||||
@import "toast";
|
||||
@import "breadcrumb";
|
||||
@import "indicator";
|
||||
@import "page";
|
||||
|
|
|
|||
120
frappe/public/scss/toast.scss
Normal file
120
frappe/public/scss/toast.scss
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
#alert-container {
|
||||
position: fixed;
|
||||
bottom: 0px;
|
||||
right: 20px;
|
||||
z-index: 1050;
|
||||
}
|
||||
|
||||
#alert-container .desk-alert {
|
||||
box-shadow: 0px 1px 4px rgba(17, 43, 66, 0.1), 0px 2px 6px rgba(17, 43, 66, 0.08);
|
||||
width: 400px;
|
||||
min-height: 50px;
|
||||
max-height: 200px;
|
||||
background-color: $white;
|
||||
|
||||
-webkit-animation-name: backInRight;
|
||||
animation-name: backInRight;
|
||||
animation-duration: 600ms;
|
||||
|
||||
// word-break: break-all;
|
||||
overflow-y: auto;
|
||||
position: relative;
|
||||
// transform: translateX(calc(100% + 20px));
|
||||
// transition: transform 300ms ease;
|
||||
padding: 0px;
|
||||
border-radius: var(--border-radius-md);
|
||||
|
||||
.alert-message-container {
|
||||
padding: 16px 40px 16px 16px;
|
||||
|
||||
.icon {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.alert-title-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.alert-message {
|
||||
font-weight: 500;
|
||||
color: var(--grey-900);
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
.alert-subtitle {
|
||||
font-size: 13px;
|
||||
padding-left: 34px;
|
||||
}
|
||||
}
|
||||
|
||||
.close {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
color: inherit;
|
||||
opacity: 1;
|
||||
font-size: inherit;
|
||||
}
|
||||
|
||||
.next-action-container {
|
||||
display: flex;
|
||||
|
||||
.next-action {
|
||||
border: none;
|
||||
background: none;
|
||||
width: 100%;
|
||||
border-top: 1px solid $border-color;
|
||||
border-right: 1px solid $border-color;
|
||||
padding: 7px;
|
||||
outline: none;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
color: $text-muted;
|
||||
|
||||
&:hover {
|
||||
color: var(--grey-900)
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
border-right: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.out {
|
||||
-webkit-animation-name: backOutRight;
|
||||
animation-name: backOutRight;
|
||||
animation-duration: 1.6s;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes backInRight {
|
||||
0% {
|
||||
-webkit-transform: translateX(2000px) scale(0.8);
|
||||
transform: translateX(2000px) scale(0.8);
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
80% {
|
||||
-webkit-transform: translateX(0px) scale(0.8);
|
||||
transform: translateX(0px) scale(0.8);
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
100% {
|
||||
-webkit-transform: scale(1);
|
||||
transform: scale(1);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes backOutRight {
|
||||
0% { opacity: 1; }
|
||||
|
||||
100% {
|
||||
-webkit-transform: translateX(2000px);
|
||||
transform: translateX(2000px);
|
||||
opacity: 0.7;
|
||||
}
|
||||
}
|
||||
|
|
@ -25,6 +25,7 @@ $light: $gray-50 !default;
|
|||
:root {
|
||||
--border-sm: 4px;
|
||||
--border-radius: 6px;
|
||||
--border-radius-md: 8px;
|
||||
--border-radius-lg: 12px;
|
||||
|
||||
--text-xs: 11px;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue