Skip to content

Commit

Permalink
Merge pull request galaxyproject#16675 from jmchilton/report_urls
Browse files Browse the repository at this point in the history
Implement instance URLs in Galaxy markdown.
  • Loading branch information
jdavcs authored Nov 8, 2023
2 parents a57b08a + c1d3eb5 commit 7404ed0
Show file tree
Hide file tree
Showing 17 changed files with 415 additions and 75 deletions.
31 changes: 31 additions & 0 deletions client/src/components/Markdown/Elements/InstanceUrl.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<script setup lang="ts">
import { computed } from "vue";
import ExternalLink from "@/components/ExternalLink.vue";
import LoadingSpan from "@/components/LoadingSpan.vue";
interface InstanceUrlProps {
href?: string;
title?: string;
loading: boolean;
}
const props = withDefaults(defineProps<InstanceUrlProps>(), {
href: null,
title: null,
});
const effectiveTitle = computed(() => {
return props.title ? props.title : props.href;
});
</script>

<template>
<p>
<LoadingSpan v-if="props.loading" message="Loading instance configuration"> </LoadingSpan>
<ExternalLink v-else-if="props.href" :href="props.href">
{{ effectiveTitle }}
</ExternalLink>
<i v-else> Configuration value unset, please contact Galaxy admin. </i>
</p>
</template>
7 changes: 7 additions & 0 deletions client/src/components/Markdown/MarkdownContainer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ import MountTarget from "./MarkdownContainer.vue";
jest.mock("utils/redirect");
withPrefix.mockImplementation((url) => url);

jest.mock("@/composables/config", () => ({
useConfig: jest.fn(() => ({
config: {},
isConfigLoaded: true,
})),
}));

const localVue = getLocalVue();
const axiosMock = new MockAdapter(axios);

