Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds subdomain handling #11001 #11002

Merged
merged 25 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ source =
arches/

omit =
*/python?.?/*
*/__init__.py
*/celery.py
*/hosts.py
*/models/migrations/*
*/python?.?/*
*/settings*.py
*/urls.py
*/wsgi.py
*/celery.py
*/__init__.py

data_file = coverage/python/.coverage

Expand Down
18 changes: 12 additions & 6 deletions arches/app/media/js/arches.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,15 @@ define(['utils/set-csrf-token'], function() {
}
}

return {
...parsedArchesData,
translations: parsedArchesTranslations,
urls: parsedArchesUrls,
};
});
const archesObject = { ...parsedArchesData };

if (Object.keys(parsedArchesTranslations).length) {
archesObject["translations"] = parsedArchesTranslations;
}

if (Object.keys(parsedArchesUrls).length) {
archesObject["urls"] = parsedArchesUrls;
}

return archesObject;
});
15 changes: 0 additions & 15 deletions arches/app/media/js/views/plugin-standalone.js

This file was deleted.

4 changes: 3 additions & 1 deletion arches/app/src/declarations.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// import declarations from other projects or Arches core
declare module "arches";
declare module "arches/*";
declare module "arches/**";

// declare untyped modules that have been added to your project in `package.json`
declare module "arches";
declare module "@babel/runtime";
declare module "@mapbox/geojsonhint";
declare module "cross-env";
Expand Down
126 changes: 126 additions & 0 deletions arches/app/templates/arches_urls.htm
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
{% block arches_urls %}
<div
class='arches-urls'
root="{% url 'root' %}"
home="{% url 'home' %}"
media="{{ STATIC_URL }}"
rdm="{% url 'rdm' ''%}"
uploadedfiles="{{ MEDIA_URL }}"
url_subpath="{{app_settings.FORCE_SCRIPT_NAME}}"
concept_tree="{% url 'concept_tree' '' %}"
concept="{% url 'concept' 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' %}"
concept_search="{% url 'concept_search' %}"
concept_value="{% url 'concept_value' %}"
concept_manage_parents="{% url 'concept_manage_parents' 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' %}"
concept_make_collection="{% url 'make_collection' 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' %}"
change_password="{% url 'change_password' %}"
export_concept="{% url 'export_concept' 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' %}"
export_concept_collections="{% url 'export_concept_collections' %}"
get_concept_collections="{% url 'get_concept_collections' %}"
dropdown="{% url 'dropdown' %}"
paged_dropdown="{% url 'paged_dropdown' %}"
get_pref_label="{% url 'get_pref_label' %}"
from_sparql_endpoint="{% url 'from_sparql_endpoint' 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' %}"
search_sparql_endpoint="{% url 'search_sparql_endpoint' %}"
confirm_delete="{% url 'confirm_delete' 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' %}"
search_home="{% url 'search_home' %}"
search_terms="{% url 'search_terms' %}"
search_results="{% url 'search_results' %}"
export_results="{% url 'export_results' %}"
get_export_file="{% url 'get_export_file' %}"
buffer="{% url 'buffer'%}"
config="{% url 'config' %}"
node="{% url 'node' 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' %}"
graph_nodes='(graphid)=>{return "{% url "graph_nodes" "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" %}".replace("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", graphid)}'
nodegroup="{% url 'nodegroup' %}"
node_layer="{% url 'node_layer' 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' %}"
graph='"{% url "graph" "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" %}".replace("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", "")'
graph_designer='(graphid)=>{return "{% url "graph_designer" "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" %}".replace("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", graphid)}'
graph_settings='(graphid)=>{return "{% url "graph_settings" "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" %}".replace("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", graphid)}'
get_notifications="{% url 'get_notifications' %}"
dismiss_notifications="{% url 'dismiss_notifications' %}"
get_notification_types="{% url 'get_notification_types' %}"
update_notification_types="{% url 'update_notification_types' %}"
card="{% url 'card' '' %}"
reorder_cards="{% url 'reorder_cards'%}"
resource="{% url 'resource' %}"
resource_editor='"{% url "resource_editor" "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" %}".replace("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", "")'
resource_copy='"{% url "resource_copy" "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" %}".replace("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", "")'
resource_report='"{% url "resource_report" "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" %}".replace("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", "")'
resource_edit_log='"{% url "resource_edit_log" "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" %}".replace("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", "")'
get_resource_edit_log='(graphid)=>{return "{% url "resource_edit_log" "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" %}".replace("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", graphid)}'
resource_data='"{% url "resource_data" "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" %}".replace(/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa/g, "")'
resource_cards='"{% url "resource_cards" "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" %}".replace("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", "")'
related_resources='"{% url "related_resources" "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" %}".replace("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", "")'
resource_descriptors='"{% url "resource_descriptors" "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" %}".replace("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", "")'
resource_tiles="{% url 'resource_tiles' 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' %}"
tile="{% url 'tile' %}"
reorder_tiles="{% url 'reorder_tiles' %}"
reorder_nodes="{% url 'reorder_nodes' %}"
delete_provisional_tile="{% url 'delete_provisional_tile' %}"
edit_history="{% url 'edit_history' %}"
tile_history="{% url 'tile_history' %}"
download_files="{% url 'download_files' %}"
apply_functions='"{% url "apply_functions" "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" %}".replace("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", "")'
remove_functions='"{% url "remove_functions" "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" %}".replace("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", "")'
time_wheel_config="{% url 'time_wheel_config' %}"
two_factor_authentication_reset="{% url 'two-factor-authentication-reset' %}"
reindex="{% url 'reindex' %}"
permission_data="{% url 'permission_data' %}"
resource_permission_data="{% url 'resource_permission_data' %}"
permission_manager_data="{% url 'permission_manager_data' %}"
clear_user_permission_cache="{% url 'clear_user_permission_cache' %}"
get_user_names="{% url 'get_user_names' %}"
feature_popup_content="{% url 'feature_popup_content' %}"
related_resource_candidates="{% url 'related_resource_candidates' %}"
relatable_resources="{% url 'relatable_resources' %}"
languages="{% url 'language' %}"
get_domain_connections='(graphid)=>{return "{% url "get_domain_connections" "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" %}".replace("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", graphid)}'
clone_graph='(graphid)=>{return "{% url "clone_graph" "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" %}".replace("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", graphid)}'
export_graph='(graphid)=>{return "{% url "export_graph" "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" %}".replace("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", graphid)}'
publish_graph='(graphid)=>{return "{% url "publish_graph" "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" %}".replace("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", graphid)}'
unpublish_graph='(graphid)=>{return "{% url "unpublish_graph" "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" %}".replace("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", graphid)}'
delete_graph='(graphid)=>{return "{% url "delete_graph" "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" %}".replace("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", graphid)}'
delete_instances='(graphid)=>{return "{% url "delete_instances" "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" %}".replace("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", graphid)}'
export_mapping_file='(graphid)=>{return "{% url "export_mapping_file" "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" %}".replace("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", graphid)}'
add_resource='(graphid)=>{return "{% url "add_resource" "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" %}".replace("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", graphid)}'
function_manager='(graphid)=>{return "{% url "function_manager" "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" %}".replace("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", graphid)}'
plugin='(pluginid)=>{return "{% url "plugins" "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" %}".replace("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", pluginid)}'
workflow_history='"{% url "workflow_history" "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" %}".replace("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", "")'
transaction_reverse='(transactionid)=> {return "{% url "transaction_reverse" "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" %}".replace("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", transactionid)}'
mvt='(nodeid)=>{return decodeURI("{% url "mvt" "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" "{z}" "{x}" "{y}" %}").replace("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", nodeid)}'
help_template="{% url 'help_templates' %}"
api_plugins='"{% url "api_plugins" "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" %}".replace("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", "")'
graphs_api='"{% url "graphs_api" "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" %}".replace("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", "")'
api_card='"{% url "api_card" "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" %}".replace("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", "")'
api_tiles='(tileid)=>{
return "{% url "api_tiles" "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" %}".replace("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", tileid);
}'
api_nodegroup='(nodegroupid)=>{
return "{% url "api_nodegroup" "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" %}".replace("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", nodegroupid);
}'
api_nodes='(nodeid)=>{
return "{% url "api_nodes" "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" %}".replace("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", nodeid);
}'
api_node_value="{% url 'api_node_value' %}"
api_resource_report='(resourceid)=>{return "{% url "api_resource_report" "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" %}".replace("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", resourceid)}'
api_bulk_resource_report="{% url 'api_bulk_resource_report' %}"
api_bulk_disambiguated_resource_instance="{% url 'api_bulk_disambiguated_resource_instance' %}"
api_resources='(resourceid)=>{return "{% url "resources" "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" %}".replace("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", resourceid)}'
api_search_component_data='"{% url "api_search_component_data" "aaaa"%}".replace("aaaa", "")'
api_user_incomplete_workflows="{% url 'api_user_incomplete_workflows' %}"
api_get_frontend_i18n_data="{% url 'get_frontend_i18n_data' %}"
geojson="{% url 'geojson' %}"
icons="{% url 'icons' %}"
ontology_properties="{% url 'ontology_properties' %}"
iiifmanifest="{% url 'iiifmanifest' %}"
manifest_manager="{% url 'manifest_manager' %}"
etl_manager="{% url 'etl_manager' %}"
iiifannotations="{% url 'iiifannotations' %}"
iiifannotationnodes="{% url 'iiifannotationnodes' %}"
validatejson='"{% url "validatejson" "aaaa"%}".replace("aaaa", "")'
get_dsl="{% url 'get_dsl' %}"
transform_edtf_for_tile="{% url 'transform_edtf_for_tile' %}"
api_get_nodegroup_tree="{% url 'api_get_nodegroup_tree' %}"
></div>
{% endblock arches_urls %}
2 changes: 1 addition & 1 deletion arches/app/templates/base-manager.htm
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ <h1 class="brand-text" style="margin-top: 15px;">{{ app_name }}</h1>

