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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Update BPMN Visualization version
name: Update the version of the bpmn-visualization TypeScript library
on:
repository_dispatch:
types: [ update_bpmn_visualization_version ]
Expand All @@ -15,33 +15,33 @@ jobs:
VERSION: ${{ github.event.client_payload.version || github.event.inputs.version }}
steps:
- uses: actions/checkout@v3
- name: Get old bpmn-visualization version
- name: Get the old version of bpmn-visualization
id: lookupOldBPMNVisuVersion
uses: mikefarah/yq@v4.30.5
with:
cmd: yq '.dependencies[] | select(.name == "bpmn-visualization") | .version' inst/htmlwidgets/bpmnVisualization.yaml
cmd: yq '.dependencies[] | select(.name == "bpmn-visualization") | .version' inst/htmlwidgets/bpmnVisualizationR.yaml
- run: echo "OLD_VERSION=${{ steps.lookupOldBPMNVisuVersion.outputs.result }}" >> $GITHUB_ENV
- name: Delete old bpmn-visualization js lib file
- name: Delete the old bpmn-visualization
run: rm inst/htmlwidgets/lib/bpmn-visualization/bpmn-visualization.min.js
- name: Download bpmn-visualization ${{ env.VERSION }}
- name: Download bpmn-visualization@${{ env.VERSION }}
uses: carlosperate/download-file-action@v2
with:
file-url: 'https://cdn.jsdelivr.net/npm/bpmn-visualization@${{ env.VERSION }}/dist/bpmn-visualization.min.js'
location: 'inst/htmlwidgets/lib/bpmn-visualization'
- name: Update bpmn-visualization version in YAML file
- name: Update the bpmn-visualization version in the YAML file
run: |
sed -i -E 's/version: ".*"/version: "${{ env.VERSION }}"/' inst/htmlwidgets/bpmnVisualization.yaml
sed -i -E 's/version: ".*"/version: "${{ env.VERSION }}"/' inst/htmlwidgets/bpmnVisualizationR.yaml
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4.2.3
with:
token: ${{ secrets.GH_RELEASE_TOKEN }}
commit-message: "[INFRA] Bump bpmn-visualization JS lib from ${{ env.OLD_VERSION }} to ${{ env.VERSION }}"
commit-message: "[INFRA] Bump bpmn-visualization from ${{ env.OLD_VERSION }} to ${{ env.VERSION }}"
committer: "process-analytics-bot <62586190+process-analytics-bot@users.noreply.github.com>"
author: "process-analytics-bot <62586190+process-analytics-bot@users.noreply.github.com>"
branch: "infra/bump_bpmn_visualization_from_${{ env.OLD_VERSION }}_to_${{ env.VERSION }}"
delete-branch: true
base: "main"
title: "[INFRA] Bump bpmn-visualization JS lib from ${{ env.OLD_VERSION }} to ${{ env.VERSION }}"
title: "[INFRA] Bump bpmn-visualization from ${{ env.OLD_VERSION }} to ${{ env.VERSION }}"
body: "bpmn-visualization is updated from https://cdn.jsdelivr.net/npm/bpmn-visualization@${{ env.VERSION }}/dist/bpmn-visualization.min.js."
labels: "dependencies"
team-reviewers: pa-collaborators
Expand Down
30 changes: 14 additions & 16 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing

You are here to help on `bpmn-visualization-R`? Awesome, feel welcome and read the following guidelines in order to know how to contribute, to ask questions and to make `bpmn-visualization-R` such a great tool.
You are here to help on `bpmnVisualizationR`? Awesome, feel welcome and read the following guidelines in order to know how to contribute, to ask questions and to make `bpmnVisualizationR` such a great tool.

