Skip to content

Commit

Permalink
Upgrade dependencies
Browse files Browse the repository at this point in the history
* Upgrade frontend dependencies
* Remove ng-cache-loader

This replaces ng-cache-loader by caching the partial templates
explicitly with html-loader and angular's $templateCache.

* Upgrade Python requirements
* Upgrade pre-commit dependencies
  • Loading branch information
replaceafill authored Oct 22, 2024
1 parent e11581b commit 4e18346
Show file tree
Hide file tree
Showing 8 changed files with 766 additions and 996 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repos:
src/(MCPClient/MCPServer|dashboard)/install/.*\.json
)
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.9
rev: v0.7.0
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down Expand Up @@ -46,7 +46,7 @@ repos:
hooks:
- id: validate-cff
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.2
rev: v1.12.1
hooks:
- id: mypy
additional_dependencies:
Expand Down
12 changes: 6 additions & 6 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ coverage[toml]==7.6.1
# via
# -r requirements-dev.in
# pytest-cov
cryptography==43.0.1
cryptography==43.0.3
# via
# -r requirements.txt
# josepy
Expand Down Expand Up @@ -144,7 +144,7 @@ mockldap @ git+https://github.com/artefactual-labs/[email protected]
# via -r requirements-dev.in
mozilla-django-oidc==4.0.1
# via -r requirements.txt
mysqlclient==2.2.4
mysqlclient==2.2.5
# via
# -r requirements.txt
# agentarchives
Expand All @@ -154,7 +154,7 @@ olefile==0.47
# opf-fido
opf-fido @ git+https://github.com/artefactual-labs/fido.git@564ceb8018a8650fe931cf20e6780ee008e60fca
# via -r requirements.txt
orjson==3.10.7
orjson==3.10.9
# via -r requirements.txt
packaging==24.1
# via
Expand Down Expand Up @@ -286,7 +286,7 @@ tomli==2.0.2
# pyproject-api
# pytest
# tox
tox==4.21.2
tox==4.23.1
# via -r requirements-dev.in
typing-extensions==4.12.2
# via
Expand All @@ -302,7 +302,7 @@ urllib3==2.2.3
# amclient
# elasticsearch
# requests
virtualenv==20.26.6
virtualenv==20.27.0
# via tox
wheel==0.44.0
# via pip-tools
Expand All @@ -325,7 +325,7 @@ zope-interface==7.1.0
# The following packages are considered to be unsafe in a requirements file:
pip==24.2
# via pip-tools
setuptools==75.1.0
setuptools==75.2.0
# via
# -r requirements.txt
# pip-tools
Expand Down
3 changes: 2 additions & 1 deletion requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ django-cas-ng
# Required for OpenID Connect authentication
mozilla-django-oidc

# These dependencies dropped support for Python 3.8, so pinning it for now.
# These dependencies dropped support for Python 3.8, so pinning them for now.
django-auth-ldap==5.0.0
gevent==24.2.1
jsonschema-specifications==2023.12.1
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ charset-normalizer==3.4.0
# via requests
clamd==1.0.2
# via -r requirements.in
cryptography==43.0.1
cryptography==43.0.3
# via
# josepy
# mozilla-django-oidc
Expand Down Expand Up @@ -94,13 +94,13 @@ metsrw==0.5.1
# via -r requirements.in
mozilla-django-oidc==4.0.1
# via -r requirements.in
mysqlclient==2.2.4
mysqlclient==2.2.5
# via agentarchives
olefile==0.47
# via opf-fido
opf-fido @ git+https://github.com/artefactual-labs/fido.git@564ceb8018a8650fe931cf20e6780ee008e60fca
# via -r requirements.in
orjson==3.10.7
orjson==3.10.9
# via -r requirements.in
packaging==24.1
# via gunicorn
Expand Down Expand Up @@ -174,7 +174,7 @@ zope-interface==7.1.0
# via gevent

# The following packages are considered to be unsafe in a requirements file:
setuptools==75.1.0
setuptools==75.2.0
# via
# zope-event
# zope-interface
49 changes: 33 additions & 16 deletions src/dashboard/frontend/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ import 'angular-tree-control/css/tree-control-attribute.css';
import 'angular';