{% for p in plugins %}
{% if p.config is not None %}
{% if p.config.show and not p.config.is_standalone %}
chrabyrd marked this conversation as resolved.
Show resolved Hide resolved
{% if p.config.show %}
<!-- ko let: {uid: Math.random().toString()} -->
<li {% if main_script == "views/plugin" and plugin.pluginid == p.pluginid %} class="active-sub" {% endif %}>
{% if p.slug is not None %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->
<!--[if !IE]><!--> <html lang="en"> <!--<![endif]-->

{% block head %}
<head>
<title>
{% block title %} {{ plugin.name }} {% endblock title %}
{% block title %}{% endblock title %}
</title>

<!-- Meta -->
Expand All @@ -46,23 +47,24 @@
<link rel="stylesheet" href="{% webpack_static 'node_modules/font-awesome/css/font-awesome.min.css' %}" />
{% endblock css %}
</head>
{% endblock head %}

{% block body_content %}
<body>
{% block main_content %}
<div id="plugin-mounting-point"></div>
{% endblock main_content %}
{% block body %}
{% endblock body %}
</body>
{% endblock body_content %}

{% block javascript %}
<script src="{% webpack_static 'node_modules/requirejs/require.js' %}"></script>

{% block pre_require_js %}
<div
id="pluginData"
style="display: none;"
pluginData='{{ plugin_json }}'
></div>
{% endblock pre_require_js %}

{% block arches_modules %}
{% include "arches_urls.htm" %}
{% endblock arches_modules %}
chrabyrd marked this conversation as resolved.
Show resolved Hide resolved

{% if main_script %}
<script src="{% webpack_static '' %}build/js/{{main_script}}.js"></script>
Expand All @@ -81,4 +83,4 @@
{% endif %}
{% endblock javascript %}

</html>
</html>
55 changes: 13 additions & 42 deletions arches/app/templates/base.htm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
{% extends "base-root.htm" %}

{% load static %}
{% load i18n %}
{% load webpack_static from webpack_loader %}
Expand All @@ -29,22 +31,11 @@
<script>document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':{{ livereload_port }}/livereload.js?snipver=1"></' + 'script>')</script>
{% endif %}

