From 084b5bfdd9dfb4bca1cf3f88cf0f944b9333c44c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 6 Mar 2023 15:27:17 +0100 Subject: [PATCH 1/5] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Update=20eslint=20vers?= =?UTF-8?q?ion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.yaml | 15 ++++----------- .pre-commit-config.yaml | 4 +--- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/.eslintrc.yaml b/.eslintrc.yaml index 586cdd232..427f3a1e9 100644 --- a/.eslintrc.yaml +++ b/.eslintrc.yaml @@ -1,11 +1,4 @@ -parserOptions: - ecmaVersion: 2018 - -overrides: - - files: - - "src/octoprint/static/js/**.js" - - "src/octoprint/plugins/**.js" - env: - browser: true - jquery: true - es6: true +env: + browser: true + jquery: true + es2018: true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6ffd3a093..0cde70f61 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -61,11 +61,9 @@ repos: hooks: - id: prettier - repo: https://github.com/pre-commit/mirrors-eslint - rev: v8.34.0 + rev: v8.35.0 hooks: - id: eslint - additional_dependencies: - - eslint@7.19.0 files: \.js$ exclude: ^(src/octoprint/vendor/|tests/static/js/lib|tests/util/_files|docs/|scripts/|translations/) - repo: https://github.com/codespell-project/codespell From 486a1722114e22b824d41de0a6a5f82701b799b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 6 Mar 2023 15:55:11 +0100 Subject: [PATCH 2/5] =?UTF-8?q?=F0=9F=93=8C=20Pin=20babel=20to=202.12.x?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since we just learned that minor version changes can break backwards compatibility (see 1.8.7), that's definitely the safer bet. --- setup.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 9bcbc97fa..7ebdd8de9 100644 --- a/setup.py +++ b/setup.py @@ -40,6 +40,7 @@ bundled_plugins = [ ] core_deps = [ "argon2_cffi>=21.3.0,<22", + "Babel>=2.12.1,<2.13", # breaking changes can happen on minor version increases "cachelib>=0.10.2,<0.11", "Click>=8.1.3,<9", "colorlog>=6.7.0,<7", @@ -69,7 +70,7 @@ core_deps = [ "semantic_version>=2.10.0,<3", "sentry-sdk>=1.16.0,<2", "tornado>=6.2,<7", - "watchdog>=2.3.0,<3", + "watchdog>=2.3.1,<3", "websocket-client>=1.5.1,<2", "werkzeug>=2.2.3,<2.3", # breaking changes can happen on minor version increases "wrapt>=1.15,<1.16", @@ -101,7 +102,7 @@ EXTRA_REQUIRES = { "ddt", "mock>=5.0.1,<6", "pytest-doctest-custom>=1.0.0,<2", - "pytest>=7.2.1,<8", + "pytest>=7.2.2,<8", # pre-commit "pre-commit", # profiler From 01cdb5e18cfed45a07d71848d4142da728719cfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 6 Mar 2023 15:55:46 +0100 Subject: [PATCH 3/5] =?UTF-8?q?=F0=9F=93=9D=20Mention=20`python=20setup.py?= =?UTF-8?q?=20scan=5Fdeps`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/development/environment.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/development/environment.rst b/docs/development/environment.rst index f7c3753a5..c901db5dd 100644 --- a/docs/development/environment.rst +++ b/docs/development/environment.rst @@ -61,6 +61,8 @@ When the virtual environment is activated you can then: * build the documentation running ``sphinx-build -b html . _build`` in the ``docs`` folder -- the documentation will be available in the newly created ``_build`` directory. You can simply browse it locally by opening ``index.html`` + * check whether there are newer versions of OctoPrint's dependencies available via + ``python setup.py scan_deps`` .. _sec-development-environment-source-linux: From efe9c68e9aea541a5eae4b9a8bf0d21a9c13a48f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 6 Mar 2023 16:12:41 +0100 Subject: [PATCH 4/5] =?UTF-8?q?=F0=9F=90=9B=20Fix=20use=20of=20TIMELAPSE?= =?UTF-8?q?=5FMANAGE=5FUNRENDERED?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/api/timelapse.rst | 4 ++-- src/octoprint/access/permissions.py | 2 +- src/octoprint/static/js/app/viewmodels/timelapse.js | 12 ++++++++++-- src/octoprint/templates/tabs/timelapse.jinja2 | 6 +++--- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/docs/api/timelapse.rst b/docs/api/timelapse.rst index 6a49a631d..c7f5a3767 100644 --- a/docs/api/timelapse.rst +++ b/docs/api/timelapse.rst @@ -48,7 +48,7 @@ Issue a command for an unrendered timelapse Current only supports to render the unrendered timelapse ``name`` via the ``render`` command. - Requires the ``TIMELAPSE_ADMIN`` permission. + Requires the ``TIMELAPSE_MANAGE_UNRENDERED`` permission. :json command: The command to issue, currently only ``render`` is supported @@ -64,7 +64,7 @@ Delete an unrendered timelapse Returns a :ref:`timelapse list ` in the response body. - Requires the ``TIMELAPSE_DELETE`` permission. + Requires the ``TIMELAPSE_MANAGE_UNRENDERED`` permission. :param unrendered: If provided and true, also include unrendered timelapses in the response diff --git a/src/octoprint/access/permissions.py b/src/octoprint/access/permissions.py index 311f3172c..91b3fa7bb 100644 --- a/src/octoprint/access/permissions.py +++ b/src/octoprint/access/permissions.py @@ -414,7 +414,7 @@ class Permissions(metaclass=PermissionsMetaClass): ) TIMELAPSE_DELETE = OctoPrintPermission( "Timelapse Delete", - gettext("Allows to delete timelapse videos and unrendered timelapses"), + gettext("Allows to delete timelapse videos"), RoleNeed("timelapse_delete"), default_groups=[USER_GROUP], ) diff --git a/src/octoprint/static/js/app/viewmodels/timelapse.js b/src/octoprint/static/js/app/viewmodels/timelapse.js index b7ae602b9..414c2aaad 100644 --- a/src/octoprint/static/js/app/viewmodels/timelapse.js +++ b/src/octoprint/static/js/app/viewmodels/timelapse.js @@ -443,7 +443,11 @@ $(function () { }; self.removeUnrendered = function (name) { - if (!self.loginState.hasPermission(self.access.permissions.TIMELAPSE_DELETE)) + if ( + !self.loginState.hasPermission( + self.access.permissions.TIMELAPSE_MANAGE_UNRENDERED + ) + ) return; var perform = function () { @@ -463,7 +467,11 @@ $(function () { }; self.removeMarkedUnrendered = function () { - if (!self.loginState.hasPermission(self.access.permissions.TIMELAPSE_DELETE)) + if ( + !self.loginState.hasPermission( + self.access.permissions.TIMELAPSE_MANAGE_UNRENDERED + ) + ) return; var perform = function () { diff --git a/src/octoprint/templates/tabs/timelapse.jinja2 b/src/octoprint/templates/tabs/timelapse.jinja2 index 597a44222..6affc0421 100644 --- a/src/octoprint/templates/tabs/timelapse.jinja2 +++ b/src/octoprint/templates/tabs/timelapse.jinja2 @@ -194,7 +194,7 @@
-
+