// Partials
import 'ng-cache-loader?prefix=[dir]!./analysis/analysis.html';
import 'ng-cache-loader?prefix=[dir]!./archivesspace/form.html';
import 'ng-cache-loader?prefix=[dir]!./arrangement/edit_metadata_form.html';
import 'ng-cache-loader?prefix=[dir]!./examine_contents/examine_contents.html';
import 'ng-cache-loader?prefix=[dir]!./examine_contents/file_info.html';
import 'ng-cache-loader?prefix=[dir]!./front_page/appraisal_tab.html';
import 'ng-cache-loader?prefix=[dir]!./front_page/transfer_browser.html';
import 'ng-cache-loader?prefix=[dir]!./preview/preview.html';
import 'ng-cache-loader?prefix=[dir]!./report/format.html';
import 'ng-cache-loader?prefix=[dir]!./report/tags.html';
import 'ng-cache-loader?prefix=[dir]!./ui/minimize-bar.html';
import 'ng-cache-loader?prefix=[dir]!./ui/minimize-panel.html';
import 'ng-cache-loader?prefix=[dir]!./visualizations/formats_by_files.html';
import 'ng-cache-loader?prefix=[dir]!./visualizations/formats_by_size.html';
import 'ng-cache-loader?prefix=[dir]!./visualizations/visualizations.html';
import analysisTemplate from './analysis/analysis.html';
import archivesSpaceFormTemplate from './archivesspace/form.html';
import editMetadataFormTemplate from './arrangement/edit_metadata_form.html';
import examineContentsTemplate from './examine_contents/examine_contents.html';
import fileInfoTemplate from './examine_contents/file_info.html';
import appraisalTabTemplate from './front_page/appraisal_tab.html';
import transferBrowserTemplate from './front_page/transfer_browser.html';
import previewTemplate from './preview/preview.html';
import reportFormatTemplate from './report/format.html';
import reportTagsTemplate from './report/tags.html';
import minimizeBarTemplate from './ui/minimize-bar.html';
import minimizePanelTemplate from './ui/minimize-panel.html';
import formatsByFilesTemplate from './visualizations/formats_by_files.html';
import formatsBySizeTemplate from './visualizations/formats_by_size.html';
import visualizationsTemplate from './visualizations/visualizations.html';

// Third-party modules
import angular from 'angular';
Expand Down Expand Up @@ -126,7 +126,7 @@ module.exports = angular.module('dashboard', [
'controllers.header',
]).

run(function ($window, gettextCatalog) {
run(function ($window, gettextCatalog, $templateCache) {
// Look up current language, fallback to English
var currentLanguage;
try {
Expand All @@ -140,6 +140,23 @@ run(function ($window, gettextCatalog) {
for (let [langCode, translations] of Object.entries(require('./locale/translations.json'))) {
gettextCatalog.setStrings(langCode, translations);
}

// Cache partials.
$templateCache.put('analysis/analysis.html', analysisTemplate);
$templateCache.put('archivesspace/form.html', archivesSpaceFormTemplate);
$templateCache.put('arrangement/edit_metadata_form.html', editMetadataFormTemplate);
$templateCache.put('examine_contents/examine_contents.html', examineContentsTemplate);
$templateCache.put('examine_contents/file_info.html', fileInfoTemplate);
$templateCache.put('front_page/appraisal_tab.html', appraisalTabTemplate);
$templateCache.put('front_page/transfer_browser.html', transferBrowserTemplate);
$templateCache.put('preview/preview.html', previewTemplate);
$templateCache.put('report/format.html', reportFormatTemplate);
$templateCache.put('report/tags.html', reportTagsTemplate);
$templateCache.put('ui/minimize-bar.html', minimizeBarTemplate);
$templateCache.put('ui/minimize-panel.html', minimizePanelTemplate);
$templateCache.put('visualizations/formats_by_files.html', formatsByFilesTemplate);
$templateCache.put('visualizations/formats_by_size.html', formatsBySizeTemplate);
$templateCache.put('visualizations/visualizations.html', visualizationsTemplate);
}).

// See https://code.angularjs.org/1.5.11/docs/api/ng/service/$http#cross-site-request-forgery-xsrf-protection
Expand Down
Loading

0 comments on commit 4e18346

Please sign in to comment.