Skip to content

Commit

Permalink
fix: ui cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitwaghchaure committed Sep 20, 2024
1 parent 444f085 commit 1672880
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 6 deletions.
3 changes: 2 additions & 1 deletion erpnext/manufacturing/doctype/bom_creator/bom_creator.json
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@
"fieldtype": "Column Break"
}
],
"hide_toolbar": 1,
"icon": "fa fa-sitemap",
"is_submittable": 1,
"links": [
Expand All @@ -403,7 +404,7 @@
"link_fieldname": "bom_creator"
}
],
"modified": "2024-05-26 15:47:10.101420",
"modified": "2024-09-20 09:05:52.945112",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "BOM Creator",
Expand Down
3 changes: 1 addition & 2 deletions erpnext/manufacturing/doctype/bom_creator/bom_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ class BOMCreator(Document):
from typing import TYPE_CHECKING

if TYPE_CHECKING:
from frappe.types import DF

from erpnext.manufacturing.doctype.bom_creator_item.bom_creator_item import BOMCreatorItem
from frappe.types import DF

amended_from: DF.Link | None
backflush_from_wip_warehouse: DF.Check
Expand Down
21 changes: 21 additions & 0 deletions erpnext/manufacturing/doctype/plant_floor/plant_floor.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,22 @@ frappe.ui.form.on("Plant Floor", {
frm.trigger("setup_queries");
},

add_workstation(frm) {
frm.add_custom_button(__("Create Workstation"), () => {
var doc = frappe.model.get_new_doc("Workstation");
doc.plant_floor = frm.doc.name;
doc.status = "Off";
frappe.ui.form.make_quick_entry(
"Workstation",
() => {
frm.trigger("prepare_workstation_dashboard");
},
null,
doc
);
}).addClass("btn-primary");
},

setup_queries(frm) {
frm.set_query("warehouse", (doc) => {
if (!doc.company) {
Expand All @@ -24,6 +40,11 @@ frappe.ui.form.on("Plant Floor", {
refresh(frm) {
frm.trigger("prepare_stock_dashboard");
frm.trigger("prepare_workstation_dashboard");

if (!frm.is_new()) {
frm.trigger("add_workstation");
frm.disable_save();
}
},

prepare_workstation_dashboard(frm) {
Expand Down
3 changes: 2 additions & 1 deletion erpnext/manufacturing/doctype/plant_floor/plant_floor.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@
"options": "Company"
}
],
"hide_toolbar": 1,
"index_web_pages_for_search": 1,
"links": [],
"modified": "2024-03-27 13:10:13.805390",
"modified": "2024-09-19 18:06:36.481625",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "Plant Floor",
Expand Down
12 changes: 11 additions & 1 deletion erpnext/public/js/bom_configurator/bom_configurator.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ class BOMConfigurator {
};

frappe.views.trees["BOM Configurator"] = new frappe.views.TreeView(options);
let node = frappe.views.trees["BOM Configurator"].tree.root_node;
frappe.views.trees["BOM Configurator"].tree.show_toolbar(node);
frappe.views.trees["BOM Configurator"].tree.load_children(node, true);
this.tree_view = frappe.views.trees["BOM Configurator"];
}

Expand Down Expand Up @@ -138,7 +141,7 @@ class BOMConfigurator {
btnClass: "hidden-xs",
},
{
label: __("Expand All"),
label: __("Collapse All"),
click: function (node) {
let view = frappe.views.trees["BOM Configurator"];

Expand Down Expand Up @@ -307,6 +310,13 @@ class BOMConfigurator {
fieldtype: "Float",
reqd: 1,
read_only: read_only,
change() {
this.layout.fields_dict.items.grid.data.forEach((row) => {
row.qty = flt(this.value);
});

this.layout.fields_dict.items.grid.refresh();
},
},
];

Expand Down
10 changes: 9 additions & 1 deletion erpnext/public/js/templates/visual_plant_floor_template.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
{% $.each(workstations, (idx, row) => { %}
<div class="workstation-wrapper">
<div class="workstation-status text-right">
<span class="indicator-pill no-indicator-dot whitespace-nowrap {{row.color}}" style="margin: 3px 4px 0px 0px;"><span style="font-size:13px">{{row.status}}</span></span>
{% if(row.status == "Production") { %}
<div class="ring-container">
<div class="ringring"></div>
<div class="circle"></div>
</div>
{% } %}
<span class="indicator-pill no-indicator-dot whitespace-nowrap {{row.color}}" style="margin: 3px 4px 0px 0px;">
<span style="font-size:13px">{{row.status}}</span>
</span>
</div>
<div class="workstation-image">
<div class="flex items-center justify-center h-32 border-b-grey text-6xl text-grey-100">
Expand Down
41 changes: 41 additions & 0 deletions erpnext/public/scss/erpnext.scss
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,47 @@ body[data-route="pos"] {
position: relative;
}

.ring-container {
position: relative;
}

.circle {
width: 9px;
height: 9px;
background-color: #278f5e;
border-radius: 50%;
position: absolute;
left: 9px;
top: 8px;
}

@keyframes pulsate {
0% {
-webkit-transform: scale(0.1, 0.1);
opacity: 0;
}
50% {
opacity: 1;
}
100% {
-webkit-transform: scale(1.2, 1.2);
opacity: 0;
}
}

.ringring {
border: 2px solid #62bd19;
-webkit-border-radius: 40px;
height: 15px;
width: 15px;
position: absolute;
left: 6px;
top: 5px;
-webkit-animation: pulsate 3s ease-out;
-webkit-animation-iteration-count: infinite;
opacity: 0;
}

.plant-floor {
padding-bottom: 25px;
}
Expand Down

0 comments on commit 1672880

Please sign in to comment.