Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mccalluc/data sets to plain data sets #2021

Merged
merged 4 commits into from
Aug 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 1 addition & 7 deletions refinery/core/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from registration.forms import RegistrationForm, RegistrationFormUniqueEmail

from .models import DataSet, Project, UserProfile, Workflow
from .models import Project, UserProfile, Workflow


class ProjectForm(ModelForm):
Expand Down Expand Up @@ -78,9 +78,3 @@ class WorkflowForm(ModelForm):
class Meta:
model = Workflow
fields = ["name", "slug", "summary", "description", "is_active"]


class DataSetForm(ModelForm):
class Meta:
model = DataSet
fields = ["summary", "description", "slug"]
2 changes: 1 addition & 1 deletion refinery/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1518,7 +1518,7 @@ def send_email(self):
# TODO: avoid hardcoding URL protocol
context_dict['url'] = urljoin(
"http://" + site_domain,
"data_sets2/{}/#/files/?{}".format(
"data_sets/{}/#/files/?{}".format(
data_set_uuid,
self.data_sets_query()
)
Expand Down
12 changes: 5 additions & 7 deletions refinery/core/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,16 @@
url(r'^analyses/$', 'analyses', name="analyses"),
url(r'^analyses/(?P<analysis_uuid>' + UUID_RE + r')/$',
'analysis', name="analysis"),
url(r'^data_sets_old/(?P<data_set_uuid>' + UUID_RE + r')/$',
url(r'^provenance/(?P<data_set_uuid>' + UUID_RE + r')/$',
'data_set', name="data_set"),
url(r'^data_sets2/(?P<data_set_uuid>' + UUID_RE + r')/$',
url(r'^data_sets/(?P<data_set_uuid>' + UUID_RE + r')/$',
'data_set2', name="data_set2"),
url(r'^data_sets2/(?P<slug>[a-zA-Z0-9\_]+)/$',
url(r'^data_sets/(?P<slug>[a-zA-Z0-9\_]+)/$',
'data_set2_slug', name="data_set2_slug"),
url(r'^data_sets_old/(?P<data_set_uuid>' + UUID_RE + r')/'
url(r'^provenance/(?P<data_set_uuid>' + UUID_RE + r')/'
r'analysis/(?P<analysis_uuid>' + UUID_RE + r')/$',
'data_set', name="data_set_analysis"),
url(r'^data_sets_old/(?P<uuid>' + UUID_RE + r')/edit/$',
'data_set_edit', name="data_set_edit"),
url(r'^data_sets_old/(?P<slug>[a-zA-Z0-9\_]+)/$',
url(r'^provenance/(?P<slug>[a-zA-Z0-9\_]+)/$',
'data_set_slug', name="data_set_slug"),
url(r'^workflows/(?P<uuid>' + UUID_RE + r')/$',
'workflow', name="workflow"),
Expand Down
66 changes: 1 addition & 65 deletions refinery/core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@
from file_store.models import FileStoreItem
from visualization_manager.views import igv_multi_species

from .forms import (DataSetForm, ProjectForm, UserForm, UserProfileForm,
WorkflowForm)
from .forms import ProjectForm, UserForm, UserProfileForm, WorkflowForm
from .models import (Analysis, CustomRegistrationProfile, DataSet,
ExtendedGroup, Invitation, Ontology, Project, UserProfile,
Workflow, WorkflowEngine)
Expand Down Expand Up @@ -435,69 +434,6 @@ def data_set2(request, data_set_uuid, analysis_uuid=None):
context_instance=RequestContext(request))


def data_set_edit(request, uuid):
data_set = get_object_or_404(DataSet, uuid=uuid)

if not request.user.has_perm('core.change_dataset', data_set):
if request.user.is_authenticated():
return HttpResponseForbidden(
custom_error_page(request, '403.html',
{user: request.user,
'msg': "edit this data set"})
)
else:
return HttpResponse(
custom_error_page(request, '401.html',
{'msg': "edit this data set"}),
status='401'
)
# get studies
investigation = data_set.get_investigation()
studies = investigation.study_set.all()
study_uuid = studies[0].uuid
assay_uuid = studies[0].assay_set.all()[0].uuid
# TODO: catch errors
isatab_archive = None
pre_isatab_archive = None

try:
if investigation.isarchive_file is not None:
isatab_archive = FileStoreItem.objects.get(
uuid=investigation.isarchive_file
)
except FileStoreItem.DoesNotExist:
pass
try:
if investigation.pre_isarchive_file is not None:
pre_isatab_archive = FileStoreItem.objects.get(
uuid=investigation.pre_isarchive_file)
except FileStoreItem.DoesNotExist:
pass

if request.method == "POST": # If the form has been submitted
# A form bound to the POST data
form = DataSetForm(data=request.POST, instance=data_set)
if form.is_valid(): # All validation rules pass
form.save()
# Process the data in form.cleaned_data
# Redirect after POST
return HttpResponseRedirect(
reverse('core.views.data_set', args=(uuid,)))
else:
form = DataSetForm(instance=data_set) # An unbound form
return render_to_response('core/data_set_edit.html',
{
'data_set': data_set,
"studies": studies,
"study_uuid": study_uuid,
"assay_uuid": assay_uuid,
"isatab_archive": isatab_archive,
"pre_isatab_archive": pre_isatab_archive,
'form': form
},
context_instance=RequestContext(request))


def workflow_slug(request, slug):
w = get_object_or_404(Workflow, slug=slug)
return workflow(request, w.uuid)
Expand Down
2 changes: 1 addition & 1 deletion refinery/static/source/js/refinery/contents.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
var showAnnotation = false;

// To avoid generation when in the data set 2 browser
if (window.location.href.indexOf('data_sets2') === -1) {
if (window.location.href.indexOf('data_sets') === -1) {
configurator.initialize(function () {
query = new SolrQuery(configurator, queryCommands);
query.initialize();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ SolrDocumentTable.prototype.render = function(solrResponse) {
.trigger('refinery/solrTable/destroy')
.html("");
// Required while data set 2 lives in parallel.
if (window.location.href.indexOf('data_sets2') === -1) {
if (window.location.href.indexOf('data_sets') === -1) {
self._renderTable(solrResponse);
//$( "#" + self._parentElementId ).html( code );
// attach event listeners
Expand Down
116 changes: 0 additions & 116 deletions refinery/templates/core/data_set_edit.html

This file was deleted.

2 changes: 1 addition & 1 deletion refinery/tool_manager/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ def launch(self):

return JsonResponse(
{
Tool.TOOL_URL: "/data_sets2/{}/#/analyses/".format(
Tool.TOOL_URL: "/data_sets/{}/#/analyses/".format(
self.dataset.uuid
)
}
Expand Down
2 changes: 1 addition & 1 deletion refinery/tool_manager/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1552,7 +1552,7 @@ def test_workflow_tool_launch_valid_workflow_object(self):
self.assertEqual(self.tool.get_tool_type(), ToolDefinition.WORKFLOW)
self.assertEqual(
json.loads(self.post_response.content)[Tool.TOOL_URL],
'/data_sets2/{}/#/analyses/'.format(self.tool.dataset.uuid)
'/data_sets/{}/#/analyses/'.format(self.tool.dataset.uuid)
)

def test_many_tools_can_be_launched_from_same_dataset(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function analysisMonitorAnalysesList ($location, $window) {
galaxyExport: 'Downloading analysis results from Galaxy'
};

if ($location.absUrl().indexOf('data_sets2') > -1) {
if ($location.absUrl().indexOf('data_sets') > -1) {
scope.AMCtrl.updateAnalysesList();
} else {
scope.$on('refinery/analyze-tab-active', function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
<div class="col-md-5 analysis-name">
<span ng-switch on="analysis.status">
<span ng-switch-when="SUCCESS">
<a ng-href="/data_sets2/{{analysis.data_set__uuid}}/#/files/?{{analysis.data_sets_query}}">
<a ng-href="/data_sets/{{analysis.data_set__uuid}}/#/files/?{{analysis.data_sets_query}}">
{{ analysis.name }}
</a>
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
&nbsp;
</div>
<div class="analyses-global-text">
<a id="analyses-popover-links" ng-href="/data_sets2/{{analysis.data_set__uuid}}/#/analyses/">
<a id="analyses-popover-links" ng-href="/data_sets/{{analysis.data_set__uuid}}/#/analyses/">
{{ analysis.name }}
</a>
</div>
Expand All @@ -55,12 +55,12 @@
</div>
<div class="analyses-global-text">
<span ng-if="analysis.status === 'SUCCESS'">
<a id="analyses-popover-links" ng-href="/data_sets2/{{analysis.data_set__uuid}}/#/files/?{{analysis.data_sets_query}}">
<a id="analyses-popover-links" ng-href="/data_sets/{{analysis.data_set__uuid}}/#/files/?{{analysis.data_sets_query}}">
{{ analysis.name }}
</a>
</span>
<span ng-if="analysis.status !== 'SUCCESS'">
<a id="analyses-popover-links" ng-href="/data_sets2/{{ analysis.data_set__uuid }}/#/analyses/">
<a id="analyses-popover-links" ng-href="/data_sets/{{ analysis.data_set__uuid }}/#/analyses/">
{{ analysis.name }}
</a>
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('Constant: LocationTest', function () {

expect(
locationTest('www.refinery.com/datasets/',
'http://192.168.50.50:8000/data_sets_old/' +
'http://192.168.50.50:8000/provenance/' +
'88d03196-0d41-42c7-9f16-4cf03657db07/#/' +
'files/browse', 'true')
).toBe(false);
Expand All @@ -43,14 +43,14 @@ describe('Constant: LocationTest', function () {
).toBe(false);

expect(
locationTest('http://192.168.50.50:8000/data_sets_old/' +
locationTest('http://192.168.50.50:8000/provenance/' +
'88d03196-0d41-42c7-9f16-4cf03657db07/#/' +
'files/browse', 'www.refinery.com/dataset/', 'false')
).toBe(false);

expect(
locationTest('www.refinery.com/dataset/',
'http://192.168.50.50:8000/data_sets_old/' +
'http://192.168.50.50:8000/provenance/' +
'88d03196-0d41-42c7-9f16-4cf03657db07/#/' +
'files/browse', 'true')
).toBe(false);
Expand Down
4 changes: 2 additions & 2 deletions refinery/ui/source/js/commons/router/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function RefineryStateProvider ($window, $stateProvider, _, locationTest) {
* this:
* http://sub.domain.tld:port/users/#/edit
* http://sub.domain.tld:port/groups/#/edit
* http://sub.domain.tld:port/data_sets_old//#/edit
* http://sub.domain.tld:port/provenance//#/edit
*
* <pre>
* var app = angular.module('app', ['refineryRouter']);
Expand Down Expand Up @@ -88,7 +88,7 @@ function RefineryStateProvider ($window, $stateProvider, _, locationTest) {
* templateUrl: '/static/partials/group/edit.html',
* controller: 'DataSetsCtrl as dataSets'
* },
* '^\/data_sets_old\/.*\/$', true);
* '^\/provenance\/.*\/$', true);
* });
* </pre>
*
Expand Down