Skip to content

Commit

Permalink
Fix serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
guerler committed May 1, 2018
1 parent 4830587 commit 5138947
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
1 change: 0 additions & 1 deletion client/galaxy/scripts/apps/analysis.js
Expand Up @@ -180,7 +180,6 @@ window.app = function app(options, bootstrapped) {
plural_name: "Histories",
item_controller: "history",
list_controller: "histories",
share_url: "url_to_share"
} }).$mount(vm);
},

Expand Down
22 changes: 13 additions & 9 deletions client/galaxy/scripts/components/Sharing.vue
Expand Up @@ -23,7 +23,8 @@
<a id="item-url" :href="item_url" target="_top">{{item_url}}</a>
</blockquote>
<div v-if="item.published">
<p>This {{item_model_class_lc}} is publicly listed and searchable in Galaxy's <a :href="list_url" target="_top">Published {{plural_name}}</a> section. You can:</p>
<p>This {{item_model_class_lc}} is publicly listed and searchable in Galaxy's <a :href="published_url" target="_top">Published {{plural_name}}</a> section.</p>
<p>You can:</p>
</div>
</div>
<div v-if="!item.published">
Expand All @@ -32,16 +33,16 @@
<div class="toolParamHelp">Disables {{item_model_class_lc}}'s link so that it is not accessible.</div>
<br/>
<button @click="enablePublish">Publish {{item.model_class}}</button>
<div class="toolParamHelp">Publishes the {{item_model_class_lc}} to Galaxy's <a :href="list_url" target="_top">Published {{plural_name}}</a> section, where it is publicly listed and searchable.</div>
<div class="toolParamHelp">Publishes the {{item_model_class_lc}} to Galaxy's <a :href="published_url" target="_top">Published {{plural_name}}</a> section, where it is publicly listed and searchable.</div>
<br/>
</div>
<div v-else>
<!-- Item is importable and published. User can unpublish or disable import and unpublish. -->
<button @click="disablePublish">Unpublish {{item.model_class}}</button>
<div class="toolParamHelp">Removes this {{item_model_class_lc}} from Galaxy's <a :href="list_url" target="_top">Published {{plural_name}}</a> section so that it is not publicly listed or searchable.</div>
<div class="toolParamHelp">Removes this {{item_model_class_lc}} from Galaxy's <a :href="published_url" target="_top">Published {{plural_name}}</a> section so that it is not publicly listed or searchable.</div>
<br/>
<button @click="disableLinkPublish">Disable Access to {{item.model_class}} via Link and Unpublish</button>
<div class="toolParamHelp">Disables this {{item_model_class_lc}}'s link so that it is not accessible and removes {{item_model_class_lc}} from Galaxy's <a :href="list_url" target="_top">Published {{plural_name}}</a> section so that it is not publicly listed or searchable.</div>
<div class="toolParamHelp">Disables this {{item_model_class_lc}}'s link so that it is not accessible and removes {{item_model_class_lc}} from Galaxy's <a :href="published_url" target="_top">Published {{plural_name}}</a> section so that it is not publicly listed or searchable.</div>
</div>
</div>
<div v-else>
Expand All @@ -50,7 +51,7 @@
<div class="toolParamHelp">Generates a web link that you can share with other people so that they can view and import the {{item_model_class_lc}}.</div>
<br/>
<button @click="enableLinkPublish">Make {{item.model_class}} Accessible and Publish</button>
<div class="toolParamHelp">Makes the {{item_model_class_lc}} accessible via link (see above) and publishes the {{item_model_class_lc}} to Galaxy's <a href='list_url' target='_top'>Published {{plural_name}}</a> section, where it is publicly listed and searchable.</div>
<div class="toolParamHelp">Makes the {{item_model_class_lc}} accessible via link (see above) and publishes the {{item_model_class_lc}} to Galaxy's <a href='published_url' target='_top'>Published {{plural_name}}</a> section, where it is publicly listed and searchable.</div>
</div>
<br/><br/>
<h3>Share {{item.model_class}} with Individual Users</h3>
Expand Down Expand Up @@ -91,6 +92,10 @@ export default {
type: String,
required: true
},
item_controller: {
type: String,
required: true
},
plural_name: {
type: String,
required: true
Expand All @@ -106,11 +111,11 @@ export default {
item_url() {
return `${Galaxy.root}${this.item_controller}/display_by_username_and_slug/?username=${this.username}&slug=${this.item.slug}&qualified=true`;
},
list_url() {
published_url() {
return `${Galaxy.root}${this.item_controller}/list_published`;
},
sharing_url() {
return `${Galaxy.root}${this.item_controller}/sharing/?id=trans.security.encode_id(item.id)`;
share_url() {
return `${Galaxy.root}${this.item_controller}/share/?id=${this.id}`;
}
},
data() {
Expand All @@ -124,7 +129,6 @@ export default {
users_shared_with: [],
slug: "slug",
},
share_url: "",
username: "",
has_username: true,
err_msg: null,
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/managers/histories.py
Expand Up @@ -261,7 +261,7 @@ def add_serializers(self):

'contents_states': self.serialize_contents_states,
'contents_active': self.serialize_contents_active,
'users_shared_with': lambda i, k, **c: i.users_shared_with,
'users_shared_with': lambda i, k, **c: [{'id': a.user.id, 'email': a.user.email} for a in i.users_shared_with],
})

# remove this
Expand Down

0 comments on commit 5138947

Please sign in to comment.