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

LIMS-1554: Add 'State' column to proposals list page #865

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions api/config_sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,8 @@
# Beamlines on which to scale the gridplot to 1024
$scale_grid = array('i24');

# URL for instructions for closed proposals
$closed_proposal_link = '';

# These map proposal types to their proposalcode
# - If these are not defined for a proposal type, the api then uses bl_types below
Expand Down
4 changes: 3 additions & 1 deletion api/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ function setupApplication($mode): Slim
$facility_courier_countries, $facility_courier_countries_nde, $facility_courier_countries_link,
$dhl_enable, $scale_grid, $scale_grid_end_date, $preset_proposal, $timezone,
$valid_components, $enabled_container_types, $ifsummary, $synchweb_version, $redirects,
$shipping_service_app_url, $use_shipping_service_redirect, $use_shipping_service_redirect_incoming_shipments;
$shipping_service_app_url, $use_shipping_service_redirect, $use_shipping_service_redirect_incoming_shipments,
$closed_proposal_link;
$app->contentType('application/json');
$options = $app->container['options'];
$app->response()->body(json_encode(array(
Expand All @@ -95,6 +96,7 @@ function setupApplication($mode): Slim
'synchweb_version' => $synchweb_version,
'shipping_service_app_url' => $use_shipping_service_redirect || $use_shipping_service_redirect_incoming_shipments ? $shipping_service_app_url : null,
'shipping_service_app_url_incoming' => $use_shipping_service_redirect_incoming_shipments ? $shipping_service_app_url : null,
'closed_proposal_link' => $closed_proposal_link,
'redirects' => $redirects
)));
});
Expand Down
2 changes: 1 addition & 1 deletion api/src/Page/Proposal.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ function _get_proposals($id = null)
$order = 'p.proposalid DESC';

if ($this->has_arg('sort_by')) {
$cols = array('ST' => 'p.bltimestamp', 'PROPOSALCODE' => 'p.proposalcode', 'PROPOSALNUMBER' => 'p.proposalnumber', 'VCOUNT' => 'vcount', 'TITLE' => 'lower(p.title)');
$cols = array('ST' => 'p.bltimestamp', 'PROPOSALCODE' => 'p.proposalcode', 'PROPOSALNUMBER' => 'p.proposalnumber', 'VCOUNT' => 'vcount', 'TITLE' => 'lower(p.title)', 'STATE' => 'p.state');
$dir = $this->has_arg('order') ? ($this->arg('order') == 'asc' ? 'ASC' : 'DESC') : 'ASC';
if (array_key_exists($this->arg('sort_by'), $cols))
$order = $cols[$this->arg('sort_by')] . ' ' . $dir;
Expand Down
11 changes: 10 additions & 1 deletion client/src/js/app/components/navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
class="tw-block tw-text-gray-900 tw-py-4 tw-px-2"
>
<p>This proposal is closed. You cannot create shipments, proteins or contacts.</p>
<span v-if="getClosedProposalLink"><a @click="onWrapperClick" :href="getClosedProposalLink">Click here for more info.</a></span>
</router-link>
</li>
<li
Expand Down Expand Up @@ -184,6 +185,9 @@ export default {
},
helpStatus: function() {
return this.showHelp ? "On" : "Off"
},
getClosedProposalLink: function() {
return app.options.get('closed_proposal_link')
}
},
methods: {
Expand All @@ -204,6 +208,11 @@ export default {
$('p.help').fadeOut()
}
},
onWrapperClick(e) {
if (e.target.tagName === 'A') {
e.stopPropagation()
}
},
}
}
</script>
Expand All @@ -224,4 +233,4 @@ export default {
margin-top: 1rem;
width: 101%;
}
</style>
</style>
3 changes: 2 additions & 1 deletion client/src/js/modules/proposal/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ define(['marionette',
{ name: 'PROPOSALCODE', label: 'Code', cell: 'string', editable: false },
{ name: 'PROPOSALNUMBER', label: 'Number', cell: 'string', editable: false },
{ name: 'VCOUNT', label: 'Visits', cell: 'string', editable: false },
{ name: 'STATE', label: 'State', cell: 'string', editable: false },
{ name: 'TITLE', label: 'Title', cell: 'string', editable: false }]

this.table = new TableView({ collection: options.collection, columns: columns, tableClass: 'proposals', filter: 's', search: options.params.s, loading: true, backgrid: { row: this.getOption('clickableRow'), emptyText: 'No proposals found', } })
Expand All @@ -41,4 +42,4 @@ define(['marionette',
},
})

})
})
Loading