-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
1,392 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
105 changes: 105 additions & 0 deletions
105
client/src/components/History/CurrentHistory/HistorySelectPreferredObjectStore.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
<template> | ||
<div> | ||
<loading-span v-if="loading" :message="loadingObjectStoreInfoMessage" /> | ||
<div v-else> | ||
<b-alert v-if="error" variant="danger" show> | ||
{{ error }} | ||
</b-alert> | ||
<b-row> | ||
<b-col cols="7"> | ||
<b-button-group vertical size="lg" style="width: 100%"> | ||
<b-button | ||
:variant="variant(null)" | ||
id="no-preferred-object-store-button" | ||
@click="handleSubmit(null)" | ||
><i>User Preference Defined Default</i></b-button | ||
> | ||
<b-button | ||
:variant="variant(object_store.object_store_id)" | ||
:id="`preferred-object-store-button-${object_store.object_store_id}`" | ||
v-for="object_store in objectStores" | ||
:key="object_store.object_store_id" | ||
@click="handleSubmit(object_store.object_store_id)" | ||
>{{ object_store.name }} | ||
<ObjectStoreBadges :badges="object_store.badges" size="lg" :more-on-hover="false" /> | ||
<ProvidedQuotaSourceUsageBar :objectStore="object_store" :compact="true"> | ||
</ProvidedQuotaSourceUsageBar> | ||
</b-button> | ||
</b-button-group> | ||
</b-col> | ||
<b-col cols="5"> | ||
<p style="float: right" localize> | ||
{{ whyIsSelectionPreferredText }} | ||
</p> | ||
</b-col> | ||
</b-row> | ||
<b-popover | ||
target="no-preferred-object-store-button" | ||
triggers="hover" | ||
:placement="popoverPlacement" | ||
v-if="userPreferredObjectStoreId"> | ||
<template v-slot:title | ||
><span v-localize>{{ userSelectionDefalutTitle }}</span></template | ||
> | ||
<span v-localize>{{ userSelectionDefalutDescription }}</span> | ||
</b-popover> | ||
<b-popover target="no-preferred-object-store-button" triggers="hover" :placement="popoverPlacement" v-else> | ||
<template v-slot:title | ||
><span v-localize>{{ galaxySelectionDefalutTitle }}</span></template | ||
> | ||
<span v-localize>{{ galaxySelectionDefalutTitle }}</span> | ||
</b-popover> | ||
<b-popover | ||
v-for="object_store in objectStores" | ||
:key="object_store.object_store_id" | ||
:target="`preferred-object-store-button-${object_store.object_store_id}`" | ||
triggers="hover" | ||
:placement="popoverPlacement"> | ||
<template v-slot:title>{{ object_store.name }}</template> | ||
<DescribeObjectStore :what="newDatasetsDescription" :storage-info="object_store"> </DescribeObjectStore> | ||
</b-popover> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import axios from "axios"; | ||
import selectionMixin from "components/ObjectStore/selectionMixin"; | ||
export default { | ||
mixins: [selectionMixin], | ||
props: { | ||
userPreferredObjectStoreId: { | ||
type: String, | ||
required: true, | ||
}, | ||
history: { | ||
type: Object, | ||
required: true, | ||
}, | ||
}, | ||
data() { | ||
const selectedObjectStoreId = this.history.preferred_object_store_id; | ||
return { | ||
selectedObjectStoreId: selectedObjectStoreId, | ||
newDatasetsDescription: "New dataset outputs from tools and workflows executed in this history", | ||
popoverPlacement: "left", | ||
userSelectionDefalutTitle: "Use Your User Preference Defaults", | ||
userSelectionDefalutDescription: | ||
"Selecting this will cause the history to not set a default and to fallback to your user preference defined default.", | ||
}; | ||
}, | ||
methods: { | ||
async handleSubmit(preferredObjectStoreId) { | ||
const payload = { preferred_object_store_id: preferredObjectStoreId }; | ||
try { | ||
await axios.put(`${this.root}api/histories/${this.history.id}`, payload); | ||
} catch (e) { | ||
this.handleError(e); | ||
} | ||
this.selectedObjectStoreId = preferredObjectStoreId; | ||
this.$emit("updated", preferredObjectStoreId); | ||
}, | ||
}, | ||
}; | ||
</script> |
55 changes: 55 additions & 0 deletions
55
client/src/components/History/CurrentHistory/HistoryTargetPreferredObjectStorePopover.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<template> | ||
<b-popover :target="`history-stoarge-${historyId}`" triggers="hover" placement="bottomleft"> | ||
<template v-slot:title>Preferred Target Object Store</template> | ||
<p class="history-preferred-object-store-inherited" v-if="historyPreferredObjectStoreId"> | ||
This target object store has been set at the history level. | ||
</p> | ||
<p class="history-preferred-object-store-not-inherited" v-else> | ||
This target object store has been inherited from your user preferences (set in User -> Preferences -> | ||
Preferred Object Store). If that option is updated, this history will target that new default. | ||
</p> | ||
<ObjectStoreDetailsProvider | ||
:id="preferredObjectStoreId" | ||
v-if="preferredObjectStoreId" | ||
v-slot="{ result: storageInfo, loading: isLoadingStorageInfo }"> | ||
<b-spinner v-if="isLoadingStorageInfo" /> | ||
<DescribeObjectStore | ||
v-else | ||
what="Galaxy will default to storing this history's datasets in " | ||
:storage-info="storageInfo"> | ||
</DescribeObjectStore> | ||
</ObjectStoreDetailsProvider> | ||
<div>Change this preference object store target by clicking on the storage button in the history panel.</div> | ||
</b-popover> | ||
</template> | ||
|
||
<script> | ||
import { ObjectStoreDetailsProvider } from "components/providers/ObjectStoreProvider"; | ||
import DescribeObjectStore from "components/ObjectStore/DescribeObjectStore"; | ||
export default { | ||
components: { | ||
DescribeObjectStore, | ||
ObjectStoreDetailsProvider, | ||
}, | ||
props: { | ||
historyId: { | ||
type: String, | ||
required: true, | ||
}, | ||
historyPreferredObjectStoreId: { | ||
type: String, | ||
}, | ||
user: { type: Object, required: true }, | ||
}, | ||
computed: { | ||
preferredObjectStoreId() { | ||
let id = this.historyPreferredObjectStoreId; | ||
if (!id) { | ||
id = this.user.preferred_object_store_id; | ||
} | ||
return id; | ||
}, | ||
}, | ||
}; | ||
</script> |
Oops, something went wrong.