-
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.
private objectstores & dataset.sharable
Setup abstractions to prevent sharing transient or private per-user objects in an objectstore.
- Loading branch information
Showing
27 changed files
with
562 additions
and
60 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
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
27 changes: 27 additions & 0 deletions
27
client/src/components/Dataset/DatasetStorage/ObjectStoreRestrictionSpan.test.js
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,27 @@ | ||
import { shallowMount } from "@vue/test-utils"; | ||
import { getLocalVue } from "jest/helpers"; | ||
import ObjectStoreRestrictionSpan from "./ObjectStoreRestrictionSpan"; | ||
|
||
const localVue = getLocalVue(); | ||
|
||
describe("ObjectStoreRestrictionSpan", () => { | ||
let wrapper; | ||
|
||
it("should render info about private storage if isPrivate", () => { | ||
wrapper = shallowMount(ObjectStoreRestrictionSpan, { | ||
propsData: { isPrivate: true }, | ||
localVue, | ||
}); | ||
expect(wrapper.find(".stored-how").text()).toBe("private"); | ||
expect(wrapper.find(".stored-how").attributes("title")).toBeTruthy(); | ||
}); | ||
|
||
it("should render info about unrestricted storage if not isPrivate", () => { | ||
wrapper = shallowMount(ObjectStoreRestrictionSpan, { | ||
propsData: { isPrivate: false }, | ||
localVue, | ||
}); | ||
expect(wrapper.find(".stored-how").text()).toBe("unrestricted"); | ||
expect(wrapper.find(".stored-how").attributes("title")).toBeTruthy(); | ||
}); | ||
}); |
38 changes: 38 additions & 0 deletions
38
client/src/components/Dataset/DatasetStorage/ObjectStoreRestrictionSpan.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,38 @@ | ||
<template> | ||
<span class="stored-how" v-b-tooltip.hover :title="title">{{ text }}</span> | ||
</template> | ||
|
||
<script> | ||
import Vue from "vue"; | ||
import BootstrapVue from "bootstrap-vue"; | ||
Vue.use(BootstrapVue); | ||
export default { | ||
props: { | ||
isPrivate: { | ||
// private is reserved word | ||
type: Boolean, | ||
}, | ||
}, | ||
computed: { | ||
text() { | ||
return this.isPrivate ? "private" : "unrestricted"; | ||
}, | ||
title() { | ||
if (this.isPrivate) { | ||
return "This dataset is stored on storage restricted to a single user. It can not be shared, pubished, or added to Galaxy data libraries."; | ||
} else { | ||
return "This dataset is stored on unrestricted storage. With sufficient Galaxy permissions, this dataset can be published, shared, or added to Galaxy data libraries."; | ||
} | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style scoped> | ||
/* Give visual indication of mouseover info */ | ||
.stored-how { | ||
text-decoration-line: underline; | ||
text-decoration-style: dashed; | ||
} | ||
</style> |
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
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
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
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
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
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
Oops, something went wrong.