Skip to content

Commit

Permalink
Merge branch 'master' into fix/DHIS2-14030-dropdown-width
Browse files Browse the repository at this point in the history
  • Loading branch information
martinkrulltott authored Sep 28, 2023
2 parents 38d11ff + 7f0fee4 commit f087a73
Show file tree
Hide file tree
Showing 5 changed files with 544 additions and 466 deletions.
61 changes: 59 additions & 2 deletions .github/workflows/dhis2-verify-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,70 @@ jobs:
if: |
failure() &&
!cancelled() &&
github.ref == 'refs/heads/master'
github.ref == 'refs/heads/master' &&
contains(github.event.head_commit.message, 'chore(release)')
steps:
- name: Checkout code
uses: actions/checkout@master

- name: Extract version
id: extract_version
uses: Saionaro/[email protected]

- name: Send failure message to analytics-internal-bot slack channel
id: slack
uses: slackapi/[email protected]
with:
channel-id: ${{ secrets.SLACK_CHANNEL_ID }}
slack-message: ':small_red_triangle_down: Line-listing-app release <https://github.com/dhis2/line-listing-app/actions/workflows/dhis2-verify-app.yml?query=branch%3Amaster+is%3Afailure>'
payload: |
{
"text": ":small_red_triangle_down: :line-listing-app: Line Listing release <https://github.com/dhis2/line-listing-app/actions/workflows/dhis2-verify-app.yml?query=branch%3Amaster+is%3Afailure|failed>",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":small_red_triangle_down: :line-listing-app: Line Listing release <https://github.com/dhis2/line-listing-app/actions/workflows/dhis2-verify-app.yml?query=branch%3Amaster+is%3Afailure|failed>"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

report-release-success:
runs-on: ubuntu-latest
needs: release
if: |
success() &&
!cancelled() &&
github.ref == 'refs/heads/master' &&
contains(github.event.head_commit.message, 'chore(release)')
steps:
- name: Checkout code
uses: actions/checkout@master

- name: Extract version
id: extract_version
uses: Saionaro/[email protected]

- name: Send success message to analytics-internal-bot slack channel
id: slack
uses: slackapi/[email protected]
with:
channel-id: ${{ secrets.SLACK_CHANNEL_ID }}
payload: |
{
"text": ":large_green_circle: :line-listing-app: :tada: Line Listing release succeeded for version: ${{ steps.extract_version.outputs.version }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":large_green_circle: :line-listing-app: :tada: Line Listing version ${{ steps.extract_version.outputs.version }} released <https://github.com/dhis2/line-listing-app/actions/workflows/dhis2-verify-app.yml?query=branch%3Amaster+is%3Asuccess|successfully>"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [100.9.2](https://github.com/dhis2/line-listing-app/compare/v100.9.1...v100.9.2) (2023-09-15)


### Bug Fixes

* always have the full pagination in view ([#431](https://github.com/dhis2/line-listing-app/issues/431)) ([05d3d79](https://github.com/dhis2/line-listing-app/commit/05d3d7921577a3a8d357c3e28aaf4ca0f952525e))

## [100.9.1](https://github.com/dhis2/line-listing-app/compare/v100.9.0...v100.9.1) (2023-08-21)


Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "line-listing-app",
"version": "100.9.1",
"version": "100.9.2",
"description": "DHIS2 Line Listing",
"license": "BSD-3-Clause",
"private": true,
Expand All @@ -24,7 +24,7 @@
"@dhis2/cypress-plugins": "^10.0.2",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^12.1.4",
"cypress": "^12.13.0",
"cypress": "^13.2.0",
"cypress-tags": "^1.1.2",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.6",
Expand All @@ -38,7 +38,7 @@
"dependencies": {
"@dhis2/analytics": "^26.0.7",
"@dhis2/app-runtime": "^3.4.4",
"@dhis2/ui": "^8.13.13",
"@dhis2/ui": "^8.14.5",
"@dnd-kit/core": "^5.0.3",
"@dnd-kit/sortable": "^6.0.1",
"@dnd-kit/utilities": "^3.2.0",
Expand Down
19 changes: 16 additions & 3 deletions src/components/Visualization/Visualization.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ import {
export const DEFAULT_SORT_DIRECTION = 'asc'
export const FIRST_PAGE = 1
export const PAGE_SIZE = 100
// +/- min width of "Rows per page" select + 2 * padding
// + 30% in case label text are longer than English
export const PAGINATION_MIN_WIDTH = 250

const getFontSizeClass = (fontSize) => {
switch (fontSize) {
Expand Down Expand Up @@ -125,16 +128,23 @@ export const Visualization = ({
const visualizationRef = useRef(visualization)

const containerCallbackRef = useCallback((node) => {
if (node === null || node.clientWidth === 0) {
if (node === null) {
return
}

const adjustSize = () => {
if (node.clientWidth === 0) {
return
}
const containerInnerWidth = node.clientWidth
const scrollBox = node.querySelector('.tablescrollbox')
const scrollbarWidth = scrollBox.offsetWidth - scrollBox.clientWidth
const maxWidth = Math.max(
containerInnerWidth - scrollbarWidth,
PAGINATION_MIN_WIDTH
)

setPaginationMaxWidth(containerInnerWidth - scrollbarWidth)
setPaginationMaxWidth(maxWidth)
}

const sizeObserver = new window.ResizeObserver(adjustSize)
Expand Down Expand Up @@ -435,7 +445,10 @@ export const Visualization = ({
styles.stickyNavigation,
sizeClass
)}
style={{ maxWidth: paginationMaxWidth }}
style={{
maxWidth: paginationMaxWidth,
minWidth: PAGINATION_MIN_WIDTH,
}}
>
<PaginationComponent
offline={offline}
Expand Down
Loading

0 comments on commit f087a73

Please sign in to comment.