Skip to content

Commit 4098987

Browse files
authored
Merge pull request #37 from AU-Biocommons/dev
Labs, Genomes and Tracks display in alphabetical order
2 parents b5f1b2b + 4652183 commit 4098987

5 files changed

Lines changed: 20 additions & 8 deletions

File tree

.github/workflows/deploy-dev.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
name: Deploy to dev
22

33
on:
4-
push:
4+
workflow_run:
5+
workflows: ["Django tests"]
6+
types:
7+
- completed
58
branches:
69
- dev
710

811
jobs:
912
run_pull:
13+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1014
name: run server update
1115
runs-on: ubuntu-latest
1216
environment: Deployment

.github/workflows/deploy-prod.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
name: Deploy to prod
22

33
on:
4-
push:
4+
workflow_run:
5+
workflows: ["Django tests"]
6+
types:
7+
- completed
58
branches:
69
- master
710

811
jobs:
912
run_pull:
13+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1014
name: run server update
1115
runs-on: ubuntu-latest
1216
environment: Deployment

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ media/
88
.env.test
99

1010
# Special files
11-
apollo_portal/genomes/data/factory/species_images/index.txt
11+
app/genomes/data/factory/species_images/index.txt
1212

1313
# Ansible stuff
1414
deploy/ansible/roles/

app/genomes/api/endpoints.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
@api_view(['GET'])
1111
def labs(request):
1212
"""Return requested labs as json."""
13-
labs = Lab.objects.all()
13+
labs = Lab.objects.all().order_by(Lower('name'))
1414
filter_labs_str = request.GET.get('labs')
1515
if filter_labs_str:
1616
filter_labs = [
@@ -34,8 +34,13 @@ def labs(request):
3434

3535
@api_view(['GET'])
3636
def genomes(request):
37-
"""Return requested genomes as json."""
38-
genomes = Genome.objects.all()
37+
"""Return requested genomes as json.
38+
39+
Optionally filter by GET parameters, where `group` matches
40+
`genome.group.name` and `lab` is a comma-joined list of lab names which
41+
matching `genome.lab.name`.
42+
"""
43+
genomes = Genome.objects.all().order_by(Lower('name'))
3944
filter_group = request.GET.get('group')
4045
if filter_group:
4146
# Case insensitive filter by genome.group.name
@@ -62,7 +67,7 @@ def genomes(request):
6267
@api_view(['GET'])
6368
def tracks(request):
6469
"""Return requested genomes as json."""
65-
tracks = Track.objects.all()
70+
tracks = Track.objects.all().order_by(Lower('name'))
6671
filter_keywords = {
6772
'group': 'genome__group__name__iexact',
6873
'genome_id': 'genome__id',

app/genomes/data/factory/species_images/index.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)