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

[24.0] Datasets list anonymous access and history link fixes. #17756

Merged
merged 4 commits into from
Mar 22, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 0 additions & 21 deletions client/src/components/Dataset/DatasetHistory.vue

This file was deleted.

10 changes: 6 additions & 4 deletions client/src/components/Dataset/DatasetList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
<DatasetName :item="row.item" @showDataset="onShowDataset" @copyDataset="onCopyDataset" />
</template>
<template v-slot:cell(history_id)="row">
<DatasetHistory :item="row.item" />
<SwitchToHistoryLink
:history-id="row.item.history_id"
:filters="{ deleted: row.item.deleted, visible: row.item.visible, hid: row.item.hid }" />
</template>
<template v-slot:cell(tags)="row">
<StatelessTags
Expand Down Expand Up @@ -49,17 +51,17 @@ import { copyDataset, getDatasets } from "@/api/datasets";
import { updateTags } from "@/api/tags";
import { useHistoryStore } from "@/stores/historyStore";

import DatasetHistory from "./DatasetHistory";
import DatasetName from "./DatasetName";
import DatasetName from "./DatasetName.vue";
import SwitchToHistoryLink from "@/components/History/SwitchToHistoryLink.vue";

export default {
components: {
DatasetHistory,
DatasetName,
LoadingSpan,
DelayedInput,
UtcDate,
StatelessTags,
SwitchToHistoryLink,
},
data() {
return {
Expand Down
5 changes: 1 addition & 4 deletions client/src/components/Dataset/DatasetName.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ describe("Dataset Name", () => {
const state = wrapper.findAll(".name");
expect(state.length).toBe(1);
expect(state.at(0).text()).toBe("name");
const $linkShow = wrapper.find(".dropdown-item:first-child");
$linkShow.trigger("click");
expect(Array.isArray(wrapper.emitted().showDataset)).toBe(true);
const $linkCopy = wrapper.find(".dropdown-item:last-child");
const $linkCopy = wrapper.find(".dropdown-item:first-child");
$linkCopy.trigger("click");
expect(Array.isArray(wrapper.emitted().copyDataset)).toBe(true);
});
Expand Down
7 changes: 0 additions & 7 deletions client/src/components/Dataset/DatasetName.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
<span class="name">{{ getName }}</span>
</b-link>
<div class="dropdown-menu" aria-labelledby="dataset-dropdown">
<a class="dropdown-item" href="#" @click.prevent="showDataset">
<span class="fa fa-eye fa-fw mr-1" />
<span>Show in History containing dataset</span>
</a>
<a class="dropdown-item" href="#" @click.prevent="copyDataset">
<span class="fa fa-copy fa-fw mr-1" />
<span>Copy to current History</span>
Expand Down Expand Up @@ -56,9 +52,6 @@ export default {
copyDataset(item) {
this.$emit("copyDataset", this.item);
},
showDataset(item) {
this.$emit("showDataset", this.item);
},
},
};
</script>
Expand Down
17 changes: 15 additions & 2 deletions client/src/components/History/SwitchToHistoryLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const historyStore = useHistoryStore();

interface Props {
historyId: string;
filters?: Record<string, string | boolean>;
}

const props = defineProps<Props>();
Expand All @@ -26,11 +27,23 @@ const history = computed(() => historyStore.getHistoryById(props.historyId));

const canSwitch = computed(() => !!history.value && !history.value.archived && !history.value.purged);

const actionText = computed(() => (canSwitch.value ? "Switch to" : "View in new tab"));
const actionText = computed(() => {
if (canSwitch.value) {
if (props.filters) {
return "Show in history";
}
return "Switch to";
}
return "View in new tab";
});

function onClick(history: HistorySummary) {
if (canSwitch.value) {
historyStore.setCurrentHistory(history.id);
if (props.filters) {
historyStore.applyFilters(history.id, props.filters);
} else {
historyStore.setCurrentHistory(history.id);
}
return;
}
viewHistoryInNewTab(history);
Expand Down
1 change: 1 addition & 0 deletions client/src/entry/analysis/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export function fetchMenu(options = {}) {
{
title: _l("Datasets"),
url: "/datasets/list_published",
hidden: !Galaxy.user.id,
},
Comment on lines 105 to 109
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{
title: _l("Datasets"),
url: "/datasets/list_published",
hidden: !Galaxy.user.id,
},

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is no grid for public datasets, this url was added erroneously during the transition under "Data" in masthead

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you're right, I'll merge and open a followup

{
title: _l("Histories"),
Expand Down