Expand Down
38 changes: 38 additions & 0 deletions client/src/components/Markdown/MarkdownContainer.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
<script setup>
import { computed, ref } from "vue";
import { useConfig } from "@/composables/config";
import HistoryDatasetAsImage from "./Elements/HistoryDatasetAsImage.vue";
import HistoryDatasetCollectionDisplay from "./Elements/HistoryDatasetCollection/CollectionDisplay.vue";
import HistoryDatasetDetails from "./Elements/HistoryDatasetDetails.vue";
import HistoryDatasetDisplay from "./Elements/HistoryDatasetDisplay.vue";
import HistoryDatasetIndex from "./Elements/HistoryDatasetIndex.vue";
import HistoryDatasetLink from "./Elements/HistoryDatasetLink.vue";
import HistoryLink from "./Elements/HistoryLink.vue";
import InstanceUrl from "./Elements/InstanceUrl.vue";
import InvocationTime from "./Elements/InvocationTime.vue";
import JobMetrics from "./Elements/JobMetrics.vue";
import JobParameters from "./Elements/JobParameters.vue";
Expand All @@ -17,6 +20,8 @@ import WorkflowDisplay from "./Elements/Workflow/WorkflowDisplay.vue";
import WorkflowImage from "./Elements/Workflow/WorkflowImage.vue";
import WorkflowLicense from "./Elements/Workflow/WorkflowLicense.vue";
const { config, isConfigLoaded } = useConfig();
const toggle = ref(false);
const props = defineProps({
name: {
Expand Down Expand Up @@ -83,6 +88,39 @@ const isVisible = computed(() => !isCollapsible.value || toggle.value);
<div v-else-if="name == 'workflow_license'" class="workflow-license">
<WorkflowLicense :license-id="workflows[args.workflow_id]['license']" />
</div>
<InstanceUrl
v-else-if="name == 'instance_citation_link'"
:href="config.citation_url"
:loading="!isConfigLoaded">
</InstanceUrl>
<InstanceUrl v-else-if="name == 'instance_terms_link'" :href="config.terms_url" :loading="!isConfigLoaded">
</InstanceUrl>
<InstanceUrl
v-else-if="name == 'instance_support_link'"
:href="config.support_url"
:loading="!isConfigLoaded">
</InstanceUrl>
<InstanceUrl
v-else-if="name == 'instance_help_link'"
:href="config.helpsite_url"
:loading="!isConfigLoaded">
</InstanceUrl>
<InstanceUrl
v-else-if="name == 'instance_resources_link'"
:href="config.instance_resource_url"
:loading="!isConfigLoaded">
</InstanceUrl>
<InstanceUrl
v-else-if="name == 'instance_access_link'"
:href="config.instance_access_url"
:loading="!isConfigLoaded">
</InstanceUrl>
<InstanceUrl
v-else-if="name == 'instance_organization_link'"
:href="config.ga4gh_service_organization_url"
:title="config.ga4gh_service_organization_name"
:loading="!isConfigLoaded">
</InstanceUrl>
<HistoryLink v-else-if="name == 'history_link'" :args="args" :histories="histories" />
<HistoryDatasetAsImage v-else-if="name == 'history_dataset_as_image'" :args="args" />
<HistoryDatasetLink v-else-if="name == 'history_dataset_link'" :args="args" />
Expand Down
43 changes: 43 additions & 0 deletions client/src/components/Markdown/MarkdownToolBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
:expanded="true"
@onClick="onClick" />
<ToolSection v-else :category="workflowSection" :expanded="true" @onClick="onClick" />
<ToolSection :category="linksSection" :expanded="false" @onClick="onClick" />
<ToolSection :category="otherSection" :expanded="true" @onClick="onClick" />
<ToolSection
v-if="hasVisualizations"
Expand Down Expand Up @@ -250,6 +251,48 @@ export default {
},
],
},
linksSection: {
title: "Galaxy Instance Links",
name: "links",
elems: [
{
id: "instance_access_link",
name: "Access",
description: "(link used to access this Galaxy)",
},
{
id: "instance_resources_link",
name: "Resources",
description: "(link for more information about this Galaxy)",
},
{
id: "instance_help_link",
name: "Help",
description: "(link for finding help content for this Galaxy)",
},
{
id: "instance_support_link",
name: "Support",
description: "(link for support for this Galaxy)",
},
{
id: "instance_citation_link",
name: "Citation",
description: "(link describing how to cite this Galaxy instance)",
},
{
id: "instance_terms_link",
name: "Terms and Conditions",
description: "(link describing terms and conditions for using this Galaxy instance)",
},
{
id: "instance_organization_link",
name: "Organization",
description: "(link describing organization that runs this Galaxy instance)",
},
],
},
visualizationSection: {
title: "Visualizations",
name: "visualizations",
Expand Down
4 changes: 3 additions & 1 deletion client/src/components/PageDisplay/PageDisplay.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
@onEdit="onEdit" />
<PageHtml v-else :page="page" />
</div>
<b-alert v-else variant="info" show>Unsupported page format.</b-alert>
<LoadingSpan v-else message="Loading Galaxy configuration" />
</template>
</PublishedItem>
</template>
Expand All @@ -27,10 +27,12 @@ import { urlData } from "@/utils/url";
import PageHtml from "./PageHtml.vue";
import PublishedItem from "@/components/Common/PublishedItem.vue";
import LoadingSpan from "@/components/LoadingSpan.vue";
import Markdown from "@/components/Markdown/Markdown.vue";
export default {
components: {
LoadingSpan,
Markdown,
PageHtml,
PublishedItem,
Expand Down
72 changes: 45 additions & 27 deletions doc/source/admin/galaxy_options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1650,13 +1650,26 @@
~~~~~~~~~~~~~~~~~~~~~~~~~

:Description:
URL of the support resource for the galaxy instance. Used in
activation emails.
URL of the support resource for the galaxy instance. Used outside
of web contexts such as in activation emails and in Galaxy
markdown report generation.
Example value 'https://galaxyproject.org/'
:Default: ``None``
:Type: str


~~~~~~~~~~~~~~~~~~~~~~~
``instance_access_url``
~~~~~~~~~~~~~~~~~~~~~~~

:Description:
URL used to access this Galaxy server. Used outside of web
contexts such as in Galaxy markdown report generation.
Example value 'https://usegalaxy.org'
:Default: ``None``
:Type: str


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
``email_domain_blocklist_file``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -4036,54 +4049,59 @@
:Type: str


~~~~~~~~~~~~~~~~~~~~
``ga4gh_service_id``
~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~
``organization_name``
~~~~~~~~~~~~~~~~~~~~~

:Description:
Service ID for GA4GH services (exposed via the service-info
endpoint for the Galaxy DRS API). If unset, one will be generated
using the URL the target API requests are made against.
The name of the organization that operates this Galaxy instance.
Serves as the default for the GA4GH service organization name and
can be exposed through Galaxy markdown for reports and such. For
instance, "Not Evil Corporation".
For GA4GH APIs, this is exposed via the service-info endpoint for
the Galaxy DRS API. If unset, one will be generated using
ga4gh_service_id (but only in the context of GA4GH APIs).
For more information on GA4GH service definitions - check out
https://github.com/ga4gh-discovery/ga4gh-service-registry and
https://editor.swagger.io/?url=https://raw.githubusercontent.com/ga4gh-discovery/ga4gh-service-registry/develop/service-registry.yaml
This value should likely reflect your service's URL. For instance
for usegalaxy.org this value should be org.usegalaxy. Particular
Galaxy implementations will treat this value as a prefix and
append the service type to this ID. For instance for the DRS
service "id" (available via the DRS API) for the above
configuration value would be org.usegalaxy.drs.
:Default: ``None``
:Type: str


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
``ga4gh_service_organization_name``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~
``organization_url``
~~~~~~~~~~~~~~~~~~~~

:Description:
Service name for host organization (exposed via the service-info
endpoint for the Galaxy DRS API). If unset, one will be generated
using ga4gh_service_id.
The URL of the organization that operates this Galaxy instance.
Serves as the default for the GA4GH service organization name and
can be exposed through Galaxy markdown for reports and such. For
instance, "notevilcorp.com".
For GA4GH APIs, this is exposed via the service-info endpoint.
For more information on GA4GH service definitions - check out
https://github.com/ga4gh-discovery/ga4gh-service-registry and
https://editor.swagger.io/?url=https://raw.githubusercontent.com/ga4gh-discovery/ga4gh-service-registry/develop/service-registry.yaml
:Default: ``None``
:Type: str


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
``ga4gh_service_organization_url``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~
``ga4gh_service_id``
~~~~~~~~~~~~~~~~~~~~

:Description:
Organization URL for host organization (exposed via the
service-info endpoint for the Galaxy DRS API). If unset, one will
be generated using the URL the target API requests are made
against.
Service ID for GA4GH services (exposed via the service-info
endpoint for the Galaxy DRS API). If unset, one will be generated
using the URL the target API requests are made against.
For more information on GA4GH service definitions - check out
https://github.com/ga4gh-discovery/ga4gh-service-registry and
https://editor.swagger.io/?url=https://raw.githubusercontent.com/ga4gh-discovery/ga4gh-service-registry/develop/service-registry.yaml
This value should likely reflect your service's URL. For instance
for usegalaxy.org this value should be org.usegalaxy. Particular
Galaxy implementations will treat this value as a prefix and
append the service type to this ID. For instance for the DRS
service "id" (available via the DRS API) for the above
configuration value would be org.usegalaxy.drs.
:Default: ``None``
:Type: str

Expand Down
2 changes: 2 additions & 0 deletions lib/galaxy/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,8 @@ class GalaxyAppConfiguration(BaseAppConfiguration, CommonConfigurationMixin):
"fetch_url_whitelist": "fetch_url_allowlist",
"containers_resolvers_config_file": "container_resolvers_config_file",
"activation_email": "email_from",
"ga4gh_service_organization_name": "organization_name",
"ga4gh_service_organization_url": "organization_url",
}

deprecated_options = list(renamed_options.keys()) + [
Expand Down
2 changes: 2 additions & 0 deletions lib/galaxy/config/config_manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ def lint(self, args, app_desc, key, value) -> None:
"legacy_eager_objectstore_initialization": _DeprecatedAndDroppedAction(),
"enable_openid": _DeprecatedAndDroppedAction(),
"openid_consumer_cache_path": _DeprecatedAndDroppedAction(),
"ga4gh_service_organization_name": _RenameAction("organization_name"),
"ga4gh_service_organization_url": _RenameAction("organization_url"),
}


Expand Down
48 changes: 30 additions & 18 deletions lib/galaxy/config/sample/galaxy.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -1116,11 +1116,17 @@ galaxy:
# message, before the 'Your Galaxy Team' signature.
#custom_activation_email_message: null

# URL of the support resource for the galaxy instance. Used in
# activation emails.
# URL of the support resource for the galaxy instance. Used outside
# of web contexts such as in activation emails and in Galaxy markdown
# report generation.
# Example value 'https://galaxyproject.org/'
#instance_resource_url: null

# URL used to access this Galaxy server. Used outside of web contexts
# such as in Galaxy markdown report generation.
# Example value 'https://usegalaxy.org'
#instance_access_url: null

# E-mail domains blocklist is used for filtering out users that are
# using disposable email addresses at registration. If their
# address's base domain matches any domain on the list, they are
Expand Down Expand Up @@ -2187,6 +2193,28 @@ galaxy:
# production server.
#bootstrap_admin_api_key: null

# The name of the organization that operates this Galaxy instance.
# Serves as the default for the GA4GH service organization name and
# can be exposed through Galaxy markdown for reports and such. For
# instance, "Not Evil Corporation".
# For GA4GH APIs, this is exposed via the service-info endpoint for
# the Galaxy DRS API. If unset, one will be generated using
# ga4gh_service_id (but only in the context of GA4GH APIs).
# For more information on GA4GH service definitions - check out
# https://github.com/ga4gh-discovery/ga4gh-service-registry and
# https://editor.swagger.io/?url=https://raw.githubusercontent.com/ga4gh-discovery/ga4gh-service-registry/develop/service-registry.yaml
#organization_name: null

# The URL of the organization that operates this Galaxy instance.
# Serves as the default for the GA4GH service organization name and
# can be exposed through Galaxy markdown for reports and such. For
# instance, "notevilcorp.com".
# For GA4GH APIs, this is exposed via the service-info endpoint.
# For more information on GA4GH service definitions - check out
# https://github.com/ga4gh-discovery/ga4gh-service-registry and
# https://editor.swagger.io/?url=https://raw.githubusercontent.com/ga4gh-discovery/ga4gh-service-registry/develop/service-registry.yaml
#organization_url: null

# Service ID for GA4GH services (exposed via the service-info endpoint
# for the Galaxy DRS API). If unset, one will be generated using the
# URL the target API requests are made against.
Expand All @@ -2201,22 +2229,6 @@ galaxy:
# be org.usegalaxy.drs.
#ga4gh_service_id: null

# Service name for host organization (exposed via the service-info
# endpoint for the Galaxy DRS API). If unset, one will be generated
# using ga4gh_service_id.
# For more information on GA4GH service definitions - check out
# https://github.com/ga4gh-discovery/ga4gh-service-registry and
# https://editor.swagger.io/?url=https://raw.githubusercontent.com/ga4gh-discovery/ga4gh-service-registry/develop/service-registry.yaml
#ga4gh_service_organization_name: null

# Organization URL for host organization (exposed via the service-info
# endpoint for the Galaxy DRS API). If unset, one will be generated
# using the URL the target API requests are made against.
# For more information on GA4GH service definitions - check out
# https://github.com/ga4gh-discovery/ga4gh-service-registry and
# https://editor.swagger.io/?url=https://raw.githubusercontent.com/ga4gh-discovery/ga4gh-service-registry/develop/service-registry.yaml
#ga4gh_service_organization_url: null

# Service environment (exposed via the service-info endpoint for the
# Galaxy DRS API) for implemented GA4GH services.
# Suggested values are prod, test, dev, staging.
Expand Down
Loading

0 comments on commit 7404ed0

Please sign in to comment.