Skip to content

Commit

Permalink
expose state, stdout, stderr, uuid in the API
Browse files Browse the repository at this point in the history
fix few bugs and UI/UX glitches
  • Loading branch information
martenson committed Oct 20, 2017
1 parent 76d187a commit f673761
Show file tree
Hide file tree
Showing 23 changed files with 123 additions and 64 deletions.
35 changes: 31 additions & 4 deletions client/galaxy/scripts/mvc/library/library-dataset-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,8 @@ define(
}
},

copyToClipboard: function() {
copyToClipboard: function(e) {
e.preventDefault();
var href = Backbone.history.location.href;
if (href.lastIndexOf("/permissions") !== -1) {
href = href.substr(0, href.lastIndexOf("/permissions"));
Expand Down Expand Up @@ -764,7 +765,7 @@ define(

'<% if (item.get("is_unrestricted")) { %>',
"<div>",
'This dataset is unrestricted so everybody with the link can access it. Just share <span class="copy-link-to-clipboard"><a>this page</a></span>.',
'This dataset is unrestricted so everybody with the link can access it. Just share <span class="copy-link-to-clipboard"><a href=""a>this page</a></span>.',
"</div>",
"<% } %>",

Expand Down Expand Up @@ -853,8 +854,34 @@ define(
'<td scope="row"><%= _.escape(item.get("tags")) %></td>',
"</tr>",
"<% } %>",
'<% if ( item.get("uuid") !== "ok" ) { %>',
"<tr>",
'<th scope="row">UUID</th>',
'<td scope="row"><%= _.escape(item.get("uuid")) %></td>',
"</tr>",
"<% } %>",
'<% if ( item.get("state") !== "ok" ) { %>',
"<tr>",
'<th scope="row">State</th>',
'<td scope="row"><%= _.escape(item.get("state")) %></td>',
"</tr>",
"<% } %>",
"</table>",

'<% if (item.get("job_stderr")) { %>',
"<h4>Job Standard Error</h4>",
'<pre class="code">',
'<%= _.escape(item.get("job_stderr")) %>',
"</pre>",
"<% } %>",

'<% if (item.get("job_stdout")) { %>',
"<h4>Job Standard Output</h4>",
'<pre class="code">',
'<%= _.escape(item.get("job_stdout")) %>',
"</pre>",
"<% } %>",

"<div>",
'<pre class="peek">',
"</pre>",
Expand Down Expand Up @@ -1154,9 +1181,9 @@ define(
"<h2>Dataset-related permissions</h2>",
'<div class="alert alert-warning">Changes made below will affect <strong>every</strong> library item that was created from this dataset and also every history this dataset is part of.</div>',
'<% if (!item.get("is_unrestricted")) { %>',
'<p>You can <span class="remove-restrictions"><a>remove all access restrictions</a></span> on this dataset.</p>',
'<p>You can <span class="remove-restrictions"><a href="">remove all access restrictions</a></span> on this dataset.</p>',
"<% } else { %>",
'<p>You can <span class="make-private"><a>make this dataset private</a></span> to you.</p>',
'<p>You can <span class="make-private"><a href="">make this dataset private</a></span> to you.</p>',
"<% } %>",
"<h4>Roles that can access the dataset</h4>",
'<div id="access_perm" class="access_perm roles-selection"></div>',
Expand Down
6 changes: 4 additions & 2 deletions client/galaxy/scripts/mvc/library/library-folderlist-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,11 +467,12 @@ define(
'<th class="button_heading"></th>',
'<th style="text-align: center; width: 20px; " title="Check to select all datasets"><input id="select-all-checkboxes" style="margin: 0;" type="checkbox"></th>',
'<th><a class="sort-folder-link" title="Click to reverse order" href="#">name</a> <span title="Sorted alphabetically" class="sort-icon fa fa-sort-alpha-<%- order %>"></span></th>',
'<th style="width:25%;">description</th>',
'<th style="width:20%;">description</th>',
'<th style="width:5%;">data type</th>',
'<th style="width:10%;">size</th>',
'<th style="width:160px;">time updated (UTC)</th>',
'<th style="width:10%;"></th> ',
'<th style="width:5%;">state</th> ',
'<th style="width:150px;"></th> ',
"</thead>",
'<tbody id="folder_list_body">',
'<tr id="first_folder_item">',
Expand All @@ -485,6 +486,7 @@ define(
"<td></td>",
"<td></td>",
"<td></td>",
"<td></td>",
"</tr>",
"</tbody>",
"</table>",
Expand Down
44 changes: 26 additions & 18 deletions client/galaxy/scripts/mvc/library/library-folderrow-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ define(
defaults: {
type: null,
visibility_config: {
edit_folder_btn: true,
edit_folder_btn: false,
save_folder_btn: false,
cancel_folder_btn: false,
permission_folder_btn: true
permission_folder_btn: false
},
edit_mode: false
},
Expand Down Expand Up @@ -306,32 +306,31 @@ define(
"<td>",
'<%- content_item.get("description") %>',
"</td>",
"<td></td>",
"<% } else if(edit_mode){ %>",
'<td><textarea rows="4" class="form-control input_folder_name" placeholder="name" ><%- content_item.get("name") %></textarea></td>',
'<td><textarea rows="4" class="form-control input_folder_description" placeholder="description" ><%- content_item.get("description") %></textarea></td>',
"<% } %>",
"<td>folder</td>",
"<td></td>",
"<td>",
'<%= _.escape(content_item.get("update_time")) %>',
"</td>",
"<td></td>",
"<td>",
"<% if(edit_mode) { %>", // start edit mode
'<button data-toggle="tooltip" data-placement="top" title="Save changes" class="primary-button btn-xs save_folder_btn" type="button" style="<% if(button_config.save_folder_btn === false) { print("display:none;") } %>">',
'<span class="fa fa-floppy-o"/>',
"&nbsp;Save",
'<span class="fa fa-floppy-o"/> Save',
"</button>",
'<button data-toggle="tooltip" data-placement="top" title="Discard changes" class="primary-button btn-xs cancel_folder_btn" type="button" style="<% if(button_config.cancel_folder_btn === false) { print("display:none;") } %>">',
'<span class="fa fa-times"/>',
"&nbsp;Cancel",
'<span class="fa fa-times"/> Cancel',
"</button>",
"<% } else if (!edit_mode){%>", // start no edit mode
'<button data-toggle="tooltip" data-placement="top" title="Modify \'<%- content_item.get("name") %>\'" class="primary-button btn-xs edit_folder_btn" type="button" style="<% if(button_config.edit_folder_btn === false) { print("display:none;") } %>">',
'<span class="fa fa-pencil"/>',
'<span class="fa fa-pencil"/> Edit',
"</button>",
'<a href="#/folders/<%- content_item.id %>/permissions">',
'<button data-toggle="tooltip" data-placement="top" class="primary-button btn-xs permission_folder_btn" title="Manage \'<%- content_item.get("name") %>\'" style="<% if(button_config.permission_folder_btn === false) { print("display:none;") } %>">',
'<span class="fa fa-group"/>',
'<button data-toggle="tooltip" data-placement="top" class="primary-button btn-xs permission_folder_btn" title="Permissions of \'<%- content_item.get("name") %>\'" style="<% if(button_config.permission_folder_btn === false) { print("display:none;") } %>">',
'<span class="fa fa-group"/> Manage',
"</button>",
"</a>",
"<% } %>", //end no edit mode
Expand Down Expand Up @@ -361,6 +360,11 @@ define(
'<td><%= _.escape(content_item.get("file_size")) %></td>',
'<td><%= _.escape(content_item.get("update_time")) %></td>',
"<td>",
'<% if ( content_item.get("state") !== "ok" ) { %>',
'<%= _.escape(content_item.get("state")) %>',
"<% } %>",
"</td>",
"<td>",
'<% if (content_item.get("is_unrestricted")) { %>',
'<span data-toggle="tooltip" data-placement="top" title="Unrestricted dataset" style="color:grey;" class="fa fa-globe fa-lg"/>',
"<% } %>",
Expand All @@ -372,8 +376,8 @@ define(
"<% } %>",
'<% if (content_item.get("can_manage")) { %>',
'<a href="#folders/<%- content_item.get("folder_id") %>/datasets/<%- content_item.id %>/permissions">',
'<button data-toggle="tooltip" data-placement="top" class="primary-button btn-xs permissions-dataset-btn" title="Manage permissions">',
'<span class="fa fa-group"/>',
'<button data-toggle="tooltip" data-placement="top" class="primary-button btn-xs permissions-dataset-btn" title="Permissions of \'<%- content_item.get("name") %>\'">',
'<span class="fa fa-group"/> Manage',
"</button>",
"</a>",
"<% } %>",
Expand Down Expand Up @@ -407,10 +411,14 @@ define(
'<%= _.escape(content_item.get("update_time")) %>',
"</td>",
"<td>",
'<% if ( content_item.get("state") !== "ok" ) { %>',
'<%= _.escape(content_item.get("state")) %>',
"<% } %>",
"</td>",
"<td>",
'<span data-toggle="tooltip" data-placement="top" title="Marked deleted" style="color:grey;" class="fa fa-ban fa-lg"/>',
'<button data-toggle="tooltip" data-placement="top" title="Undelete <%- content_item.get("name") %>" class="primary-button btn-xs undelete_dataset_btn" type="button" style="margin-left:1em;">',
'<span class="fa fa-unlock"/>',
"&nbsp;Undelete",
'<button data-toggle="tooltip" data-placement="top" title="Undelete \'<%- content_item.get("name") %>\'" class="primary-button btn-xs undelete_dataset_btn" type="button" style="margin-left:1em;">',
'<span class="fa fa-unlock"/> Undelete',
"</button>",
"</td>",
"</tr>"
Expand Down Expand Up @@ -439,11 +447,11 @@ define(
"<td>",
'<%= _.escape(content_item.get("update_time")) %>',
"</td>",
"<td></td>",
"<td>",
'<span data-toggle="tooltip" data-placement="top" title="Marked deleted" style="color:grey;" class="fa fa-ban fa-lg"/>',
'<button data-toggle="tooltip" data-placement="top" title="Undelete <%- content_item.get("name") %>" class="primary-button btn-xs undelete_folder_btn" type="button" style="margin-left:1em;">',
'<span class="fa fa-unlock"/>',
"&nbsp;Undelete",
'<button data-toggle="tooltip" data-placement="top" title="Undelete \'<%- content_item.get("name") %>\'" class="primary-button btn-xs undelete_folder_btn" type="button" style="margin-left:1em;">',
'<span class="fa fa-unlock"/> Undelete',
"</button>",
"</td>",
"</tr>"
Expand Down
17 changes: 10 additions & 7 deletions client/galaxy/scripts/mvc/library/library-foldertoolbar-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,10 @@ define(
show_page: parseInt(this.options.show_page),
page_count: parseInt(this.options.page_count),
total_items_count: this.options.total_items_count,
items_shown: this.options.items_shown
items_shown: this.options.items_shown,
folder_page_size: Galaxy.libraries.preferences.get(
"folder_page_size"
)
})
);
},
Expand Down Expand Up @@ -1432,7 +1435,8 @@ define(
/**
* Show user the prompt to change the number of items shown on page.
*/
showPageSizePrompt: function() {
showPageSizePrompt: function(e) {
e.preventDefault();
var folder_page_size = prompt(
"How many items per page do you want to see?",
Galaxy.libraries.preferences.get("folder_page_size")
Expand Down Expand Up @@ -1886,11 +1890,10 @@ define(
"<% } %>",
"</ul>",
"<span>",
"&nbsp;showing&nbsp;",
'<a data-toggle="tooltip" data-placement="top" title="Click to change the number of items on page" class="page_size_prompt">',
"<%- items_shown %>",
"</a>",
"&nbsp;of <%- total_items_count %> items",
' <%- items_shown %> items shown <a href="" data-toggle="tooltip" data-placement="top" title="currently <%- folder_page_size %> per page" class="page_size_prompt">(change)</a>',
"</span>",
"<span>",
" <%- total_items_count %> total",
"</span>"
].join("")
);
Expand Down

0 comments on commit f673761

Please sign in to comment.