diff --git a/client/src/bundleToolshed.js b/client/src/bundleToolshed.js deleted file mode 100644 index c2510b540b17..000000000000 --- a/client/src/bundleToolshed.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * The toolshed list of globals we expose in window.bundleToolshed used by Toolshed makos. - */ - -/* jquery and _ are exposed via expose-loader while several external plugins rely on these */ -import $ from "jquery"; // eslint-disable-line no-unused-vars -import _ from "underscore"; // eslint-disable-line no-unused-vars - -export { default as LegacyGridView } from "legacy/grid/grid-view"; -export { default as store } from "storemodern"; -export { default as ToolshedGroups } from "toolshed/toolshed.groups"; diff --git a/client/src/style/scss/base.scss b/client/src/style/scss/base.scss index 436e3d963829..0b08c0aa0af1 100644 --- a/client/src/style/scss/base.scss +++ b/client/src/style/scss/base.scss @@ -37,7 +37,6 @@ $fa-font-path: "../../../node_modules/@fortawesome/fontawesome-free/webfonts/"; @import "charts.scss"; @import "message.scss"; @import "markdown.scss"; -@import "toolshed.scss"; @import "multiselect.scss"; @import "icon-btn.scss"; @import "peek-columns.scss"; diff --git a/client/src/style/scss/toolshed.scss b/client/src/style/scss/toolshed.scss deleted file mode 100644 index 72a4c8b68852..000000000000 --- a/client/src/style/scss/toolshed.scss +++ /dev/null @@ -1,40 +0,0 @@ -@import "theme/blue.scss"; -.shed-style-container { - width: 95%; - margin: auto; - margin-top: 1em; - overflow: auto !important; - .header { - h2 { - float: left; - } - span { - float: right; - } - } -} -.ui-autocomplete { - background-color: #fff; - li.ui-menu-item { - list-style-type: none; - } -} - -.masthead-simple { - background-color: $brand-dark; - height: $masthead-height; - .navbar-brand { - position: absolute; - left: 0.5rem; - .navbar-brand-image { - max-height: 2rem; - } - } - .navbar-brand-title { - color: $brand-light; - font-size: 1.1rem; - } - .nav-link { - color: $brand-light !important; - } -} diff --git a/client/src/style/scss/unsorted.scss b/client/src/style/scss/unsorted.scss index adbf5f8679e4..4c3799859c8f 100644 --- a/client/src/style/scss/unsorted.scss +++ b/client/src/style/scss/unsorted.scss @@ -932,7 +932,6 @@ div.toolSectionTitle { } /* Toolshed, reports custom styles from mako templates */ -body.toolshed, body.reports { margin: 0; padding: 0; diff --git a/client/src/toolshed/groups/group-detail-view.js b/client/src/toolshed/groups/group-detail-view.js deleted file mode 100644 index bb4836c95056..000000000000 --- a/client/src/toolshed/groups/group-detail-view.js +++ /dev/null @@ -1,141 +0,0 @@ -import Backbone from "backbone"; -import $ from "jquery"; -import mod_group_model from "toolshed/groups/group-model"; -import { Toast } from "ui/toast"; -import _ from "underscore"; - -// toolshed group detail view -const GroupDetailView = Backbone.View.extend({ - el: "#groups_element", - options: {}, - app: null, - - initialize: function (options) { - this.options = _.extend(this.options, options); - this.app = window.globalTS.groups; - - if (this.app.collection !== null) { - this.model = this.app.collection.get(this.options.group_id); - this.render(); - } else { - this.fetchGroup(); - } - }, - - fetchGroup: function (options) { - const that = this; - this.options = _.extend(this.options, options); - this.model = new mod_group_model.Group({ id: this.options.group_id }); - this.model.fetch({ - success: function (model) { - console.log("received data: "); - console.log(model); - that.render(); - }, - error: function (model, response) { - if (typeof response.responseJSON !== "undefined") { - Toast.error(response.responseJSON.err_msg); - } else { - Toast.error("An error occurred."); - } - }, - }); - }, - - render: function () { - const template = this.templateRow(); - this.$el.html(template({ group: this.model })); - $('#center [data-toggle="tooltip"]').tooltip({ trigger: "hover" }); - $("#center").css("overflow", "auto"); - }, - - templateRow: function () { - return _.template( - [ - "
", - '

<%= _.escape(group.get("name")) %>

', - '

', - 'A group of <%= group.get("members").length %> members with <%= group.get("repositories").length %> repositories and a total of <%= group.get("total_downloads") %> combined repository clones.

', - - "

Members

