Skip to content

Commit

Permalink
Merge branch 'main' into feat/automatically-enable-datatables
Browse files Browse the repository at this point in the history
  • Loading branch information
miya authored Jun 25, 2024
2 parents 5d75d20 + 7125380 commit 55080c6
Show file tree
Hide file tree
Showing 20 changed files with 569 additions and 92 deletions.
3 changes: 3 additions & 0 deletions .github/git-pr-release-template.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<%= ENV['GIT_PR_RELEASE_TITLE'] %>
<%= ENV['GIT_PR_RELEASE_BODY'] %>
61 changes: 61 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
prerelease: true

# Filter previous releases to consider target_commitish
include-pre-releases: true
filter-by-commitish: true

categories:
- title: 'BREAKING CHANGES'
labels:
- 'type/breaking'
- title: '💎 Features'
labels:
- 'type/feature'
- title: '🚀 Improvement'
labels:
- 'type/improvement'
- title: '🐛 Bug Fixes'
labels:
- 'type/bug'
- title: '🧰 Maintenance'
labels:
- 'type/support'
- 'type/dependencies'
category-template: '### $TITLE'
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
autolabeler:
- label: 'type/feature'
branch:
- '/^feat\/.+/'
title:
- '/^feat/i'
- label: 'type/improvement'
branch:
- '/^imprv\/.+/'
title:
- '/^imprv/i'
- label: 'type/bug'
branch:
- '/^fix\/.+/'
title:
- '/^fix/i'
- label: 'type/support'
branch:
- '/^support\/.+/'
title:
- '/^support/i'
- '/^chore/i'
- '/^ci/i'
- '/^docs/i'
- '/^test/i'
include-labels:
- type/breaking
- type/feature
- type/improvement
- type/bug
- type/support
- type/dependencies
exclude-labels:
- 'flag/exclude-from-changelog'
template: |
$CHANGES
38 changes: 38 additions & 0 deletions .github/workflows/pr_check_title.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Pull Request - Check title

