feat(ui): update manager interface and remove full stock display from /manage
Build and Push Fridger Container / Build & Push Fridger Image (push) Successful in 1m21s
Build and Push Fridger Container / Build & Push Fridger Image (push) Successful in 1m21s
This commit is contained in:
+29
-13
@@ -92,9 +92,9 @@ function setRoute(path) {
|
||||
stockBtn.className = inactiveClass;
|
||||
managePage.classList.remove('hidden');
|
||||
stockPage.classList.add('hidden');
|
||||
subTitle.textContent = 'Tablet Station';
|
||||
subTitle.textContent = 'Manager';
|
||||
resetTabletManageStation();
|
||||
renderTabletProductPicker();
|
||||
renderTabletProductPicker('');
|
||||
}
|
||||
|
||||
initLucide();
|
||||
@@ -145,7 +145,8 @@ async function loadItems() {
|
||||
if (state.currentRoute === '/') {
|
||||
renderStockView();
|
||||
} else {
|
||||
renderTabletProductPicker();
|
||||
const query = document.getElementById('tablet-search-input')?.value || '';
|
||||
renderTabletProductPicker(query);
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
@@ -307,7 +308,8 @@ function renderStockView() {
|
||||
}
|
||||
|
||||
// ----------------------------------------------------
|
||||
// ROUTE 2: /manage (TABLET STATION WORKFLOW)
|
||||
// ----------------------------------------------------
|
||||
// ROUTE 2: /manage (MANAGER WORKFLOW)
|
||||
// ----------------------------------------------------
|
||||
|
||||
function resetTabletManageStation() {
|
||||
@@ -315,7 +317,12 @@ function resetTabletManageStation() {
|
||||
state.manage.action = null;
|
||||
document.getElementById('tablet-step-select').classList.remove('hidden');
|
||||
document.getElementById('tablet-step-action').classList.add('hidden');
|
||||
document.getElementById('tablet-search-input').value = '';
|
||||
const searchInput = document.getElementById('tablet-search-input');
|
||||
if (searchInput) searchInput.value = '';
|
||||
const resultsContainer = document.getElementById('tablet-search-results-container');
|
||||
if (resultsContainer) resultsContainer.classList.add('hidden');
|
||||
const picker = document.getElementById('tablet-product-picker');
|
||||
if (picker) picker.innerHTML = '';
|
||||
}
|
||||
|
||||
function handleTabletSearch(val) {
|
||||
@@ -331,27 +338,37 @@ function handleTabletSearch(val) {
|
||||
}
|
||||
|
||||
function renderTabletProductPicker(filterQuery = '') {
|
||||
const container = document.getElementById('tablet-product-picker');
|
||||
if (!container) return;
|
||||
const picker = document.getElementById('tablet-product-picker');
|
||||
const resultsContainer = document.getElementById('tablet-search-results-container');
|
||||
if (!picker || !resultsContainer) return;
|
||||
|
||||
const query = filterQuery.toLowerCase().trim();
|
||||
|
||||
// Only display search results if user has entered a search query
|
||||
if (!query) {
|
||||
resultsContainer.classList.add('hidden');
|
||||
picker.innerHTML = '';
|
||||
return;
|
||||
}
|
||||
|
||||
resultsContainer.classList.remove('hidden');
|
||||
|
||||
const matched = state.items.filter(i => {
|
||||
if (!query) return true;
|
||||
return (i.name && i.name.toLowerCase().includes(query)) ||
|
||||
(i.brand && i.brand.toLowerCase().includes(query)) ||
|
||||
(i.barcode && i.barcode.includes(query));
|
||||
});
|
||||
|
||||
if (matched.length === 0) {
|
||||
container.innerHTML = `
|
||||
<div class="col-span-full py-4 text-center text-xs text-slate-500">
|
||||
No matching product found. Scan barcode or tap "Add Manually"!
|
||||
picker.innerHTML = `
|
||||
<div class="col-span-full py-4 text-center text-xs sm:text-sm text-slate-400">
|
||||
No matching product found. Use "Scan Barcode" or tap "Add Manually".
|
||||
</div>
|
||||
`;
|
||||
return;
|
||||
}
|
||||
|
||||
container.innerHTML = matched.map(item => `
|
||||
picker.innerHTML = matched.map(item => `
|
||||
<button
|
||||
onclick="forwardToProductActionById(${item.id})"
|
||||
class="p-3 rounded-2xl bg-slate-950 hover:bg-slate-800/80 border border-slate-800/90 text-left flex items-center gap-3 transition active:scale-95 touch-manipulation min-h-[52px]"
|
||||
@@ -419,7 +436,6 @@ function forwardToProductAction(item) {
|
||||
|
||||
function cancelActionAndReturnToManage() {
|
||||
resetTabletManageStation();
|
||||
renderTabletProductPicker();
|
||||
}
|
||||
|
||||
function setActionType(action) {
|
||||
|
||||
Reference in New Issue
Block a user