", - '', - "", - "", - "", - "", - "", - "", - '<% _.each(group.get("members"), function(member) { %>', - "", - "", - "", - "", - "", - "<% }); %>", - "", - "
NameRepositoriesRegistered
", - "<%= _.escape(member.username) %>", - "", - '<%= member.user_repos_count %>', - "", - "<%= member.time_created %>", - "
", - - "

Repositories

", - '', - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - '<% _.each(group.get("repositories"), function(repo) { %>', - "", - "", - "", - "", - "", - "", - '", - '", - "", - "", - "", - "<% }); %>", - "", - "
NameDescriptionClonesOwnerCategoriesCreatedUpdatedRatingVerified
", - '<%= _.escape(repo.name) %>', - "", - "<%= _.escape(repo.description) %>", - "", - "<%= repo.times_downloaded %>", - "", - "<%= _.escape(repo.owner) %>", - "", - "<% _.each((repo.categories), function(cat) { %>", - '<%= cat.name %>
', - // '<%= repo.categories %>', - "<% }); %>", - "
', - "<%= repo.time_created %>", - "', - "<%= repo.time_updated %>", - "", - "<%= repo.ratings_mean %>", - "", - "<%= repo.approved %>", - "
", - "
", - ].join("") - ); - }, -}); -export default { - GroupDetailView: GroupDetailView, -}; diff --git a/client/src/toolshed/groups/group-list-view.js b/client/src/toolshed/groups/group-list-view.js deleted file mode 100644 index 6d21347f8144..000000000000 --- a/client/src/toolshed/groups/group-list-view.js +++ /dev/null @@ -1,130 +0,0 @@ -import Backbone from "backbone"; -import $ from "jquery"; -import mod_group_row from "toolshed/groups/group-listrow-view"; -import mod_group_model from "toolshed/groups/group-model"; -import { Toast } from "ui/toast"; -import _ from "underscore"; - -const GroupListView = Backbone.View.extend({ - el: "#groups_element", - defaults: {}, - - /** - * Initialize and fetch the groups from server. - * Async render afterwards. - * @param {object} options an object with options - */ - initialize: function (options) { - this.options = _.defaults(this.options || {}, this.defaults, options); - const that = this; - window.globalTS.groups.collection = new mod_group_model.Groups(); - window.globalTS.groups.collection.fetch({ - success: function (model) { - that.render(); - }, - error: function (model, response) { - if (typeof response.responseJSON !== "undefined") { - Toast.error(response.responseJSON.err_msg); - } else { - Toast.error("An error occurred."); - } - }, - }); - }, - - fetch: function () {}, - - /** - * Render the groups table from the object's own collection. - */ - render: function (options) { - this.options = _.extend(this.options, options); - $(".tooltip").hide(); - const template = this.templateGroupsList(); - this.$el.html(template({ length: window.globalTS.groups.collection.models.length })); - this.renderRows(window.globalTS.groups.collection.models); - $('#center [data-toggle="tooltip"]').tooltip({ trigger: "hover" }); - $("#center").css("overflow", "auto"); - }, - - /** - * Render all given models as rows in the groups list - * @param {array} groups_to_render array of group models to render - */ - renderRows: function (groups_to_render) { - for (let i = 0; i < groups_to_render.length; i++) { - const group = groups_to_render[i]; - this.renderOne({ group: group }); - } - }, - - /** - * Create a view for the given model and add it to the groups view. - * @param {Group} model of the view that will be rendered - */ - renderOne: function (options) { - const rowView = new mod_group_row.GroupListRowView(options); - this.$el.find("#group_list_body").append(rowView.el); - }, - - /** - * Table heading was clicked, update sorting preferences and re-render. - * @return {[type]} [description] - */ - // sort_clicked : function(){ - // if (Galaxy.libraries.preferences.get('sort_order') === 'asc'){ - // Galaxy.libraries.preferences.set({'sort_order': 'desc'}); - // } else { - // Galaxy.libraries.preferences.set({'sort_order': 'asc'}); - // } - // this.render(); - // }, - - /** - * Sort the underlying collection according to the parameters received. - * Currently supports only sorting by name. - */ - // sortLibraries: function(){ - // if (Galaxy.libraries.preferences.get('sort_by') === 'name'){ - // if (Galaxy.libraries.preferences.get('sort_order') === 'asc'){ - // this.collection.sortByNameAsc(); - // } else if (Galaxy.libraries.preferences.get('sort_order') === 'desc'){ - // this.collection.sortByNameDesc(); - // } - // } - // }, - - // MMMMMMMMMMMMMMMMMM - // === TEMPLATES ==== - // MMMMMMMMMMMMMMMMMM - - templateGroupsList: function () { - const tmpl_array = []; - - tmpl_array.push('
'); - tmpl_array.push("
"); - tmpl_array.push('
'); - tmpl_array.push("<% if(length === 0) { %>"); - tmpl_array.push("
There are no groups yet.
"); - tmpl_array.push("<% } else{ %>"); - tmpl_array.push(''); - tmpl_array.push(" "); - tmpl_array.push(" "); - // tmpl_array.push(' '); - tmpl_array.push(" "); - tmpl_array.push(" "); - tmpl_array.push(" "); - tmpl_array.push(' '); - // group item views will attach here - tmpl_array.push(" "); - tmpl_array.push("
NamedescriptionMembersRepositories
"); - tmpl_array.push("<% }%>"); - tmpl_array.push("
"); - - return _.template(tmpl_array.join("")); - }, -}); - -export default { - GroupListView: GroupListView, -}; diff --git a/client/src/toolshed/groups/group-listrow-view.js b/client/src/toolshed/groups/group-listrow-view.js deleted file mode 100644 index 8acfa31e7634..000000000000 --- a/client/src/toolshed/groups/group-listrow-view.js +++ /dev/null @@ -1,35 +0,0 @@ -import Backbone from "backbone"; -import _ from "underscore"; - -// toolshed group row view -const GroupListRowView = Backbone.View.extend({ - events: {}, - - initialize: function (options) { - this.render(options.group); - }, - - render: function (group) { - const tmpl = this.templateRow(); - this.setElement(tmpl({ group: group })); - this.$el.show(); - return this; - }, - - templateRow: function () { - return _.template( - [ - '">', - '"><%= _.escape(group.get("name")) %>', - // 'description', - '<%= group.get("total_members") %>', - '<%= group.get("total_repos") %>', - "", - ].join("") - ); - }, -}); - -export default { - GroupListRowView: GroupListRowView, -}; diff --git a/client/src/toolshed/groups/group-model.js b/client/src/toolshed/groups/group-model.js deleted file mode 100644 index e001830830d6..000000000000 --- a/client/src/toolshed/groups/group-model.js +++ /dev/null @@ -1,20 +0,0 @@ -import Backbone from "backbone"; -import { getAppRoot } from "onload/loadConfig"; - -// ============================================================================ -// TS GROUP RELATED MODELS - -const Group = Backbone.Model.extend({ - urlRoot: `${getAppRoot()}api/groups`, -}); - -const Groups = Backbone.Collection.extend({ - url: `${getAppRoot()}api/groups`, - - model: Group, -}); - -export default { - Group: Group, - Groups: Groups, -}; diff --git a/client/src/toolshed/toolshed.groups.js b/client/src/toolshed/toolshed.groups.js deleted file mode 100644 index 89fb79623d45..000000000000 --- a/client/src/toolshed/toolshed.groups.js +++ /dev/null @@ -1,43 +0,0 @@ -// MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM -// === MAIN TOOLSHED GROUP MODULE ==== -// MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM - -import Backbone from "backbone"; -import mod_group_detail from "toolshed/groups/group-detail-view"; -import mod_group_list from "toolshed/groups/group-list-view"; - -// ============================================================================ -// ROUTER -const ToolshedRouter = Backbone.Router.extend({ - routes: { - "": "groups", - ":group_id": "group_page", - }, -}); - -const ToolshedGroups = Backbone.View.extend({ - groupListView: null, - groupDetailView: null, - collection: null, - - initialize: function () { - window.globalTS.groups = this; - - this.ts_router = new ToolshedRouter(); - this.ts_router.on("route:groups", () => { - window.globalTS.groups.groupListView = new mod_group_list.GroupListView(); - }); - - this.ts_router.on("route:group_page", (group_id) => { - window.globalTS.groups.groupDetailView = new mod_group_detail.GroupDetailView({ - group_id: group_id, - }); - }); - - Backbone.history.start({ pushState: false }); - }, -}); - -export default { - ToolshedGroups: ToolshedGroups, -}; diff --git a/client/webpack.config.js b/client/webpack.config.js index e68cd301aadf..15063f8cd3e4 100644 --- a/client/webpack.config.js +++ b/client/webpack.config.js @@ -50,7 +50,6 @@ module.exports = (env = {}, argv = {}) => { entry: { analysis: ["polyfills", "bundleEntries", "entry/analysis"], generic: ["polyfills", "bundleEntries", "entry/generic"], - toolshed: ["polyfills", "bundleToolshed", "entry/generic"], }, output: { path: path.join(__dirname, "dist"), @@ -154,18 +153,6 @@ module.exports = (env = {}, argv = {}) => { }, ], }, - // Attaches the bundleToolshed to the window object. - { - test: `${scriptsBase}/bundleToolshed`, - use: [ - { - loader: "expose-loader", - options: { - exposes: "bundleToolshed", - }, - }, - ], - }, { test: `${scriptsBase}/onload/loadConfig.js`, use: [