Skip to content

Commit

Permalink
Merge branch 'main' into NDT-207-Upgrade-to-Node-20-LTS
Browse files Browse the repository at this point in the history
  • Loading branch information
RRanath authored Aug 14, 2024
2 parents ad7268a + 9d06acb commit 909f109
Show file tree
Hide file tree
Showing 9 changed files with 576 additions and 523 deletions.
2 changes: 1 addition & 1 deletion .bin/install-gitleaks-linux-x64.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -xeuo pipefail;

version="8.16.0";
version="8.18.4";
releases_api="https://api.github.com/repositories/119190187/releases/tags/v${version}";
releases_json="$(curl -s ${releases_api})";

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # tag=v3.25.15
uses: github/codeql-action/upload-sarif@429e1977040da7a23b6822b13c129cd1ba93dbb2 # tag=v3.26.2
with:
sarif_file: results.sarif
10 changes: 5 additions & 5 deletions .github/workflows/test-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
ignore-unfixed: false
severity: UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a
uses: github/codeql-action/upload-sarif@429e1977040da7a23b6822b13c129cd1ba93dbb2
with:
sarif_file: 'trivy-results.sarif'

Expand All @@ -61,13 +61,13 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a
uses: github/codeql-action/init@429e1977040da7a23b6822b13c129cd1ba93dbb2
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a
uses: github/codeql-action/autobuild@429e1977040da7a23b6822b13c129cd1ba93dbb2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a
uses: github/codeql-action/analyze@429e1977040da7a23b6822b13c129cd1ba93dbb2

cocogitto:
runs-on: ubuntu-latest
Expand All @@ -92,7 +92,7 @@ jobs:
- uses: actions/checkout@v4
- run: ./.bin/install-gitleaks-linux-x64.sh
- run: ./gitleaks detect --exit-code 0 --report-format sarif --report-path "gitleaks.sarif"
- uses: github/codeql-action/upload-sarif@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a
- uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'gitleaks.sarif'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-code.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
fs.writeFileSync('results.sarif', JSON.stringify(sarifJson, null, 2));
EOF
working-directory: ./app
- uses: github/codeql-action/upload-sarif@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a
- uses: github/codeql-action/upload-sarif@429e1977040da7a23b6822b13c129cd1ba93dbb2
with:
sarif_file: app/results.sarif

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test-containers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
severity: CRITICAL
timeout: 10m0s
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a
uses: github/codeql-action/upload-sarif@429e1977040da7a23b6822b13c129cd1ba93dbb2
with:
sarif_file: 'trivy-results.sarif'
- name: Get Results Length From Sarif
Expand All @@ -64,7 +64,7 @@ jobs:
severity: CRITICAL
timeout: 10m0s
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a
uses: github/codeql-action/upload-sarif@429e1977040da7a23b6822b13c129cd1ba93dbb2
with:
sarif_file: 'trivy-results.sarif'
- name: Get Results Length From Sarif
Expand All @@ -81,7 +81,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Self-hosted Renovate
uses: renovatebot/github-action@v40.2.5
uses: renovatebot/github-action@v40.2.6
with:
configurationFile: ./.github/renovate.json
token: ${{ secrets.RENOVATE_GITHUB_TOKEN }}
69 changes: 21 additions & 48 deletions app/components/Table/Pagination.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import React from 'react';
import PaginationUnstyled from '@mui/base/TablePaginationUnstyled';
import { Dropdown, Button } from '@button-inc/bcgov-theme';
import styled from 'styled-components';
import { IconButtonProps, TablePagination } from '@mui/material';

