From 885998bc9db0774b7f64b0823ffbe7e8844bb892 Mon Sep 17 00:00:00 2001
From: Bointeka
Date: Mon, 15 Nov 2021 18:48:45 -0500
Subject: [PATCH 01/12] Added Administrator to dashboard in
./nav-bar/index.hbs. Added administrator routing to router.js
---
app/components/nav-bar/index.hbs | 2 ++
app/router.js | 5 +++++
2 files changed, 7 insertions(+)
diff --git a/app/components/nav-bar/index.hbs b/app/components/nav-bar/index.hbs
index 6564c9d80..c7ecdd6b0 100644
--- a/app/components/nav-bar/index.hbs
+++ b/app/components/nav-bar/index.hbs
@@ -13,6 +13,8 @@
-
+
\ No newline at end of file
+>
+
\ No newline at end of file
From 4542b22ee2c02f3cea722ac9c7043709a564e81f Mon Sep 17 00:00:00 2001
From: Bointeka
Date: Tue, 23 Nov 2021 18:52:32 -0500
Subject: [PATCH 07/12] To enable sorting through elastic search rather than
Ember models table, Added displayDataChangedAction that submits another
action to the router which submits a new query based on the sort/filter
requested.
---
app/controllers/administrator/index.js | 45 +++++++++++++++++++++-
app/routes/administrator/index.js | 53 +++++++++++++++++++-------
app/templates/administrator/index.hbs | 1 +
3 files changed, 84 insertions(+), 15 deletions(-)
diff --git a/app/controllers/administrator/index.js b/app/controllers/administrator/index.js
index b552aef2c..11ab6b664 100644
--- a/app/controllers/administrator/index.js
+++ b/app/controllers/administrator/index.js
@@ -1,13 +1,15 @@
import Controller from '@ember/controller';
import { tracked } from '@glimmer/tracking';
import Bootstrap4Theme from 'ember-models-table/themes/bootstrap4';
-import { get } from '@ember/object';
+import { set, get } from '@ember/object';
import { inject as service } from '@ember/service';
+import {action} from '@ember/object';
export default class SubmissionsIndex extends Controller {
@service currentUser;
@service('app-static-config') configurator;
+ actionData = null;
@tracked assetsUri = null;
@tracked themeInstance = Bootstrap4Theme.create();
// Bound to message dialog.
@@ -45,7 +47,7 @@ export default class SubmissionsIndex extends Controller {
propertyName: 'repositories',
title: 'Repositories',
className: 'repositories-column',
- component: 'submissions-repo-cell'
+ component: 'submissions-repo-cell',
},
{
propertyName: 'submittedDate',
@@ -82,4 +84,43 @@ export default class SubmissionsIndex extends Controller {
return [];
}
}
+
+ @action
+ myAction(data) {
+ let filteredColumn = this.getFilteredColumns(data);
+ let sortedColumn = this.getSortedColumns(data);
+
+ this.send('updateTable', {sortedColumn: sortedColumn,
+ filteredColumn: filteredColumn})
+ }
+
+ getSortedColumns(data) {
+ if (data.sort.length === 0) {
+ return undefined;
+ }
+ let sort = data.sort[0].split(':')
+ let propertyName = sort[0];
+ let sortDirection = sort[1];
+
+ let querySort = {};
+ querySort[propertyName] = {
+ missing: '_last',
+ order: `${sortDirection}`
+ }
+ return [querySort];
+ }
+
+ getFilteredColumns(data) {
+ if (Object.keys(data.columnFilters).length === 0) {
+ return undefined;
+ }
+ let filterSort = [];
+ for (let column in data.columnFilters) {
+ let query = { 'term' : {}}
+ query['term'][column] = data.columnFilters[column]
+ filterSort.push(query)
+ }
+ return filterSort;
+ }
+
}
diff --git a/app/routes/administrator/index.js b/app/routes/administrator/index.js
index 9cba5c53f..396a794f8 100644
--- a/app/routes/administrator/index.js
+++ b/app/routes/administrator/index.js
@@ -2,6 +2,7 @@ import { inject as service } from '@ember/service';
import CheckSessionRoute from '../check-session-route';
import RSVP from 'rsvp';
import { get } from '@ember/object';
+import {action} from '@ember/object';
export default class IndexRoute extends CheckSessionRoute {
@service('current-user')
@@ -10,6 +11,19 @@ export default class IndexRoute extends CheckSessionRoute {
@service('search-helper')
searchHelper;
+ defaultAdminSort = [{
+ submittedDate: {
+ missing: '_last',
+ order: 'desc'
+ }
+ }];
+
+ defaultSubmitterSort = [
+ { submitted: { missing: '_last', order: 'asc' } },
+ { submittedDate: { missing: '_last', order: 'desc' } },
+ { submissionStatus: { missing: '_last', order: 'asc' } }
+ ];
+
async model() {
const user = get(this, 'currentUser.user');
@@ -28,16 +42,13 @@ export default class IndexRoute extends CheckSessionRoute {
});
}
- _doAdmin() {
+
+
+ _doAdmin(sortedColumn = this.defaultAdminSort) {
const ignoreList = this.searchHelper.getIgnoreList();
const query = {
- sort: [{
- submittedDate: {
- missing: '_last',
- order: 'desc'
- }
- }],
+ sort: sortedColumn,
query: {
match_all: {},
must_not: [
@@ -54,15 +65,11 @@ export default class IndexRoute extends CheckSessionRoute {
return this.store.query('submission', query);
}
- _doSubmitter(user) {
+ _doSubmitter(user, sortedColumn = this.defaultSubmitterSort) {
const ignoreList = this.searchHelper.getIgnoreList();
const query = {
- sort: [
- { submitted: { missing: '_last', order: 'asc' } },
- { submittedDate: { missing: '_last', order: 'desc' } },
- { submissionStatus: { missing: '_last', order: 'asc' } }
- ],
+ sort: sortedColumn,
query: {
bool: {
should: [
@@ -83,4 +90,24 @@ export default class IndexRoute extends CheckSessionRoute {
return this.store.query('submission', query);
}
+
+ @action
+ async updateTable({sortedColumn, filteredColumn}) {
+ console.log(sortedColumn, filteredColumn)
+ const user = get(this, 'currentUser.user');
+
+ let submissions = null;
+
+ if (user.get('isAdmin')) {
+ submissions = this._doAdmin(sortedColumn);
+ } else if (user.get('isSubmitter')) {
+ submissions = this._doSubmitter(user, sortedColumn);
+ }
+
+ submissions.then(() => this.searchHelper.clearIgnore());
+
+ return RSVP.hash({
+ submissions
+ });
+ }
}
diff --git a/app/templates/administrator/index.hbs b/app/templates/administrator/index.hbs
index 31dfe26a5..ef678c4b0 100644
--- a/app/templates/administrator/index.hbs
+++ b/app/templates/administrator/index.hbs
@@ -21,6 +21,7 @@
@authorSelected="authorclick"
@pageSize={{this.tablePageSize}}
@pageSizeValues={{this.tablePageSizeValues}}
+ @displayDataChangedAction={{this.myAction}}
/>
From b0a2d3882f64524c200d36136eaafeffb2f9d40c Mon Sep 17 00:00:00 2001
From: Bointeka
Date: Tue, 23 Nov 2021 19:16:58 -0500
Subject: [PATCH 08/12] Added another method of updating query
---
app/routes/administrator/index.js | 35 ++++++++++++++++++++++++-------
1 file changed, 28 insertions(+), 7 deletions(-)
diff --git a/app/routes/administrator/index.js b/app/routes/administrator/index.js
index 396a794f8..68025e6ab 100644
--- a/app/routes/administrator/index.js
+++ b/app/routes/administrator/index.js
@@ -24,17 +24,29 @@ export default class IndexRoute extends CheckSessionRoute {
{ submissionStatus: { missing: '_last', order: 'asc' } }
];
+ sort = undefined;
+ filter = undefined;
+
+
async model() {
const user = get(this, 'currentUser.user');
let submissions = null;
+ //Method 1 of updating model
if (user.get('isAdmin')) {
- submissions = this._doAdmin();
+ submissions = this._doAdmin(this.sort, this.filter);
} else if (user.get('isSubmitter')) {
- submissions = this._doSubmitter(user);
+ submissions = this._doSubmitter(user, this.sort, this.filter);
}
+ /* Default model - Method 2
+ if (user.get('isAdmin')) {
+ submissions = this._doAdmin();
+ } else if (user.get('isSubmitter')) {
+ submissions = this._doSubmitter(user);
+ } */
+
submissions.then(() => this.searchHelper.clearIgnore());
return RSVP.hash({
@@ -44,13 +56,14 @@ export default class IndexRoute extends CheckSessionRoute {
- _doAdmin(sortedColumn = this.defaultAdminSort) {
+ _doAdmin(sortedColumn = this.defaultAdminSort, filteredColumn = []) {
const ignoreList = this.searchHelper.getIgnoreList();
const query = {
sort: sortedColumn,
query: {
match_all: {},
+ filter: filteredColumn,
must_not: [
{ term: { submissionStatus: 'cancelled' } }
]
@@ -65,7 +78,7 @@ export default class IndexRoute extends CheckSessionRoute {
return this.store.query('submission', query);
}
- _doSubmitter(user, sortedColumn = this.defaultSubmitterSort) {
+ _doSubmitter(user, sortedColumn = this.defaultSubmitterSort, filteredColumn = []) {
const ignoreList = this.searchHelper.getIgnoreList();
const query = {
@@ -76,6 +89,7 @@ export default class IndexRoute extends CheckSessionRoute {
{ term: { submitter: user.get('id') } },
{ term: { preparers: user.get('id') } },
],
+ filter: filteredColumn,
must_not: [
{ term: { submissionStatus: 'cancelled' } }
]
@@ -93,15 +107,21 @@ export default class IndexRoute extends CheckSessionRoute {
@action
async updateTable({sortedColumn, filteredColumn}) {
- console.log(sortedColumn, filteredColumn)
const user = get(this, 'currentUser.user');
+ //Method 1 of updating model
+ //Update fields then call model()
+ this.sort = sortedColumn;
+ this.filter = filteredColumn;
+ this.model();
+
+ /* Method 2 of updating model
let submissions = null;
if (user.get('isAdmin')) {
- submissions = this._doAdmin(sortedColumn);
+ submissions = this._doAdmin(sortedColumn, filteredColumn);
} else if (user.get('isSubmitter')) {
- submissions = this._doSubmitter(user, sortedColumn);
+ submissions = this._doSubmitter(user, sortedColumn, filteredColumn);
}
submissions.then(() => this.searchHelper.clearIgnore());
@@ -109,5 +129,6 @@ export default class IndexRoute extends CheckSessionRoute {
return RSVP.hash({
submissions
});
+ */
}
}
From ebf147714044253a11cb09c7e5454c9a38fb6416 Mon Sep 17 00:00:00 2001
From: Bointeka
Date: Sat, 4 Dec 2021 00:34:36 -0500
Subject: [PATCH 09/12] Split the Award/Funder cell into two distinct cells
---
app/components/submissions-award-cell/index.hbs | 2 +-
app/components/submissions-funder-cell/index.hbs | 6 ++++++
app/components/submissions-funder-cell/index.js | 3 +++
3 files changed, 10 insertions(+), 1 deletion(-)
create mode 100644 app/components/submissions-funder-cell/index.hbs
create mode 100644 app/components/submissions-funder-cell/index.js
diff --git a/app/components/submissions-award-cell/index.hbs b/app/components/submissions-award-cell/index.hbs
index ab90c64bb..5cbbe9efa 100644
--- a/app/components/submissions-award-cell/index.hbs
+++ b/app/components/submissions-award-cell/index.hbs
@@ -1,6 +1,6 @@
{{#each @record.grants as |grant index|}}
{{if index ',
'}}
- {{grant.awardNumber}} ({{grant.primaryFunder.name}})
+ {{grant.awardNumber}}
{{else}}
Not Available
{{/each}}
diff --git a/app/components/submissions-funder-cell/index.hbs b/app/components/submissions-funder-cell/index.hbs
new file mode 100644
index 000000000..4c2ec5a14
--- /dev/null
+++ b/app/components/submissions-funder-cell/index.hbs
@@ -0,0 +1,6 @@
+{{#each @record.grants as |grant index|}}
+ {{if index ',
'}}
+ {{grant.primaryFunder.name}}
+ {{else}}
+ Not Available
+{{/each}}
diff --git a/app/components/submissions-funder-cell/index.js b/app/components/submissions-funder-cell/index.js
new file mode 100644
index 000000000..985cac0a0
--- /dev/null
+++ b/app/components/submissions-funder-cell/index.js
@@ -0,0 +1,3 @@
+import Component from '@glimmer/component';
+
+export default class SubmissionsAwardCell extends Component {}
From 30f127183030ba8d13dd64b62d321030f4b22d4d Mon Sep 17 00:00:00 2001
From: Bointeka
Date: Sat, 4 Dec 2021 00:35:19 -0500
Subject: [PATCH 10/12] Fixed naming error
---
app/templates/administrator/detail.hbs | 241 +++++++++++++++++++++++++
1 file changed, 241 insertions(+)
create mode 100644 app/templates/administrator/detail.hbs
diff --git a/app/templates/administrator/detail.hbs b/app/templates/administrator/detail.hbs
new file mode 100644
index 000000000..736c00848
--- /dev/null
+++ b/app/templates/administrator/detail.hbs
@@ -0,0 +1,241 @@
+
+
+
+
+
Submission Detail
+
+
+ {{#if this.model.sub.isStub}}
+
+ Finish submission
+
+ {{else if this.model.sub.isDraft}}
+
+ Edit submission
+
+
+ {{/if}}
+
+
+
+
+
+
+
+
{{this.model.sub.publication.title}}
+ {{#if this.model.sub.submittedDate}}Submitted {{format-date
+ this.model.sub.submittedDate}}{{/if}}
+
+
DOI: {{#if this.model.sub.publication.doi}}{{this.model.sub.publication.doi}}{{else}}None{{/if}}
+
+
+
+ | Submission status |
+
+
+ |
+
+ {{#if this.model.sub.isCovid}}
+
+ |
+
+
+ |
+
+ {{/if}}
+
+ | Grants |
+
+
+ {{#each this.model.sub.grants as |grant|}}
+ - {{grant.awardNumber}}: {{grant.projectName}}
+ - Funder: {{grant.primaryFunder.name}}
+ {{#if (not-eq grant this.model.sub.grants.lastObject)}}
+
+ {{/if}}
+ {{/each}}
+
+ |
+
+ {{!-- Consolidate repository, deposit, repoCopy info --}}
+ {{#if this.repoMap}}
+
+ | Repositories |
+
+
+ {{#each this.repoMap as |repoInfo index|}}
+
+ {{/each}}
+
+ |
+
+ {{/if}}
+ {{#if this.externalSubmission}}
+
+ | External Submission Repositories |
+
+
+ {{#each this.externalSubmission as |sub|}}
+ - {{sub.message}}
+ {{/each}}
+
+ |
+
+ {{/if}}
+
+ | Submitter |
+
+ {{#if (eq this.model.sub.source "other")}}
+ This submission did not originate from PASS
+ {{else if this.displaySubmitterName}}
+ {{this.displaySubmitterName}}
+ {{/if}}
+ {{#if this.displaySubmitterEmail}}
+ ({{this.displaySubmitterEmail}})
+ {{/if}}
+ |
+
+ {{#if (await this.model.sub.preparers)}}
+
+ | Preparer(s) |
+
+ {{#each (await this.model.sub.preparers) as |preparer index|}}
+ {{#if index}}, {{/if}} {{get (await preparer) 'displayName'}}
+ {{#if (get (await preparer) 'email')}}
+ ({{get (await preparer) 'email'}})
+ {{/if}}
+ {{/each}}
+ |
+
+ {{/if}}
+ {{#if this.mustVisitWeblink}}
+
+
+ External Submission Required
+
+ {{#if this.disableSubmit}}
+
+ {{/if}}
+ |
+
+
+
+ {{#each this.weblinkRepos as |repo|}}
+ -
+
+
+ {{/each}}
+
+ |
+
+ {{/if}}
+
+ | Details |
+
+
+ |
+
+
+ | Files |
+
+ {{#if (eq this.model.sub.source "other")}}
+
+ We do not have a copy of manuscript files because this submission did not originate from PASS
+
+ {{else}}
+
+
+
+ |
+ Name |
+ Type |
+ Description |
+
+
+
+ {{#each (get this.model 'files') as |file|}}
+
+ |
+ {{#if (eq file.mimeType 'png')}}
+ {{else if (eq file.mimeType
+ 'vnd.openxmlformats-officedocument.presentationml.presentation')}}
+ {{else if (eq
+ file.mimeType 'msword')}}
+ {{else if (eq file.mimeType
+ 'pdf')}}
+
+ {{else}}
+
+ {{/if}}
+ |
+
+ {{file.name}}
+ |
+
+ {{file.fileRole}}
+ |
+
+ {{file.description}}
+ |
+
+ {{/each}}
+
+
+ {{/if}}
+ |
+
+ {{#if (or this.this.isPreparer this.isSubmitter)}}
+
+ | Comments |
+
+
+ {{#if (or (and this.isSubmitter this.submissionNeedsSubmitter) (and this.isPreparer this.submissionNeedsPreparer))}}
+ {{/if}} |
+
+ {{/if}}
+
+
+
+
+
+
+{{#if (and this.isSubmitter this.submissionNeedsSubmitter)}}
+
+
+
+
+ Edit Submission
+
+
+
+{{/if}}
+{{#if (and this.isPreparer this.submissionNeedsPreparer)}}
+
+
+ Edit this
+ submission
+
+
+{{/if}}
From 354c414159c09c31c85c3150d9fcf59fd67eb09d Mon Sep 17 00:00:00 2001
From: Bointeka
Date: Sat, 4 Dec 2021 00:38:43 -0500
Subject: [PATCH 11/12] Removed unneeded comments. Added admin check in
nav-bar/index.js
---
app/components/nav-bar/index.hbs | 5 +-
app/routes/administrator/index.js | 8 +-
app/templates/administrator/detali.hbs | 241 -------------------------
3 files changed, 7 insertions(+), 247 deletions(-)
delete mode 100644 app/templates/administrator/detali.hbs
diff --git a/app/components/nav-bar/index.hbs b/app/components/nav-bar/index.hbs
index c7ecdd6b0..5b82f7a5c 100644
--- a/app/components/nav-bar/index.hbs
+++ b/app/components/nav-bar/index.hbs
@@ -13,8 +13,9 @@
- Dashboard
{{#if this.hasAUser}}
- {{!-- TODO: Check whether the user is an administrator and not a regular user --}}
- - Administrator
+ {{#if this.currentUser.isAdmin}}
+ - Administrator
+ {{/if}}
- Grants
- Submissions
{{/if}}
diff --git a/app/routes/administrator/index.js b/app/routes/administrator/index.js
index 68025e6ab..869740cc6 100644
--- a/app/routes/administrator/index.js
+++ b/app/routes/administrator/index.js
@@ -3,6 +3,7 @@ import CheckSessionRoute from '../check-session-route';
import RSVP from 'rsvp';
import { get } from '@ember/object';
import {action} from '@ember/object';
+import PublicationModel from '../../models/publication';
export default class IndexRoute extends CheckSessionRoute {
@service('current-user')
@@ -80,7 +81,6 @@ export default class IndexRoute extends CheckSessionRoute {
_doSubmitter(user, sortedColumn = this.defaultSubmitterSort, filteredColumn = []) {
const ignoreList = this.searchHelper.getIgnoreList();
-
const query = {
sort: sortedColumn,
query: {
@@ -89,19 +89,19 @@ export default class IndexRoute extends CheckSessionRoute {
{ term: { submitter: user.get('id') } },
{ term: { preparers: user.get('id') } },
],
- filter: filteredColumn,
must_not: [
{ term: { submissionStatus: 'cancelled' } }
]
- }
+
+ },
},
size: 500
};
-
if (ignoreList && ignoreList.length > 0) {
query.query.bool.must_not.push({ terms: { '@id': ignoreList } });
}
+ console.log("tets")
return this.store.query('submission', query);
}
diff --git a/app/templates/administrator/detali.hbs b/app/templates/administrator/detali.hbs
deleted file mode 100644
index 736c00848..000000000
--- a/app/templates/administrator/detali.hbs
+++ /dev/null
@@ -1,241 +0,0 @@
-
-
-
-
-
Submission Detail
-
-
- {{#if this.model.sub.isStub}}
-
- Finish submission
-
- {{else if this.model.sub.isDraft}}
-
- Edit submission
-
-
- {{/if}}
-
-
-
-
-
-
-
-
{{this.model.sub.publication.title}}
- {{#if this.model.sub.submittedDate}}Submitted {{format-date
- this.model.sub.submittedDate}}{{/if}}
-
-
DOI: {{#if this.model.sub.publication.doi}}{{this.model.sub.publication.doi}}{{else}}None{{/if}}
-
-
-
- | Submission status |
-
-
- |
-
- {{#if this.model.sub.isCovid}}
-
- |
-
-
- |
-
- {{/if}}
-
- | Grants |
-
-
- {{#each this.model.sub.grants as |grant|}}
- - {{grant.awardNumber}}: {{grant.projectName}}
- - Funder: {{grant.primaryFunder.name}}
- {{#if (not-eq grant this.model.sub.grants.lastObject)}}
-
- {{/if}}
- {{/each}}
-
- |
-
- {{!-- Consolidate repository, deposit, repoCopy info --}}
- {{#if this.repoMap}}
-
- | Repositories |
-
-
- {{#each this.repoMap as |repoInfo index|}}
-
- {{/each}}
-
- |
-
- {{/if}}
- {{#if this.externalSubmission}}
-
- | External Submission Repositories |
-
-
- {{#each this.externalSubmission as |sub|}}
- - {{sub.message}}
- {{/each}}
-
- |
-
- {{/if}}
-
- | Submitter |
-
- {{#if (eq this.model.sub.source "other")}}
- This submission did not originate from PASS
- {{else if this.displaySubmitterName}}
- {{this.displaySubmitterName}}
- {{/if}}
- {{#if this.displaySubmitterEmail}}
- ({{this.displaySubmitterEmail}})
- {{/if}}
- |
-
- {{#if (await this.model.sub.preparers)}}
-
- | Preparer(s) |
-
- {{#each (await this.model.sub.preparers) as |preparer index|}}
- {{#if index}}, {{/if}} {{get (await preparer) 'displayName'}}
- {{#if (get (await preparer) 'email')}}
- ({{get (await preparer) 'email'}})
- {{/if}}
- {{/each}}
- |
-
- {{/if}}
- {{#if this.mustVisitWeblink}}
-
-
- External Submission Required
-
- {{#if this.disableSubmit}}
-
- {{/if}}
- |
-
-
-
- {{#each this.weblinkRepos as |repo|}}
- -
-
-
- {{/each}}
-
- |
-
- {{/if}}
-
- | Details |
-
-
- |
-
-
- | Files |
-
- {{#if (eq this.model.sub.source "other")}}
-
- We do not have a copy of manuscript files because this submission did not originate from PASS
-
- {{else}}
-
-
-
- |
- Name |
- Type |
- Description |
-
-
-
- {{#each (get this.model 'files') as |file|}}
-
- |
- {{#if (eq file.mimeType 'png')}}
- {{else if (eq file.mimeType
- 'vnd.openxmlformats-officedocument.presentationml.presentation')}}
- {{else if (eq
- file.mimeType 'msword')}}
- {{else if (eq file.mimeType
- 'pdf')}}
-
- {{else}}
-
- {{/if}}
- |
-
- {{file.name}}
- |
-
- {{file.fileRole}}
- |
-
- {{file.description}}
- |
-
- {{/each}}
-
-
- {{/if}}
- |
-
- {{#if (or this.this.isPreparer this.isSubmitter)}}
-
- | Comments |
-
-
- {{#if (or (and this.isSubmitter this.submissionNeedsSubmitter) (and this.isPreparer this.submissionNeedsPreparer))}}
- {{/if}} |
-
- {{/if}}
-
-
-
-
-
-
-{{#if (and this.isSubmitter this.submissionNeedsSubmitter)}}
-
-
-
-
- Edit Submission
-
-
-
-{{/if}}
-{{#if (and this.isPreparer this.submissionNeedsPreparer)}}
-
-
- Edit this
- submission
-
-
-{{/if}}
From ebe12955bc413b589d55ae942f4e7ad7a8e62425 Mon Sep 17 00:00:00 2001
From: Bointeka
Date: Sat, 4 Dec 2021 00:40:07 -0500
Subject: [PATCH 12/12] Removed filtering and sorting from non-working cells.
Split up Funder and Award Cells. Added drop down filtering for status cell
---
app/controllers/administrator/index.js | 36 +++++++++++++++++++-------
1 file changed, 27 insertions(+), 9 deletions(-)
diff --git a/app/controllers/administrator/index.js b/app/controllers/administrator/index.js
index 11ab6b664..6a8d82de0 100644
--- a/app/controllers/administrator/index.js
+++ b/app/controllers/administrator/index.js
@@ -17,7 +17,7 @@ export default class SubmissionsIndex extends Controller {
@tracked messageTo = '';
@tracked messageSubject = '';
@tracked messageText = '';
- @tracked tablePageSize = 50;
+ @tracked tablePageSize = 10;
@tracked tablePageSizeValues = [10, 25, 50];
constructor() {
@@ -29,19 +29,31 @@ export default class SubmissionsIndex extends Controller {
// Columns displayed depend on the user role
get columns() {
- //TODO: Change currentUser.user.isAdmin
- if (get(this, 'currentUser.user.isSubmitter')) {
+ if (get(this, 'currentUser.user.isAdmin')) {
return [
{
propertyName: 'publication',
title: 'Article',
className: 'title-column',
- component: 'submissions-article-cell'
+ component: 'submissions-article-cell',
+ disableSorting: true,
+ disableFiltering: true
},
{
- title: 'Award Number (Funder)',
+ propertyName: 'awardNumber',
+ title: 'Award Number',
className: 'awardnum-funder-column',
- component: 'submissions-award-cell'
+ component: 'submissions-award-cell',
+ disableSorting: true,
+ disableFiltering: true
+ },
+ {
+ propertyName: 'Funder',
+ title: 'Funder',
+ className: 'funder-column',
+ component: 'submissions-funder-cell',
+ disableSorting: true,
+ disableFiltering: true
},
{
propertyName: 'repositories',
@@ -59,7 +71,8 @@ export default class SubmissionsIndex extends Controller {
propertyName: 'submissionStatus',
title: 'Status',
className: 'status-column',
- component: 'submissions-status-cell'
+ component: 'submissions-status-cell',
+ filterWithSelect: true
},
{
propertyName: 'submitterName',
@@ -74,10 +87,12 @@ export default class SubmissionsIndex extends Controller {
component: 'submissions-email-cell'
},
{
- // propertyName: 'repoCopies',
+ propertyName: 'repoCopies',
title: 'Manuscript IDs',
className: 'msid-column',
- component: 'submissions-repoid-cell'
+ component: 'submissions-repoid-cell',
+ disableSorting: true,
+ disableFiltering: true
}
];
} else { // eslint-disable-line
@@ -107,6 +122,7 @@ export default class SubmissionsIndex extends Controller {
missing: '_last',
order: `${sortDirection}`
}
+ console.log(querySort)
return [querySort];
}
@@ -117,6 +133,8 @@ export default class SubmissionsIndex extends Controller {
let filterSort = [];
for (let column in data.columnFilters) {
let query = { 'term' : {}}
+ if (column === "publication") {
+ }
query['term'][column] = data.columnFilters[column]
filterSort.push(query)
}