Skip to content

Commit

Permalink
Added code to update transcription status display when accepting. Upd…
Browse files Browse the repository at this point in the history
…ated eslint versions and config to fix issue with linter. Small JS code change due to new rule in linter (#2225)
  • Loading branch information
joshuastegmaier committed Jan 5, 2024
1 parent a2bd1c3 commit 86d7d77
Show file tree
Hide file tree
Showing 5 changed files with 248 additions and 110 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ rules:
'unicorn/prefer-ternary': off
env:
browser: true
es6: true
es2024: true
parserOptions:
sourceType: script
ecmaVersion": '2018'
ecmaVersion: latest
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ repos:
- id: prettier
files: \.(css|less|scss|ts|tsx|graphql|gql|json|js|jsx|md|yaml|yml)$
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v8.51.0
rev: v8.56.0
hooks:
- id: eslint
additional_dependencies:
- eslint-plugin-prettier@^4.2.1
- eslint-plugin-unicorn@^26.0.0
- eslint@^7.17.0
- eslint-plugin-unicorn@^50.0.1
- eslint@^8.56.0
- prettier@^2.7.1
- repo: https://github.com/awebdeveloper/pre-commit-stylelint
rev: 0.0.2
Expand Down
22 changes: 20 additions & 2 deletions concordia/static/js/src/contribute.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ function setupPage() {
action: status,
},
})
.done(function () {
.done(function (data) {
if (status == 'reject') {
$.ajax({
url: window.location,
Expand Down Expand Up @@ -443,6 +443,24 @@ function setupPage() {
);
});
} else {
$('#transcription-status-display')
.children()
.attr('hidden', 'hidden')
.filter('#display-completed')
.removeAttr('hidden');
let messageChildren = $(
'#transcription-status-message',
).children();
console.log(messageChildren);
messageChildren
.attr('hidden', 'hidden')
.filter('#message-completed')
.removeAttr('hidden');
messageChildren
.filter('#message-contributors')
.removeAttr('hidden')
.find('#message-contributors-num')
.html(data.asset.contributors);
$('#review-accepted-modal')
.modal()
.on('hidden.bs.modal', function () {
Expand Down Expand Up @@ -505,7 +523,7 @@ function setupPage() {
);
}).length;

if (!dupeCount) {
if (dupeCount == 0) {
var $newTag = $(
'\
<li class="btn btn-outline-dark btn-sm"> \
Expand Down
Loading

0 comments on commit 86d7d77

Please sign in to comment.