Skip to content

Commit

Permalink
hide upload help after one viewing and add Rule-based info to it
Browse files Browse the repository at this point in the history
Fixes #19334
  • Loading branch information
ahmedhamidawan committed Jan 9, 2025
1 parent fed368f commit 89baf0b
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 9 deletions.
2 changes: 2 additions & 0 deletions client/src/components/Help/terms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,5 @@ galaxy:
A utility for uploading files to a Galaxy server from the command line. Use ``galaxy-upload`` to upload
file(s) to a Galaxy server, and ``galaxy-history-search``, a helper utility to find Galaxy histories
to pass to the ``galaxy-upload`` command.
ruleBased: |
Galaxy can bulk import lists & tables of URLs into datasets or collections using reproducible rules.
46 changes: 37 additions & 9 deletions client/src/components/Upload/UploadModal.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { BModal } from "bootstrap-vue";
import { BCarousel, BCarouselSlide, BModal } from "bootstrap-vue";
import { storeToRefs } from "pinia";
import { ref, watch } from "vue";
Expand All @@ -13,7 +13,7 @@ import ExternalLink from "../ExternalLink.vue";
import HelpText from "../Help/HelpText.vue";
import UploadContainer from "./UploadContainer.vue";
const { currentUser } = storeToRefs(useUserStore());
const { currentUser, hasSeenUploadHelp } = storeToRefs(useUserStore());
const { currentHistoryId, currentHistory } = useUserHistories(currentUser);
const { config, isConfigLoaded } = useConfig();
Expand Down Expand Up @@ -65,7 +65,14 @@ async function open(overrideOptions) {
watch(
() => showModal.value,
(modalShown) => setIframeEvents(["galaxy_main"], modalShown)
(modalShown) => {
setIframeEvents(["galaxy_main"], modalShown);
// once the modal closes the first time a user sees help, we never show it again
if (!modalShown && !hasSeenUploadHelp.value) {
hasSeenUploadHelp.value = true;
}
}
);
defineExpose({
Expand All @@ -91,12 +98,33 @@ defineExpose({
to <b>{{ currentHistory.name }}</b>
</span>
</h2>
<span>
<ExternalLink href="https://galaxy-upload.readthedocs.io/en/latest/"> Click here </ExternalLink>
to check out the
<HelpText uri="galaxy.upload.galaxyUploadUtil" text="galaxy-upload" />
util!
</span>
<BCarousel v-if="!hasSeenUploadHelp" :interval="4000" no-touch>
<BCarouselSlide>
<template v-slot:img>
<span class="text-nowrap float-right">
<ExternalLink href="https://galaxy-upload.readthedocs.io/en/latest/">
Click here
</ExternalLink>
to check out the
<HelpText uri="galaxy.upload.galaxyUploadUtil" text="galaxy-upload" />
util!
</span>
</template>
</BCarouselSlide>
<BCarouselSlide>
<template v-slot:img>
<span class="text-nowrap float-right">
More info on <HelpText uri="galaxy.upload.ruleBased" text="Rule-based" /> uploads
<ExternalLink
href="https://training.galaxyproject.org/training-material/topics/galaxy-interface/tutorials/upload-rules/tutorial.html">
here
</ExternalLink>
.
</span>
</template>
</BCarouselSlide>
</BCarousel>
</div>
</template>
<UploadContainer
Expand Down
2 changes: 2 additions & 0 deletions client/src/stores/userStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const useUserStore = defineStore("userStore", () => {
const currentPreferences = ref<Preferences | null>(null);

const preferredListViewMode = useUserLocalStorage("user-store-preferred-list-view-mode", "grid", currentUser);
const hasSeenUploadHelp = useUserLocalStorage("user-store-seen-upload-help", false, currentUser);

let loadPromise: Promise<void> | null = null;

Expand Down Expand Up @@ -148,6 +149,7 @@ export const useUserStore = defineStore("userStore", () => {
currentTheme,
currentFavorites,
preferredListViewMode,
hasSeenUploadHelp,
loadUser,
matchesCurrentUsername,
setCurrentUser,
Expand Down

0 comments on commit 89baf0b

Please sign in to comment.