Skip to content

Commit

Permalink
Merge branch 'release-0.29.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
oatymart committed Feb 3, 2022
2 parents 50a606e + c858f62 commit fa8f2fc
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 53 deletions.
34 changes: 0 additions & 34 deletions .Jenkinsfile

This file was deleted.

7 changes: 7 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dist/
build/
node_modules/
.nyc_ouput/
coverage/
lib/
environment/
53 changes: 53 additions & 0 deletions .github/workflows/continous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Continous integration

on:
pull_request:
branches: [ develop ]

jobs:
code-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.GH_TOKEN }}
- run: git fetch --tags --unshallow
- name: Check commit
if: always()
uses: oat-sa/conventional-commit-action@v0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-node@v1
with:
node-version: 14.x
registry-url: https://registry.npmjs.org
- name: Install packages
run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.BUILD_NPM_TOKEN }}
- name: Running tests
run: npm run test:cov
- name: Build coverage
run: npm run coverage:clover
- name: Report coverage
if: always()
uses: slavcodev/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
clover_file: coverage/clover.xml
threshold_alert: 75
threshold_warning: 90
comment_mode: update
- name: Save Code Linting Report JSON
if: always()
run: npm run lint:report | true
- name: Annotate Code Linting Results
if: always()
continue-on-error: true
uses: ataylorme/[email protected]
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
report-json: "eslint_report.json"
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,6 @@ dist
.idea/

# OS
.DS_Store
.DS_Store

eslint_report.json
8 changes: 4 additions & 4 deletions package-lock.json

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

9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oat-sa/tao-item-runner-qti",
"version": "0.29.0",
"version": "0.29.1",
"displayName": "TAO Item Runner QTI",
"description": "TAO QTI Item Runner modules",
"files": [
Expand All @@ -16,10 +16,13 @@
"test:cov": "npm run build:cov && npx qunit-testrunner --cov",
"coverage": "nyc report",
"coverage:html": "nyc report --reporter=lcov && open-cli coverage/lcov-report/index.html",
"coverage:clover": "nyc report --reporter=clover",
"build": "rollup --config ./build/rollup.config.js",
"build:watch": "rollup --config ./build/rollup.config.js --watch",
"build:cov": "rollup --config ./build/rollup.config.js --environment COVERAGE",
"lint": "eslint src test",
"lint:src": "eslint -c .eslintrc.js src",
"lint:test": "eslint -c .eslintrc.js test",
"lint:report": "eslint -c .eslintrc.js --output-file eslint_report.json --format json . | true",
"prepare": "npm run build"
},
"repository": {
Expand All @@ -43,7 +46,7 @@
},
"homepage": "https://github.com/oat-sa/tao-item-runner-qti-fe#readme",
"devDependencies": {
"@oat-sa/browserslist-config-tao": "^0.1.0",
"@oat-sa/browserslist-config-tao": "^0.3.1",
"@oat-sa/eslint-config-tao": "^1.1.1",
"@oat-sa/expr-eval": "1.3.0",
"@oat-sa/prettier-config": "^0.1.1",
Expand Down
28 changes: 17 additions & 11 deletions src/qtiCommonRenderer/helpers/sizeAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Copyright (c) 2015-2021 (original work) Open Assessment Technologies SA;
* Copyright (c) 2015-2022 (original work) Open Assessment Technologies SA;
*
*/
import $ from 'jquery';
Expand Down Expand Up @@ -44,16 +44,22 @@ export default {
}

$container.waitForMedia(function () {
adaptSize.height($elements);
document.addEventListener(
'load',
e => {
if (e.target && e.target.rel === 'stylesheet') {
adaptSize.height($elements);
}
},
true
);
// Occasionally in caching scenarios, after waitForMedia(), image.height is reporting its naturalHeight instead of its CSS height
// The timeout allows adaptSize.height() to work with the true rendered heights of elements, instead of naturalHeights
setTimeout(() => {
adaptSize.height($elements);

// detect any CSS load, and adapt heights again after
document.addEventListener(
'load',
e => {
if (e.target && e.target.rel === 'stylesheet') {
adaptSize.height($elements);
}
},
true
);
}, 1);
});
}
};

0 comments on commit fa8f2fc

Please sign in to comment.