{% block head %}
{{ block.super }}
<head>
<title>{% block title %}{{ app_settings.APP_NAME }} - {% endblock title %}</title>

<!-- Meta -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">

<link rel="shortcut icon" href="{% webpack_static 'favicons/favicon.ico' %}" type="image/x-icon" />
<link rel="apple-touch-icon" href="{% webpack_static 'favicons/apple-touch-icon.png' %}" />
<link rel="apple-touch-icon" sizes="76x76" href="{% webpack_static 'favicons/apple-touch-icon-76x76.png' %}" />
<link rel="apple-touch-icon" sizes="120x120" href="{% webpack_static 'favicons/apple-touch-icon-120x120.png' %}" />
<link rel="apple-touch-icon" sizes="152x152" href="{% webpack_static 'favicons/apple-touch-icon-152x152.png' %}" />
<link rel="apple-touch-icon" sizes="180x180" href="{% webpack_static 'favicons/apple-touch-icon-180x180.png' %}" />

{% block css %}
{% render_bundle 'css/arches' 'css' %}
{% render_bundle 'css/core' 'css' %}
Expand All @@ -62,49 +53,29 @@
{% endblock css %}

</head>
{% endblock head %}

{% block body_content %}
{{ block.super }}
<body dir="{{ app_settings.ACTIVE_LANGUAGE_DIR }}" {% block body_attributes %}class="scroll-y-auto"{% endblock %}>
{% block loading_mask %}

<div class="loading-mask" data-bind="visible: typeof(loading()) === 'boolean' && loading()"></div>

<div class="loading-mask" style="display: none;" data-bind="visible: typeof(loading()==='string') && loading().length > 0">
<div class="loading-mask-string" data-bind="text: loading"></div>
</div>


{% endblock loading_mask %}
{% block body %}

{% block body %}
{% endblock body %}
</body>
{% endblock body_content %}

{% block javascript %}
<script src="{% webpack_static 'node_modules/requirejs/require.js' %}"></script>

{% block pre_require_js %}
{% endblock pre_require_js %}

{% include 'javascript.htm' %}

{% if main_script %}
<script src="{% webpack_static '' %}build/js/{{main_script}}.js"></script>
{% endif %}

{% if app_settings.GOOGLE_ANALYTICS_TRACKING_ID != None %}

<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', '{{app_settings.GOOGLE_ANALYTICS_TRACKING_ID}}', 'auto');
ga('send', 'pageview');
</script>

{% endif %}
{{ block.super }}

{% block arches_modules %}
{% include 'javascript.htm' %}
{% endblock arches_modules %}
{% endblock javascript %}

</html>
Loading