on:
pull_request:
branches:
- main
- dev/*.*.*
# Only following types are handled by the action, but one can default to all as well
types: [opened, reopened, edited, synchronize]

jobs:
check-title:
runs-on: ubuntu-latest

# Ignore these cases
# - Out of changelog target
# - Created by "dependabot", "github-actions"
if: >
(
!contains( github.event.pull_request.labels.*.name, 'flag/exclude-from-changelog' )
&& !startsWith( github.head_ref, 'dependabot/' )
&& !contains( github.actor, 'github-actions' )
)
steps:
- uses: amannn/action-semantic-pull-request@v5.4.0
with:
types: |
feat
imprv
fix
support
chore
ci
docs
test
requireScope: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26 changes: 26 additions & 0 deletions .github/workflows/pr_labelling.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Pull Request - Labelling

permissions:
pull-requests: write
on:
pull_request:
branches:
- main
- dev/*.*.*
# Only following types are handled by the action, but one can default to all as well
types: [opened, reopened, edited, synchronize]

jobs:
# Refs: https://github.com/release-drafter/release-drafter
labeling:
runs-on: ubuntu-latest

if: >
!contains( github.event.pull_request.labels.*.name, 'flag/exclude-from-changelog' )
steps:
- uses: release-drafter/release-drafter@v5
with:
disable-releaser: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
95 changes: 95 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: Release

permissions:
pull-requests: write
contents: write
on:
pull_request:
branches:
- release/current
- release/*.*.*
types: [closed]

jobs:
release:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
outputs:
RELEASED_VERSION: ${{ steps.package-json.outputs.packageVersion }}

steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.ref }}
- uses: actions/setup-node@v4
with:
node-version: '20'

- name: Bump version (ex. from "v1.0.0-RC.0" to "v1.0.0")
run: yarn version --no-git-tag-version --preid=RC --patch

- name: Retrieve information from package.json
uses: myrotvorets/info-from-package-json-action@2.0.0
id: package-json

- name: Update CHANGELOG.md
uses: stefanzweifel/changelog-updater-action@v1
with:
latest-version: v${{ steps.package-json.outputs.packageVersion }}
release-notes: ${{ github.event.pull_request.body }}

- name: 'Git commit, tagging and push (commit message: "Release v1.0.0", tag name: "v1.0.0")'
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: ${{ github.event.pull_request.base.ref }}
commit_message: Release v${{ steps.package-json.outputs.packageVersion }}
tagging_message: v${{ steps.package-json.outputs.packageVersion }}

- name: Publish GitHub Release
uses: softprops/action-gh-release@v1
with:
body: ${{ github.event.pull_request.body }}
tag_name: v${{ steps.package-json.outputs.packageVersion }}
target_commitish: ${{ github.head_ref }}

- name: Delete GitHub draft Releases
uses: hugo19941994/delete-draft-releases@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

create-pr-for-next-rc:
needs: release
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
ref: v${{ needs.release.outputs.RELEASED_VERSION }}
- uses: actions/setup-node@v4
with:
node-version: '20'

- name: Bump version for next RC (ex. from "v1.0.0" to "v1.0.1-RC.0")
run: yarn version --no-git-tag-version --preid=RC --prepatch

- name: Retrieve information from package.json
uses: myrotvorets/info-from-package-json-action@1.2.0
id: package-json

- name: Git commit
uses: github-actions-x/commit@v2.9
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
push-branch: support/prepare-v${{ steps.package-json.outputs.packageVersion }}
commit-message: 'Bump version'
name: GitHub Action

- name: Create PR
uses: repo-sync/pull-request@v2
with:
source_branch: support/prepare-v${{ steps.package-json.outputs.packageVersion }}
destination_branch: ${{ github.head_ref }}
pr_title: Prepare v${{ steps.package-json.outputs.packageVersion }}
pr_label: flag/exclude-from-changelog,type/prepare-next-version
pr_body: '[skip ci] An automated PR generated by create-pr-for-next-rc'
github_token: ${{ secrets.GITHUB_TOKEN }}
77 changes: 77 additions & 0 deletions .github/workflows/update_draft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Update draft

permissions:
pull-requests: write
contents: write
on:
push:
branches:
- main
- dev/*.*.*
concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
# Refs: https://github.com/release-drafter/release-drafter
update-release-draft:
runs-on: ubuntu-latest

outputs:
CURRENT_VERSION: ${{ steps.package-json.outputs.packageVersion }}
RELEASE_DRAFT_BODY: ${{ steps.release-drafter.outputs.body }}

steps:
- uses: actions/checkout@v4

- name: Retrieve information from package.json
uses: myrotvorets/info-from-package-json-action@2.0.0
id: package-json

# Drafts your next Release notes as Pull Requests are merged into "main"
- uses: release-drafter/release-drafter@v5
id: release-drafter
with:
name: v${{ steps.package-json.outputs.packageVersion }}
tag: v${{ steps.package-json.outputs.packageVersion }}
version: ${{ steps.package-json.outputs.packageVersion }}
disable-autolabeler: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Refs: https://github.com/bakunyo/git-pr-release-action
update-release-pr:
needs: update-release-draft

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get release version
id: release-version
run: |
RELEASE_VERSION=`npx semver -i patch ${{ needs.update-release-draft.outputs.CURRENT_VERSION }}`
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_OUTPUT
- name: Get base branch
id: base-branch
run: |
GITHUB_REF_NAME=${{ github.ref_name }}
WILDCARD_VERSION=${GITHUB_REF_NAME#dev/}
# set "release/current" or "release/X.X.x" to BASE_BRANCH
BASE_BRANCH=release/${{ github.ref_name == 'main' && 'current' || '$WILDCARD_VERSION' }}
echo "BASE_BRANCH=$BASE_BRANCH" >> $GITHUB_OUTPUT
- name: Create/Update Pull Request
uses: bakunyo/git-pr-release-action@master
with:
# Overwrite everything so that the old content does not remain in the release notes, if the label attached to the PR changes
args: --overwrite-description
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GIT_PR_RELEASE_BRANCH_PRODUCTION: ${{ steps.base-branch.outputs.BASE_BRANCH }}
GIT_PR_RELEASE_BRANCH_STAGING: ${{ github.ref_name }}
GIT_PR_RELEASE_TEMPLATE: .github/git-pr-release-template.erb
GIT_PR_RELEASE_TITLE: Release v${{ steps.release-version.outputs.RELEASE_VERSION }}
GIT_PR_RELEASE_BODY: ${{ needs.update-release-draft.outputs.RELEASE_DRAFT_BODY }}
37 changes: 37 additions & 0 deletions .mergify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
shared:
required_actions_were_succeeded_or_skipped: &required_actions_were_succeeded_or_skipped
- or:
- check-success = check_artifacts_are_latest
- check-skipped = check_artifacts_are_latest
- or:
- check-skipped = lint
- check-success = lint
- or:
- check-skipped = build
- check-success = build
- or:
- check-skipped = check-title
- check-success = check-title
- or:
- check-skipped = labeling
- check-success = labeling

pull_request_rules:
- name: All required actions were succeeded or skipped
conditions:
- and: *required_actions_were_succeeded_or_skipped
actions:
post_check:
title: required-actions-were-succeeded-or-skipped
success_conditions:
- and: *required_actions_were_succeeded_or_skipped
- name: Automatic merge for Preparing next version
conditions:
- author = github-actions[bot]
- label = "type/prepare-next-version"
actions:
review:
type: APPROVE
message: Automatically approving github-actions[bot]
merge:
method: merge
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Changelog

## v1.0.0 - 2024-02-17

### 💎 Features

* feat: Add a button to adapt `DataTable` that extends some functionality to a table (#15) @ryu-sato
* feat: Add new CalcMethod using Math.js (#7) @miya
* feat: Implementation of {hsum} and {havg} calc methods (#4) @miya
* feat: Replace {sum} and {avg} with the results of each calculation (#3) @miya

### 🐛 Bug Fixes

* fix: Moves to the bottom when activated if there are culumns with only number (#11) @ryu-sato

## Unreleased

*Please do not manually update this file. We've automated the process.*
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,19 @@ DataTable is extended by following features.
- Numerical values are in natural order
- ex. "2.4m", "4.5m", "10.9m", ... (Ascending)
- Scrolling vertically (Max table height: 500px)
- Extension buttons
- "Column visibility" button: Toggle column visibility
- "SearchPanels" button: Filter rows for each column (by search value, by select value)
- "Copy" button: Copy the table
- "CSV" button: Download the table in CSV format
- "Print" button: Print the table

### before adapt

![image](https://github.com/weseek/growi-plugin-datatables/assets/32702772/1d045990-11e2-4d32-af79-9bb09b1775e3)
![image](https://github.com/weseek/growi-plugin-datatables/assets/32702772/fed3b66b-6b1b-4dd3-9d2b-43693255eb49)

### after adapt and search with "carnivore" and sort by "Name"
### after adapt and filter with "carnivore" and sort by "Name"

![image](https://github.com/weseek/growi-plugin-datatables/assets/32702772/b6e43820-66f8-41b9-8f68-21e86c3262e7)
![image](https://github.com/weseek/growi-plugin-datatables/assets/32702772/5491e0af-0150-4189-947e-e3c2acf85293)

![image](https://github.com/weseek/growi-plugin-datatables/assets/32702772/7e6512b0-9fcd-4c08-94fb-072d35a2f492)
88 changes: 88 additions & 0 deletions dist/assets/client-entry.13796303.js

Large diffs are not rendered by default.

Loading

0 comments on commit 55080c6

Please sign in to comment.