Skip to content

Commit 600e641

Browse files
committed
include activityID for future control and enhancements
1 parent 71e893d commit 600e641

5 files changed

Lines changed: 45 additions & 14 deletions

File tree

.github/workflows/release.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,18 @@ jobs:
2828
- name: Checkout code
2929
uses: actions/checkout@v4
3030
with:
31-
fetch-depth: 2 # Need previous commit to compare
31+
fetch-depth: 0 # Fetch full history and all tags
3232

3333
- name: Check if version changed
3434
id: check
3535
run: |
3636
# Get current version from DESCRIPTION
3737
NEW_VERSION=$(grep "^Version:" DESCRIPTION | sed 's/Version: //')
38-
39-
# Get previous version from last commit
40-
git checkout HEAD~1 -- DESCRIPTION 2>/dev/null || true
41-
OLD_VERSION=$(grep "^Version:" DESCRIPTION | sed 's/Version: //' || echo "0.0.0")
42-
git checkout HEAD -- DESCRIPTION
38+
39+
# Get the version from the last published git tag (not HEAD~1)
40+
# This avoids the issue where a version bump commit has subsequent commits stacked on top
41+
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
42+
OLD_VERSION=$(echo "$LAST_TAG" | sed 's/^v//')
4343
4444
echo "Old version: $OLD_VERSION"
4545
echo "New version: $NEW_VERSION"

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: ganttify
22
Type: Package
33
Title: Create Interactive Gantt Charts with Work Breakdown Structure
4-
Version: 0.2.6
4+
Version: 0.2.7
55
Authors@R: person("Ahmed", "Aredah", email = "Ahmed.Aredah@gmail.com",
66
role = c("aut", "cre"))
77
Description: Create Primavera-style interactive Gantt charts with Work Breakdown

NEWS.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# ganttify 0.2.7
2+
3+
## Improvements
4+
5+
* **Activity-bar click identification**: Each activity bar's plotly `customdata`
6+
now carries an additional `activity_id` field (the value of the `Activity_ID`
7+
column for that bar), alongside the existing `type`, `original_start`, and
8+
`original_end` keys. This lets consuming apps resolve a clicked bar back to its
9+
source record via `event_data("plotly_click")$customdata`. The change is purely
10+
additive — existing `customdata` keys are unchanged, so the bar-width JavaScript
11+
(which reads `type`/`original_start`/`original_end` by name) is unaffected.
12+
Applies to all three activity-bar traces: planned, actual, and single bars.
13+
114
# ganttify 0.2.6
215

316
## Improvements

R/Ganttify.R

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1429,7 +1429,8 @@ Ganttify <- function(
14291429
customdata = list(list(
14301430
type = "activity_planned",
14311431
original_start = as.character(activity_data$start[i]),
1432-
original_end = as.character(activity_data$end[i])
1432+
original_end = as.character(activity_data$end[i]),
1433+
activity_id = activity_data$id[i]
14331434
))
14341435
)
14351436

@@ -1447,7 +1448,8 @@ Ganttify <- function(
14471448
customdata = list(list(
14481449
type = "activity_actual",
14491450
original_start = as.character(activity_data$start_actual[i]),
1450-
original_end = as.character(activity_data$end_actual[i])
1451+
original_end = as.character(activity_data$end_actual[i]),
1452+
activity_id = activity_data$id[i]
14511453
))
14521454
)
14531455

@@ -1507,7 +1509,8 @@ Ganttify <- function(
15071509
customdata = list(list(
15081510
type = "activity",
15091511
original_start = as.character(activity_data$start[i]),
1510-
original_end = as.character(activity_data$end[i])
1512+
original_end = as.character(activity_data$end[i]),
1513+
activity_id = activity_data$id[i]
15111514
))
15121515
)
15131516
}

man/Ganttify.Rd

Lines changed: 19 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)