Skip to content
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
# Use Node 20 if available (or install if needed)
if [ -f .nvmrc ]; then
if command -v nvm >/dev/null 2>&1 && [ -f .nvmrc ]; then

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes the shared pre-commit hook for everyone, and looks unrelated to the materials table. Seems like a reasonable fix on its own - could it go in a separate PR?

nvm use 20 2>/dev/null || nvm install 20 && nvm use 20
fi

Expand Down
11 changes: 11 additions & 0 deletions src/actions/bmdashboard/materialsActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,17 @@ export const postMaterialUpdateBulk = payload => {
};
};

export const postMaterialsBulkAction = async payload => {
return axios
.post(ENDPOINTS.BM_MATERIALS_BULK_ACTIONS, payload)
.then(res => res)
.catch(err => {
if (err.response) return err.response;
if (err.request) return err.request;
return err.message;
});
};

export const purchaseMaterial = async body => {
return axios
.post(ENDPOINTS.BM_MATERIALS, body)
Expand Down
128 changes: 128 additions & 0 deletions src/components/BMDashboard/ItemList/ItemListView.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -567,3 +567,131 @@ table td {
min-width: 0;
}
}

.bulkActionsContainer {
display: flex;
justify-content: space-between;
align-items: center;
gap: 10px;
flex-wrap: wrap;
padding: 10px 15px;
background-color: #f8f9fa;
border: 1px solid #dee2e6;
border-radius: 4px;
margin-bottom: 15px;
}

.bulkActionsButton {
background-color: #1565c0;
color: white;
border: none;
padding: 8px 12px;
border-radius: 4px;
cursor: pointer;
}

.bulkActionsButton:hover {
background-color: #0d4ea8;
}

.bulkActionsButton:disabled {
background-color: #9aa6b2;
cursor: not-allowed;
}

.selectedCount {
font-weight: bold;
color: #495057;
}

.selectedRow {
background-color: #e3f2fd !important;
}

.selectedRow:hover {
background-color: #bbdefb !important;
}

.bulkStatusCell {
display: flex;
gap: 6px;
justify-content: center;
flex-wrap: wrap;
}

.bulkTagHold,
.bulkTagReviewed,
.bulkTagNote,
.bulkTagNone {
font-size: 0.72rem;
padding: 2px 8px;
border-radius: 999px;
font-weight: 600;
line-height: 1.35;
}

.bulkTagHold {
background: #fff4e5;
color: #a44900;
border: 1px solid #ffcf99;
}

.bulkTagReviewed {
background: #e8f7ef;
color: #106c3f;
border: 1px solid #b8e6cb;
}

.bulkTagNote {
background: #eaf1ff;
color: #1f4ba8;
border: 1px solid #c5d6ff;
}

.bulkTagNone {
background: #f1f5f9;
color: #475569;
border: 1px solid #d8e0e8;
}

.darkBulkActions {
background-color: #2f4157;
border: 1px solid #3f5269;
color: #e8edf4;
}

.darkBulkActions .selectedCount {
color: #e8edf4;
}

.darkTable .selectedRow {
background-color: #3f5269 !important;
}

.darkTable .selectedRow:hover {
background-color: #4a5f7a !important;
}

.darkTable .bulkTagHold {
background: #5a3a12;
color: #ffd8a6;
border-color: #7a4b1a;
}

.darkTable .bulkTagReviewed {
background: #0f4a34;
color: #b7f7d7;
border-color: #166848;
}

.darkTable .bulkTagNote {
background: #203a69;
color: #d3e3ff;
border-color: #2d4f89;
}

.darkTable .bulkTagNone {
background: #334155;
color: #d1dae7;
border-color: #41556f;
}
Loading
Loading