From a6cbff8ff6329548ca4ab41427c76fee24bed79e Mon Sep 17 00:00:00 2001 From: Reckless_Satoshi Date: Thu, 29 Sep 2022 05:49:01 -0700 Subject: [PATCH] Prepare for 0.2.1 patch release --- .github/workflows/android-build.yml | 11 ++- .github/workflows/client-image.yml | 18 +++-- .github/workflows/coordinator-image.yml | 22 +++-- .github/workflows/frontend-build.yml | 4 +- .github/workflows/release.yml | 16 ++-- frontend/package.json | 2 +- frontend/src/components/BookTable.tsx | 103 ++++++++++++------------ version.json | 2 +- 8 files changed, 104 insertions(+), 74 deletions(-) diff --git a/.github/workflows/android-build.yml b/.github/workflows/android-build.yml index 9018b4ce..185751fd 100644 --- a/.github/workflows/android-build.yml +++ b/.github/workflows/android-build.yml @@ -21,6 +21,7 @@ jobs: uses: actions/checkout@v3 - name: 'Download main.js Artifact' + if: inputs.semver == '' # Only if workflow fired from frontend-build.yml uses: dawidd6/action-download-artifact@v2 with: workflow: frontend-build.yml @@ -28,6 +29,13 @@ jobs: name: mobile-main-js path: mobile/html/Web.bundle/js/ + - name: 'Download main.js Artifact for a release' + if: inputs.semver != '' # Only if fired as job in release.yml + uses: actions/download-artifact@v3 + with: + name: mobile-main-js + path: mobile/html/Web.bundle/js/ + - name: 'Install npm Dependencies' run: | cd mobile @@ -71,8 +79,8 @@ jobs: path: mobile/android/app/build/outputs/apk/release/app-release.apk - name: 'Upload .apk Debug Artifact (for Pre-release)' + if: inputs.semver == '' # Only build debug if this is a pre-release uses: actions/upload-artifact@v3 - if: inputs.semver != '' # only if this workflow is not called from a push to tag (a Release) with: name: robosats-debug-${{ steps.commit.outputs.short }}.apk path: mobile/android/app/build/outputs/apk/debug/app-debug.apk @@ -86,6 +94,7 @@ jobs: with: tag_name: android-${{ steps.commit.outputs.short }} release_name: robosats-android-${{ steps.commit.outputs.short }} + changelog: mobile/CHANGELOG.md draft: false prerelease: true diff --git a/.github/workflows/client-image.yml b/.github/workflows/client-image.yml index 0847d79b..4093a95a 100644 --- a/.github/workflows/client-image.yml +++ b/.github/workflows/client-image.yml @@ -3,6 +3,10 @@ name: Client App Image CI/CD on: workflow_dispatch: workflow_call: + inputs: + semver: + required: true + type: string push: branches: [ "main" ] paths: ["frontend", "nodeapp"] @@ -10,10 +14,6 @@ on: branches: [ "main" ] paths: ["frontend", "nodeapp"] -# concurrency: -# group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' -# cancel-in-progress: true - jobs: push_to_registry: name: 'Push Docker image to Docker Hub' @@ -27,12 +27,20 @@ jobs: cp -r frontend/static nodeapp/static - name: 'Download main.js Artifact' + if: inputs.semver == '' # Only if workflow fired from frontend-build.yml uses: dawidd6/action-download-artifact@v2 with: workflow: frontend-build.yml workflow_conclusion: success name: web-main-js path: nodeapp/static/frontend/ + + - name: 'Download main.js Artifact for a release' + if: inputs.semver != '' # Only if fired as job in release.yml + uses: actions/download-artifact@v3 + with: + name: web-main-js + path: nodeapp/static/frontend/ - name: 'Log in to Docker Hub' uses: docker/login-action@v2 @@ -50,7 +58,7 @@ jobs: type=ref,event=tag type=semver,pattern={{major}}.{{minor}} type=sha,enable=true,priority=100,prefix=,suffix=,format=short - type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }} + type=raw,value=latest - name: 'Get Commit Hash' id: commit diff --git a/.github/workflows/coordinator-image.yml b/.github/workflows/coordinator-image.yml index 74b4c304..85aa275d 100644 --- a/.github/workflows/coordinator-image.yml +++ b/.github/workflows/coordinator-image.yml @@ -3,10 +3,10 @@ name: Coodinator Image CI on: workflow_dispatch: workflow_call: - -# concurrency: -# group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' -# cancel-in-progress: true + inputs: + semver: + required: true + type: string jobs: push_to_registry: @@ -16,13 +16,21 @@ jobs: - uses: actions/checkout@v3 - name: 'Download main.js Artifact' + if: inputs.semver == '' # Only if workflow fired from frontend-build.yml uses: dawidd6/action-download-artifact@v2 with: workflow: frontend-build.yml workflow_conclusion: success name: web-main-js - path: frontend/static/frontend/ - + path: nodeapp/static/frontend/ + + - name: 'Download main.js Artifact for a release' + if: inputs.semver != '' # Only if fired as job in release.yml + uses: actions/download-artifact@v3 + with: + name: web-main-js + path: nodeapp/static/frontend/ + - name: 'Log in to Docker Hub' uses: docker/login-action@v2 with: @@ -39,7 +47,7 @@ jobs: type=ref,event=tag type=semver,pattern={{major}}.{{minor}} type=sha,enable=true,priority=100,prefix=,suffix=,format=short - type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }} + type=raw,value=latest - name: 'Get Commit Hash' id: commit diff --git a/.github/workflows/frontend-build.yml b/.github/workflows/frontend-build.yml index c3e45a8c..e128b344 100644 --- a/.github/workflows/frontend-build.yml +++ b/.github/workflows/frontend-build.yml @@ -48,12 +48,12 @@ jobs: run: | cd frontend npm run build - - name: 'Archive Built Results' + - name: 'Archive Web Built Results' uses: actions/upload-artifact@v3 with: name: web-main-js path: frontend/static/frontend/main.js - - name: 'Archive Built Results' + - name: 'Archive Mobile Built Results' uses: actions/upload-artifact@v3 with: name: mobile-main-js diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b63cb0af..e5b32fc9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -49,20 +49,24 @@ jobs: uses: reckless-satoshi/robosats/.github/workflows/coordinator-image.yml@main needs: [django-test, frontend-build] secrets: inherit + with: + semver: ${{ needs.check-versions.outputs.semver }} client-image: uses: reckless-satoshi/robosats/.github/workflows/client-image.yml@main needs: frontend-build secrets: inherit + with: + semver: ${{ needs.check-versions.outputs.semver }} android-build: - uses: reckless-satoshi/robosats/.github/workflows/coordinator-image.yml@main - needs: frontend-build + uses: reckless-satoshi/robosats/.github/workflows/android-build.yml@main + needs: [frontend-build, check-versions] with: semver: ${{ needs.check-versions.outputs.semver }} release: - needs: [check-versions, coordinator-image, client-image] #, android-build] + needs: [check-versions, coordinator-image, client-image, android-build] runs-on: ubuntu-latest steps: - name: Checkout @@ -78,12 +82,10 @@ jobs: with: body: ${{ steps.changelog.outputs.changelog }} - # Upload APK artifact + # Upload APK artifact asset - name: 'Download APK Artifact' - uses: dawidd6/action-download-artifact@v2 + uses: actions/download-artifact@v3 with: - workflow: android-build.yml - workflow_conclusion: success name: robosats-${{ needs.check-versions.outputs.semver }}.apk path: . - name: 'Upload APK Asset' diff --git a/frontend/package.json b/frontend/package.json index 4bf7f33c..e83065d4 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "frontend", - "version": "0.2.0", + "version": "0.2.1", "description": "", "main": "index.js", "scripts": { diff --git a/frontend/src/components/BookTable.tsx b/frontend/src/components/BookTable.tsx index fb17aff5..60cd90e7 100644 --- a/frontend/src/components/BookTable.tsx +++ b/frontend/src/components/BookTable.tsx @@ -64,7 +64,9 @@ const BookTable = ({ const verticalHeightFrame = 6.9075; const verticalHeightRow = 3.25; const defaultPageSize = Math.max( - Math.floor(((fullscreen? fullHeight *0.875:maxHeight) - verticalHeightFrame) / verticalHeightRow), + Math.floor( + ((fullscreen ? fullHeight * 0.875 : maxHeight) - verticalHeightFrame) / verticalHeightRow, + ), 1, ); const height = defaultPageSize * verticalHeightRow + verticalHeightFrame; @@ -577,7 +579,7 @@ const BookTable = ({ return [columns, width * 0.875 + 0.15]; }; - const [columns, width] = filteredColumns(fullscreen? fullWidth : maxWidth); + const [columns, width] = filteredColumns(fullscreen ? fullWidth : maxWidth); const gridComponents = { NoResultsOverlay: () => ( @@ -586,65 +588,66 @@ const BookTable = ({ ), Footer: () => ( - + - setFullscreen(!fullscreen)}> - {fullscreen ? : } - + setFullscreen(!fullscreen)}> + {fullscreen ? : } + - + ), - } + }; - if (!fullscreen){ - return( + if (!fullscreen) { + return ( - (order.type == type || type == null) && (order.currency == currency || currency == 0), - )} - loading={loading} - columns={columns} - components={gridComponents} - pageSize={loading ? 0 : pageSize} - rowsPerPageOptions={[0, pageSize, defaultPageSize * 2, 50, 100]} - onPageSizeChange={(newPageSize) => { - setPageSize(newPageSize); - setUseDefaultPageSize(false); - }} - onRowClick={(params) => history.push('/order/' + params.row.id)} // Whole row is clickable, but the mouse only looks clickly in some places. - /> + localeText={localeText} + rows={orders.filter( + (order) => + (order.type == type || type == null) && (order.currency == currency || currency == 0), + )} + loading={loading} + columns={columns} + components={gridComponents} + pageSize={loading ? 0 : pageSize} + rowsPerPageOptions={[0, pageSize, defaultPageSize * 2, 50, 100]} + onPageSizeChange={(newPageSize) => { + setPageSize(newPageSize); + setUseDefaultPageSize(false); + }} + onRowClick={(params) => history.push('/order/' + params.row.id)} // Whole row is clickable, but the mouse only looks clickly in some places. + /> - ) + ); } else { - return( - - - - (order.type == type || type == null) && (order.currency == currency || currency == 0), - )} - loading={loading} - columns={columns} - components={gridComponents} - pageSize={loading ? 0 : pageSize} - rowsPerPageOptions={[0, pageSize, defaultPageSize * 2, 50, 100]} - onPageSizeChange={(newPageSize) => { - setPageSize(newPageSize); - setUseDefaultPageSize(false); - }} - onRowClick={(params) => history.push('/order/' + params.row.id)} // Whole row is clickable, but the mouse only looks clickly in some places. - /> - - - ) + return ( + + + + (order.type == type || type == null) && + (order.currency == currency || currency == 0), + )} + loading={loading} + columns={columns} + components={gridComponents} + pageSize={loading ? 0 : pageSize} + rowsPerPageOptions={[0, pageSize, defaultPageSize * 2, 50, 100]} + onPageSizeChange={(newPageSize) => { + setPageSize(newPageSize); + setUseDefaultPageSize(false); + }} + onRowClick={(params) => history.push('/order/' + params.row.id)} // Whole row is clickable, but the mouse only looks clickly in some places. + /> + + + ); } }; diff --git a/version.json b/version.json index 9bbfcfef..0c92b299 100644 --- a/version.json +++ b/version.json @@ -1,5 +1,5 @@ { "major":0, "minor":2, - "patch":0 + "patch":1 } \ No newline at end of file