Arches 5.1 release notes ------------------------ ### Major enhancements - Users are now able to restrict access of an instance to specific users and groups. - Bidirectional support for the resource relationship datatype. Resource relationships saved to a tile are now represented in the search page's related resources interface. - The date datatype, widget, and advanced search now support time. - Tile edits and deletion made on the web are now synced with instances in a collector project. - Arches now provides an annotation datatype and interface allowing users to annotate imagery from a IIIF service. - Improved management of front-end dependencies so that Arches upgrades are less likely to impact project customizations. - Improved support for localization. Administrators can now configure their Arches interface to switch between different languages. ### Additional highlights - Fixed formatting of numbers in reports improving node name and value alignment - Added ability to configure Arches so that cards without data do not show in a report - Added a button to the search page to allow a user to clear all active filters - Add a summary report so that users can see more information about an instance without opening a full report - Changed mapping of the number datatype so that users can search on floating point values - Add explicit ES mappings for every datatype - Enable users to search on uploaded file names - Now using a global search connection instead of unnecessarily creating multiple connections - Resource instance import is done with Celery (if available) - Moved the date format from the datepicker widget to the node config and added support for time selection in the widget - Added a photo gallery card - Added a IIIF card for displaying and annotating data from IIIF services - Added a file viewer card for displaying images, pdfs, charts, etc - Allow a user to request multiple nodes via geojson api - The d3 graph preview was removed to improve UI performance - Enabled users to configure the datatype of the top node of a branch - Added the ability to seed new tiles with previous tile's data for cardinality n cards - Added a card summary for cardinality n cards so editors can quickly see a cards data - Restricted a user from deleting an instance that has tile data that they are not permitted to delete - Added a check for node permissions when accessing a tile's uploaded files ### Backwards Compatiblity: **A Celery worker is now required to sync from Arches Collector.** If you are not using Collector, running Celery is not required. Some features of version 5.0 graphs and resource data are not compatible with version 5.1. This means that once you complete the upgrade, you will not be able to safely import 5.0 graphs and 5.0 resource data into a 5.1 system. ***BEFORE UPGRADING:*** be sure to import any graphs and resource instance data that you need in your system because you will not be able to import them after the upgrade ***AFTER UPGRADING:*** be sure to export your graphs and resource data if you intend to reimport them or import them into a different 5.1 system Some important changes that are not compatible with 5.0 inlude changes to the resource instance datatype and the addition of the unique node name constraint. #### Changes to the related instance and instance list datatypes: In order to support bidirectional relationships for the resource instance and instance list datatypes, the format of the data needed to be changed. In 5.0 the datatype was simply the uuid of the related resource (or a list of uuids for the resource-instance-list datatype). In 5.1 the datatype is a list of json objects: ``` [{ "resourceId": "7178b18c-5926-4fae-a148-8e320fcf5ed2", // Primary key of the related resource "ontologyProperty": "", "resourceXresourceId": "8733176a-14bd-11eb-a10e-acde48001122", // Primary key in the resource_x_resource table "inverseOntologyProperty": "" }] ``` In the case of the related-resource datatype the list can only contain 1 object. In the case of the related-resource-list datatype, the list can contain any number of objects. #### Unique node name constraint: Version 5.1 requires you to use unique node names in a node group and also between sibling nodes. After upgrading you may notice that some node names will have the nodeid appended to the end of the name. This was done to prevent any name conflicts from occurring. You can change the name to something else so long as the unique naming constraints are followed. ### Additional Notes: 1. The package_load command has changed. You no longer need to include the word `true` after the `-db` option, and if you include the `-dev` option, 3 test users will be created for you. 2. Users are still able to create resource relationships without using the Resource Instance or Resource Instance List datatypes. However, this feature will deprecated in a future release. **Users are strongly encouraged to use the Resource Instance or Resource Instance List datatypes to relate resources**. 3. Some Arches instances may be running on Python 3.6. The date format saved by Arches Collector cannot be parsed by the datetime library in Python 3.6.x. Therefore, if you need to support Collector projects, Arches should run using Python 3.7. ### Dependency changes: ``` Python: Upgraded: Django 2.2.8 > 2.2.13 django-guardian 2.1.0 > 2.3.0 celery 4.3.0 > 4.4.4 django-celery-results 1.1.2 > 1.2.1 New: pillow==7.0.0 arcgis2geojson==2.0.0 JS: Upgraded: d3: 3.5.17 > 6.1.1 dropzone: 3.8.4 > 5.7.0 leaflet: 1.0.3 > 1.6.0 leaflet-draw: 0.4.9 > 1.0.4 leaflet-iiif: 1.1.1 > 3.0.0 mapbox-gl: 1.0.0 > 1.8.1 New: leaflet.fullscreen: 1.6.0 Removed: blueimp-gallery: 2.15.2 ``` ### Upgrading Arches 1. You must be upgraded to at least version 5.0 before proceeding 2. Be sure to import any graphs and resource instance data that you need in your system because you won't be able to do it after the upgrade. 3. Be sure to backup your database before proceeding 4. Upgrade to Arches 5.1 pip install --upgrade arches 5. Within your project with your Python 3 virtual environment activated: python manage.py migrate python manage.py es reindex_database 6. If you are maintaining an Arches package, be sure to export your graphs and resource instance data before reimporting or reloading your package. ### Upgrading an Arches project 1. Update your JavaScript dependencies We have changed how front-end dependencies are managed in Arches. The new way is to make Arches a dependency in your project's package.json file. - To do that first remove all dependencies from your package.json file except any dependencies you may have added to support project customizations. - Next add `"arches": "archesproject/arches#5.1.0"` in your package.json file's dependencies. - Your package.json file should now look like this (but with your project's name of course): ``` { "name": "myproject", "dependencies": { "arches": "archesproject/arches#stable/5.1.0", {your project specific dependencies (if any) should be here...} } } ``` - Finally remove your `yarn.lock` file and from the same directory where your package.json file is located and then run: ```yarn install``` This eliminates the need to manage the dependencies that Arches uses in your project and helps ensure that there are no conflicts when you upgrade Arches in the future. 2. If you want to support localization you'll need to do the following: Update your settings.py file by adding this import statment: from django.utils.translation import gettext_lazy as _ Next copy the MIDDLEWARE setting to your project's settings.py file. If it's already in your settings.py file, be sure to uncomment ```"django.middleware.locale.LocaleMiddleware"``` ``` MIDDLEWARE = [ # 'debug_toolbar.middleware.DebugToolbarMiddleware', "corsheaders.middleware.CorsMiddleware", "django.middleware.security.SecurityMiddleware", "django.contrib.sessions.middleware.SessionMiddleware", #'arches.app.utils.middleware.TokenMiddleware', "django.middleware.locale.LocaleMiddleware", "django.middleware.common.CommonMiddleware", "django.middleware.csrf.CsrfViewMiddleware", "arches.app.utils.middleware.ModifyAuthorizationHeader", "oauth2_provider.middleware.OAuth2TokenMiddleware", "django.contrib.auth.middleware.AuthenticationMiddleware", "django.contrib.messages.middleware.MessageMiddleware", # "django.middleware.clickjacking.XFrameOptionsMiddleware", "arches.app.utils.middleware.SetAnonymousUser", ] ``` Next add the LANGUAGE_CODE, LANGUAGES, and ADD_LANGUAGE_SWITCH to your projects's settings.py file and update them to reflect your project's requirements: ``` # default language of the application # language code needs to be all lower case with the form: # {langcode}-{regioncode} eg: en, en-gb .... # a list of language codes can be found here http://www.i18nguy.com/unicode/language-identifiers.html LANGUAGE_CODE = "en" # list of languages to display in the language switcher, # if left empty or with a single entry then the switch won't be displayed # language codes need to be all lower case with the form: # {langcode}-{regioncode} eg: en, en-gb .... # a list of language codes can be found here http://www.i18nguy.com/unicode/language-identifiers.html LANGUAGES = [ ('de', _('German')), ('en', _('English')), ('en-gb', _('British English')), ('es', _('Spanish')), ] # override this to permenantly display/hide the language switcher SHOW_LANGUAGE_SWITCH = len(LANGUAGES) > 1 ``` Now add this import statement to the top of your urls.py file: from django.conf.urls.i18n import i18n_patterns Finally add the following code to the end of your urls.py file: if settings.SHOW_LANGUAGE_SWITCH is True: urlpatterns = i18n_patterns(*urlpatterns) ### Known Issues: - The Docker install needs to be updated to support the dependency changes.