interface Props {
/**
Expand All @@ -25,51 +23,14 @@ export const DEFAULT_PAGE_SIZE = 20;

const PAGE_SIZE_OPTIONS = [20, 50, 100];

const paginationComponents = {
select: Dropdown,
toolbar: styled.div`
display: flex;
font-size: 0.8rem;
justify-content: flex-end;
align-items: baseline;
& > * {
margin-right: 0.5rem;
}
`,
};

const actionButtonProps = {
variant: 'secondary',
const actionButtonProps: IconButtonProps = {
size: 'small',
style: {
padding: '0.33rem 0.50rem',
marginRight: '0.2rem',
},
};

const paginationComponentsProps = {
actions: {
components: {
FirstButton: Button,
LastButton: Button,
NextButton: Button,
BackButton: Button,
},
componentsProps: {
firstButton: actionButtonProps,
lastButton: actionButtonProps,
nextButton: actionButtonProps,
backButton: actionButtonProps,
},
showFirstButton: true,
showLastButton: true,
},
select: {
size: 'small',
style: { width: '3.5rem' },
},
};

const FilterableTablePagination: React.FunctionComponent<Props> = ({
totalCount,
pageSize = DEFAULT_PAGE_SIZE,
Expand All @@ -96,17 +57,29 @@ const FilterableTablePagination: React.FunctionComponent<Props> = ({
aria-disabled={disabled}
className={disabled ? 'disabled' : ''}
>
<PaginationUnstyled
component="div"
<TablePagination
rowsPerPageOptions={PAGE_SIZE_OPTIONS}
colSpan={3}
count={totalCount}
page={activePage}
rowsPerPage={pageSize}
rowsPerPageOptions={PAGE_SIZE_OPTIONS}
page={activePage}
labelRowsPerPage="Items per page:"
showFirstButton
showLastButton
slotProps={{
select: {
size: 'small',
style: { width: '3.5rem' },
},
actions: {
firstButton: actionButtonProps,
lastButton: actionButtonProps,
nextButton: actionButtonProps,
previousButton: actionButtonProps,
},
}}
onPageChange={handlePageChange}
onRowsPerPageChange={handlePageSizeChange}
labelRowsPerPage="Items per page:"
slots={paginationComponents}
slotProps={paginationComponentsProps as any}
/>
</td>
);
Expand Down
14 changes: 7 additions & 7 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
"format": "prettier --write './**/*.tsx' --config ../.prettierrc"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.617.0",
"@aws-sdk/client-s3": "^3.629.0",
"@aws-sdk/client-sns": "^3.245.0",
"@aws-sdk/credential-providers": "^3.515.0",
"@aws-sdk/lib-storage": "^3.617.0",
"@aws-sdk/middleware-apply-body-checksum": "^3.374.0",
"@aws-sdk/node-http-handler": "^3.296.0",
"@aws-sdk/s3-request-presigner": "^3.606.0",
"@aws-sdk/s3-request-presigner": "^3.629.0",
"@bcgov-cas/sso-express": "^3.2.0",
"@bcgov-cas/sso-react": "^2.0.0",
"@bcgov-ccbc/ccbc-node-sp-auth": "^1.0.0",
Expand All @@ -46,7 +46,7 @@
"@growthbook/growthbook-react": "^0.9.0",
"@mui/base": "^5.0.0-alpha.115",
"@mui/icons-material": "^5.14.13",
"@mui/material": "^5.14.13",
"@mui/material": "^5.16.5",
"@mui/x-date-pickers": "^6.16.2",
"@rjsf/core": "^5.17.1",
"@rjsf/utils": "^5.17.1",
Expand Down Expand Up @@ -113,10 +113,10 @@
"xlsx": "https://cdn.sheetjs.com/xlsx-0.19.3/xlsx-0.19.3.tgz"
},
"devDependencies": {
"@aws-sdk/client-s3": "^3.617.0",
"@aws-sdk/client-s3": "^3.629.0",
"@microsoft/eslint-formatter-sarif": "^3.0.0",
"@testing-library/cypress": "^10.0.1",
"@testing-library/jest-dom": "^6.4.5",
"@testing-library/jest-dom": "^6.4.8",
"@testing-library/react": "^14.1.2",
"@testing-library/react-hooks": "^8.0.1",
"@testing-library/user-event": "^14.4.3",
Expand All @@ -140,14 +140,14 @@
"aws-sdk-client-mock": "^2.0.1",
"babel-plugin-module-resolver": "^5.0.2",
"babel-plugin-relay": "^16.2.0",
"babel-plugin-styled-components": "^2.0.7",
"babel-plugin-styled-components": "^2.1.4",
"cypress": "13.13.2",
"eslint": "^8.57.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-config-next": "^13.4.4",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-cypress": "^3.5.0",
"eslint-plugin-jest": "^28.5.0",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-relay": "^1.8.3",
Expand Down
8 changes: 6 additions & 2 deletions app/tests/components/Table/Pagination.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,13 @@ describe('PaginationBar', () => {
</tfoot>
</table>
);
fireEvent.change(screen.getByLabelText(/items per page/i), {
target: { value: 50 },
const pageSizeSelect = screen.getByRole('combobox', {
name: /items per page/i,
});
fireEvent.mouseDown(pageSizeSelect);

const pageSizeOption = screen.getByRole('option', { name: /50/i });
fireEvent.click(pageSizeOption);

expect(handlePageSizeChange).toHaveBeenCalledWith(50);
});
Expand Down
Loading

0 comments on commit 909f109

Please sign in to comment.