Skip to content

Commit

Permalink
Merge branch 'release_24.0' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek committed Mar 28, 2024
2 parents 6b96bb1 + 3669cae commit 68aa360
Show file tree
Hide file tree
Showing 30 changed files with 368 additions and 85 deletions.
53 changes: 36 additions & 17 deletions client/src/api/schema/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6656,19 +6656,38 @@ export interface components {
* This model is based on the Discourse API response for the search endpoint.
*/
HelpForumSearchResponse: {
/** Categories */
categories: components["schemas"]["HelpForumCategory"][] | null;
grouped_search_result: components["schemas"]["HelpForumGroupedSearchResult"] | null;
/** Groups */
groups: components["schemas"]["HelpForumGroup"][] | null;
/** Posts */
posts: components["schemas"]["HelpForumPost"][] | null;
/** Tags */
tags: components["schemas"]["HelpForumTag"][] | null;
/** Topics */
topics: components["schemas"]["HelpForumTopic"][] | null;
/** Users */
users: components["schemas"]["HelpForumUser"][] | null;
/**
* Categories
* @description The list of categories returned by the search.
*/
categories?: components["schemas"]["HelpForumCategory"][] | null;
/** @description The grouped search result. */
grouped_search_result?: components["schemas"]["HelpForumGroupedSearchResult"] | null;
/**
* Groups
* @description The list of groups returned by the search.
*/
groups?: components["schemas"]["HelpForumGroup"][] | null;
/**
* Posts
* @description The list of posts returned by the search.
*/
posts?: components["schemas"]["HelpForumPost"][];
/**
* Tags
* @description The list of tags returned by the search.
*/
tags?: components["schemas"]["HelpForumTag"][] | null;
/**
* Topics
* @description The list of topics returned by the search.
*/
topics?: components["schemas"]["HelpForumTopic"][];
/**
* Users
* @description The list of users returned by the search.
*/
users?: components["schemas"]["HelpForumUser"][] | null;
};
/**
* HelpForumTag
Expand Down Expand Up @@ -6696,7 +6715,7 @@ export interface components {
* Bookmarked
* @description Whether the topic is bookmarked.
*/
bookmarked: boolean | null;
bookmarked?: boolean | null;
/**
* Bumped
* @description Whether the topic was bumped.
Expand Down Expand Up @@ -6751,7 +6770,7 @@ export interface components {
* Liked
* @description Whether the topic is liked.
*/
liked: boolean | null;
liked?: boolean | null;
/**
* Pinned
* @description Whether the topic is pinned.
Expand Down Expand Up @@ -6781,7 +6800,7 @@ export interface components {
* Tags Descriptions
* @description The descriptions of the tags of the topic.
*/
tags_descriptions: Record<string, never> | null;
tags_descriptions?: Record<string, never> | null;
/**
* Title
* @description The title of the topic.
Expand All @@ -6791,7 +6810,7 @@ export interface components {
* Unpinned
* @description Whether the topic is unpinned.
*/
unpinned: boolean | null;
unpinned?: boolean | null;
/**
* Unseen
* @description Whether the topic is unseen.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { useDatasetStore } from "@/stores/datasetStore";
import { type ItemUrls } from ".";
import DatasetActions from "./DatasetActions.vue";
import DatasetMiscInfo from "./DatasetMiscInfo.vue";
const datasetStore = useDatasetStore();
Expand Down Expand Up @@ -56,9 +57,7 @@ function toggleHighlights() {
result.genome_build
}}</BLink>
</span>
<div v-if="result.misc_info" class="info">
<span class="value">{{ result.misc_info }}</span>
</div>
<DatasetMiscInfo v-if="result.misc_info" :misc-info="result.misc_info" />
</div>
<DatasetActions
:item="result"
Expand Down
62 changes: 62 additions & 0 deletions client/src/components/History/Content/Dataset/DatasetMiscInfo.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<script setup lang="ts">
import { computed, ref, watch } from "vue";
interface Props {
miscInfo: string;
}
const showErrorHelp = ref(false);
const sharingError = ref(false);
// old sharable error: Attempted to create shared output datasets in objectstore with sharing disabled
// new sharable error: Job attempted to create sharable output datasets in a storage location with sharing disabled
const sharingErrorRex: RegExp = /with sharing disabled/g;
const knownErrors = [{ regex: sharingErrorRex, modalRef: sharingError }];
const props = defineProps<Props>();
const fixable = computed(() => {
return knownErrors.some((error) => error.modalRef.value);
});
function checkForKnownErrors() {
for (const knownError of knownErrors) {
const regex = knownError.regex;
if (props.miscInfo.match(regex)) {
knownError.modalRef.value = true;
}
}
}
watch(props, checkForKnownErrors, { immediate: true });
function showHelp() {
showErrorHelp.value = true;
}
</script>

<template>
<div class="info">
<b-modal v-if="sharingError" v-model="showErrorHelp" title="Dataset Sharing Misconfigured" ok-only>
<p>
This error message indicates that your history is setup to allow sharing but your job was run in a
configuration to target a storage location that explicitly disables sharing.
</p>
<p>
To fix this configure your history so that new datasets are private or target a different storage
location.
</p>
<p>
To re-configure your history, click the history menu and go to the "Set Permissions" option in the
dropdown. This should result in a toggle that allows you to configure the history so that new datasets
are created as private datasets.
</p>
<p>
There are many ways to instead target different storage for your job. This can be selected in the tool
or workflow form right before you execute your job or a different default for your history or user can
be chosen that allows for sharing.
</p>
</b-modal>
<span class="value">{{ miscInfo }} <a v-if="fixable" href="#" @click="showHelp">How do I fix this?</a></span>
</div>
</template>
13 changes: 12 additions & 1 deletion client/src/components/History/CurrentHistory/HistoryCounter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@ import { useRouter } from "vue-router/composables";
import type { HistorySummary } from "@/api";
import { HistoryFilters } from "@/components/History/HistoryFilters.js";
import { useConfig } from "@/composables/config";
import { useStorageLocationConfiguration } from "@/composables/storageLocation";
import { useUserStore } from "@/stores/userStore";
import { useDetailedHistory } from "./usesDetailedHistory";
import PreferredStorePopover from "./PreferredStorePopover.vue";
import SelectPreferredStore from "./SelectPreferredStore.vue";
const { isOnlyPreference } = useStorageLocationConfiguration();
library.add(faDatabase, faEyeSlash, faHdd, faMapMarker, faSync, faTrash);
const props = withDefaults(
Expand Down Expand Up @@ -54,6 +57,14 @@ const historyPreferredObjectStoreId = ref(props.history.preferred_object_store_i
const niceHistorySize = computed(() => prettyBytes(historySize.value));
const storageLocationTitle = computed(() => {
if (isOnlyPreference.value) {
return "History Preferred Storage Location";
} else {
return "History Storage Location";
}
});
function onDashboard() {
router.push({ name: "HistoryOverviewInAnalysis", params: { historyId: props.history.id } });
}
Expand Down Expand Up @@ -206,7 +217,7 @@ onMounted(() => {

<BModal
v-model="showPreferredObjectStoreModal"
title="History Preferred Storage Location"
:title="storageLocationTitle"
modal-class="history-preferred-object-store-modal"
title-tag="h3"
size="sm"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
import { BPopover } from "bootstrap-vue";
import { computed } from "vue";
import { useStorageLocationConfiguration } from "@/composables/storageLocation";
import ShowSelectedObjectStore from "@/components/ObjectStore/ShowSelectedObjectStore.vue";
const { isOnlyPreference } = useStorageLocationConfiguration();
interface Props {
historyId: string;
historyPreferredObjectStoreId?: string;
Expand All @@ -19,28 +23,40 @@ const preferredObjectStoreId = computed(() => {
}
return id;
});
const title = computed(() => {
if (isOnlyPreference.value) {
return "Preferred Storage Location";
} else {
return "Storage Location";
}
});
</script>

<template>
<BPopover :target="`history-storage-${historyId}`" triggers="hover" placement="bottomleft" boundary="window">
<template v-slot:title>Preferred Storage Location</template>
<template v-slot:title>{{ title }}</template>
<div class="popover-wide">
<p>
<b
>This option only affects new datasets created in this history. Existing history datasets will
remain at their current storage location.</b
>
</p>

<p v-if="historyPreferredObjectStoreId" class="history-preferred-object-store-inherited">
This storage location has been set at the history level.
</p>
<p v-else class="history-preferred-object-store-not-inherited">
This storage location has been inherited from your user preferences (set in User -> Preferences ->
Preferred Storage Location). If that option is updated, this history will target that new default.
This storage location has been inherited from your user preferences (set in
<router-link to="/user">User -> Preferences</router-link> -> {{ title }}). If that option is updated,
this history will target that new default.
</p>

<ShowSelectedObjectStore
v-if="preferredObjectStoreId"
:preferred-object-store-id="preferredObjectStoreId"
for-what="Galaxy will default to storing this history's datasets in " />

<div v-localize>
Change preferred storage location by clicking on the storage button in the history panel.
</div>
</div>
</BPopover>
</template>
Expand Down
6 changes: 4 additions & 2 deletions client/src/components/ObjectStore/SelectObjectStore.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { storeToRefs } from "pinia";
import { computed, ref } from "vue";
import { ConcreteObjectStoreModel } from "@/api";
import { useStorageLocationConfiguration } from "@/composables/storageLocation";
import { useObjectStoreStore } from "@/stores/objectStoreStore";
import ObjectStoreSelectButton from "./ObjectStoreSelectButton.vue";
Expand All @@ -25,6 +26,7 @@ const props = withDefaults(defineProps<SelectObjectStoreProps>(), {
const store = useObjectStoreStore();
const { isLoading, loadErrorMessage, selectableObjectStores } = storeToRefs(store);
const { isOnlyPreference } = useStorageLocationConfiguration();
const loadingObjectStoreInfoMessage = ref("Loading storage location information");
const whyIsSelectionPreferredText = ref(`
Expand Down Expand Up @@ -64,7 +66,7 @@ async function handleSubmit(preferredObjectStore: ConcreteObjectStoreModel | nul
<b-alert v-if="error" variant="danger" class="object-store-selection-error" show>
{{ error }}
</b-alert>
<b-row>
<b-row align-h="center">
<b-col cols="7">
<b-button-group vertical size="lg" style="width: 100%">
<b-button
Expand All @@ -85,7 +87,7 @@ async function handleSubmit(preferredObjectStore: ConcreteObjectStoreModel | nul
@click="handleSubmit(objectStore)" />
</b-button-group>
</b-col>
<b-col cols="5">
<b-col v-if="isOnlyPreference" cols="5">
<p v-localize style="float: right">
{{ whyIsSelectionPreferredText }}
</p>
Expand Down
14 changes: 13 additions & 1 deletion client/src/components/ObjectStore/showTargetPopoverMixin.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import { mapState } from "pinia";

import { useConfigStore } from "@/stores/configurationStore";

import ShowSelectedObjectStore from "./ShowSelectedObjectStore";

export default {
Expand All @@ -11,8 +15,16 @@ export default {
},
},
computed: {
...mapState(useConfigStore, ["config"]),
preferredOrEmptyString() {
if (this.config?.object_store_always_respect_user_selection) {
return "";
} else {
return "Preferred";
}
},
title() {
return this.l(`Preferred Target Storage Location ${this.titleSuffix || ""}`);
return this.l(`${this.preferredOrEmptyString} Target Storage Location ${this.titleSuffix || ""}`);
},
},
};
12 changes: 11 additions & 1 deletion client/src/components/Tool/ToolCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { getAppRoot } from "onload/loadConfig";
import { storeToRefs } from "pinia";
import { computed, ref, watch } from "vue";
import { useStorageLocationConfiguration } from "@/composables/storageLocation";
import { useConfigStore } from "@/stores/configurationStore";
import { useUserStore } from "@/stores/userStore";
Expand Down Expand Up @@ -83,12 +84,21 @@ function onSetError(e) {
errorText.value = e;
}
const { isOnlyPreference } = useStorageLocationConfiguration();
const { currentUser, isAnonymous } = storeToRefs(useUserStore());
const { isLoaded: isConfigLoaded, config } = storeToRefs(useConfigStore());
const hasUser = computed(() => !isAnonymous.value);
const versions = computed(() => props.options.versions);
const showVersions = computed(() => props.options.versions?.length > 1);
const storageLocationModalTitle = computed(() => {
if (isOnlyPreference.value) {
return "Tool Execution Preferred Storage Location";
} else {
return "Tool Execution Storage Location";
}
});
const root = computed(() => getAppRoot());
const showPreferredObjectStoreModal = ref(false);
const toolPreferredObjectStoreId = ref(props.preferredObjectStoreId);
Expand Down Expand Up @@ -148,7 +158,7 @@ const showHelpForum = computed(() => isConfigLoaded.value && config.value.enable
</ToolTargetPreferredObjectStorePopover>
<b-modal
v-model="showPreferredObjectStoreModal"
title="Tool Execution Preferred Storage Location"
:title="storageLocationModalTitle"
modal-class="tool-preferred-object-store-modal"
title-tag="h3"
size="sm"
Expand Down
6 changes: 4 additions & 2 deletions client/src/components/Tool/ToolHelpForum.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { computed, onMounted, ref } from "vue";
import { fetcher } from "@/api/schema";
import { useConfigStore } from "@/stores/configurationStore";
import { getShortToolId } from "@/utils/tool";
import { createTopicUrl, type HelpForumPost, type HelpForumTopic, useHelpURLs } from "./helpForumUrls";
Expand All @@ -26,7 +27,8 @@ const helpAvailable = computed(() => topics.value.length > 0);
const root = ref(null);
const query = computed(() => `tags:${props.toolId}+${toolHelpTag} status:solved`);
const shortToolId = computed(() => getShortToolId(props.toolId));
const query = computed(() => `tags:${shortToolId.value}+${toolHelpTag} status:solved`);
onMounted(async () => {
const response = await helpFetcher({ query: query.value });
Expand All @@ -49,7 +51,7 @@ function blurbForTopic(topicId: number): string {
const { createNewTopicUrl, searchTopicUrl } = useHelpURLs({
title: computed(() => props.toolName),
tags: computed(() => [props.toolId, toolHelpTag]),
tags: computed(() => [shortToolId.value, toolHelpTag]),
query,
});
Expand Down
Loading

0 comments on commit 68aa360

Please sign in to comment.