diff --git a/.coveragerc b/.coveragerc index c62d855..0b2c4a4 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,6 +1,6 @@ [run] source = - arches_references/ + arches_controlled_lists/ omit = */python?.?/* diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bedd7db..2ad42bc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,7 @@ jobs: image: postgis/postgis:13-3.0 env: POSTGRES_PASSWORD: postgis - POSTGRES_DB: arches_references + POSTGRES_DB: arches_controlled_lists ports: - 5432:5432 options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 @@ -44,7 +44,7 @@ jobs: uses: ./.github/actions/build-and-test-branch with: secrets: ${{ toJSON(secrets) }} - project-name: 'arches_references' + project-name: 'arches_controlled_lists' branch-type: 'target' build_feature_branch: @@ -55,7 +55,7 @@ jobs: image: postgis/postgis:13-3.0 env: POSTGRES_PASSWORD: postgis - POSTGRES_DB: arches_references + POSTGRES_DB: arches_controlled_lists ports: - 5432:5432 options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 @@ -85,7 +85,7 @@ jobs: uses: ./.github/actions/build-and-test-branch with: secrets: ${{ toJSON(secrets) }} - project-name: 'arches_references' + project-name: 'arches_controlled_lists' branch-type: 'feature' check_frontend_coverage: diff --git a/.gitignore b/.gitignore index 9a30484..3dd30b0 100644 --- a/.gitignore +++ b/.gitignore @@ -2,15 +2,15 @@ *.log node_modules coverage/ -arches_references/logs -arches_references/export_deliverables -arches_references/cantaloupe/* -arches_references/staticfiles -arches_references/media/packages -arches_references/media/build/ -arches_references/uploadedfiles/* -arches_references/list_item_images -arches_references/settings_local.py +arches_controlled_lists/logs +arches_controlled_lists/export_deliverables +arches_controlled_lists/cantaloupe/* +arches_controlled_lists/staticfiles +arches_controlled_lists/media/packages +arches_controlled_lists/media/build/ +arches_controlled_lists/uploadedfiles/* +arches_controlled_lists/list_item_images +arches_controlled_lists/settings_local.py webpack-stats.json .vscode/ *.egg-info diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9801a70..de1389d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,12 +18,12 @@ repos: name: prettier entry: npm run prettier:fix language: system - files: arches_references/src + files: arches_controlled_lists/src - id: eslint name: eslint entry: npm run eslint:fix language: system - files: arches_references/src + files: arches_controlled_lists/src - id: typescript name: typescript entry: bash -c 'npm run ts:check' diff --git a/README.md b/README.md index ea617fe..9efd0cc 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ -# arches-references +# arches-controlled-lists Arches application for managing reference data and controlled lists diff --git a/arches_references/__init__.py b/arches_controlled_lists/__init__.py similarity index 100% rename from arches_references/__init__.py rename to arches_controlled_lists/__init__.py diff --git a/arches_references/apps.py b/arches_controlled_lists/apps.py similarity index 69% rename from arches_references/apps.py rename to arches_controlled_lists/apps.py index a198143..732859e 100644 --- a/arches_references/apps.py +++ b/arches_controlled_lists/apps.py @@ -4,9 +4,9 @@ from arches.settings_utils import generate_frontend_configuration -class ArchesReferencesConfig(AppConfig): - name = "arches_references" - verbose_name = "Arches References" +class ArchesControlledListsConfig(AppConfig): + name = "arches_controlled_lists" + verbose_name = "Arches Controlled Lists" is_arches_application = True def ready(self): diff --git a/arches_references/celery.py b/arches_controlled_lists/celery.py similarity index 71% rename from arches_references/celery.py rename to arches_controlled_lists/celery.py index dbaff2d..1ee33e4 100644 --- a/arches_references/celery.py +++ b/arches_controlled_lists/celery.py @@ -7,7 +7,7 @@ if platform.system().lower() == "windows": os.environ.setdefault("FORKED_BY_MULTIPROCESSING", "1") -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "arches_references.settings") -app = Celery("arches_references") +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "arches_controlled_lists.settings") +app = Celery("arches_controlled_lists") app.config_from_object("django.conf:settings", namespace="CELERY") app.autodiscover_tasks() diff --git a/arches_references/datatypes/__init__.py b/arches_controlled_lists/datatypes/__init__.py similarity index 100% rename from arches_references/datatypes/__init__.py rename to arches_controlled_lists/datatypes/__init__.py diff --git a/arches_references/datatypes/datatypes.py b/arches_controlled_lists/datatypes/datatypes.py similarity index 99% rename from arches_references/datatypes/datatypes.py rename to arches_controlled_lists/datatypes/datatypes.py index 6a86d2a..a0c5d60 100644 --- a/arches_references/datatypes/datatypes.py +++ b/arches_controlled_lists/datatypes/datatypes.py @@ -8,7 +8,7 @@ from arches.app.models.models import Node from arches.app.models.graph import GraphValidationError -from arches_references.models import ListItem +from arches_controlled_lists.models import ListItem @dataclass(kw_only=True) diff --git a/arches_references/functions/__init__.py b/arches_controlled_lists/functions/__init__.py similarity index 100% rename from arches_references/functions/__init__.py rename to arches_controlled_lists/functions/__init__.py diff --git a/arches_controlled_lists/hosts.py b/arches_controlled_lists/hosts.py new file mode 100644 index 0000000..520b3a0 --- /dev/null +++ b/arches_controlled_lists/hosts.py @@ -0,0 +1,11 @@ +import re +from django_hosts import patterns, host + +host_patterns = patterns( + "", + host( + re.sub(r"_", r"-", r"arches_controlled_lists"), + "arches_controlled_lists.urls", + name="arches_controlled_lists", + ), +) diff --git a/arches_references/locale/.gitkeep b/arches_controlled_lists/locale/.gitkeep similarity index 100% rename from arches_references/locale/.gitkeep rename to arches_controlled_lists/locale/.gitkeep diff --git a/arches_references/locale/messages.pot b/arches_controlled_lists/locale/messages.pot similarity index 100% rename from arches_references/locale/messages.pot rename to arches_controlled_lists/locale/messages.pot diff --git a/arches_references/management/__init__.py b/arches_controlled_lists/management/__init__.py similarity index 100% rename from arches_references/management/__init__.py rename to arches_controlled_lists/management/__init__.py diff --git a/arches_references/management/commands/__init__.py b/arches_controlled_lists/management/commands/__init__.py similarity index 100% rename from arches_references/management/commands/__init__.py rename to arches_controlled_lists/management/commands/__init__.py diff --git a/arches_references/management/commands/controlled_lists.py b/arches_controlled_lists/management/commands/controlled_lists.py similarity index 99% rename from arches_references/management/commands/controlled_lists.py rename to arches_controlled_lists/management/commands/controlled_lists.py index af0d819..2cca5e0 100644 --- a/arches_references/management/commands/controlled_lists.py +++ b/arches_controlled_lists/management/commands/controlled_lists.py @@ -16,7 +16,7 @@ Value, Widget, ) -from arches_references.models import List +from arches_controlled_lists.models import List class Command(BaseCommand): diff --git a/arches_references/management/commands/packages.py b/arches_controlled_lists/management/commands/packages.py similarity index 99% rename from arches_references/management/commands/packages.py rename to arches_controlled_lists/management/commands/packages.py index 6825ac5..48dab6b 100644 --- a/arches_references/management/commands/packages.py +++ b/arches_controlled_lists/management/commands/packages.py @@ -4,7 +4,7 @@ from arches.management.commands.packages import Command as PackagesCommand from arches.app.models.system_settings import settings from arches.app.models import models -from arches_references.models import List, ListItem, ListItemValue +from arches_controlled_lists.models import List, ListItem, ListItemValue from django.db import transaction diff --git a/arches_references/media/css/themes/_project.scss b/arches_controlled_lists/media/css/themes/_project.scss similarity index 100% rename from arches_references/media/css/themes/_project.scss rename to arches_controlled_lists/media/css/themes/_project.scss diff --git a/arches_references/media/img/favicon.png b/arches_controlled_lists/media/img/favicon.png similarity index 100% rename from arches_references/media/img/favicon.png rename to arches_controlled_lists/media/img/favicon.png diff --git a/arches_references/media/js/reports/default.js b/arches_controlled_lists/media/js/reports/default.js similarity index 100% rename from arches_references/media/js/reports/default.js rename to arches_controlled_lists/media/js/reports/default.js diff --git a/arches_references/media/js/viewmodels/reference-select.js b/arches_controlled_lists/media/js/viewmodels/reference-select.js similarity index 100% rename from arches_references/media/js/viewmodels/reference-select.js rename to arches_controlled_lists/media/js/viewmodels/reference-select.js diff --git a/arches_references/media/js/views/components/datatypes/reference.js b/arches_controlled_lists/media/js/views/components/datatypes/reference.js similarity index 100% rename from arches_references/media/js/views/components/datatypes/reference.js rename to arches_controlled_lists/media/js/views/components/datatypes/reference.js diff --git a/arches_references/media/js/views/components/plugins/controlled-list-manager.js b/arches_controlled_lists/media/js/views/components/plugins/controlled-list-manager.js similarity index 88% rename from arches_references/media/js/views/components/plugins/controlled-list-manager.js rename to arches_controlled_lists/media/js/views/components/plugins/controlled-list-manager.js index cec319e..b4c6d31 100644 --- a/arches_references/media/js/views/components/plugins/controlled-list-manager.js +++ b/arches_controlled_lists/media/js/views/components/plugins/controlled-list-manager.js @@ -2,8 +2,8 @@ import ko from 'knockout'; import { definePreset } from '@primevue/themes'; import { ArchesPreset, DEFAULT_THEME } from '@/arches/themes/default.ts'; -import { routes } from '@/arches_references/routes.ts'; -import ControlledListManager from '@/arches_references/plugins/ControlledListManager.vue'; +import { routes } from '@/arches_controlled_lists/routes.ts'; +import ControlledListManager from '@/arches_controlled_lists/plugins/ControlledListManager.vue'; import createVueApplication from 'utils/create-vue-application'; import ControlledListManagerTemplate from 'templates/views/components/plugins/controlled-list-manager.htm'; diff --git a/arches_references/media/js/views/components/widgets/reference-select.js b/arches_controlled_lists/media/js/views/components/widgets/reference-select.js similarity index 100% rename from arches_references/media/js/views/components/widgets/reference-select.js rename to arches_controlled_lists/media/js/views/components/widgets/reference-select.js diff --git a/arches_references/migrations/0001_initial.py b/arches_controlled_lists/migrations/0001_initial.py similarity index 92% rename from arches_references/migrations/0001_initial.py rename to arches_controlled_lists/migrations/0001_initial.py index f3676fc..c87931a 100644 --- a/arches_references/migrations/0001_initial.py +++ b/arches_controlled_lists/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 4.2.14 on 2024-07-11 12:20 +# Generated by Django 5.1.2 on 2025-02-12 13:55 import textwrap import uuid @@ -121,6 +121,15 @@ def remove_view_plugin(apps, schema_editor): """ ) + create_index = textwrap.dedent( + """ + CREATE INDEX "lists_reffed_by_node_idx" ON "nodes" ( + ((("config" ->> 'controlledList'))::uuid) + ); + """ + ) + remove_index = 'DROP INDEX IF EXISTS "lists_reffed_by_node_idx";' + operations = [ migrations.RunPython(add_plugin, remove_plugin), migrations.RunPython(assign_view_plugin, remove_view_plugin), @@ -140,7 +149,7 @@ def remove_view_plugin(apps, schema_editor): ("value", models.FileField(upload_to="list_item_images")), ], options={ - "db_table": "arches_references_listitemvalue", + "db_table": "arches_controlled_lists_listitemvalue", "managed": False, }, ), @@ -161,6 +170,16 @@ def remove_view_plugin(apps, schema_editor): ("search_only", models.BooleanField(default=False)), ], ), + migrations.CreateModel( + name="NodeProxy", + fields=[], + options={ + "proxy": True, + "indexes": [], + "constraints": [], + }, + bases=("models.node",), + ), migrations.CreateModel( name="ListItem", fields=[ @@ -173,7 +192,7 @@ def remove_view_plugin(apps, schema_editor): serialize=False, ), ), - ("uri", models.URLField(blank=True, max_length=2048, null=True)), + ("uri", models.URLField(blank=True, max_length=2048)), ( "sortorder", models.IntegerField( @@ -186,7 +205,7 @@ def remove_view_plugin(apps, schema_editor): models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, related_name="list_items", - to="arches_references.list", + to="arches_controlled_lists.list", ), ), ( @@ -196,13 +215,13 @@ def remove_view_plugin(apps, schema_editor): null=True, on_delete=django.db.models.deletion.CASCADE, related_name="children", - to="arches_references.listitem", + to="arches_controlled_lists.listitem", ), ), ], ), migrations.CreateModel( - name="ListItemValue", + name="ListItemImageMetadata", fields=[ ( "id", @@ -213,40 +232,40 @@ def remove_view_plugin(apps, schema_editor): serialize=False, ), ), - ("value", models.CharField(blank=True, max_length=1024)), + ( + "metadata_type", + models.CharField( + choices=[ + ("title", "Title"), + ("desc", "Description"), + ("attr", "Attribution"), + ("alt", "Alternative text"), + ], + max_length=5, + ), + ), + ("value", models.CharField(max_length=2048)), ( "language", models.ForeignKey( - blank=True, db_column="languageid", - null=True, on_delete=django.db.models.deletion.PROTECT, to="models.language", to_field="code", ), ), ( - "list_item", + "list_item_image", models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, - related_name="list_item_values", - to="arches_references.listitem", - ), - ), - ( - "valuetype", - models.ForeignKey( - limit_choices_to=models.Q( - ("category__in", ("label", "image", "note")) - ), - on_delete=django.db.models.deletion.PROTECT, - to="models.dvaluetype", + related_name="list_item_image_metadata", + to="arches_controlled_lists.listitemimage", ), ), ], ), migrations.CreateModel( - name="ListItemImageMetadata", + name="ListItemValue", fields=[ ( "id", @@ -257,38 +276,63 @@ def remove_view_plugin(apps, schema_editor): serialize=False, ), ), - ( - "metadata_type", - models.CharField( - choices=[ - ("title", "Title"), - ("desc", "Description"), - ("attr", "Attribution"), - ("alt", "Alternative text"), - ], - max_length=5, - ), - ), - ("value", models.CharField(max_length=2048)), + ("value", models.CharField(blank=True, max_length=1024)), ( "language", models.ForeignKey( + blank=True, db_column="languageid", + null=True, on_delete=django.db.models.deletion.PROTECT, to="models.language", to_field="code", ), ), ( - "list_item_image", + "list_item", models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, - related_name="list_item_image_metadata", - to="arches_references.listitemimage", + related_name="list_item_values", + to="arches_controlled_lists.listitem", + ), + ), + ( + "valuetype", + models.ForeignKey( + limit_choices_to=models.Q( + ("category__in", ("label", "image", "note")) + ), + on_delete=django.db.models.deletion.PROTECT, + to="models.dvaluetype", ), ), ], ), + migrations.AddConstraint( + model_name="listitem", + constraint=models.UniqueConstraint( + deferrable=django.db.models.constraints.Deferrable["DEFERRED"], + fields=("list", "sortorder"), + name="unique_list_sortorder", + violation_error_message="All items in this list must have distinct sort orders.", + ), + ), + migrations.AddConstraint( + model_name="listitem", + constraint=models.UniqueConstraint( + fields=("list", "uri"), + name="unique_list_uri", + violation_error_message="All items in this list must have distinct URIs.", + ), + ), + migrations.AddConstraint( + model_name="listitemimagemetadata", + constraint=models.UniqueConstraint( + fields=("list_item_image", "metadata_type", "language"), + name="unique_image_metadata_valuetype_language", + violation_error_message="Only one metadata entry per language and metadata type is permitted.", + ), + ), migrations.AddConstraint( model_name="listitemvalue", constraint=models.UniqueConstraint( @@ -318,29 +362,5 @@ def remove_view_plugin(apps, schema_editor): violation_error_message="Item values must be associated with a language.", ), ), - migrations.AddConstraint( - model_name="listitemimagemetadata", - constraint=models.UniqueConstraint( - fields=("list_item_image", "metadata_type", "language"), - name="unique_image_metadata_valuetype_language", - violation_error_message="Only one metadata entry per language and metadata type is permitted.", - ), - ), - migrations.AddConstraint( - model_name="listitem", - constraint=models.UniqueConstraint( - deferrable=django.db.models.constraints.Deferrable["DEFERRED"], - fields=("list", "sortorder"), - name="unique_list_sortorder", - violation_error_message="All items in this list must have distinct sort orders.", - ), - ), - migrations.AddConstraint( - model_name="listitem", - constraint=models.UniqueConstraint( - fields=("list", "uri"), - name="unique_list_uri", - violation_error_message="All items in this list must have distinct URIs.", - ), - ), + migrations.RunSQL(create_index, remove_index), ] diff --git a/arches_references/migrations/0002_etl_collections_to_controlled_lists.py b/arches_controlled_lists/migrations/0002_etl_collections_to_controlled_lists.py similarity index 95% rename from arches_references/migrations/0002_etl_collections_to_controlled_lists.py rename to arches_controlled_lists/migrations/0002_etl_collections_to_controlled_lists.py index 57c442e..dd53daf 100644 --- a/arches_references/migrations/0002_etl_collections_to_controlled_lists.py +++ b/arches_controlled_lists/migrations/0002_etl_collections_to_controlled_lists.py @@ -4,7 +4,7 @@ class Migration(migrations.Migration): dependencies = [ - ("arches_references", "0001_initial"), + ("arches_controlled_lists", "0001_initial"), ("guardian", "0002_generic_permissions_index"), ] @@ -81,30 +81,30 @@ class Migration(migrations.Migration): -- If overwrite flag is provided, completely recreate the list/items/values if overwrite then - delete from arches_references_listitemvalue + delete from arches_controlled_lists_listitemvalue where list_item_id in ( select id - from arches_references_listitem + from arches_controlled_lists_listitem where list_id in ( select id - from arches_references_list + from arches_controlled_lists_list where name = any(collection_names) ) ); - delete from arches_references_listitem + delete from arches_controlled_lists_listitem where list_id in ( select id - from arches_references_list + from arches_controlled_lists_list where name = any(collection_names) ); - delete from arches_references_list + delete from arches_controlled_lists_list where name = any(collection_names); end if; -- Migrate Collection -> Controlled List - insert into arches_references_list ( + insert into arches_controlled_lists_list ( id, name, dynamic, @@ -182,7 +182,7 @@ class Migration(migrations.Migration): with filtered_collection_hierarchy as ( select * from temp_collection_hierarchy - where root_list in (select id from arches_references_list where name = collection) + where root_list in (select id from arches_controlled_lists_list where name = collection) ), -- Rank prefLabels by user provided language, -- if no prefLabel in that language exists for a concept, fall back on next prefLabel ordered by languageid @@ -214,7 +214,7 @@ class Migration(migrations.Migration): depth from ranked_prefLabels rpl where language_rank = 1 and - root_list in (select id from arches_references_list where name = collection) + root_list in (select id from arches_controlled_lists_list where name = collection) ) insert into temp_list_items_and_values ( list_item_id, @@ -265,7 +265,7 @@ class Migration(migrations.Migration): list_id, parent_id, TRUE as existing_item - from arches_references_listitem + from arches_controlled_lists_listitem ) as t ) update temp_list_items_and_values t @@ -315,7 +315,7 @@ class Migration(migrations.Migration): set listitemvalue_id = uuid_generate_v4() where rownumber > 1; - insert into arches_references_listitem ( + insert into arches_controlled_lists_listitem ( id, uri, sortorder, @@ -333,7 +333,7 @@ class Migration(migrations.Migration): from temp_list_items_and_values; -- Migrate concept values -> controlled list item values - insert into arches_references_listitemvalue ( + insert into arches_controlled_lists_listitemvalue ( id, value, list_item_id, diff --git a/arches_references/migrations/__init__.py b/arches_controlled_lists/migrations/__init__.py similarity index 100% rename from arches_references/migrations/__init__.py rename to arches_controlled_lists/migrations/__init__.py diff --git a/arches_references/models.py b/arches_controlled_lists/models.py similarity index 99% rename from arches_references/models.py rename to arches_controlled_lists/models.py index eaa1cd1..3ccf626 100644 --- a/arches_references/models.py +++ b/arches_controlled_lists/models.py @@ -11,7 +11,7 @@ from arches.app.models.models import DValueType, Language, Node from arches.app.models.utils import field_names -from arches_references.querysets import ( +from arches_controlled_lists.querysets import ( ListQuerySet, ListItemImageManager, ListItemValueQuerySet, @@ -316,7 +316,7 @@ class ListItemImage(models.Model): class Meta: managed = False - db_table = "arches_references_listitemvalue" + db_table = "arches_controlled_lists_listitemvalue" def serialize(self): return { diff --git a/arches_references/querysets.py b/arches_controlled_lists/querysets.py similarity index 97% rename from arches_references/querysets.py rename to arches_controlled_lists/querysets.py index 7c215fd..94474ef 100644 --- a/arches_references/querysets.py +++ b/arches_controlled_lists/querysets.py @@ -6,7 +6,7 @@ class ListQuerySet(models.QuerySet): def annotate_node_fields(self, **kwargs): - from arches_references.models import NodeProxy + from arches_controlled_lists.models import NodeProxy qs = self for annotation_name, node_field in kwargs.items(): diff --git a/arches_references/search_components/__init__.py b/arches_controlled_lists/search_components/__init__.py similarity index 100% rename from arches_references/search_components/__init__.py rename to arches_controlled_lists/search_components/__init__.py diff --git a/arches_references/search_indexes/__init__.py b/arches_controlled_lists/search_indexes/__init__.py similarity index 100% rename from arches_references/search_indexes/__init__.py rename to arches_controlled_lists/search_indexes/__init__.py diff --git a/arches_references/settings.py b/arches_controlled_lists/settings.py similarity index 94% rename from arches_references/settings.py rename to arches_controlled_lists/settings.py index cce505b..45a9147 100644 --- a/arches_references/settings.py +++ b/arches_controlled_lists/settings.py @@ -1,5 +1,5 @@ """ -Django settings for arches_references project. +Django settings for arches_controlled_lists project. """ import inspect @@ -14,7 +14,7 @@ except ImportError: pass -APP_NAME = "arches_references" +APP_NAME = "arches_controlled_lists" APP_VERSION = semantic_version.Version(major=0, minor=0, patch=0) APP_ROOT = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) @@ -24,10 +24,10 @@ }, } -DATATYPE_LOCATIONS.append("arches_references.datatypes") -FUNCTION_LOCATIONS.append("arches_references.functions") -ETL_MODULE_LOCATIONS.append("arches_references.etl_modules") -SEARCH_COMPONENT_LOCATIONS.append("arches_references.search_components") +DATATYPE_LOCATIONS.append("arches_controlled_lists.datatypes") +FUNCTION_LOCATIONS.append("arches_controlled_lists.functions") +ETL_MODULE_LOCATIONS.append("arches_controlled_lists.etl_modules") +SEARCH_COMPONENT_LOCATIONS.append("arches_controlled_lists.search_components") LOCALE_PATHS.insert(0, os.path.join(APP_ROOT, "locale")) @@ -57,7 +57,7 @@ # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -ROOT_URLCONF = "arches_references.urls" +ROOT_URLCONF = "arches_controlled_lists.urls" # Modify this line as needed for your project to connect to elasticsearch with a password that you generate ELASTICSEARCH_CONNECTION_OPTIONS = { @@ -79,11 +79,11 @@ # Or Kibana: https://www.elastic.co/guide/en/kibana/current/api-keys.html # a prefix to append to all elasticsearch indexes, note: must be lower case -ELASTICSEARCH_PREFIX = "arches_references" +ELASTICSEARCH_PREFIX = "arches_controlled_lists" ELASTICSEARCH_CUSTOM_INDEXES = [] # [{ -# 'module': 'arches_references.search_indexes.sample_index.SampleIndex', +# 'module': 'arches_controlled_lists.search_indexes.sample_index.SampleIndex', # 'name': 'my_new_custom_index', <-- follow ES index naming rules # 'should_update_asynchronously': False <-- denotes if asynchronously updating the index would affect custom functionality within the project. # }] @@ -107,7 +107,7 @@ "CONN_MAX_AGE": 0, "ENGINE": "django.contrib.gis.db.backends.postgis", "HOST": "localhost", - "NAME": "arches_references", + "NAME": "arches_controlled_lists", "OPTIONS": {}, "PASSWORD": "postgis", "PORT": "5432", @@ -130,7 +130,7 @@ "django.contrib.staticfiles", "django.contrib.gis", "django_hosts", - "arches_references", + "arches_controlled_lists", "arches", "arches.app.models", "arches.management", @@ -148,8 +148,8 @@ # take precedence over core arches templates in arches/app/templates. INSTALLED_APPS += ("arches.app",) -ROOT_HOSTCONF = "arches_references.hosts" -DEFAULT_HOST = "arches_references" +ROOT_HOSTCONF = "arches_controlled_lists.hosts" +DEFAULT_HOST = "arches_controlled_lists" MIDDLEWARE = [ "corsheaders.middleware.CorsMiddleware", @@ -188,7 +188,7 @@ SYSTEM_SETTINGS_LOCAL_PATH = os.path.join( APP_ROOT, "system_settings", "System_Settings.json" ) -WSGI_APPLICATION = "arches_references.wsgi.application" +WSGI_APPLICATION = "arches_controlled_lists.wsgi.application" # URL that handles the media served from MEDIA_ROOT, used for managing stored files. # It must end in a slash if set to a non-empty value. @@ -252,7 +252,7 @@ DATA_UPLOAD_MAX_MEMORY_SIZE = 15728640 # Unique session cookie ensures that logins are treated separately for each app -SESSION_COOKIE_NAME = "arches_references" +SESSION_COOKIE_NAME = "arches_controlled_lists" # For more info on configuring your cache: https://docs.djangoproject.com/en/2.2/topics/cache/ CACHES = { diff --git a/arches_references/src/arches_references/api.ts b/arches_controlled_lists/src/arches_controlled_lists/api.ts similarity index 98% rename from arches_references/src/arches_references/api.ts rename to arches_controlled_lists/src/arches_controlled_lists/api.ts index 51eee9e..f5982b4 100644 --- a/arches_references/src/arches_references/api.ts +++ b/arches_controlled_lists/src/arches_controlled_lists/api.ts @@ -1,7 +1,10 @@ import arches from "arches"; import Cookies from "js-cookie"; -import { makeParentMap, makeSortOrderMap } from "@/arches_references/utils.ts"; +import { + makeParentMap, + makeSortOrderMap, +} from "@/arches_controlled_lists/utils.ts"; import type { ControlledList, @@ -12,7 +15,7 @@ import type { NewOrExistingControlledListItemImageMetadata, NewValue, Value, -} from "@/arches_references/types"; +} from "./types"; function getToken() { const token = Cookies.get("csrftoken"); diff --git a/arches_references/src/arches_references/components/ControlledListsMain.vue b/arches_controlled_lists/src/arches_controlled_lists/components/ControlledListsMain.vue similarity index 86% rename from arches_references/src/arches_references/components/ControlledListsMain.vue rename to arches_controlled_lists/src/arches_controlled_lists/components/ControlledListsMain.vue index dc6fe0d..1e84602 100644 --- a/arches_references/src/arches_references/components/ControlledListsMain.vue +++ b/arches_controlled_lists/src/arches_controlled_lists/components/ControlledListsMain.vue @@ -11,16 +11,16 @@ import { displayedRowKey, selectedLanguageKey, systemLanguageKey, -} from "@/arches_references/constants.ts"; -import { routeNames } from "@/arches_references/routes.ts"; -import { dataIsList } from "@/arches_references/utils.ts"; +} from "@/arches_controlled_lists/constants.ts"; +import { routeNames } from "@/arches_controlled_lists/routes.ts"; +import { dataIsList } from "@/arches_controlled_lists/utils.ts"; -import ListHeader from "@/arches_references/components/misc/ListHeader.vue"; -import MainSplitter from "@/arches_references/components/MainSplitter.vue"; +import ListHeader from "@/arches_controlled_lists/components/misc/ListHeader.vue"; +import MainSplitter from "@/arches_controlled_lists/components/MainSplitter.vue"; import type { Ref } from "vue"; import type { Language } from "@/arches_vue_utils/types"; -import type { Selectable } from "@/arches_references/types"; +import type { Selectable } from "../types"; const router = useRouter(); diff --git a/arches_references/src/arches_references/components/MainSplitter.vue b/arches_controlled_lists/src/arches_controlled_lists/components/MainSplitter.vue similarity index 69% rename from arches_references/src/arches_references/components/MainSplitter.vue rename to arches_controlled_lists/src/arches_controlled_lists/components/MainSplitter.vue index f982a18..d9853c3 100644 --- a/arches_references/src/arches_references/components/MainSplitter.vue +++ b/arches_controlled_lists/src/arches_controlled_lists/components/MainSplitter.vue @@ -5,16 +5,16 @@ import ProgressSpinner from "primevue/progressspinner"; import Splitter from "primevue/splitter"; import SplitterPanel from "primevue/splitterpanel"; -import { displayedRowKey } from "@/arches_references/constants.ts"; -import { routeNames } from "@/arches_references/routes.ts"; -import { dataIsList } from "@/arches_references/utils.ts"; -import ControlledListSplash from "@/arches_references/components/misc/ControlledListSplash.vue"; -import ItemEditor from "@/arches_references/components/editor/ItemEditor.vue"; -import ListCharacteristics from "@/arches_references/components/editor/ListCharacteristics.vue"; -import ListTree from "@/arches_references/components/tree/ListTree.vue"; +import { displayedRowKey } from "@/arches_controlled_lists/constants.ts"; +import { routeNames } from "@/arches_controlled_lists/routes.ts"; +import { dataIsList } from "@/arches_controlled_lists/utils.ts"; +import ControlledListSplash from "@/arches_controlled_lists/components/misc/ControlledListSplash.vue"; +import ItemEditor from "@/arches_controlled_lists/components/editor/ItemEditor.vue"; +import ListCharacteristics from "@/arches_controlled_lists/components/editor/ListCharacteristics.vue"; +import ListTree from "@/arches_controlled_lists/components/tree/ListTree.vue"; import type { Ref } from "vue"; -import type { ControlledList } from "@/arches_references/types"; +import type { ControlledList } from "../types"; const { displayedRow } = inject(displayedRowKey) as unknown as { displayedRow: Ref; diff --git a/arches_references/src/arches_references/components/editor/AddMetadata.vue b/arches_controlled_lists/src/arches_controlled_lists/components/editor/AddMetadata.vue similarity index 90% rename from arches_references/src/arches_references/components/editor/AddMetadata.vue rename to arches_controlled_lists/src/arches_controlled_lists/components/editor/AddMetadata.vue index 67196ac..bd0dfa7 100644 --- a/arches_references/src/arches_references/components/editor/AddMetadata.vue +++ b/arches_controlled_lists/src/arches_controlled_lists/components/editor/AddMetadata.vue @@ -5,8 +5,15 @@ import { useGettext } from "vue3-gettext"; import Button from "primevue/button"; -import { itemKey, CONTRAST, PRIMARY } from "@/arches_references/constants.ts"; -import { dataIsNew, shouldUseContrast } from "@/arches_references/utils.ts"; +import { + itemKey, + CONTRAST, + PRIMARY, +} from "@/arches_controlled_lists/constants.ts"; +import { + dataIsNew, + shouldUseContrast, +} from "@/arches_controlled_lists/utils.ts"; import type { Ref } from "vue"; import type { @@ -14,7 +21,7 @@ import type { ControlledListItemImage, ControlledListItemImageMetadata, LabeledChoice, -} from "@/arches_references/types"; +} from "@/arches_controlled_lists/types"; const { labeledChoices, image, makeMetadataEditable } = defineProps<{ labeledChoices: LabeledChoice[]; diff --git a/arches_references/src/arches_references/components/editor/AddValue.vue b/arches_controlled_lists/src/arches_controlled_lists/components/editor/AddValue.vue similarity index 94% rename from arches_references/src/arches_references/components/editor/AddValue.vue rename to arches_controlled_lists/src/arches_controlled_lists/components/editor/AddValue.vue index e3902cd..f0f73ef 100644 --- a/arches_references/src/arches_references/components/editor/AddValue.vue +++ b/arches_controlled_lists/src/arches_controlled_lists/components/editor/AddValue.vue @@ -11,8 +11,11 @@ import { CONTRAST, NOTE_CHOICES, PRIMARY, -} from "@/arches_references/constants.ts"; -import { dataIsNew, shouldUseContrast } from "@/arches_references/utils.ts"; +} from "@/arches_controlled_lists/constants.ts"; +import { + dataIsNew, + shouldUseContrast, +} from "@/arches_controlled_lists/utils.ts"; import type { Ref } from "vue"; import type { Language } from "@/arches_vue_utils/types"; @@ -20,7 +23,7 @@ import type { ControlledListItem, Value, ValueType, -} from "@/arches_references/types"; +} from "@/arches_controlled_lists/types"; const { valueType, makeNewValueEditable } = defineProps<{ valueType?: ValueType; diff --git a/arches_references/src/arches_references/components/editor/ImageEditor.vue b/arches_controlled_lists/src/arches_controlled_lists/components/editor/ImageEditor.vue similarity index 89% rename from arches_references/src/arches_references/components/editor/ImageEditor.vue rename to arches_controlled_lists/src/arches_controlled_lists/components/editor/ImageEditor.vue index a65fe07..ae89ad0 100644 --- a/arches_references/src/arches_references/components/editor/ImageEditor.vue +++ b/arches_controlled_lists/src/arches_controlled_lists/components/editor/ImageEditor.vue @@ -7,15 +7,15 @@ import { itemKey, METADATA_CHOICES, systemLanguageKey, -} from "@/arches_references/constants.ts"; -import ImageMetadata from "@/arches_references/components/editor/ImageMetadata.vue"; +} from "@/arches_controlled_lists/constants.ts"; +import ImageMetadata from "@/arches_controlled_lists/components/editor/ImageMetadata.vue"; import type { Ref } from "vue"; import type { Language } from "@/arches_vue_utils/types"; import type { ControlledListItem, ControlledListItemImage, -} from "@/arches_references/types"; +} from "@/arches_controlled_lists/types"; const item = inject(itemKey) as Ref; const systemLanguage = inject(systemLanguageKey) as Language; diff --git a/arches_references/src/arches_references/components/editor/ImageMetadata.vue b/arches_controlled_lists/src/arches_controlled_lists/components/editor/ImageMetadata.vue similarity index 97% rename from arches_references/src/arches_references/components/editor/ImageMetadata.vue rename to arches_controlled_lists/src/arches_controlled_lists/components/editor/ImageMetadata.vue index 47db506..e210218 100644 --- a/arches_references/src/arches_references/components/editor/ImageMetadata.vue +++ b/arches_controlled_lists/src/arches_controlled_lists/components/editor/ImageMetadata.vue @@ -14,7 +14,7 @@ import { deleteImage, deleteMetadata, upsertMetadata, -} from "@/arches_references/api.ts"; +} from "@/arches_controlled_lists/api.ts"; import { CONTRAST, DANGER, @@ -22,13 +22,13 @@ import { ERROR, METADATA_CHOICES, itemKey, -} from "@/arches_references/constants.ts"; +} from "@/arches_controlled_lists/constants.ts"; import { dataIsNew, languageNameFromCode, shouldUseContrast, -} from "@/arches_references/utils.ts"; -import AddMetadata from "@/arches_references/components/editor/AddMetadata.vue"; +} from "@/arches_controlled_lists/utils.ts"; +import AddMetadata from "@/arches_controlled_lists/components/editor/AddMetadata.vue"; import type { Ref } from "vue"; import type { DataTableRowEditInitEvent } from "primevue/datatable"; @@ -39,7 +39,7 @@ import type { ControlledListItemImageMetadata, LabeledChoice, NewOrExistingControlledListItemImageMetadata, -} from "@/arches_references/types"; +} from "@/arches_controlled_lists/types"; const toast = useToast(); const { $gettext } = useGettext(); diff --git a/arches_references/src/arches_references/components/editor/ItemEditor.vue b/arches_controlled_lists/src/arches_controlled_lists/components/editor/ItemEditor.vue similarity index 55% rename from arches_references/src/arches_references/components/editor/ItemEditor.vue rename to arches_controlled_lists/src/arches_controlled_lists/components/editor/ItemEditor.vue index 78a56ba..7ca3665 100644 --- a/arches_references/src/arches_references/components/editor/ItemEditor.vue +++ b/arches_controlled_lists/src/arches_controlled_lists/components/editor/ItemEditor.vue @@ -1,21 +1,21 @@