Commit 8e9c2431 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Removed temporary 'migrated' aggregation from repo api and GUI.

parent 161122ca
......@@ -70,7 +70,7 @@ class SearchPage extends React.Component {
state = {
data: SearchPage.emptySearchData,
owner: 'migrated',
owner: 'all',
searchState: {
...SearchAggregations.defaultState
},
......@@ -164,7 +164,6 @@ class SearchPage extends React.Component {
const { pagination: { total }, metrics } = data
const ownerLabel = {
migrated: 'With PID',
all: 'All entries',
public: 'Only public entries',
user: 'Only your entries',
......@@ -172,14 +171,13 @@ class SearchPage extends React.Component {
}
const ownerTooltips = {
migrated: 'Only show entries with established provenance in the original Nomad repository.',
all: 'This will show all entries in the database, even those that might be duplicates.',
public: 'Do not show entries that are only visible to you.',
user: 'Do only show entries visible to you.',
staging: 'Will only show entries that you uploaded, but not yet published.'
}
const withoutLogin = ['migrated', 'all']
const withoutLogin = ['all']
const useMetric = Object.keys(metrics).find(metric => metric !== 'code_runs') || 'code_runs'
const helperText = <span>
......@@ -231,7 +229,7 @@ class SearchPage extends React.Component {
<FormControl>
<FormLabel>Filter entries and show: </FormLabel>
<FormGroup row>
{['migrated', 'all', 'public', 'user', 'staging']
{['all', 'public', 'user', 'staging']
.filter(key => user || withoutLogin.indexOf(key) !== -1)
.map(owner => (
<Tooltip key={owner} title={ownerTooltips[owner]}>
......
......@@ -186,13 +186,13 @@ class RepoCalcsResource(Resource):
if order not in [-1, 1]:
abort(400, message='invalid pagination')
if owner == 'migrated':
# TODO this should be removed after migration
q = Q('term', published=True) & Q('term', with_embargo=False)
if g.user is not None:
q = q | Q('term', owners__user_id=g.user.user_id)
q = q & ~Q('term', **{'uploader.user_id': 1}) # pylint: disable=invalid-unary-operand-type
elif owner == 'all':
# TODO this should be removed after migration
# if owner == 'migrated':
# q = Q('term', published=True) & Q('term', with_embargo=False)
# if g.user is not None:
# q = q | Q('term', owners__user_id=g.user.user_id)
# q = q & ~Q('term', **{'uploader.user_id': 1}) # pylint: disable=invalid-unary-operand-type
if owner == 'all':
q = Q('term', published=True) & Q('term', with_embargo=False)
if g.user is not None:
q = q | Q('term', owners__user_id=g.user.user_id)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment