Skip to content

Commit

Permalink
Merge branch 'dev' into install
Browse files Browse the repository at this point in the history
Signed-off-by: Carter Landis <[email protected]>
  • Loading branch information
ccarterlandis committed Sep 21, 2019
2 parents 39a481d + bdd5436 commit d99438f
Show file tree
Hide file tree
Showing 25 changed files with 437 additions and 372 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Augur
augur.config.json
node_modules/
logs/
# Byte-compiled / optimized / DLL files
__pycache__/
*$py.class
Expand Down
2 changes: 1 addition & 1 deletion augur/datasources/augur_db/augur_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -3046,7 +3046,7 @@ def top_insights(self, repo_group_id, num_repos=6):
SELECT repo_id
FROM repo
WHERE repo_group_id = :repo_group_id
AND repo_id IN (SELECT repo_id FROM repo_insights WHERE data_collection_date > CURRENT_DATE - INTERVAL '10' DAY GROUP BY repo_id, ri_id HAVING 304 > count(repo_insights.repo_id) ORDER BY ri_id desc)
AND repo_id IN (SELECT repo_id FROM repo_insights GROUP BY repo_id, ri_id HAVING 304 > count(repo_insights.repo_id) ORDER BY ri_id desc)
LIMIT :num_repos
)
""")
Expand Down
41 changes: 11 additions & 30 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 55 additions & 15 deletions frontend/src/Augur.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,29 +57,69 @@ export default function Augur() {
if (!to.params.compares) {
store.commit('compare/resetCompared')
}
store.dispatch('compare/setBaseRepo').then((data: any) => {
return store.dispatch('compare/setBaseGroup')
}).finally(() => {
next()
})
} else if (to.params.group && to.params.repo) {
console.log("bout to")
NProgress.set(0.6);
store.dispatch('compare/setBaseRepo', {
rg_name: to.params.group,
repo_name: to.params.repo,
repo_group_id: to.params.repo_group_id,
repo_id: to.params.repo_id,
gitURL: to.params.url
}).then(() => {
NProgress.set(0.8);
if(to.params.compares) {
let compares = to.params.compares === '' ? [] : to.params.compares.split(',');
return store.dispatch('compare/setComparedRepos', compares)
}
}).finally(()=>{
}).then((data: any) => {
return store.dispatch('compare/setBaseGroup', {
rg_name: to.params.group,
repo_name: to.params.repo,
repo_group_id: to.params.repo_group_id,
repo_id: to.params.repo_id,
gitURL: to.params.url
})
}).finally(() => {
next()
})
} else if (to.params.group && to.params.repo) {
console.log("bout to", to.params, !to.params.repo_group_id || !to.params.repo_id)
NProgress.set(0.6);
let repo_group_id = null
let repo_id = null
if (!to.params.repo_group_id || !to.params.repo_id) {
store.dispatch('common/retrieveRepoIds', {
repo: to.params.repo,
rg_name: to.params.group
}).then((ids: any) => {
repo_group_id = ids['repo_group_id']
repo_id = ids['repo_id']
store.dispatch('compare/setBaseRepo', {
rg_name: to.params.group,
repo: to.params.repo,
repo_group_id: repo_group_id,
repo_id: repo_id
}).then(() => {
NProgress.set(0.8);
if(to.params.compares) {
let compares = to.params.compares === '' ? [] : to.params.compares.split(',');
let ids = to.params.comparedRepoIds === '' ? [] : to.params.comparedRepoIds.split(',');
return store.dispatch('compare/setComparedRepos', { 'names': compares, 'ids': ids })
}
}).finally(()=>{
next()
})
})
} else {
store.dispatch('compare/setBaseRepo', {
rg_name: to.params.group,
repo: to.params.repo,
repo_group_id: to.params.repo_group_id,
repo_id: to.params.repo_id
}).then(() => {
NProgress.set(0.8);
if(to.params.compares) {
let compares = to.params.compares === '' ? [] : to.params.compares.split(',');
let ids = to.params.comparedRepoIds === '' ? [] : to.params.comparedRepoIds.split(',');
return store.dispatch('compare/setComparedRepos', { 'names': compares, 'ids': ids })
}
}).finally(()=>{
next()
})
}

} else if (to.params.group && !to.params.repo) {
NProgress.set(0.6)
store.dispatch('compare/setBaseGroup', {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/AugurAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default class AugurAPI {
this.__downloadedGitRepos = []

this._version = version || '/api/unstable'
this._host = 'http://augur.osshealth.io:5001'//hostURL// || 'http://localhost:5000'
this._host = hostURL || 'http://localhost:5000'
console.log(this._host)
this.__cache = {}
this.__timeout = null
Expand Down
7 changes: 4 additions & 3 deletions frontend/src/components/ReposInGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@
</div>
</div>

<spinner v-if="!loadedRepos"></spinner>


<div v-if="loadedRepos" class="row">
<div class="row">
<div class="col">
<div class="card card-small mb-4">
<div class="card-header border-bottom">
<h6 class="m-0">Currently Stored Repos</h6>
</div>
<div class="card-body p-0 pb-3 text-center">
<d-card-body v-if="!loadedRepos"><spinner></spinner></d-card-body>
<div v-if="loadedRepos" class="card-body p-0 pb-3 text-center">
<table style="table-layout:fixed;" class="table mb-0">
<thead class="bg-light">
<tr>
Expand Down
16 changes: 10 additions & 6 deletions frontend/src/components/charts/MainInsight.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import Spinner from '../Spinner.vue'
import vegaEmbed from 'vega-embed'
export default {
props: ['url', 'source', 'title', 'color', 'data', 'field', 'insight'],
props: ['url', 'source', 'title', 'color', 'data', 'insight'],
components: {
Spinner
},
Expand All @@ -26,7 +26,8 @@ export default {
computedField: 'value',
first_discovered: null,
x: 0,
y: 0
y: 0,
field: null
}
},
computed: {
Expand Down Expand Up @@ -100,8 +101,8 @@ export default {
let config = {
// "$schema": "https://vega.github.io/schema/vega-lite/v2.json",
"width": this.x / 2.1,
"height": this.y / 2,
"padding": {'left': 0, 'top': 0, 'right': 0, 'bottom': 0},
"height": this.y / 2.5,
"padding": {'left': 0, 'top': 10, 'right': 20, 'bottom': 0},
"selection": {
"grid": {
"type": "interval", "bind": "scales"
Expand Down Expand Up @@ -229,7 +230,7 @@ export default {
"field": this.computedField,"type": "quantitative",
"axis": {
"labels": true,
"title": this.computedField
"title": this.field
}
},
"color": {"value": this.color}
Expand Down Expand Up @@ -307,9 +308,12 @@ export default {
let keys = Object.keys(el)
let field = null
let found = false
keys.forEach((key) => {
if (el[key] != null && key != 'date' && key != 'repo_name' && key != 'field' && key != 'value'){
if (el[key] != null && key != 'date' && key != 'repo_name' && key != 'field' && key != 'value' && !found){
this.field = key
field = key
found = true
}
})
el['value'] = el[field]
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/charts/SparkChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default {
let config = {
"$schema": "https://vega.github.io/schema/vega-lite/v2.json",
"width": this.x / 15,
"height": this.y / 22,
"height": this.y / 25,
"padding": 0,
"mark": {
"type":"line",
Expand Down
24 changes: 22 additions & 2 deletions frontend/src/components/common/CompareControl.vue
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,19 @@
return this.selectedRepos
}
get selectedRepoEntities () {
console.log("Compare control")
let repos: any[] = []
let repo = null
let i = null
for (i in this.selectedRepos) {
repo = this.selectedRepos[i]
console.log(this.repoRelations[this.selectedGroups[0][repo.split('/')[1]]])
repos.push(this.repoRelations[this.selectedGroups[0][repo.split('/')[1]]])
}
return repos
}
// get GroupOptions() {
// let rg_names:string[] = []
// this.repoGroups.forEach((rg:any) => {
Expand Down Expand Up @@ -376,15 +389,22 @@
onCompare(e: any) {
if(!this.isGroup) {
console.log(this.selectedRepos)
console.log("onCompare: ", e, this.base)
let comparedRepoIds = String(this.base.repo_id)
let repo: any = null
for (repo in this.selectedRepoEntities) {
comparedRepoIds += "," + String(repo.repo_id)
}
router.push({
name: 'repo_overview_compare',
params: {
group: this.base.rg_name,
repo: this.base.repo_name,
repo_group_id: this.base.repo_group_id,
repo_id: this.base.repo_id,
compares: this.selectedRepos.join(',')}
compares: this.selectedRepos.join(','),
comparedRepoIds
}
})
} else {
router.push({
Expand Down
Loading

0 comments on commit d99438f

Please sign in to comment.