All members of our community are expected to follow our [Code of Conduct](https://github.com/process-analytics/.github/blob/main/CODE_OF_CONDUCT.md). Please make sure you are welcoming and friendly in all of our spaces.

Expand All @@ -11,7 +11,7 @@ There are many ways to contribute:
- help people with the questions they ask on the [GitHub Issues](https://github.com/process-analytics/bpmn-visualization-R/issues)
- submitting bug reports and feature requests in the [GitHub Issues](https://github.com/process-analytics/bpmn-visualization-R/issues/new)
- improving the README & documentation
- writing code which can be incorporated into `bpmn-visualization-R` itself
- writing code which can be incorporated into `bpmnVisualizationR` itself

### Code and documentation changes guidelines

Expand All @@ -34,7 +34,7 @@ For all contributions, please respect the following guidelines:

### Fork & create a branch

[Fork bpmn-visualization-R](https://help.github.com/articles/fork-a-repo) and create a branch with a descriptive name.
[Fork the bpmn-visualization-R repository](https://help.github.com/articles/fork-a-repo) and create a branch with a descriptive name.

A good branch name would be (where issue #25 is the ticket you're working on): **25-customize_overlays**

Expand All @@ -45,34 +45,32 @@ git checkout -b 25-customize_overlays
### Commit in the Pull Request
There is no convention for the commit message in the Pull Request.
The most important part is the title of the Pull Request, because:
- Everyone must use Pull Request, no direct commit allowed on main branch
- The commits of a Pull Request are almost always squashed
- The title of the Pull Request is used as proposal for the maintainer merging the Pull Request
- Everyone must use Pull Request, no direct commit allowed on the `main` branch.
- The commits of a Pull Request are almost always squashed.
- The title of the Pull Request is used as proposal for the maintainer merging the Pull Request.

### Open a Pull Request

At this point, you should switch back to your main branch and make sure it's up-to-date with `bpmn-visualization-R`
`main` branch:
At this point, you should switch back to your own branch and make sure it's up-to-date with the `main` branch of the `bpmn-visualization-R` repository:

```sh
git remote add upstream git@github.com:process-analytics/bpmn-visualization-R.git
git checkout main
git pull upstream main
```

Then update your feature branch from your local copy of main, and push it!
Then update your feature branch from your local copy of the `main` branch, and push it!

```sh
git checkout 25-customize_overlays
git rebase main
git push --set-upstream origin 25-customize_overlays
```

Finally, go to GitHub and [make a Pull Request](https://help.github.com/articles/creating-a-pull-request) with labels :smile:
Finally, go to GitHub and [make a Pull Request](https://help.github.com/articles/creating-a-pull-request) with labels 😄
For the title, follow the directives of the Pull Request template.
Add a screenshot of the rendering of your examples/bpmn-file.

:warning: We care about quality. So your PR won't be merged until all tests pass.
⚠️ We care about quality. So your PR won't be merged until all tests pass.

### Sign the Contributor License Agreement

Expand All @@ -88,7 +86,7 @@ You only need to sign the CLA once or when the CLA terms have changed.

### Keeping your Pull Request updated

If a maintainer asks you to [rebase](http://git-scm.com/book/en/Git-Branching-Rebasing) your PR, they're saying that a lot of code has changed, and that you need to update your branch so it's easier to merge.
If a maintainer asks you to [rebase](http://git-scm.com/book/en/Git-Branching-Rebasing) your PR, they're saying that a lot of code has changed, and that you need to update your branch, so it's easier to merge.

Here's the suggested workflow:

Expand Down Expand Up @@ -129,16 +127,16 @@ pkgdown::build_site(devel = TRUE, lazy = TRUE, preview = FALSE)
```
For more details about the available options, see [the official documentation](https://pkgdown.r-lib.org/reference/build_site.html).

### bpmn-visualization TypeScript library update
### Update of the `bpmn-visualization` TypeScript library

The [bpmn-visualization](https://github.com/process-analytics/bpmn-visualization-js) dependency is automatically updated by the [Update bpmn-visualization version](.github/workflows/update_bpmn_visualization_version.yml) workflow when a new version of this library is released.
The [`bpmn-visualization`](https://github.com/process-analytics/bpmn-visualization-js) dependency is automatically updated by the [Update bpmn-visualization version](.github/workflows/update-bpmn-visualization-version.yml) workflow when a new version of this library is released.

This generates a new Pull Request and notifies the reviewers.

___
⚠️⚠️⚠️ _**Manual procedure - Only if the job does NOT work!**_ ⚠️⚠️⚠️

- Change [bpmn-visualization.min.js](inst/htmlwidgets/lib/bpmn-visualization/bpmn-visualization.min.js). The file can be retrieved from [jsdelivr](https://www.jsdelivr.com/package/npm/bpmn-visualization) or [unpkg](https://unpkg.com/browse/bpmn-visualization/).
- Update the version of `bpmn-visualization` in [bpmnVisualization.yaml](inst/htmlwidgets/bpmnVisualization.yaml)
- Update the version of `bpmn-visualization` TypeScript library in [bpmnVisualizationR.yaml](inst/htmlwidgets/bpmnVisualizationR.yaml)
___

8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
Package: bpmnVisualization
Package: bpmnVisualizationR
Type: Package
Title: Visualize Process Execution Data on BPMN Diagrams
Version: 0.2.2.9000
Authors@R: c(person("Celine", "Souchet", role = c("aut", "cre"), email = "process.analytics.dev+CRAN@gmail.com"),
person("Thomas", "Bouffard", role = "aut"))
Description: To visualize the execution data of the processes on BPMN (Business Process Model and Notation) diagrams, using overlays, style customization and interactions, with BPMN Visualization.
Description: To visualize the execution data of the processes on BPMN (Business Process Model and Notation) diagrams, using overlays, style customization and interactions, with the bpmn-visualization TypeScript library.
License: Apache License (== 2)
Copyright: Bonitasoft S.A.
URL: https://process-analytics.github.io/bpmn-visualization-R/, https://github.com/process-analytics/bpmn-visualization-R
URL: https://process-analytics.github.io/bpmn-visualization-R, https://github.com/process-analytics/bpmn-visualization-R
BugReports: https://github.com/process-analytics/bpmn-visualization-R/issues
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.2.1
RoxygenNote: 7.2.3
Imports:
htmlwidgets,
rlang,
Expand Down
4 changes: 2 additions & 2 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ ___

You can use this template:

> 📣 bpmn-visualization R package {version} is out! 🎉
> 📣 bpmnVisualizationR {version} is out! 🎉
>
> ===> some short description here <===
>
Expand All @@ -146,7 +146,7 @@ Channel: [news](https://discord.com/channels/1011911769607913562/102432915903349

You can use this template:

> 📣 bpmn-visualization R package {version} is out! 🎉
> 📣 bpmnVisualizationR {version} is out! 🎉
>
> ===> some short description here <===
>
Expand Down
4 changes: 2 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Generated by roxygen2: do not edit by hand

export(bpmnVisualizationOutput)
export(bpmnVisualizationROutput)
export(create_overlay)
export(display)
export(renderBpmnVisualization)
export(renderBpmnVisualizationR)
import(htmlwidgets)
import(xml2)
File renamed without changes.
46 changes: 23 additions & 23 deletions R/bpmnVisualization.R → R/bpmnVisualizationR.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,23 @@
#' generated one). Useful if you have other JavaScript that needs to explicitly
#' discover and interact with a specific widget instance.
#'
#' @returns A \code{bpmn-visualization} Widget that will intelligently print itself into HTML in a variety of contexts
#' @returns A \code{bpmnVisualizationR} Widget that will intelligently print itself into HTML in a variety of contexts
#' including the R console, within R Markdown documents, and within Shiny output bindings.
#'
#' @examples
#' # Load the BPMN file
#' bpmn_file <- system.file("examples/Order_Management.bpmn", package = "bpmnVisualization")
#' bpmn_file <- system.file("examples/Order_Management.bpmn", package = "bpmnVisualizationR")
#'
#' # Display the BPMN diagram
#' bpmnVisualization::display(bpmn_file, width='auto', height='auto')
#' bpmnVisualizationR::display(bpmn_file, width='auto', height='auto')
#'
#' # Display the BPMN diagram with overlays
#' overlays <- list(
#' create_overlay("start_event_1_1", "42"),
#' create_overlay("sequence_flow_1_1", "42"),
#' create_overlay("task_1_1", "9")
#' bpmnVisualizationR::create_overlay("start_event_1_1", "42"),
#' bpmnVisualizationR::create_overlay("sequence_flow_1_1", "42"),
#' bpmnVisualizationR::create_overlay("task_1_1", "9")
#' )
#' bpmnVisualization::display(bpmn_file, overlays, width='auto', height='auto')
#' bpmnVisualizationR::display(bpmn_file, overlays, width='auto', height='auto')
#'
#' @seealso \code{\link{create_overlay}} to create an overlay
#'
Expand All @@ -64,58 +64,58 @@ display <- function(
)
# create widget
htmlwidgets::createWidget(
name = "bpmnVisualization",
name = "bpmnVisualizationR",
x,
width = width,
height = height,
package = "bpmnVisualization",
package = "bpmnVisualizationR",
elementId = elementId
)
}

#' @title Shiny output binding for the \code{bpmn-visualization} HTML widget
#' @title Shiny output binding for the \code{bpmnVisualizationR} HTML widget
#'
#' @name bpmnVisualization-shiny-output
#' @name bpmnVisualizationR-shiny-output
#' @description
#' Helper to create output function for using the \code{bpmn-visualization} HTML widget within Shiny applications and interactive Rmd documents.
#' Helper to create output function for using the \code{bpmnVisualizationR} HTML widget within Shiny applications and interactive Rmd documents.
#'
#' @param outputId output variable to read from
#' @param width,height Must be a valid CSS unit (like \code{'100\%'},
#' \code{'400px'}, \code{'auto'}) or a number, which will be coerced to a
#' string and have \code{'px'} appended.
#'
#' @returns An output function that enables the use of the \code{bpmn-visualization} widget within Shiny applications.
#' @returns An output function that enables the use of the \code{bpmnVisualizationR} widget within Shiny applications.
#'
#' @export
bpmnVisualizationOutput <- function(
bpmnVisualizationROutput <- function(
outputId,
width = "100%",
height = "400px"
) {
htmlwidgets::shinyWidgetOutput(
outputId,
"bpmnVisualization",
"bpmnVisualizationR",
width,
height,
package = "bpmnVisualization"
package = "bpmnVisualizationR"
)
}

#' @title Shiny render binding for the \code{bpmn-visualization} HTML widget
#' @title Shiny render binding for the \code{bpmnVisualizationR} HTML widget
#'
#' @rdname bpmnVisualization-shiny-render
#' @rdname bpmnVisualizationR-shiny-render
#' @description
#' Helper to create render function for using the \code{bpmn-visualization} HTML widget within Shiny applications and interactive Rmd documents.
#' Helper to create render function for using the \code{bpmnVisualizationR} HTML widget within Shiny applications and interactive Rmd documents.
#'
#' @param expr An expression that generates a \code{bpmn-visualization} HTML widget
#' @param expr An expression that generates a \code{bpmnVisualizationR} HTML widget
#' @param env The environment in which to evaluate \code{expr}.
#' @param quoted Is \code{expr} a quoted expression (with \code{quote()})? This
#' is useful if you want to save an expression in a variable.
#'
#' @returns A render function that enables the use of the \code{bpmn-visualization} widget within Shiny applications.
#' @returns A render function that enables the use of the \code{bpmnVisualizationR} widget within Shiny applications.
#'
#' @export
renderBpmnVisualization <- function(
renderBpmnVisualizationR <- function(
expr,
env = parent.frame(),
quoted = FALSE
Expand All @@ -127,7 +127,7 @@ renderBpmnVisualization <- function(
} # force quoted
htmlwidgets::shinyRenderWidget(
expr,
bpmnVisualizationOutput,
bpmnVisualizationROutput,
env,
quoted = TRUE
)
Expand Down
Loading