Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
38 changes: 23 additions & 15 deletions .github/workflows/auto-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,27 @@ jobs:
pull-requests: write
contents: read
steps:
- uses: actions/checkout@v4

- name: Create Pull Request if not exists
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
EXISTING=$(gh pr list --base main --head dev --json number --jq '.[0].number')
if [ -z "$EXISTING" ]; then
gh pr create \
--base main \
--head dev \
--title "Sprint 5: Price, Expiry, and Supplier Tracking" \
--body "## Changes\n- Added price field with total inventory value on dashboard\n- Added expiration date tracking with expiring-soon alerts\n- Added supplier tracking\n- Added 'Add Expiring Soon Items' button in Receive Delivery\n- Updated seed data with real-world supplier names"
else
echo "PR #$EXISTING already exists, skipping."
fi
uses: actions/github-script@v7
with:
script: |
const { data: pulls } = await github.rest.pulls.list({
owner: context.repo.owner,
repo: context.repo.repo,
base: 'main',
head: 'dev',
state: 'open'
});
if (pulls.length === 0) {
await github.rest.pulls.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: 'Sprint 5: Price, Expiry, and Supplier Tracking',
head: 'dev',
base: 'main',
body: '## Changes\n- Added price field with total inventory value on dashboard\n- Added expiration date tracking with expiring-soon alerts\n- Added supplier tracking\n- Added \'Add Expiring Soon Items\' button in Receive Delivery\n- Updated seed data with real-world supplier names'
});
console.log('Pull request created successfully.');
} else {
console.log(`PR #${pulls[0].number} already exists, skipping.`);
}
23 changes: 6 additions & 17 deletions src/main/java/com/inventorypro/ui/Scenes.java
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ protected void updateItem(Void v, boolean empty) {
});

table.getColumns().addAll(colName, colCategory, colLocation, colQty, colPrice, colExpiry, colAdj);
VBox.setVgrow(table, Priority.ALWAYS);

Button goAdd = new Button("Add Item");
goAdd.setOnAction(e -> stage.getScene().setRoot(createAddItem(stage)));
Expand Down Expand Up @@ -441,12 +442,7 @@ public static Parent createAddItem(Stage stage) {
service.addItem(newItem);
items.add(newItem);

Alert success = new Alert(Alert.AlertType.INFORMATION);
success.setHeaderText("Item Added");
success.setContentText("The item was added successfully.");
success.showAndWait();

stage.getScene().setRoot(createDashboard(stage));
javafx.application.Platform.runLater(() -> stage.getScene().setRoot(createDashboard(stage)));
});

Button back = new Button("Back to Dashboard");
Expand Down Expand Up @@ -586,12 +582,7 @@ public static Parent createEditItem(Stage stage, Item item) {
items.set(idx, updated);
}

Alert success = new Alert(Alert.AlertType.INFORMATION);
success.setHeaderText("Item Updated");
success.setContentText("The item was updated successfully.");
success.showAndWait();

stage.getScene().setRoot(createDashboard(stage));
javafx.application.Platform.runLater(() -> stage.getScene().setRoot(createDashboard(stage)));
});

Button back = new Button("Cancel");
Expand Down Expand Up @@ -761,11 +752,7 @@ protected void updateItem(Item item, boolean empty) {
}
items.setAll(service.listItems());

Alert ok = new Alert(Alert.AlertType.INFORMATION);
ok.setHeaderText("Delivery Processed");
ok.setContentText("Received stock for " + count + " item(s).");
ok.showAndWait();
stage.getScene().setRoot(createDashboard(stage));
javafx.application.Platform.runLater(() -> stage.getScene().setRoot(createDashboard(stage)));
});

Button clearManifest = new Button("Clear Order");
Expand Down Expand Up @@ -817,6 +804,7 @@ protected void updateItem(Item item, boolean empty) {
HBox buttons = new HBox(10, processDelivery, clearManifest, addExpiringSoon, back);
buttons.setPadding(new Insets(10, 0, 0, 0));

VBox.setVgrow(manifestTable, Priority.ALWAYS);
VBox root = new VBox(10, title, instructions, pickerRow, currentStockLabel, addStatus,
manifestCount, manifestTable, buttons);
root.setPadding(new Insets(18));
Expand Down Expand Up @@ -869,6 +857,7 @@ public static Parent createTransactionHistory(Stage stage, Item item) {
});

table.setItems(filteredTransactions);
VBox.setVgrow(table, Priority.ALWAYS);

if (historyList.isEmpty()) {
table.setPlaceholder(new Label("No transaction history found for this item."));
Expand Down
Loading