Skip to content

Commit

Permalink
Merge branch 'master' into data-entry-existing-glosses
Browse files Browse the repository at this point in the history
  • Loading branch information
imnasnainaec authored Oct 19, 2023
2 parents bf0fcb3 + 5494338 commit aeb1ae2
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 39 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,19 +129,19 @@ jobs:
with:
dotnet-version: "6.0.x"
- name: Initialize CodeQL
uses: github/codeql-action/init@2cb752a87e96af96708ab57187ab6372ee1973ab # v2.22.0
uses: github/codeql-action/init@fdcae64e1484d349b3366718cdfef3d404390e85 # v2.22.1
with:
languages: csharp
- name: Autobuild
uses: github/codeql-action/autobuild@2cb752a87e96af96708ab57187ab6372ee1973ab # v2.22.0
uses: github/codeql-action/autobuild@fdcae64e1484d349b3366718cdfef3d404390e85 # v2.22.1
- name: Upload artifacts if build failed
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
if: ${{ failure() }}
with:
name: tracer-logs
path: ${{ runner.temp }}/*.log
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@2cb752a87e96af96708ab57187ab6372ee1973ab # v2.22.0
uses: github/codeql-action/analyze@fdcae64e1484d349b3366718cdfef3d404390e85 # v2.22.1

docker_build:
runs-on: ubuntu-22.04
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@2cb752a87e96af96708ab57187ab6372ee1973ab # v2.22.0
uses: github/codeql-action/init@fdcae64e1484d349b3366718cdfef3d404390e85 # v2.22.1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -76,7 +76,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@2cb752a87e96af96708ab57187ab6372ee1973ab # v2.22.0
uses: github/codeql-action/autobuild@fdcae64e1484d349b3366718cdfef3d404390e85 # v2.22.1

# Command-line programs to run using the OS shell.
# See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Expand All @@ -89,6 +89,6 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@2cb752a87e96af96708ab57187ab6372ee1973ab # v2.22.0
uses: github/codeql-action/analyze@fdcae64e1484d349b3366718cdfef3d404390e85 # v2.22.1
with:
category: "/language:${{matrix.language}}"
2 changes: 1 addition & 1 deletion .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@2cb752a87e96af96708ab57187ab6372ee1973ab # v2.22.0
uses: github/codeql-action/upload-sarif@fdcae64e1484d349b3366718cdfef3d404390e85 # v2.22.1
with:
sarif_file: results.sarif
54 changes: 27 additions & 27 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"wordlist": "hunspell-reader words"
},
"dependencies": {
"@emotion/react": "^11.11.0",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@loadable/component": "^5.15.3",
"@material-table/core": "^6.2.11",
Expand Down Expand Up @@ -70,7 +70,7 @@
"react-beautiful-dnd": "^13.1.1",
"react-chartjs-2": "^5.2.0",
"react-dom": "^17.0.2",
"react-i18next": "^12.3.1",
"react-i18next": "^13.2.2",
"react-modal": "^3.16.1",
"react-redux": "^8.1.3",
"react-router-dom": "^6.16.0",
Expand All @@ -84,10 +84,10 @@
"validator": "^13.11.0"
},
"devDependencies": {
"@testing-library/jest-dom": "^6.1.2",
"@testing-library/jest-dom": "^6.1.4",
"@testing-library/react": "^12.1.5",
"@testing-library/react-hooks": "^8.0.0",
"@testing-library/user-event": "^14.4.3",
"@testing-library/user-event": "^14.5.1",
"@types/crypto-js": "^4.1.2",
"@types/css-mediaquery": "^0.1.2",
"@types/jest": "^29.5.5",
Expand All @@ -107,7 +107,7 @@
"@typescript-eslint/eslint-plugin": "^6.7.2",
"@typescript-eslint/parser": "^6.3.0",
"css-mediaquery": "^0.1.2",
"eslint": "^8.50.0",
"eslint": "^8.51.0",
"eslint-import-resolver-typescript": "^3.6.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-react": "^7.33.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export default function ReviewEntriesTable(
const { t } = useTranslation();
const [maxRows, setMaxRows] = useState(words.length);
const [pageState, setPageState] = useState(getPageState(words.length));
const [scrollToTop, setScrollToTop] = useState(false);

const updateMaxRows = (): void => {
if (tableRef.current) {
Expand All @@ -79,6 +80,15 @@ export default function ReviewEntriesTable(
});
}, [maxRows, setPageState]);

useEffect(() => {
// onRowsPerPageChange={() => window.scrollTo({ top: 0 })} doesn't work.
// This useEffect on an intermediate state triggers scrolling at the right time.
if (scrollToTop) {
window.scrollTo({ behavior: "smooth", top: 0 });
setScrollToTop(false);
}
}, [scrollToTop]);

const materialTableLocalization = {
body: {
editRow: {
Expand Down Expand Up @@ -136,6 +146,7 @@ export default function ReviewEntriesTable(
)}
data={words}
onFilterChange={updateMaxRows}
onRowsPerPageChange={() => setScrollToTop(true)}
editable={{
onRowUpdate: (newData: ReviewEntriesWord, oldData: ReviewEntriesWord) =>
new Promise(async (resolve, reject) => {
Expand Down

0 comments on commit aeb1ae2

Please sign in to comment.