From 63a262302f4366268b49031310b72dd3ab1ef583 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20H=C3=B8rl=C3=BCck=20Berg?= <36937807+henrikhorluck@users.noreply.github.com> Date: Wed, 18 Oct 2023 22:24:38 +0200 Subject: [PATCH] Remove jquery-bar-rating The fall-back is a select, which works _fine_. It is too much effort to try to fix the import to use the right jQuery version. --- apps/feedback/forms.py | 1 - assets/feedback/answerRating.js | 9 --------- assets/feedback/index.js | 7 ------- package-lock.json | 9 --------- package.json | 1 - 5 files changed, 27 deletions(-) delete mode 100644 assets/feedback/answerRating.js diff --git a/apps/feedback/forms.py b/apps/feedback/forms.py index 52f0efb91..a515e62d5 100644 --- a/apps/feedback/forms.py +++ b/apps/feedback/forms.py @@ -28,7 +28,6 @@ def __init__(self, *args, **kwargs): class RatingAnswerForm(AnswerForm): answer = forms.ChoiceField( - widget=forms.Select(attrs={"class": "rating", "name": "rating"}), choices=RATING_CHOICES, ) diff --git a/assets/feedback/answerRating.js b/assets/feedback/answerRating.js deleted file mode 100644 index fd798d5bd..000000000 --- a/assets/feedback/answerRating.js +++ /dev/null @@ -1,9 +0,0 @@ -// import $ from 'jquery'; -import 'jquery-bar-rating'; - -export default () => { - $('.rating').barrating('show', { - showValues: true, - showSelectedRating: false, - }); -}; diff --git a/assets/feedback/index.js b/assets/feedback/index.js index 35b7d7d43..950659a95 100644 --- a/assets/feedback/index.js +++ b/assets/feedback/index.js @@ -1,14 +1,7 @@ -import AnswerRating from './answerRating'; import FeedBackResults from './feedbackResults'; import './less/feedback.less'; -// Check if bar rating should be initialized -const ratingWrapper = document.querySelector('.rating-wrapper'); -if (ratingWrapper !== null) { - AnswerRating(); -} - // Check if feed back results charts should be initialized const feedBackResultsElement = document.getElementById('feedback-results'); if (feedBackResultsElement !== null) { diff --git a/package-lock.json b/package-lock.json index d96af8e72..ff48d9291 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,6 @@ "font-awesome": "^4.7.0", "fuse.js": "^2.7.3", "jquery": "2", - "jquery-bar-rating": "^1.2.1", "js-cookie": "^3.0.5", "masonry-layout": "^4.1.1", "moment": "^2.29.2", @@ -3704,14 +3703,6 @@ "resolved": "https://registry.npmjs.org/jquery/-/jquery-2.2.4.tgz", "integrity": "sha512-lBHj60ezci2u1v2FqnZIraShGgEXq35qCzMv4lITyHGppTnA13rwR0MgwyNJh9TnDs3aXUvd1xjAotfraMHX/Q==" }, - "node_modules/jquery-bar-rating": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/jquery-bar-rating/-/jquery-bar-rating-1.2.2.tgz", - "integrity": "sha512-0OtYCrgDzyc3FQ6r08Twns35t1bKd4V/9+Nberg3Idg3ZpBw2dVre8Hut0w3sbekm391desWxpbKFKSPzuk81w==", - "dependencies": { - "jquery": ">=1.7.2" - } - }, "node_modules/js-cookie": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/js-cookie/-/js-cookie-3.0.5.tgz", diff --git a/package.json b/package.json index d403c27af..9b7f0d45b 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,6 @@ "font-awesome": "^4.7.0", "fuse.js": "^2.7.3", "jquery": "2", - "jquery-bar-rating": "^1.2.1", "js-cookie": "^3.0.5", "masonry-layout": "^4.1.1", "moment": "^2.29.2",